Browse Source

org-footnote: Fix consistency between footnotes and links

* lisp/org-footnote.el (org-footnote-action): Mimic `org-open-at-point'
  behavior for consistency.
Nicolas Goaziou 5 years ago
parent
commit
6a0454e4f0
1 changed files with 7 additions and 0 deletions
  1. 7 0
      lisp/org-footnote.el

+ 7 - 0
lisp/org-footnote.el

@@ -661,6 +661,13 @@ offer additional commands in a menu."
   (let* ((context (and (not special) (org-element-context)))
 	 (type (org-element-type context)))
     (cond
+     ;; On white space after element, insert a new footnote.
+     ((> (point)
+	 (save-excursion
+	   (goto-char (org-element-property :end context))
+	   (skip-chars-backward " \t")
+	   (point)))
+      (org-footnote-new))
      ((eq type 'footnote-reference)
       (let ((label (org-element-property :label context)))
 	(cond