summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2018-05-11 19:40:10 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2018-05-11 19:40:10 +0200
commit92b03d161ab16e7352bef4980a8f19e00011e14f (patch)
treea6c72c9e43f04b24f0bf53c5653966ed96c5ce6d
parent13fb6a3fae056eea0954570f4fe308386a93c8f7 (diff)
downloadorg-mode-92b03d161ab16e7352bef4980a8f19e00011e14f.tar.gz
ox-texinfo: Change sentence ending
* lisp/ox-texinfo.el (org-texinfo-plain-text): Sentences can end with a capital letter without a special symbol in Org. It is simpler to provide a non-breaking space when a capital letter followed by a period should not end than providing a way to force ending a sentence.
-rw-r--r--lisp/ox-texinfo.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index 83600f1..c58f47f 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -1289,8 +1289,13 @@ contextual information."
(when (plist-get info :preserve-breaks)
(setq output (replace-regexp-in-string
"\\(\\\\\\\\\\)?[ \t]*\n" " @*\n" output)))
- ;; Return value.
- output))
+ ;; Reverse sentence ending. A sentence can end with a capital
+ ;; letter. Use non-breaking space if it shouldn't.
+ (let ((case-fold-search nil))
+ (replace-regexp-in-string
+ "[A-Z]\\([.?!]\\)\\(?:[])]\\|'\\{1,2\\}\\)?\\(?: \\|$\\)"
+ "@\\1"
+ output nil nil 1))))
;;;; Planning