reddit / emacs

org-mode links in 2022: implementation, packages, articles and videos | THIS IS EMACS

tonyaldon · 2022-05-11 16:40
* this post in Org format: [https://github.com/tonyaldon/posts](https://github.com/tonyaldon/posts) * email me: [aldon.tony@gmail.com](mailto:aldon.tony@gmail.com) * message me: [https://twitter.com/tonyaldon](https://twitter.com/tonyaldon) ─────────────────────────────────────────── Hey Emacsers, I hope you are doing well. In the last few weeks, we have dedicated 6 posts to org-mode links. Our interest was not only to show the specific features of org-mode links but also to see how they are implemented. In this post, the last one about org-mode links, we list ALL the videos, articles and packages related to org-mode links. It is unrealistic to think that it is possible to do so. But, we can try. And If you think about any video, article or package that should be part of that list, please do share it in the comment section below. Let's go! Table of Contents: 1. Implementation 2. Videos 1. Zaiste Programming 2. Rainer König 3. John Kitchin 3. Articles 4. Packages # Implementation In the post [Search options in file links | link abbreviations | COME WITH ME on this JOURNEY into the heart of the command org-open-at-point](https://www.reddit.com/r/emacs/comments/tw3fpu/search_options_in_file_links_link_abbreviations/), we looked at the implementation of `org-open-at-point`. To do so, we also looked at the functions: `org-element-context`, `org-element--object-lex`, `org-element-link-parser`, `org-link-expand-abbrev`, `org-link-open`, `org-link-open-as-file` and `org-open-file`. In the post [Did you know that Org links in property drawers are not links?](https://www.reddit.com/r/emacs/comments/tznia8/did_you_know_that_org_links_in_property_drawers/), we looked at the functions `org-element-link-parser`, `org-link-make-regexps`, `org-open-at-point` and also the variable `org-link-any-re`. In the post [FULL example of org-mode links: internal links and search options](https://www.reddit.com/r/emacs/comments/ud75wt/full_example_of_orgmode_links_internal_links_and/), instead of "explaining" the implementation of the function `org-link-search` we gave an full example that demonstrates its behavior and provided some Elisp examples of the functions and variables used by `org-link-search`: `case-fold-search`, `replace-regexp-in-string`, `string-to-char`, `split-string`, `substring` and `regexp-quote`. In the post [Link to a git commit from Org mode using Magit | THIS IS EMACS](https://www.reddit.com/r/emacs/comments/uenjjs/link_to_a_git_commit_from_org_mode_using_magit/), we looked at the functions `org-link-open`, `org-link-get-parameter` and `org-link--open-elisp`. In the post [org-mode links everywhere, not only in org-mode buffers | THIS IS EMACS](https://www.reddit.com/r/emacs/comments/ui8eiq/orgmode_links_everywhere_not_only_in_orgmode/), we looked at `org-open-at-point-global` and `org-link-open-from-string`. In the post [org-store-link... powerful and flexible | THIS IS EMACS](https://www.reddit.com/r/emacs/comments/ujpq3s/orgstorelink_powerful_and_flexible_this_is_emacs/), we looked at `org-store-link` and `org-link--store-help`. # Videos ## Zaiste Programming In his series [DoomCasts: Emacs Doom Screencasts](https://www.youtube.com/watch?v=rCMh7srOqvw&list=PLhXZp00uXBk4np17N39WvB80zgxlZfVwj&ab_channel=ZaisteProgramming) Zaiste dedicates the episode 10, 11 and 12 to org-mode links. In [Emacs Doom E10: Org Mode - Links, Hyperlinks and more](https://www.youtube.com/watch?v=BRqjaN4-gGQ&ab_channel=ZaisteProgramming), the focus is on internal links to headline, file links, links to url, elisp link type (use for instance to open org agenda with `org-agenda`), `shell` link type (to list files in a directory) and `org-insert-link`. In [Emacs Doom E11: Org Mode - Custom Link Types](https://www.youtube.com/watch?v=Febe4lUK5G4&ab_channel=ZaisteProgramming) Zaist describes how to add a new link type using `org-add-link-type`. Note that `org-add-link-type` is obsolete since org-mode `9.0` but still supported. Since `9.0` we use `org-link-set-parameters` to add the links: ;; from the video (defun make-youtube-link (youtube_id) (browse-url (concat "https://www.youtube.com/embed/" youtube_id))) (org-add-link-type "yt" #'make-youtube-link) ; obsolete since 9.0 ;; since 9.0 (org-link-set-parameters "yt" :follow #'make-youtube-link) This allows us to open the following link `[[yt:Febe4lUK5G4]]` in the browser with `org-open-at-point` (bound to `C-c C-o` by default). In [Emacs Doom E12: Org Mode - Linking to words & Bookmarks](https://www.youtube.com/watch?v=aU1EV8gzZb8&ab_channel=ZaisteProgramming) the focus is on using command `org-store-link` on an org-mode headline and the behavior of `org-open-at-point` when we modify the variable `org-link-search-must-match-exact-headline`. ## Rainer König In his series [OrgMode tutorial](https://www.youtube.com/watch?v=sQS06Qjnkcc&list=PLVtKhBrRV_ZkPnBtt_TD1Cs9PJlU0IIdE&ab_channel=RainerK%C3%B6nig) Rainer König dedicates the episode `E05S01` and `E05S02` to org-mode links. In [OrgMode E05S01: Linking (internal)](https://www.youtube.com/watch?v=eoIfLS4zMa8&ab_channel=RainerK%C3%B6nig) the focus is on `org-insert-link`, link to named target (`#+NAME:`), link to headline with `CUSTOM_ID` property, radio targets (enclosed by triple angular brackets like this `<<<radio target>>>`). At some point he says that we are responsible for the `CUSTOM_ID` to make them unique through out the document which is true. We take the opportunity to mention the command `org-lint` that checks the current Org buffer for syntax mistakes. This command reports if there are duplicated `CUSTOM_ID` property. For instance, if we call the command `org-lint` in the following Org buffer (with two `CUSTOM_ID` with the value `foo`): * headline 1 :PROPERTIES: :CUSTOM_ID: foo :END: * headline 2 :PROPERTIES: :CUSTOM_ID: foo :END: the buffer `*Org Lint*` pops up with the following content: 3 nil Duplicate CUSTOM_ID property "foo" 7 nil Duplicate CUSTOM_ID property "foo" In [OrgMode E05S02: Linking (external)](https://www.youtube.com/watch?v=0TS3pTNGFIA&ab_channel=RainerK%C3%B6nig) Rainer talks about links of type file, url, bbdb. He shows how to use `id` links (`org-id-get-create` and some custom functions). He also demonstrates how `id` links does not break when we archive a subtree with the command `org-archive-subtree-default` (bound to `C-c C-x C-a` by default). ## John Kitchin In [New link features in org-mode v9.0](https://www.youtube.com/watch?v=5haX95nk02E&ab_channel=JohnKitchin) John Kitchin demonstrates how to defines new link types using the function `org-link-set-parameters`: 1. the `:face` property is used to make links green, 2. the `:display` property is used to show "all" the link, 3. the `:help-echo` is used to produce a dynamic tooltip for some links, 4. the `:follow` property is used to define a function to open `file` type link that let you choose the command to use to open a file with completion using `helm`, 5. the `:keymap` property is used to define a keymap only active on some links, 6. the properties `:complete`, `:store` and `:activate-func` are also demonstrated. This video is completed with this article [New link features in org 9](https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/). # Articles In [New link features in org 9](https://kitchingroup.cheme.cmu.edu/blog/2016/11/04/New-link-features-in-org-9/) John Kitchin demonstrates how to defines new link types using the function `org-link-set-parameters`. This article is completed with this videos [New link features in org-mode v9.0](https://www.youtube.com/watch?v=5haX95nk02E&ab_channel=JohnKitchin). Kaushal Modi wrote two articles about org-mode links: [Linking and Exporting Org "info:" links](https://scripter.co/linking-and-exporting-org-info-links/) with the following abstract: Journey of Org links from copying (storing) them, inserting them in Org documents and exporting them. The focus of this post is on the info: type Org links, but the same concept would apply to any Org link type. and [Improving ox-hugo exported Org "info:" links](https://scripter.co/improving-ox-hugo-exported-org-info-links/) with the following abstract: In my previous post, I talked about how info: Org link export support got added to ox-hugo. This post is about making those exported links a tiny 🤏 bit better. In [Custom Org-mode link abbrevs](https://www.eigenbahn.com/2021/11/14/custom-org-link-abbrevs) Eigenbahn "blends" link abbreviations and link types to have fast copy/paste experience with link abbreviations. He uses `org-link-set-parameters` and advices the command `org-yank` to do so. In [Emacs: With ace-window and link-hint, open links exactly where you want them](https://localauthor.github.io/posts/aw-select.html) Grant Rosson describes, as said in the abstract: how the Emacs package link-hint can be combined with ace-window to allow you to select, on-the-fly, which window a link will open in—instead of letting fate, or custom, or Emacs decide for you. <a id="org0bca1a4"></a> ## Packages The repository [https://git.sr.ht/\~bzg/org-contrib](https://git.sr.ht/~bzg/org-contrib) contains many add-ons to Org. Doing a recursive grep inside the repository we can find the following link types that we list here without any description: * `mew` in lisp/ol-mew.el, * `vm` and `vm-imap` in lisp/ol-vm.el, * `mairix` in lisp/org-mairix.el, * `notmuch`, `notmuch-search` and `notmuch-tree` in lisp/ol-notmuch.el, * `elisp-symbol` in lisp/ol-elisp-symbol.el * `x-together-item`, `addressbook`, `skim`, `acrobat`, `mac-outlook`, `mac-evernote`, `x-devonthink-item` and message in lisp/org-mac-link.el * `gitbare` and `git` in lisp/ol-git-link.el * `molecule` in lisp/ob-smiles.el, * `wl` in lisp/ol-wl.el * `tel` and `org-contact` in lisp/org-contacts.el * `bookmark` in lisp/ol-bookmark.el In the comments of the previous posts, the following packages have been proposed in comments: * [https://github.com/magit/orgit](https://github.com/magit/orgit): This package defines several Org link types, which can be used to link to certain Magit buffers. * [https://github.com/magit/orgit-forge/](https://github.com/magit/orgit-forge/): This package defines the Org link type orgit-topic, which can be used to link to Forge topic buffers. This is similar to the orgit package, which links to various Magit buffers. I've used [https://grep.app/](https://grep.app/) to search across public GitHub repository to look for link types. There is so many. Can you help me and add in the comment packages that you find helpful related to org-mode links. I will add them later in the [https://github.com/tonyaldon/posts](https://github.com/tonyaldon/posts). WE ARE DONE!!!
benide · 2022-05-12 03:16
Excited to dig into this post this weekend. Your post history is amazing, thanks for all of the great info!
tonyaldon · 2022-05-12 05:44
Thanks :) I'm glad to hear that. Have a nice read this weekend.