From 366dfee5749ea1bf0285c9bb249b6c778f89217d Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 7 Jul 2025 15:50:22 +0100 Subject: [PATCH] * lisp/vc/vc.el (with-vc-properties): Fix macro variable capture. (cherry picked from commit 6227a0412d419e6bda2b5ac2517bae8517868c10) --- lisp/vc/vc.el | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 8e8d708f36a..bfeba44c5fa 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -1081,22 +1081,23 @@ executing FORM, set those properties from SETTINGS that have not yet been updated to their corresponding values. Return the result of evaluating FORM." (declare (debug t)) - `(let ((vc-touched-properties (list t)) - (flist nil)) - (prog2 (dolist (file ,files) - (if (file-directory-p file) - (dolist (buffer (buffer-list)) - (let ((fname (buffer-file-name buffer))) - (when (and fname (string-prefix-p file fname)) - (push fname flist)))) - (push file flist))) - ,form - (dolist (file flist) - (dolist (setting ,settings) - (let ((property (car setting))) - (unless (memq property vc-touched-properties) - (put (intern file vc-file-prop-obarray) - property (cdr setting))))))))) + (cl-with-gensyms (vc-touched-properties flist) + `(let ((,vc-touched-properties (list t)) + (,flist nil)) + (prog2 (dolist (file ,files) + (if (file-directory-p file) + (dolist (buffer (buffer-list)) + (let ((fname (buffer-file-name buffer))) + (when (and fname (string-prefix-p file fname)) + (push fname ,flist)))) + (push file ,flist))) + ,form + (dolist (file ,flist) + (dolist (setting ,settings) + (let ((property (car setting))) + (unless (memq property ,vc-touched-properties) + (put (intern file vc-file-prop-obarray) + property (cdr setting)))))))))) ;;; Code for deducing what fileset and backend to assume -- 2.39.5