GNU bug report logs -
#51614
29.0.50; [PATCH] vc-switches ignore file or directory variables
Previous Next
To reply to this bug, email your comments to 51614 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51614
; Package
emacs
.
(Fri, 05 Nov 2021 16:40:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Aleksandr Vityazev <avityazev <at> posteo.org>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 05 Nov 2021 16:40:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
The current implementation of the vc-switches function from
lisp/vc/vc.el ignores the values of vc-BACKEND-diff-switches,
vc-diff-switches set as local directory or file variables.
Here's a reproduction:
1. Run "emacs -Q"
2. "C-x C-f" to open file /tmp/test-project/.dir-locals.el
3. Type this into the buffer:
((nil ((vc-git-diff-switches . ("--binary" "--textconv")))))
4. "C-x C-s" to save the buffer
5. "C-x C-f" to open the file /tmp/test-project/test.gpg.
Without --binary and --textconv, diff will not be displayed
for a file with a .gpg extension.
6. Type something in the buffer for example: "Just a test"
7. "C-x C-s" to save the file
8. "C-x v v" to choose VCS backend: in this case, Git
and register the file under VCS
9. "C-x v v" to commit changes
10. Type commit message and "C-c C-c"
11. Type something in the buffer with file /tmp/test-project/test.gpg
12. "C-x C-s" to save the buffer
13. "C-x v =" to show the diff
14. Bug occurs: diff is not displayed.
Perhaps the attached patch can solve the problem.
[0001-lisp-vc-vc.el-vc-switches-Handle-dir-local-variables.patch (text/x-patch, attachment)]
[Message part 3 (text/plain, inline)]
--
Best regards,
Aleksandr Vityazev
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51614
; Package
emacs
.
(Sat, 10 Sep 2022 04:44:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 51614 <at> debbugs.gnu.org (full text, mbox):
Aleksandr Vityazev <avityazev <at> posteo.org> writes:
> The current implementation of the vc-switches function from
> lisp/vc/vc.el ignores the values of vc-BACKEND-diff-switches,
> vc-diff-switches set as local directory or file variables.
(I'm going through old bug reports that unfortunately weren't resolved
at the time.)
> Perhaps the attached patch can solve the problem.
[...]
> + (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.
I'm adding Dmitry to the CCs; perhaps he has some comments here.
Removed tag(s) patch.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 10 Sep 2022 04:44:02 GMT)
Full text and
rfc822 format available.
Added tag(s) moreinfo.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 10 Sep 2022 04:44:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#51614
; Package
emacs
.
(Fri, 07 Oct 2022 00:10:02 GMT)
Full text and
rfc822 format available.
Message #15 received at 51614 <at> debbugs.gnu.org (full text, mbox):
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.
Removed tag(s) moreinfo.
Request was from
Stefan Kangas <stefankangas <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Sun, 03 Sep 2023 08:50:02 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 286 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.