bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#34949: 27.0.50; Docstring of `vc-deduce-fileset' incomplete


From: Juri Linkov
Subject: bug#34949: 27.0.50; Docstring of `vc-deduce-fileset' incomplete
Date: Sun, 15 Mar 2020 01:31:31 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

>> Ok, here's the patch that is 10 times longer.
>> It creates a new function vc-use-vc-dir-on-files
>> called from vc-next-action that checks whether
>> the buffer is Dired with marked directories,
>
> Can we create a separate command for Dired buffers instead?

Good idea.

> Called dired-vc-next-action. From you earlier description, I imagined that
> it would simply invoke a VC-Dir in all cases, but if you need to check
> whether there are any directories selected, it would call vc-dir only in
> that case, and delegate to vc-next-action otherwise.
>
> That would be a more additive change.

And the patch will be shorter.

>> and for optimization returns a list of files
>> to give to vc-dir via a new arg MARK-FILES.
>
>> Then vc-dir let-binds the global variable use-mark-files
>> exactly the same way as already let-binds use-vc-backend
>> since there is no other way.
>
> I'd rather look for another way still, without a global var (of this kind),
> or passing an argument.

No way to pass an argument, and the existence of the global variable
use-vc-backend proves this fact.

>> Then vc-dir-refresh puts all marks on files.
>
> Could dired-vc-next-action use vc-delayed, to then run marking code after
> the vc-dir buffer refreshes?

Maybe it's not working since vc-dir-refresh already doesn't use
vc-run-delayed to run vc-dir-refresh-files and vc-dir-update.

> Or if it's not working, or not reliable enough, we can add
> a vc-dir--after-refresh-hook. Which dired-vc-next-action would add to, and 
> vc-dir-refresh would run (the function will remove itself from the hook
> upon completion).

Isn't vc-dir--after-refresh-hook a global variable too?

>> Also the patch adds a new useful global keybinding 'C-x v V'
>> bound to vc-next-action-on-root to open *vc-dir* buffer where
>> all registered files are marked.
>
> Sounds more like vc-dir-root-with-registered-files-selected. I wouldn't
> call it "next action" because it only provides one action.

Maybe then a shorter name vc-root-dir-action?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]