mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-11-28 07:44:49 +00:00
org-footnote: Fix type error when creating a new footnote
* lisp/org-footnote.el (org-footnote-get-definition): Fix type error when creating a new footnote. When footnote definition is new, contents are nil.
This commit is contained in:
parent
c8e3873a5e
commit
8f394624b8
@ -350,15 +350,18 @@ If no footnote is found, return nil."
|
||||
(type (org-element-type datum)))
|
||||
(when (memq type '(footnote-definition footnote-reference))
|
||||
(throw 'found
|
||||
(list label
|
||||
(org-element-property :begin datum)
|
||||
(org-element-property :end datum)
|
||||
(replace-regexp-in-string
|
||||
"[ \t\n]*\\'"
|
||||
""
|
||||
(buffer-substring-no-properties
|
||||
(org-element-property :contents-begin datum)
|
||||
(org-element-property :contents-end datum))))))))
|
||||
(list
|
||||
label
|
||||
(org-element-property :begin datum)
|
||||
(org-element-property :end datum)
|
||||
(let ((cbeg (org-element-property :contents-begin datum)))
|
||||
(if (not cbeg) ""
|
||||
(replace-regexp-in-string
|
||||
"[ \t\n]*\\'"
|
||||
""
|
||||
(buffer-substring-no-properties
|
||||
cbeg
|
||||
(org-element-property :contents-end datum))))))))))
|
||||
nil))))
|
||||
|
||||
(defun org-footnote-goto-definition (label)
|
||||
|
Loading…
Reference in New Issue
Block a user