소스 검색

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

Nicolas Goaziou 14 년 전
부모
커밋
e98a2e4b4d
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      lisp/org-footnote.el

+ 2 - 0
lisp/org-footnote.el

@@ -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
 existing label, only insert the label.  If the footnote label is empty
 or new, let the user edit the definition of the footnote."
 or new, let the user edit the definition of the footnote."
   (interactive)
   (interactive)
+  (unless (org-footnote-in-valid-context-p)
+    (error "Cannot insert a footnote here"))
   (let* ((labels (and (not (equal org-footnote-auto-label 'random))
   (let* ((labels (and (not (equal org-footnote-auto-label 'random))
 		      (org-footnote-all-labels)))
 		      (org-footnote-all-labels)))
 	 (propose (org-footnote-unique-label labels))
 	 (propose (org-footnote-unique-label labels))