unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: Juri Linkov <juri@linkov.net>
Cc: 69712@debbugs.gnu.org
Subject: bug#69712: Package author/maintainer printing fix
Date: Fri, 22 Mar 2024 08:47:38 +0000	[thread overview]
Message-ID: <87frwifyad.fsf@posteo.net> (raw)
In-Reply-To: <86h6hegr0b.fsf@mail.linkov.net> (Juri Linkov's message of "Sun,  10 Mar 2024 19:03:16 +0200")

Juri Linkov <juri@linkov.net> writes:

> There are many packages with non-dot author/maintainer format that fail with
>
> Debugger entered--Lisp error: (wrong-type-argument listp "XXIV")
>   car("XXIV")
>   package--print-email-button("XXIV")
>   describe-package-1(#s(package-desc :name chaos-mode ((:authors ("XXIV")) (:maintainers ("XXIV")) (:maintainer "XXIV"))))
>   describe-package(#s(package-desc :name chaos-mode ((:authors ("XXIV")) (:maintainers ("XXIV")) (:maintainer "XXIV"))))
>   package-menu-describe-package(#<marker (moves after insertion) at 67389 in *Packages*>)
>   button-activate(#<marker (moves after insertion) at 67389 in *Packages*> nil)
>   push-button(67389)
>   funcall-interactively(push-button 67389)
>   command-execute(push-button)
>
> Here is the fix:

Is there any reason not to apply this?  It makes sense to me.

> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index fe7b10f569a..790860df2a7 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -3082,19 +3082,21 @@ package--print-email-button
>    "Insert a button whose action will send an email to RECIPIENT.
>  NAME should have the form (FULLNAME . EMAIL) where FULLNAME is
>  either a full name or nil, and EMAIL is a valid email address."
> -  (when (car recipient)
> -    (insert (car recipient)))
> -  (when (and (car recipient) (cdr recipient))
> -    (insert " "))
> -  (when (cdr recipient)
> -    (insert "<")
> -    (insert-text-button (cdr recipient)
> -                        'follow-link t
> -                        'action (lambda (_)
> -                                  (compose-mail
> -                                   (format "%s <%s>" (car recipient) (cdr recipient)))))
> -    (insert ">"))
> -  (insert "\n"))
> +  (if (stringp recipient)
> +      (insert recipient "\n")
> +    (when (car recipient)
> +      (insert (car recipient)))
> +    (when (and (car recipient) (cdr recipient))
> +      (insert " "))
> +    (when (cdr recipient)
> +      (insert "<")
> +      (insert-text-button (cdr recipient)
> +                          'follow-link t
> +                          'action (lambda (_)
> +                                    (compose-mail
> +                                     (format "%s <%s>" (car recipient) (cdr recipient)))))
> +      (insert ">"))
> +    (insert "\n")))
>  
>  \f
>  ;;;; Package menu mode.
>

-- 
	Philip Kaludercic on peregrine





  parent reply	other threads:[~2024-03-22  8:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-10 17:03 bug#69712: Package author/maintainer printing fix Juri Linkov
2024-03-12  4:55 ` J.P.
2024-03-22  8:47 ` Philip Kaludercic [this message]
2024-03-22 11:38   ` Eli Zaretskii
2024-03-22 16:07   ` Juri Linkov
2024-03-22 12:10 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-22 16:08   ` Juri Linkov
2024-03-22 19:02 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-23 18:24   ` Juri Linkov
2024-03-23 20:12     ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]     ` <86le4cgaad.fsf@mail.linkov.net>
2024-05-16 15:05       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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=87frwifyad.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=69712@debbugs.gnu.org \
    --cc=juri@linkov.net \
    /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).