]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/vc/vc.el (with-vc-properties): Fix macro variable capture.
authorSean Whitton <spwhitton@spwhitton.name>
Mon, 7 Jul 2025 14:50:22 +0000 (15:50 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 24 Jul 2025 07:48:43 +0000 (09:48 +0200)
(cherry picked from commit 6227a0412d419e6bda2b5ac2517bae8517868c10)

lisp/vc/vc.el

index 8e8d708f36a7b9be197a32519e8c92d2b787915b..bfeba44c5fac87ff8b089a3fb76b8a8ee7c6be40 100644 (file)
@@ -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