From 327941b211299013868469e65050d92ea513f067 Mon Sep 17 00:00:00 2001 From: Alan Mackenzie Date: Mon, 30 Jan 2023 20:02:36 +0000 Subject: [PATCH] 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) -- 2.39.2