1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

; Touch up tramp-*-with-sudo documentation, add FIXMEs

* doc/emacs/dired.texi (Dired Visiting):
* doc/emacs/files.texi (Reverting):
* doc/misc/tramp.texi (Ad-hoc multi-hops):
* etc/NEWS:
* lisp/net/tramp-cmds.el (tramp-revert-buffer-with-sudo)
(tramp-dired-find-file-with-sudo): Touch up documentation of
these features.  Add FIXMEs about renaming the two commands.
This commit is contained in:
Sean Whitton 2025-03-15 19:32:35 +08:00
parent 87f9c09ab5
commit a57e9f45db
5 changed files with 39 additions and 20 deletions

View file

@ -683,10 +683,21 @@ An alternative method could be chosen with `tramp-file-name-with-method'."
(make-tramp-file-name
:method tramp-file-name-with-method :localname filename))))
;; FIXME: We would like to rename this for Emacs 31.1 to a name that
;; does not encode the default method. It is intended as a generic
;; privilege-elevation command. Some ideas from bug#76974:
;; `tramp-revert-buffer-obtain-root',
;; `tramp-revert-buffer-as-superuser'.
;;;###autoload
(defun tramp-revert-buffer-with-sudo ()
"Revert current buffer to visit with \"sudo\" permissions.
An alternative method could be chosen with `tramp-file-name-with-method'.
"Visit the current file again with superuser, or root, permissions.
By default this is done using the \"sudo\" Tramp method.
You can customize `tramp-file-name-with-method' to change this.
Interactively, with a prefix argument, prompt for a different method.
If the buffer visits a file, the file is replaced.
If the buffer runs `dired', the buffer is reverted."
(interactive)
@ -708,10 +719,16 @@ If the buffer runs `dired', the buffer is reverted."
(dired-advertise)
(revert-buffer)))))
;; FIXME: See FIXME above about renaming this before Emacs 31.1.
;;;###autoload
(defun tramp-dired-find-file-with-sudo ()
"In Dired, visit the file or directory named on this line.
This is performed with \"sudo\" permissions."
"Visit the file or directory named on this line as the superuser.
By default this is done using the \"sudo\" Tramp method.
YOu can customize `tramp-file-name-with-method' to change this.
Interactively, with a prefix argument, prompt for a different method."
(interactive)
(with-tramp-file-name-with-method
(find-file (tramp-file-name-with-sudo (dired-get-file-for-visit)))))