Michael Albinus <michael.albi...@gmx.de> writes: Hi Warren,
>> Again, I was upgrading from Emacs 26.3 to 29.0.91 (Linux), and found >> shortened multi-hop tramp file names are mandatory now. I am sure many >> people like this feature, but my own preference is to have every >> multi-hop tramp file name to be self-contained, with all the hops >> included in the name. > > I will work on this. However, it won't be a short shot, it might take > some days. It seems easier than expected. Could you pls check the appended patch? It's on top of Tramp 2.6.0.5 (from ELPA), but it should also apply on Tramp integrated into the Emacs 29 pretest (I hope). There's a new user option `tramp-show-ad-hoc-multi-hops'. When you set it to t, the full multi-hop file names shall be visible. I haven't finished regression tests, but it looks promising. >> Warren Best regards, Michael.
diff --git a/lisp/tramp.el b/lisp/tramp.el index 90fd53b0..745913f8 100644 --- a/lisp/tramp.el +++ b/lisp/tramp.el @@ -1800,6 +1800,11 @@ See `tramp-dissect-file-name' for details." (put #'tramp-buffer-name 'tramp-suppress-trace t) +(defcustom tramp-show-ad-hoc-multi-hops nil + "Whether to show ad-hoc multi-hops in file names." + :version "29.2" + :type 'boolean) + ;;;###tramp-autoload (defun tramp-make-tramp-file-name (&rest args) "Construct a Tramp file name from ARGS. @@ -1825,8 +1830,8 @@ the form (METHOD USER DOMAIN HOST PORT LOCALNAME &optional HOP)." (when (cadr args) (setq localname (and (stringp (cadr args)) (cadr args)))) (when hop - ;; Keep hop in file name for completion. - (unless minibuffer-completing-file-name + ;; Keep hop in file name for completion or when indicated. + (unless (or minibuffer-completing-file-name tramp-show-ad-hoc-multi-hops) (setq hop nil)) ;; Assure that the hops are in `tramp-default-proxies-alist'. ;; In tramp-archive.el, the slot `hop' is used for the archive