summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2015-08-24 00:10:54 -0400
committerKyle Meyer <kyle@kyleam.com>2015-08-24 00:10:54 -0400
commit4ef2c0e439af3e7218ee0c1fe8eda72a94597a1a (patch)
treeb1e03622a9bb19cb993542b25e354461c0be5bdc
parentcd1d623b8541a370cd72f35a1fd94bd6681de8ce (diff)
downloadorg-mode-4ef2c0e439af3e7218ee0c1fe8eda72a94597a1a.tar.gz
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.
-rw-r--r--lisp/org-footnote.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index c3af965..10e95ee 100644
--- a/lisp/org-footnote.el
+++ b/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)))