diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2021-03-13 14:35:39 +0100 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2021-03-13 14:35:39 +0100 |
commit | 695f6792f1524a446d276bf5c5e53bbb4c200909 (patch) | |
tree | c1c039876fd7ac8bb0a0ca32d0499ca2872a68d7 /lisp/net/tramp-crypt.el | |
parent | aa644996dfd67872a0271d5bf92dcaa44aba6469 (diff) | |
download | emacs-695f6792f1524a446d276bf5c5e53bbb4c200909.tar.gz emacs-695f6792f1524a446d276bf5c5e53bbb4c200909.tar.bz2 emacs-695f6792f1524a446d276bf5c5e53bbb4c200909.zip |
Remove ;;;###tramp-autoload cookie from Tramp defcustoms (Bug#47063)
* lisp/net/tramp-crypt.el (tramp-crypt-enabled-p): New defun.
(tramp-crypt-add-directory, tramp-crypt-remove-directory):
Add property `completion-predicate'.
* lisp/net/tramp-sh.el (tramp-terminal-type, tramp-remote-path)
(tramp-remote-process-environment): Remove. Move them to ...
* lisp/net/tramp.el: ... here.
Diffstat (limited to 'lisp/net/tramp-crypt.el')
-rw-r--r-- | lisp/net/tramp-crypt.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el index f8de7085e25..278fb9d8732 100644 --- a/lisp/net/tramp-crypt.el +++ b/lisp/net/tramp-crypt.el @@ -112,6 +112,14 @@ initializing a new crypted remote directory." "Non-nil when encryption support is available.") (setq tramp-crypt-enabled (executable-find tramp-crypt-encfs-program)) +;; This function takes action since Emacs 28.1, when +;; `read-extended-command-predicate' is set to +;; `command-completion-default-include-p'. +(defun tramp-crypt-enabled-p (_symbol _buffer) + "A predicate for Tramp interactive commands. +They are completed by \"M-x TAB\" only when encryption support is enabled." + tramp-crypt-enabled) + ;;;###tramp-autoload (defconst tramp-crypt-encfs-config ".encfs6.xml" "Encfs configuration file name.") @@ -469,6 +477,7 @@ See `tramp-crypt-do-encrypt-or-decrypt-file'." Files in that directory and all subdirectories will be encrypted before copying to, and decrypted after copying from that directory. File names will be also encrypted." + ;; (declare (completion tramp-crypt-enabled-p)) (interactive "DRemote directory name: ") (unless tramp-crypt-enabled (tramp-user-error nil "Feature is not enabled.")) @@ -481,10 +490,16 @@ directory. File names will be also encrypted." (setq tramp-crypt-directories (cons name tramp-crypt-directories))) (tramp-register-file-name-handlers)) +;; Starting with Emacs 28.1, this can be replaced by the "(declare ...)" form. +;;;###tramp-autoload +(function-put + #'tramp-crypt-add-directory 'completion-predicate #'tramp-crypt-enabled-p) + (defun tramp-crypt-remove-directory (name) "Unmark remote directory NAME for encryption. Existing files in that directory and its subdirectories will be kept in their encrypted form." + ;; (declare (completion tramp-crypt-enabled-p)) (interactive "DRemote directory name: ") (unless tramp-crypt-enabled (tramp-user-error nil "Feature is not enabled.")) @@ -498,6 +513,10 @@ kept in their encrypted form." (setq tramp-crypt-directories (delete name tramp-crypt-directories)) (tramp-register-file-name-handlers))) +;; Starting with Emacs 28.1, this can be replaced by the "(declare ...)" form. +(function-put + #'tramp-crypt-remove-directory 'completion-predicate #'tramp-crypt-enabled-p) + ;; `auth-source' requires a user. (defun tramp-crypt-dissect-file-name (name) "Return a `tramp-file-name' structure for NAME. |