浏览代码

org-footnote-action: Handle nil context

* lisp/org-footnote.el (org-footnote-action): Check whether context is
  non-nil before trying to move to the end of the element.
Kyle Meyer 9 年之前
父节点
当前提交
4ef2c0e439
共有 1 个文件被更改,包括 6 次插入5 次删除
  1. 6 5
      lisp/org-footnote.el

+ 6 - 5
lisp/org-footnote.el

@@ -662,11 +662,12 @@ offer additional commands in a menu."
 	 (type (org-element-type context)))
     (cond
      ;; On white space after element, insert a new footnote.
-     ((> (point)
-	 (save-excursion
-	   (goto-char (org-element-property :end context))
-	   (skip-chars-backward " \t")
-	   (point)))
+     ((and context
+	   (> (point)
+	      (save-excursion
+		(goto-char (org-element-property :end context))
+		(skip-chars-backward " \t")
+		(point))))
       (org-footnote-new))
      ((eq type 'footnote-reference)
       (let ((label (org-element-property :label context)))