1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-12 09:28:24 +00:00

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.
This commit is contained in:
Basil L. Contovounesios 2021-09-19 22:39:20 +01:00
parent 0646c68171
commit 5b962a7ad8
2 changed files with 6 additions and 3 deletions

View File

@ -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
+++

View File

@ -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."