emacs-diffs
[Top][All Lists]
Advanced

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

master 5b962a7: Avoid double argument evaluation in vc-call macro


From: Basil L. Contovounesios
Subject: master 5b962a7: Avoid double argument evaluation in vc-call macro
Date: Tue, 21 Sep 2021 07:50:04 -0400 (EDT)

branch: master
commit 5b962a7ad8d0acfe40a41ce139059b9c8e46f666
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Avoid double argument evaluation in vc-call macro
    
    * lisp/vc/vc-hooks.el (vc-call): Ensure second argument is evaluated
    only once (bug#50690).
    * etc/NEWS (Change Logs and VC): Announce this change in behavior.
---
 etc/NEWS            | 3 +++
 lisp/vc/vc-hooks.el | 6 +++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 2bdcb64..d80b9c0 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1749,6 +1749,9 @@ tags to be considered as well.
 *** New user option 'vc-git-log-switches'.
 String or list of strings specifying switches for Git log under VC.
 
+---
+*** The macro 'vc-call' no longer evaluates its second argument twice.
+
 ** Gnus
 
 +++
diff --git a/lisp/vc/vc-hooks.el b/lisp/vc/vc-hooks.el
index 0612310..b7760e3 100644
--- a/lisp/vc/vc-hooks.el
+++ b/lisp/vc/vc-hooks.el
@@ -256,9 +256,9 @@ It is usually called via the `vc-call' macro."
 (defmacro vc-call (fun file &rest args)
   "A convenience macro for calling VC backend functions.
 Functions called by this macro must accept FILE as the first argument.
-ARGS specifies any additional arguments.  FUN should be unquoted.
-BEWARE!! FILE is evaluated twice!!"
-  `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args))
+ARGS specifies any additional arguments.  FUN should be unquoted."
+  (macroexp-let2 nil file file
+    `(vc-call-backend (vc-backend ,file) ',fun ,file ,@args)))
 
 (defsubst vc-parse-buffer (pattern i)
   "Find PATTERN in the current buffer and return its Ith submatch."



reply via email to

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