emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 7272901 1/3: Fix glitch in generating cxterm doc strings


From: Paul Eggert
Subject: master 7272901 1/3: Fix glitch in generating cxterm doc strings
Date: Mon, 11 Nov 2019 13:33:01 -0500 (EST)

branch: master
commit 72729014fcad377cbcdb2c5a59eb8b37ecf2a020
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>

    Fix glitch in generating cxterm doc strings
    
    * lisp/international/titdic-cnv.el (tit-process-header):
    In generated doc strings, escape \, ", ', and ` properly.
    Currently only ' appears but we might as well future-proof this.
---
 lisp/international/titdic-cnv.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/lisp/international/titdic-cnv.el b/lisp/international/titdic-cnv.el
index 8615d95..34bd1cf 100644
--- a/lisp/international/titdic-cnv.el
+++ b/lisp/international/titdic-cnv.el
@@ -283,7 +283,14 @@ SPC, 6, 3, 4, or 7 specifying a tone (SPC:陰平, 6:陽平, 3:上聲, 
4:去聲,
            (pos (point)))
        (cond ((= ch ?C)                ; COMMENT
               (cond ((looking-at "COMMENT")
-                     (let ((pos (match-end 0)))
+                     (let ((pos (match-end 0))
+                           (to (progn (end-of-line) (point))))
+                       (goto-char pos)
+                       (while (re-search-forward "[\\\"]" to t)
+                         (replace-match "\\\\\\&"))
+                       (goto-char pos)
+                       (while (re-search-forward "['`]" to t)
+                         (replace-match "\\\\\\\\=\\&"))
                        (end-of-line)
                        (setq tit-comments
                              (cons (buffer-substring-no-properties pos (point))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]