Sfoglia il codice sorgente

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.
Nicolas Goaziou 6 anni fa
parent
commit
92b03d161a
1 ha cambiato i file con 7 aggiunte e 2 eliminazioni
  1. 7 2
      lisp/ox-texinfo.el

+ 7 - 2
lisp/ox-texinfo.el

@@ -1289,8 +1289,13 @@ contextual information."
     (when (plist-get info :preserve-breaks)
     (when (plist-get info :preserve-breaks)
       (setq output (replace-regexp-in-string
       (setq output (replace-regexp-in-string
 		    "\\(\\\\\\\\\\)?[ \t]*\n" " @*\n" output)))
 		    "\\(\\\\\\\\\\)?[ \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
 ;;;; Planning