summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2017-10-08 10:36:48 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2017-10-08 10:36:48 +0200
commitfa56da61a7d78e5c84cb1610c43745d7771d93b0 (patch)
treea3b7c64724356df9a1e5f9074b96c33a89a14d60
parent7f56bfe0c25e22c40bc2bcd27d41bf528ebef971 (diff)
parentd747e51fbf3f88751800981c1cfa4dabfcf174ec (diff)
downloadorg-mode-fa56da61a7d78e5c84cb1610c43745d7771d93b0.tar.gz
Merge branch 'maint'
-rw-r--r--lisp/org.el4
-rw-r--r--testing/lisp/test-org.el10
2 files changed, 10 insertions, 4 deletions
diff --git a/lisp/org.el b/lisp/org.el
index f26b024..fbd6810 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -23609,7 +23609,9 @@ depending on context."
(skip-chars-forward " \r\t\n"))))
(narrow-to-region (org-element-property :contents-begin element)
contents-end))
- (call-interactively #'forward-sentence))))))
+ ;; End of heading is considered as the end of a sentence.
+ (let ((sentence-end (concat (sentence-end) "\\|^\\*+ .*$")))
+ (call-interactively #'forward-sentence)))))))
(define-key org-mode-map "\M-a" 'org-backward-sentence)
(define-key org-mode-map "\M-e" 'org-forward-sentence)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index a185cff..fbe053f 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -3414,8 +3414,8 @@ SCHEDULED: <2017-05-06 Sat>
(org-test-with-temp-text "Paragraph 1.<point>\n\nParagraph 2."
(org-forward-sentence)
(eobp)))
- ;; On a headline, stop at the end of the line, unless point is
- ;; already there.
+ ;; Headlines are considered to be sentences by themselves, even if
+ ;; they do not end with a full stop.
(should
(equal
"* Headline"
@@ -3425,7 +3425,11 @@ SCHEDULED: <2017-05-06 Sat>
(should
(org-test-with-temp-text "* Headline<point>\nSentence."
(org-forward-sentence)
- (eobp))))
+ (eobp)))
+ (should
+ (org-test-with-temp-text "Sentence.<point>\n\n* Headline\n\nSentence 2."
+ (org-forward-sentence)
+ (and (org-at-heading-p) (eolp)))))
(ert-deftest test-org/backward-sentence ()
"Test `org-backward-sentence' specifications."