emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 327941b2112: CC Mode: Fix a coding bug in c-make-keywords-re. T


From: Alan Mackenzie
Subject: emacs-29 327941b2112: CC Mode: Fix a coding bug in c-make-keywords-re. This should fix bug #61135
Date: Mon, 30 Jan 2023 15:04:34 -0500 (EST)

branch: emacs-29
commit 327941b211299013868469e65050d92ea513f067
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    CC Mode: Fix a coding bug in c-make-keywords-re.  This should fix bug #61135
    
    * lisp/progmodes/cc-defs.el (c-make-keywords-re): Generate "\>" components 
in
    result regexp when argument ADORN is `appendable'.  This fully fixes a bug
    which was half-fixed on 2019-01-22.
---
 lisp/progmodes/cc-defs.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/cc-defs.el b/lisp/progmodes/cc-defs.el
index bdbc03e7c94..aa6f33e9cab 100644
--- a/lisp/progmodes/cc-defs.el
+++ b/lisp/progmodes/cc-defs.el
@@ -1994,7 +1994,7 @@ when it's needed.  The default is the current language 
taken from
            ;; doesn't occur in any word in LIST.  Append it to all
            ;; the alternatives where we want to add \>.  Run through
            ;; `regexp-opt' and then replace it with \>.
-           (let ((unique "") pos)
+           (let ((unique "") (list1 (copy-tree list)) pos)
              (while (let (found)
                       (setq unique (concat unique "@")
                             pos list)
@@ -2005,13 +2005,12 @@ when it's needed.  The default is the current language 
taken from
                                     t))
                         (setq pos (cdr pos)))
                       found))
-             (setq pos (copy-tree list)
-                   )
+             (setq pos list1)
              (while pos
                (if (string-match "\\w\\'" (car pos))
                    (setcar pos (concat (car pos) unique)))
                (setq pos (cdr pos)))
-             (setq re (regexp-opt list))
+             (setq re (regexp-opt list1))
              (setq pos 0)
              (while (string-match unique re pos)
                (setq pos (+ (match-beginning 0) 2)



reply via email to

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