Browse Source

org.el (org-end-of-line): Don't throw an error outside elements

* org.el (org-end-of-line): Don't throw an error outside
elements.
Bastien Guerry 5 years ago
parent
commit
afcb175e05
1 changed files with 4 additions and 2 deletions
  1. 4 2
      lisp/org.el

+ 4 - 2
lisp/org.el

@@ -22221,8 +22221,10 @@ the cursor is already beyond the end of the headline."
 			((fboundp 'move-end-of-line) 'move-end-of-line)
 			(t 'end-of-line))))
     (if (or (not special) arg) (call-interactively move-fun)
-      (let* ((element (save-excursion (beginning-of-line)
-				      (org-element-at-point)))
+      (let* ((element (ignore-errors
+			;; Don't throw an error outside elements
+			(save-excursion (beginning-of-line)
+					(org-element-at-point))))
 	     (type (org-element-type element)))
 	(cond
 	 ((memq type '(headline inlinetask))