emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: master 695f679: Remove ; ; ; ###tramp-autoload cookie from Tramp def


From: Basil L. Contovounesios
Subject: Re: master 695f679: Remove ; ; ; ###tramp-autoload cookie from Tramp defcustoms (Bug#47063)
Date: Sat, 13 Mar 2021 22:27:48 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Michael.Albinus@gmx.de (Michael Albinus) writes:

> diff --git a/lisp/net/tramp-crypt.el b/lisp/net/tramp-crypt.el
> index f8de708..278fb9d 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)
[...]
> +;; 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)
[...]
> +;; 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)

Here, the completion-predicate property is autoloaded, but
tramp-crypt-enabled-p is not, resulting in the following unfortunate
interaction when only tramp.el is loaded:

0. emacs -Q
1. M-x toggle-debug-on-error RET
2. M-x load-library RET tramp RET
3. M-x customize-set-variable RET read-extended-command-predicate RET
4. e TAB RET
5. M-x TAB

  Debugger entered--Lisp error: (void-function tramp-crypt-enabled-p)
    tramp-crypt-enabled-p(tramp-crypt-add-directory #<buffer *scratch*>)
    command-completion-default-include-p(tramp-crypt-add-directory
                                         #<buffer *scratch*>)

My question is, which combination of the following should happen:

- The completion-predicate properties are not autoloaded.
- The function tramp-crypt-enabled-p is autoloaded.
- The function command-completion-default-include-p checks whether
  completion-predicate is functionp.

Thanks,

-- 
Basil



reply via email to

[Prev in Thread] Current Thread [Next in Thread]