Subject: bug#76974: 31.0.50; [wishlist] Add global key binding for tramp-revert-buffer-with-sudo

From: Michael Albinus <[email-masked]>
Date: Fri, 14 Mar 2025 16:40:47 +0100

Version: 31.1

Filipp Gunbin <[email-masked]> writes:

Hi everybody,

>> Yes, I did. Neither tramp-revert-buffer-with-sudo nor
>> tramp-revert-buffer-obtain-root are a perfect name. We don't know for
>> sure, that the method will be "sudo", nor that the user will be
>> "root". On my QNAP NAS, the root user is called "admin".
>>
>> And using a Tramp specific name for a global bound command doesn't seem
>> to be proper as well.
>>
>> I was thinking to introduce a new command
>> 'revert-buffer-<something-better-than-sudo-or-root>', which will be an
>> alias of tramp-revert-buffer-with-sudo. But I'm bad with proper names.
>
> Maybe revert-buffer-as-superuser?

There is general agreement on this feature. So I've pushed a patch to the
master branch:

- Add key binding 'C-x x @' to tramp-revert-buffer-with-sudo.
- New command tramp-dired-find-file-with-sudo, bound to '@' in Dired.
- Add handling of prefix argument 'C-u' for both commands, asking
  interactively for another Tramp method but "sudo".

I haven't changed the command names; it doesn't seem to be urgent now we
have the bindings.

Closing the bug.

Best regards, Michael.