|
From: | Dmitry Gutov |
Subject: | bug#51614: 29.0.50; [PATCH] vc-switches ignore file or directory variables |
Date: | Fri, 7 Oct 2022 03:09:24 +0300 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 |
On 10.09.2022 07:43, Lars Ingebrigtsen wrote:
+ (let* ((buffer (other-buffer (current-buffer) t)) + (switches + (or (when backend + (let ((sym (vc-make-backend-sym + backend (intern (concat (symbol-name op) + "-switches"))))) + (when (boundp sym) (buffer-local-value sym buffer)))) + (let ((sym (intern (format "vc-%s-switches" (symbol-name op))))) + (when (boundp sym) (buffer-local-value sym buffer))) + (cond + ((eq op 'diff) diff-switches)))))I don't think using `other-buffer' here is a reliable way of getting the buffer we're interested in here, so I think this would have to be fixed in a different way.
Right.
I'm adding Dmitry to the CCs; perhaps he has some comments here.
I was thinking vc-switches could have a new, optional argument: buffer. But even that seems hard to get ahold of in vc-diff-internal (the FILES var might have one element, which is a directory, with no visiting buffers).
Perhaps support for this would need to be added on command-by-command basis, with some helper which would collect all buffer-local vars and bind them dynamically.
Alternatively, we could support setting 'vc-XX-switches' to a function value. That function could take the current default-directory and compute the value based on it. I'm not sure if that'll fit Aleksandr's workflow, though.
[Prev in Thread] | Current Thread | [Next in Thread] |