unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69712: Package author/maintainer printing fix
@ 2024-03-10 17:03 Juri Linkov
  2024-03-12  4:55 ` J.P.
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Juri Linkov @ 2024-03-10 17:03 UTC (permalink / raw)
  To: 69712

[-- Attachment #1: Type: text/plain, Size: 723 bytes --]

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:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: package--print-email-button.patch --]
[-- Type: text/x-diff, Size: 1469 bytes --]

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.

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-05-16 15:05 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).