I make a lot of notes in org-mode including emacs and elisp notes. If I put the following in an org file I would like the find-grep-dired to be highlighted similar to how it is in a Help buffer. It doesn't necessarily have to provide a link like Help does but that would be an added bonus.

`find-grep-dired' find all files containing a grep match

Is there an easy way to do that?


Not a direct answer to your question, but Org has a built-in concept of links that can be used for elisp commands and other things. Links are displayed in a certain way and can be followed using the command org-open-at-point (C-c C-o).

If you are looking at the Help buffer for a command, try invoking org-store-link. Then switch to an org buffer and call org-insert-link (C-c C-l). This will create a link to that documentation.

You can create help and lisp links, e.g.

;; link to command help, displays "help:find-grep-dired"

;; link to command help, displays "find-grep-dired"

;; link to execute command, displays "elisp:find-grep-dired"

;; link to execute lisp form, displays "find foobar"
[[elisp:(find-grep-dired "~/org" foobar)][find foobar]]
  • I figured links would be the way to do it. Unfortunately I have a lot of notes where I didn't insert a link. But I think I will go through and make them links because it is good practice. Thanks for providing a good explanation! – eflanigan00 Dec 4 '16 at 4:38

I wrote https://github.com/jkitchin/scimax/blob/master/emacs-keybinding-command-tooltip-mode.el for this. It highlights things using the emacs documentation syntax: [find-file] and `find-file'. The first one shows the keybinding, and the second shows the docstring in tooltips, and both are clickable to open the help.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.