unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Basil L. Contovounesios" <contovob@tcd.ie>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: emacs-devel@gnu.org
Subject: Re: master 695f679: Remove ; ; ; ###tramp-autoload cookie from Tramp defcustoms (Bug#47063)
Date: Sat, 13 Mar 2021 22:27:48 +0000	[thread overview]
Message-ID: <877dma1yfv.fsf@tcd.ie> (raw)
In-Reply-To: <20210313133547.AA06C20B2E@vcs0.savannah.gnu.org> (Michael Albinus's message of "Sat, 13 Mar 2021 08:35:47 -0500 (EST)")

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	other threads:[~2021-03-13 22:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210313133546.6042.78482@vcs0.savannah.gnu.org>
     [not found] ` <20210313133547.AA06C20B2E@vcs0.savannah.gnu.org>
2021-03-13 22:27   ` Basil L. Contovounesios [this message]
2021-03-13 23:20     ` master 695f679: Remove ; ; ; ###tramp-autoload cookie from Tramp defcustoms (Bug#47063) Stefan Monnier
2021-03-14  8:39       ` Michael Albinus
2021-03-14 12:59         ` Basil L. Contovounesios
2021-03-14 14:57           ` Stefan Monnier
2021-03-24 22:19             ` Basil L. Contovounesios
2021-03-25  8:25               ` Michael Albinus
2021-03-26 15:18                 ` Basil L. Contovounesios
2021-03-26 15:24                   ` Michael Albinus
2021-03-25  9:12               ` Lars Ingebrigtsen
2021-03-25 14:05                 ` Stefan Monnier
2021-03-26 11:28                   ` Lars Ingebrigtsen
2021-03-26 13:39                     ` Stefan Monnier
2021-03-26 14:42                       ` Michael Albinus
2021-03-26 18:39                         ` Basil L. Contovounesios
2021-03-26 15:36                       ` Basil L. Contovounesios
2021-03-26 16:37                         ` Stefan Monnier
2021-03-26 18:18                           ` Basil L. Contovounesios
2021-03-26 22:12                       ` Lars Ingebrigtsen
2021-03-26 15:57                     ` Basil L. Contovounesios
2021-03-26 15:33                   ` Basil L. Contovounesios
2021-03-26 16:32                     ` Stefan Monnier
2021-03-26 18:18                       ` Basil L. Contovounesios
2021-03-26 15:27                 ` Basil L. Contovounesios
2021-03-26 22:11                   ` Lars Ingebrigtsen
2021-03-27  1:18                     ` Basil L. Contovounesios
2021-03-27 12:33                       ` Lars Ingebrigtsen
2021-03-27 20:29                         ` Basil L. Contovounesios
2021-03-14 14:57         ` Stefan Monnier
2021-03-14 18:42           ` Michael Albinus
2021-03-14 20:30             ` Stefan Monnier
2021-03-15  9:00               ` Michael Albinus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877dma1yfv.fsf@tcd.ie \
    --to=contovob@tcd.ie \
    --cc=emacs-devel@gnu.org \
    --cc=michael.albinus@gmx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).