diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2019-11-20 13:45:30 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2019-11-20 13:45:30 +0100 |
commit | 035931777bd89b939436fd1d8a2b8d5a80ede095 (patch) | |
tree | b0ce714884bc106eaa95415754e807cb40c761e6 /lisp/net/tramp-integration.el | |
parent | 5c5c1b559313d06aab6516ff1b1acf1da3a01c7d (diff) | |
download | emacs-035931777bd89b939436fd1d8a2b8d5a80ede095.tar.gz |
Add renaming of remote buffer file names to Tramp
* doc/misc/tramp.texi (Default User): Fix typo.
(Cleanup remote connections): Adapt arguments of
`tramp-cleanup-connection'.
(Renaming remote files): New node.
(Frequently Asked Questions): New item "How to save files when a
remote host isn't reachable anymore?".
* etc/NEWS: Add `tramp-rename-files' and `tramp-rename-these-files'.
* lisp/net/tramp-cmds.el (tramp-default-rename-alist)
(tramp-confirm-rename-file-names): New defcustoms.
(tramp-rename-read-file-name-dir)
(tramp-rename-read-file-name-init): New defsubsts.
(tramp-default-rename-file, tramp-rename-files)
(tramp-rename-these-files): New defuns.
* lisp/net/tramp-integration.el (ido, ivy): Integrate with them.
Diffstat (limited to 'lisp/net/tramp-integration.el')
-rw-r--r-- | lisp/net/tramp-integration.el | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lisp/net/tramp-integration.el b/lisp/net/tramp-integration.el index 0bb19ed9c4d..0c3107603fb 100644 --- a/lisp/net/tramp-integration.el +++ b/lisp/net/tramp-integration.el @@ -36,6 +36,8 @@ (declare-function tramp-file-name-equal-p "tramp") (declare-function tramp-tramp-file-p "tramp") (defvar eshell-path-env) +(defvar ido-read-file-name-non-ido) +(defvar ivy-completing-read-handlers-alist) (defvar recentf-exclude) (defvar tramp-current-connection) (defvar tramp-postfix-host-format) @@ -170,6 +172,20 @@ NAME must be equal to `tramp-current-connection'." (remove-hook 'tramp-cleanup-all-connections-hook #'tramp-recentf-cleanup-all)))) +;;; Integration of ido.el: + +(with-eval-after-load 'ido + (add-to-list 'ido-read-file-name-non-ido 'tramp-rename-files) + (add-to-list 'ido-read-file-name-non-ido 'tramp-these-rename-files)) + +;;; Integration of ivy.el: + +(with-eval-after-load 'ivy + (add-to-list 'ivy-completing-read-handlers-alist + '(tramp-rename-files . completing-read-default)) + (add-to-list 'ivy-completing-read-handlers-alist + '(tramp-these-rename-files . completing-read-default))) + ;;; Default connection-local variables for Tramp: (defconst tramp-connection-local-default-profile |