diff options
| author | Michael Albinus | 2025-03-14 16:31:51 +0100 |
|---|---|---|
| committer | Michael Albinus | 2025-03-14 16:31:51 +0100 |
| commit | 24ffcbb3da9a010cf564bb496af3f5ce0b805f17 (patch) | |
| tree | 526559c170333bcaf9241d693e19aef863dd7d88 /doc/misc | |
| parent | 21371aa106e6924377e916237d8418bfff2a754c (diff) | |
| download | emacs-24ffcbb3da9a010cf564bb496af3f5ce0b805f17.tar.gz emacs-24ffcbb3da9a010cf564bb496af3f5ce0b805f17.zip | |
Improve tramp-*-with-sudo commands
* doc/emacs/dired.texi (Dired Visiting):
Add tramp-dired-find-file-with-sudo.
* doc/emacs/files.texi (Reverting):
Add tramp-revert-buffer-with-sudo.
* doc/misc/tramp.texi (Ad-hoc multi-hops): Extend wrt
`tramp-*-with-sudo' commands.
* etc/NEWS: Add tramp-dired-find-file-with-sudo.
Fix typos.
* lisp/bindings.el (ctl-x-x-map):
* lisp/dired.el (dired-mode-map): Add "@" binding. (Bug#76974)
* lisp/net/tramp-cmds.el (dired-get-file-for-visit): Declare.
(with-tramp-file-name-with-method): New macro.
(tramp-revert-buffer-with-sudo): Autoload. Preserve position.
Use `with-tramp-file-name-with-method'.
(tramp-dired-find-file-with-sudo): New command.
Diffstat (limited to 'doc/misc')
| -rw-r--r-- | doc/misc/tramp.texi | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi index 81feb56ec31..6e66de552de 100644 --- a/doc/misc/tramp.texi +++ b/doc/misc/tramp.texi | |||
| @@ -3928,23 +3928,31 @@ containers on the remote host. | |||
| 3928 | 3928 | ||
| 3929 | A common use case for ad-hoc specifications is to visit a file or a | 3929 | A common use case for ad-hoc specifications is to visit a file or a |
| 3930 | directory with proper permissions, for example with the @option{sudo} | 3930 | directory with proper permissions, for example with the @option{sudo} |
| 3931 | method. The command @code{tramp-revert-buffer-with-sudo} supports | 3931 | method. The commands @code{tramp-revert-buffer-with-sudo} (@kbd{C-x x |
| 3932 | this. | 3932 | @@}), and @code{tramp-dired-find-file-with-sudo} (@kbd{@@} in |
| 3933 | @code{dired-mode}) support this. | ||
| 3933 | 3934 | ||
| 3935 | @kindex C-x x @@ | ||
| 3934 | @deffn Command tramp-revert-buffer-with-sudo | 3936 | @deffn Command tramp-revert-buffer-with-sudo |
| 3935 | This command shows the current buffer with @option{sudo} permissions. | 3937 | This command shows the current buffer with @option{sudo} permissions. |
| 3936 | The buffer must either visit a file, or a directory | 3938 | The buffer must either visit a file, or a directory |
| 3937 | (@code{dired-mode}). | 3939 | (@code{dired-mode}). |
| 3938 | @end deffn | 3940 | @end deffn |
| 3939 | 3941 | ||
| 3942 | @kindex @@ @r{(in dired}) | ||
| 3943 | @deffn Command tramp-dired-find-file-with-sudo | ||
| 3944 | In @code{dired-mode}, visit the file or directory named on this line. | ||
| 3945 | This is performed with @option{sudo} permissions. | ||
| 3946 | @end deffn | ||
| 3947 | |||
| 3940 | @defopt tramp-file-name-with-method | 3948 | @defopt tramp-file-name-with-method |
| 3941 | The method @code{tramp-revert-buffer-with-sudo} shows an alternate | 3949 | The method used in @code{tramp-revert-buffer-with-sudo} and |
| 3942 | buffer. It defaults to @option{sudo}, other valid methods are | 3950 | @code{tramp-dired-find-file-with-sudo}. It defaults to @option{sudo}, |
| 3943 | @option{su}, @option{doas}, @option{run0}, and @option{ksu}. | 3951 | other valid methods are @option{su}, @option{doas}, @option{run0}, and |
| 3952 | @option{ksu}. | ||
| 3944 | 3953 | ||
| 3945 | @lisp | 3954 | If a command is called with a prefix argument @kbd{C-u}, the option's |
| 3946 | (customize-set-variable 'tramp-file-name-with-method "doas") | 3955 | value is read interactively. |
| 3947 | @end lisp | ||
| 3948 | @end defopt | 3956 | @end defopt |
| 3949 | 3957 | ||
| 3950 | These methods apply the user @samp{root} as default. If another user | 3958 | These methods apply the user @samp{root} as default. If another user |