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 5183123: Add Tramp recompilation
Date: Fri, 23 Apr 2021 17:23:13 +0100	[thread overview]
Message-ID: <878s59m0lq.fsf@tcd.ie> (raw)
In-Reply-To: <20210419095259.0651220FD4@vcs0.savannah.gnu.org> (Michael Albinus's message of "Mon, 19 Apr 2021 05:52:58 -0400 (EDT)")

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

> diff --git a/lisp/net/tramp-cmds.el b/lisp/net/tramp-cmds.el
> index d208f0e..6342cf5 100644
> --- a/lisp/net/tramp-cmds.el
> +++ b/lisp/net/tramp-cmds.el
> @@ -472,6 +472,48 @@ For details, see `tramp-rename-files'."
>  (function-put
>   #'tramp-rename-these-files 'completion-predicate #'tramp-command-completion-p)
>  
> +;; This function takes action since Emacs 28.1, when
> +;; `read-extended-command-predicate' is set to
> +;; `command-completion-default-include-p'.
> +;;;###tramp-autoload
> +(defun tramp-recompile-elpa-command-completion-p (_symbol _buffer)
> +  "A predicate for `tramp-recompile-elpa'.
> +It is completed by \"M-x TAB\" only if package.el is loaded, and
> +Tramp is an installed ELPA package."
> +  ;; We cannot apply `package-installed-p', this would also return the
> +  ;; builtin package.
> +  (tramp-compat-funcall 'package--user-installed-p 'tramp))

It looks like package--user-installed-p isn't currently designed to be
used in this way:

0. emacs -Q
1. (progn
     (require 'package)
     (require 'tramp)
     (setq read-extended-command-predicate
           #'command-completion-default-include-p)
     (read-extended-command))
2. C-j C-i

Debugger entered--Lisp error: (wrong-type-argument package-desc nil)
  signal(wrong-type-argument (package-desc nil))
  package--user-installed-p(tramp)
  tramp-recompile-elpa-command-completion-p(tramp-recompile-elpa
                                            #<buffer *scratch*>)
  command-completion-default-include-p(tramp-recompile-elpa
                                       #<buffer *scratch*>)

Should package--user-installed-p simply guard against a nil package
descriptor?

Thanks,

-- 
Basil



       reply	other threads:[~2021-04-23 16:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20210419095256.30298.23862@vcs0.savannah.gnu.org>
     [not found] ` <20210419095259.0651220FD4@vcs0.savannah.gnu.org>
2021-04-23 16:23   ` Basil L. Contovounesios [this message]
2021-04-23 17:00     ` master 5183123: Add Tramp recompilation Stefan Monnier
2021-04-23 18:02       ` Michael Albinus
2021-04-23 20:02         ` Stefan Monnier
2021-04-23 20:17           ` Michael Albinus
2021-04-23 20:47             ` Stefan Monnier
2021-04-25 13:08               ` Michael Albinus
2021-04-23 17:58     ` 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=878s59m0lq.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).