Browse Source

Merge branch 'maint'

Bastien 4 years ago
parent
commit
c67413a7b6
1 changed files with 5 additions and 1 deletions
  1. 5 1
      lisp/org.el

+ 5 - 1
lisp/org.el

@@ -20964,7 +20964,11 @@ See `org-backward-paragraph'."
 	  (cond
 	  (cond
 	   ;; There is a blank line above.  Move there.
 	   ;; There is a blank line above.  Move there.
 	   ((and (org-previous-line-empty-p)
 	   ((and (org-previous-line-empty-p)
-		 (not (org-invisible-p (1- (line-end-position 0)))))
+                 (let ((lep (line-end-position 0)))
+                   ;; When the first headline start at point 2, don't choke while
+                   ;; checking with `org-invisible-p'.
+                   (or (= lep 1)
+		       (not (org-invisible-p (1- (line-end-position 0)))))))
 	    (forward-line -1))
 	    (forward-line -1))
 	   ;; At the beginning of the first element within a greater
 	   ;; At the beginning of the first element within a greater
 	   ;; element.  Move to the beginning of the greater element.
 	   ;; element.  Move to the beginning of the greater element.