org-footnote: refuse to insert a footnote in an inappropriate context

This commit is contained in:
Nicolas Goaziou 2011-07-08 16:22:11 +02:00
parent d29fcc50ea
commit e98a2e4b4d
1 changed files with 2 additions and 0 deletions

View File

@ -398,6 +398,8 @@ This command prompts for a label. If this is a label referencing an
existing label, only insert the label. If the footnote label is empty
or new, let the user edit the definition of the footnote."
(interactive)
(unless (org-footnote-in-valid-context-p)
(error "Cannot insert a footnote here"))
(let* ((labels (and (not (equal org-footnote-auto-label 'random))
(org-footnote-all-labels)))
(propose (org-footnote-unique-label labels))