summaryrefslogtreecommitdiff
path: root/lisp/progmodes/cc-defs.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2023-01-30 20:02:36 +0000
committerAlan Mackenzie <acm@muc.de>2023-01-30 20:02:36 +0000
commit327941b211299013868469e65050d92ea513f067 (patch)
tree06677058c4ae039d447b4b60d4124dbfe241fbd1 /lisp/progmodes/cc-defs.el
parent2f3683cd4dc1e2358ae5f8c11f30a773f4540df7 (diff)
downloademacs-327941b211299013868469e65050d92ea513f067.tar.gz
emacs-327941b211299013868469e65050d92ea513f067.tar.bz2
emacs-327941b211299013868469e65050d92ea513f067.zip
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.
Diffstat (limited to 'lisp/progmodes/cc-defs.el')
-rw-r--r--lisp/progmodes/cc-defs.el7
1 files 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)