"C. Conrad" <[email protected]> writes:

Hi,

> Since 2.6.0 - this worked with prior tramp versions (from melpa):
>
> Opening a file as non-root in /etc/...
>
> then M-x sudo-edit
>
> (defun sudo-edit (&optional arg)
>   "Edit currently visited file as root."
>   (interactive "P")
>   (if (or arg (not buffer-file-name))
>       (find-file (concat "/sudo:root@localhost:"
>                          (ido-read-file-name "Find file(as root): ")))
>     (find-alternate-file (concat "/sudo:root@localhost:"
> buffer-file-name))))
>
> =>
>
> tramp-error: Tramp failed to connect.  If this happens repeatedly, try
>     ‘M-x tramp-cleanup-this-connection’
>
> Did a tramp-cleanup-all-connections before.

I've tried to reproduce it in a clean environment. I did the following:

- ~/src/emacs-28/src/emacs -Q -L ~/.emacs.d/elpa/tramp-2.6.0 -l ido /etc/hosts

- Eval your sudo-edit function in *scratch*

- In buffer "hosts", call M-x sudo-edit

Everything works as expected. Could you pls try to reproduce it similarly?

Best regards, Michael.

Reply via email to