mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-28 07:44:49 +00:00
org-footnote: Fix bug related to sorting and folded view
* lisp/org-footnote.el (org-footnote-delete-definitions): Remove blank lines before the footnote definition instead of removing those after it. * testing/lisp/test-org-footnote.el: Adapt tests.
This commit is contained in:
parent
2ff3da0f1a
commit
d6faea24d4
@ -864,11 +864,11 @@ Return the number of footnotes removed."
|
||||
(while (re-search-forward def-re nil t)
|
||||
(let ((full-def (org-footnote-at-definition-p)))
|
||||
(when full-def
|
||||
;; Remove the footnote, and all blank lines after it.
|
||||
(goto-char (nth 2 full-def))
|
||||
(org-skip-whitespace)
|
||||
(unless (eobp) (beginning-of-line))
|
||||
(delete-region (nth 1 full-def) (point))
|
||||
;; Remove the footnote, and all blank lines before it.
|
||||
(goto-char (nth 1 full-def))
|
||||
(skip-chars-backward " \r\t\n")
|
||||
(unless (bolp) (forward-line))
|
||||
(delete-region (point) (nth 2 full-def))
|
||||
(incf ndef))))
|
||||
ndef)))
|
||||
|
||||
|
@ -109,7 +109,6 @@ Body[1]
|
||||
\[4] Inline
|
||||
|
||||
\[5] Anonymous
|
||||
|
||||
")))
|
||||
;; 2.2. Put each footnote definition at the end of the section
|
||||
;; containing its first reference.
|
||||
@ -256,7 +255,6 @@ Signature")))))
|
||||
\[fn:2] B
|
||||
|
||||
\[fn:label] C
|
||||
|
||||
")))))
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user