Browse Source

Fix error when using a special C-a at an empty item

* lisp/org.el (org-beginning-of-line): Handle case when there's no
  character after box.
Nicolas Goaziou 13 years ago
parent
commit
0e7f2d6e26
1 changed files with 5 additions and 3 deletions
  1. 5 3
      lisp/org.el

+ 5 - 3
lisp/org.el

@@ -20511,9 +20511,11 @@ beyond the end of the headline."
 	;; Set special position at first white space character after
 	;; bullet, and check-box, if any.
 	(let ((after-bullet
-	       (progn (looking-at org-list-full-item-re)
-		      (let ((bul (or (match-end 3) (match-end 1))))
-			(if (= (char-after bul) ? ) (1+ bul) bul)))))
+	       (and (looking-at org-list-full-item-re)
+		    (let ((box (match-end 3)))
+		      (if (not box) (match-end 1)
+			(let ((after (char-after box)))
+			  (if (and after (= after ? )) (1+ box) box)))))))
 	  ;; Special case: Move point to special position when
 	  ;; currently after it or at beginning of line.
 	  (if (eq special t)