diff --git a/lisp/org.el b/lisp/org.el index 18241214b..9807e933e 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -23816,7 +23816,7 @@ beyond the end of the headline." (when special (cond ((and (looking-at org-complex-heading-regexp) - (= (char-after (match-end 1)) ?\ )) + (eq (char-after (match-end 1)) ?\s)) (setq refpos (min (1+ (or (match-end 3) (match-end 2) (match-end 1))) (point-at-eol))) (goto-char diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el index af9dbffe5..9243be491 100644 --- a/testing/lisp/test-org.el +++ b/testing/lisp/test-org.el @@ -1815,7 +1815,15 @@ drops support for Emacs 24.1 and 24.2." (org-end-of-line) (and (progn (org-beginning-of-line) (looking-at "Headline")) (progn (org-beginning-of-line) (bolp)) - (progn (org-beginning-of-line) (looking-at "Headline"))))))) + (progn (org-beginning-of-line) (looking-at "Headline")))))) + ;; Special case: Do not error when the buffer contains only a single + ;; asterisk. + (should + (org-test-with-temp-text "*" + (let ((org-special-ctrl-a/e t)) (org-beginning-of-line)))) + (should + (org-test-with-temp-text "*" + (let ((org-special-ctrl-a/e nil)) (org-beginning-of-line))))) (ert-deftest test-org/end-of-line () "Test `org-end-of-line' specifications."