mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-08-27 09:32:52 +00:00
Goto correct footnote insertion point in org-mode buffers
* lisp/org-footnote.el: (org-footnote-create-definition): Don't search for last footnote when in org-mode file. The recent changes to accommodate signatures in message-mode instruct org-mode to search for the last footnote in the entire buffer when inserting a new footnote definition. This causes problems in org buffers, since org-footnote-goto-local-insertion-point already finds the correct insertion point. (I.e., the insertion point is always placed in beneath the last footnote in the buffer, even if org-footnote-section is nil.) This patch invokes the search only if in non org-mode buffers.
This commit is contained in:
parent
7b74ef1c13
commit
51244d5344
|
@ -310,10 +310,10 @@ or new, let the user edit the definition of the footnote."
|
||||||
(skip-chars-backward " \t\r\n")
|
(skip-chars-backward " \t\r\n")
|
||||||
(delete-region (point) max)
|
(delete-region (point) max)
|
||||||
(insert "\n\n")
|
(insert "\n\n")
|
||||||
(insert org-footnote-tag-for-non-org-mode-files "\n")))))
|
(insert org-footnote-tag-for-non-org-mode-files "\n")))
|
||||||
;; Skip existing footnotes
|
;; Skip existing footnotes
|
||||||
(while (re-search-forward "^[[:space:]]*\\[[^]]+\\] " nil t)
|
(while (re-search-forward "^[[:space:]]*\\[[^]]+\\] " nil t)
|
||||||
(forward-line))
|
(forward-line))))
|
||||||
(insert "\n[" label "] \n")
|
(insert "\n[" label "] \n")
|
||||||
(goto-char (1- (point)))
|
(goto-char (1- (point)))
|
||||||
(message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'.")))
|
(message "Edit definition and go back with `C-c &' or, if unique, with `C-c C-c'.")))
|
||||||
|
|
Loading…
Reference in a new issue