GNU bug report logs - #51614
29.0.50; [PATCH] vc-switches ignore file or directory variables

Previous Next

Package: emacs;

Reported by: Aleksandr Vityazev <avityazev <at> posteo.org>

Date: Fri, 5 Nov 2021 16:40:02 UTC

Severity: normal

Found in version 29.0.50

Full log


Message #15 received at 51614 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Lars Ingebrigtsen <larsi <at> gnus.org>,
 Aleksandr Vityazev <avityazev <at> posteo.org>
Cc: 51614 <at> debbugs.gnu.org
Subject: Re: bug#51614: 29.0.50; [PATCH] vc-switches ignore file or directory
 variables
Date: Fri, 7 Oct 2022 03:09:24 +0300
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.




This bug report was last modified 1 year and 287 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.