diff options
author | Kyle Meyer <kyle@kyleam.com> | 2015-08-24 00:10:54 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2015-08-24 00:10:54 -0400 |
commit | 4ef2c0e439af3e7218ee0c1fe8eda72a94597a1a (patch) | |
tree | b1e03622a9bb19cb993542b25e354461c0be5bdc | |
parent | cd1d623b8541a370cd72f35a1fd94bd6681de8ce (diff) | |
download | org-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.el | 11 |
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))) |