[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#40967: 27.0.50; vc-diff in indirect buffers
From: |
Phil Sainty |
Subject: |
bug#40967: 27.0.50; vc-diff in indirect buffers |
Date: |
Wed, 17 Jun 2020 00:08:40 +1200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 |
On 30/04/20 6:13 am, Dmitry Gutov wrote:
> On 29.04.2020 21:01, Nathan Moreau wrote:
>> open any file-under-version-control
>> M-x clone-indirect-buffer
>> In the new buffer, run vc-diff fails with `vc-deduce-fileset:
>> Buffer [...] is not associated with a file`
>
> I'm not sure we really want to support that workflow. Or else
> a lot of commands would have to be changed the same way,
> inside and outside of VC.
>
> But opinions welcome.
FWIW, we did the same thing for `diff-buffer-with-file' quite
recently:
https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=1bcf5d02da96784a04034b4c0aba8fdfa1413c4e
Personally I'd be ok with seeing piecemeal changes to commands
like these to enable certain common workflows to DTRT with
indirect buffers. I think there will likely be a subset of
commands which are of higher value than others, and so there
might not be such a vast number of things which are very useful
to change in practice. (Or maybe it's a slippery slope.)
Something like the following might be convenient:
(defun buffer-base-buffer-file-name (&optional buffer)
"Like `buffer-file-name', but also supporting indirect buffers."
(buffer-file-name
(or (buffer-base-buffer buffer) buffer (current-buffer))))
-Phil
- bug#40967: 27.0.50; vc-diff in indirect buffers,
Phil Sainty <=