I want to follow footnote links in org-mode by positioning the point over the link and hitting the return key.

In my init.el file, I have (setq org-return-follows-link t) which works fine for regular org-mode links but has no effect on footnotes, i.e., links of the form [fn:1].

Any ideas?


I had an idea to add something like this to my init.el. But it's not working quite yet...

(global-set-key (kbd "<return>")
                (condition-case nil
                  (error (execute-kbd-macro (read-kbd-macro "<return>")))
  • The built-in commands for following a footnote link are described in the manual: orgmode.org/manual/Footnotes.html Someone may wish to add this new return key feature, which can probably done without opening up a Pandora's Box [?].
    – lawlist
    Commented May 24, 2017 at 21:50
  • Thanks @lawlist. Hey, I just added some code (above). It's not working yet. But maybe you have some insights?
    – Adam
    Commented May 24, 2017 at 22:31
  • @Adam Look at the documentation for functions global-set-key and the lower-level define-key (C-h f <function-name> RET). You should place the condition-case form within an interactive command, whether named (defun) or otherwise (lambda).
    – Basil
    Commented May 25, 2017 at 7:47
  • Thanks Basil. Can you elaborate on how to use interactive in this case?
    – Adam
    Commented May 25, 2017 at 11:51
  • @Adam See here, in particular this section.
    – Basil
    Commented May 26, 2017 at 18:11

1 Answer 1


I added a new condition to org-return, very similar to how it handles a link containing the org-link face property ..., with the new condition being triggered if the org-footnote face property is present. We use org-footnote-action to jump to/from. The code is from Org version 8.2.10 that ships with Emacs 25.2.1.

(require 'org)

(setq org-return-follows-link t)

(defun org-return (&optional indent)
  "Goto next table row or insert a newline.
Calls `org-table-next-row' or `newline', depending on context.
See the individual commands for more information."
  (let (org-ts-what)
      ((or (bobp) (org-in-src-block-p))
        (if indent (newline-and-indent) (newline)))
        (call-interactively 'org-table-next-row))
      ;; when `newline-and-indent' is called within a list, make sure
      ;; text moved stays inside the item.
      ((and (org-in-item-p) indent)
        (if (and (org-at-item-p) (>= (point) (match-end 0)))
            (save-match-data (newline))
            (org-indent-line-to (length (match-string 0))))
          (let ((ind (org-get-indentation)))
            (if (org-looking-back org-list-end-re)
              (org-indent-line-to ind)))))
      ((and org-return-follows-link
        (org-at-timestamp-p t)
        (not (eq org-ts-what 'after)))
      ((and org-return-follows-link
            (let ((tprop (get-text-property (point) 'face)))
              (or (eq tprop 'org-link)
                  (and (listp tprop) (memq 'org-link tprop)))))
         (call-interactively 'org-open-at-point))
      ;;; NEW CONDITION:  `org-footnote' face property => `org-footnote-action'
      ((and org-return-follows-link
            (let ((tprop (get-text-property (point) 'face)))
              (or (eq tprop 'org-footnote)
                  (and (listp tprop) (memq 'org-footnote tprop)))))
      ((and (org-at-heading-p)
              (org-re "\\([ \t]+\\(:[[:alnum:]_@#%:]+:\\)\\)[ \t]*$")))
        (end-of-line 1)
        (if indent

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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