Просмотр исходного кода

org-footnote: allow inserting inlined footnotes at column 0

* lisp/org-footnote.el (org-footnote-new): only forbid non-inlined
  footnotes at column 0, as only them can be confused with a footnote
  definition.
Nicolas Goaziou 14 лет назад
Родитель
Сommit
1913f3f50c
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      lisp/org-footnote.el

+ 3 - 1
lisp/org-footnote.el

@@ -422,7 +422,7 @@ 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 (and (not (bolp)) (org-footnote-in-valid-context-p))
+  (unless (org-footnote-in-valid-context-p)
     (error "Cannot insert a footnote here"))
     (error "Cannot insert a footnote here"))
   (let* ((lbls (and (not (equal org-footnote-auto-label 'random))
   (let* ((lbls (and (not (equal org-footnote-auto-label 'random))
 		    (org-footnote-all-labels)))
 		    (org-footnote-all-labels)))
@@ -441,6 +441,8 @@ or new, let the user edit the definition of the footnote."
 	      (mapcar 'list lbls) nil nil
 	      (mapcar 'list lbls) nil nil
 	      (if (eq org-footnote-auto-label 'confirm) propose nil)))))))
 	      (if (eq org-footnote-auto-label 'confirm) propose nil)))))))
     (cond
     (cond
+     ((and label (bolp) (not org-footnote-define-inline))
+      (error "Cannot create a non-inlined footnote at left margin"))
      ((not label)
      ((not label)
       (insert "[fn:: ]")
       (insert "[fn:: ]")
       (backward-char 1))
       (backward-char 1))