Package: emacs;
Reported by: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
Date: Mon, 8 Sep 2025 20:20:04 UTC
Severity: normal
Found in version 31.0.50
To reply to this bug, email your comments to 79411 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
philipk <at> posteo.net, bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Mon, 08 Sep 2025 20:20:04 GMT) Full text and rfc822 format available.Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>:philipk <at> posteo.net, bug-gnu-emacs <at> gnu.org.
(Mon, 08 Sep 2025 20:20:04 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> To: bug-gnu-emacs <at> gnu.org Subject: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Mon, 8 Sep 2025 22:18:43 +0200
X-Debbugs-Cc: Philip Kaludercic <philipk <at> posteo.net>
Move your `package-user-dir' temporarily away. Then start "./src/emacs
-Q". Then:
M-x package-initialize RET
M-x package-list-packages RET
C-h P beframe RET
This shows the README.md as package description, as defined by
Prots through property :readme:
# Beframe (beframe.el) for GNU Emacs
`beframe` enables a frame-oriented Emacs workflow where each frame has
access to the list of buffers visited therein. In the interest of
brevity, we call buffers that belong to frames "beframed".
**Video demo:** <https://protesilaos.com/codelog/2023-02-28-emacs-beframe-demo/>
+ Package name (GNU ELPA): `beframe`
+ Official manual: <https://protesilaos.com/emacs/beframe>
+ Change log: <https://protesilaos.com/emacs/beframe-changelog>
+ Git repositories:
+ GitHub: <https://github.com/protesilaos/beframe>
+ GitLab: <https://gitlab.com/protesilaos/beframe>
+ Backronym: Buffers Encapsulated in Frames Realise Advanced
Management of Emacs.
Then:
M-x package-install beframe RET
C-h P beframe RET
Now this shows the README.org file as package description, which
in that place is ... ugly. I am aware of the following comment
in function `package--get-description':
;; We don’t include README.md here, because that is often the home
;; page on a site like github, and not suitable as the package long
;; description.
But probably if a package author has willfully designed her/his
README.md to be used as property :readme, then it should also be
used for installed packages [1]? Probably if there is a :readme
property, then function `package--get-description' should even
always use that, and not resort to guessing [2]?
If you agree and want me to provide a patch to that effect ([1]
or [2]?), please let me know.
[ I'm filing/asking this because I have been planning to use a
combination of (:readme "README.md" :doc "README.org") similar
to what Prots has been doing for his beframe package. ]
In GNU Emacs 31.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version
3.24.38, cairo version 1.16.0) of 2025-09-08 built on sappc2
Repository revision: 4c74b68fb1f23db6ba770f7322efe378f3492751
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12201009
System Description: Debian GNU/Linux 12 (bookworm)
Configured using:
'configure --with-native-compilation --with-mailutils'
Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP
NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF
TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM XRANDR GTK3
ZLIB
Important settings:
value of $LC_COLLATE: POSIX
value of $LC_TIME: POSIX
value of $LANG: en_US.UTF-8
value of $XMODIFIERS: @im=ibus
locale-coding-system: utf-8-unix
Major mode: Lisp Interaction
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
minibuffer-regexp-mode: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug transient pcase format-spec edmacro
kmacro warnings info beframe-autoloads easy-mmode loaddefs-gen tar-mode
arc-mode archive-mode novice cus-edit pp cus-start cus-load wid-edit
lisp-mnt misearch multi-isearch cl-extra cl-print help-fns radix-tree
help-mode mm-archive message sendmail yank-media dired dired-loaddefs
rfc822 mml mml-sec epa derived gnus-util time-date mailabbrev gmm-utils
mailheader mm-decode mm-bodies mm-encode mail-utils mule-util gnutls
network-stream url-cache url-http url-auth mail-parse rfc2231 rfc2047
rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm puny epg rfc6068
epg-config display-line-numbers compile text-property-search comint
ansi-osc ansi-color ring comp-run comp-common rx finder-inf thingatpt
package browse-url xdg url url-proxy url-privacy url-expand url-methods
url-history url-cookie generate-lisp-file url-domsuf url-util mailcap
url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs icons
password-cache json subr-x map byte-opt gv bytecomp byte-compile
url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset
image regexp-opt fringe tabulated-list replace newcomment text-mode
lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch
easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo gtk
x-toolkit xinput2 x multi-tty move-toolbar make-network-process
tty-child-frames native-compile emacs)
Memory information:
((conses 16 348941 46086) (symbols 48 13566 0) (strings 32 67396 5547)
(string-bytes 1 1770646) (vectors 16 33740)
(vector-slots 8 746562 66527) (floats 8 61 158)
(intervals 56 25221 0) (buffers 984 16))
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Mon, 08 Sep 2025 20:57:03 GMT) Full text and rfc822 format available.Message #8 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Philip Kaludercic <philipk <at> posteo.net> To: debbugs-submit <at> debbugs.gnu.org, Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>, 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Mon, 08 Sep 2025 20:56:36 +0000
Hi, if you have a reasonable patch, I would gladly review it. The behaviour you describe does fundamentally sound confusing, and it would be nice to come up with a solution. On 8 September 2025 22:18:43 CEST, Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> wrote: >X-Debbugs-Cc: Philip Kaludercic <philipk <at> posteo.net> > >Move your `package-user-dir' temporarily away. Then start "./src/emacs >-Q". Then: > >M-x package-initialize RET >M-x package-list-packages RET >C-h P beframe RET > >This shows the README.md as package description, as defined by >Prots through property :readme: > > # Beframe (beframe.el) for GNU Emacs > > `beframe` enables a frame-oriented Emacs workflow where each frame has > access to the list of buffers visited therein. In the interest of > brevity, we call buffers that belong to frames "beframed". > > **Video demo:** <https://protesilaos.com/codelog/2023-02-28-emacs-beframe-demo/> > > + Package name (GNU ELPA): `beframe` > + Official manual: <https://protesilaos.com/emacs/beframe> > + Change log: <https://protesilaos.com/emacs/beframe-changelog> > + Git repositories: > + GitHub: <https://github.com/protesilaos/beframe> > + GitLab: <https://gitlab.com/protesilaos/beframe> > + Backronym: Buffers Encapsulated in Frames Realise Advanced > Management of Emacs. > >Then: > >M-x package-install beframe RET >C-h P beframe RET > >Now this shows the README.org file as package description, which >in that place is ... ugly. I am aware of the following comment >in function `package--get-description': > > ;; We don’t include README.md here, because that is often the home > ;; page on a site like github, and not suitable as the package long > ;; description. > >But probably if a package author has willfully designed her/his >README.md to be used as property :readme, then it should also be >used for installed packages [1]? Probably if there is a :readme >property, then function `package--get-description' should even >always use that, and not resort to guessing [2]? > >If you agree and want me to provide a patch to that effect ([1] >or [2]?), please let me know. > >[ I'm filing/asking this because I have been planning to use a > combination of (:readme "README.md" :doc "README.org") similar > to what Prots has been doing for his beframe package. ] > >In GNU Emacs 31.0.50 (build 6, x86_64-pc-linux-gnu, GTK+ Version > 3.24.38, cairo version 1.16.0) of 2025-09-08 built on sappc2 >Repository revision: 4c74b68fb1f23db6ba770f7322efe378f3492751 >Repository branch: master >Windowing system distributor 'The X.Org Foundation', version 11.0.12201009 >System Description: Debian GNU/Linux 12 (bookworm) > >Configured using: > 'configure --with-native-compilation --with-mailutils' > >Configured features: >ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG >LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP >NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF >TOOLKIT_SCROLL_BARS WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM XRANDR GTK3 >ZLIB > >Important settings: > value of $LC_COLLATE: POSIX > value of $LC_TIME: POSIX > value of $LANG: en_US.UTF-8 > value of $XMODIFIERS: @im=ibus > locale-coding-system: utf-8-unix > >Major mode: Lisp Interaction > >Minor modes in effect: > tooltip-mode: t > global-eldoc-mode: t > eldoc-mode: t > show-paren-mode: t > electric-indent-mode: t > mouse-wheel-mode: t > tool-bar-mode: t > menu-bar-mode: t > file-name-shadow-mode: t > global-font-lock-mode: t > font-lock-mode: t > blink-cursor-mode: t > minibuffer-regexp-mode: t > line-number-mode: t > indent-tabs-mode: t > transient-mark-mode: t > auto-composition-mode: t > auto-encryption-mode: t > auto-compression-mode: t > >Load-path shadows: >None found. > >Features: >(shadow sort mail-extr emacsbug transient pcase format-spec edmacro >kmacro warnings info beframe-autoloads easy-mmode loaddefs-gen tar-mode >arc-mode archive-mode novice cus-edit pp cus-start cus-load wid-edit >lisp-mnt misearch multi-isearch cl-extra cl-print help-fns radix-tree >help-mode mm-archive message sendmail yank-media dired dired-loaddefs >rfc822 mml mml-sec epa derived gnus-util time-date mailabbrev gmm-utils >mailheader mm-decode mm-bodies mm-encode mail-utils mule-util gnutls >network-stream url-cache url-http url-auth mail-parse rfc2231 rfc2047 >rfc2045 mm-util ietf-drums mail-prsvr url-gw nsm puny epg rfc6068 >epg-config display-line-numbers compile text-property-search comint >ansi-osc ansi-color ring comp-run comp-common rx finder-inf thingatpt >package browse-url xdg url url-proxy url-privacy url-expand url-methods >url-history url-cookie generate-lisp-file url-domsuf url-util mailcap >url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs icons >password-cache json subr-x map byte-opt gv bytecomp byte-compile >url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren >electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel >term/x-win x-win term/common-win x-dnd touch-screen tool-bar dnd fontset >image regexp-opt fringe tabulated-list replace newcomment text-mode >lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch >easymenu timer select scroll-bar mouse jit-lock font-lock syntax >font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic >indonesian philippine cham georgian utf-8-lang misc-lang vietnamese >tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek >romanian slovak czech european ethiopic indian cyrillic chinese >composite emoji-zwj charscript charprop case-table epa-hook >jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs >theme-loaddefs faces cus-face macroexp files window text-properties >overlay sha1 md5 base64 format env code-pages mule custom widget keymap >hashtable-print-readable backquote threads dbusbind inotify lcms2 >dynamic-setting system-font-setting font-render-setting cairo gtk >x-toolkit xinput2 x multi-tty move-toolbar make-network-process >tty-child-frames native-compile emacs) > >Memory information: >((conses 16 348941 46086) (symbols 48 13566 0) (strings 32 67396 5547) > (string-bytes 1 1770646) (vectors 16 33740) > (vector-slots 8 746562 66527) (floats 8 61 158) > (intervals 56 25221 0) (buffers 984 16)) > > > Sent from my phone
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Tue, 09 Sep 2025 12:02:01 GMT) Full text and rfc822 format available.Message #11 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> To: Philip Kaludercic <philipk <at> posteo.net>, 79411 <at> debbugs.gnu.org Cc: Stephen Leake <stephen_leake <at> stephe-leake.org> Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Tue, 9 Sep 2025 14:00:34 +0200
On 2025-09-08 22:56, Philip Kaludercic wrote:
> Hi, if you have a reasonable patch, I would gladly review it. The
> behaviour you describe does fundamentally sound confusing, and it
> would be nice to come up with a solution.
Thanks for your quick reply and for caring about ELPA, package.el, and
the packaging system in general!
Only having a "reasonable" solution is more difficult than I initially
thought ... I started edebugging and eyeballing that code only after
filing this bug, sorry.
So here are some facts, not to lecture you, but to have them summarized
and probably corrected, if I got them wrong:
- I have been hoping on the ELPA metadata, like, :news, :doc:, :readme
etc., but that's not part of the archive web server contract (as in
(elisp) Archive Web Server).
The only thing we can get from an archive web server to help with this
issue is file <package name>-readme.txt.
- For the following reasons it is not reasonable to access that file
online *for installed packages*:
+ The user might be offline.
+ A package, once installed, forgets about its originating archive,
and determining a matching archive might be difficult.
+ The file on the archive web server is not versioned, so it might not
match the version of the installed package.
- So the only thing that seems reasonable is to download <package
name>-readme.txt during package installation and store it below
`package-user-dir'. And remove it during package deinstallation.
Well, and Emacs did exactly that already until commit
d4fb2690702fbd348977fc94a9f7a99c00cc3010 removed it. Does anybody have
an idea as to why that was removed? (CCing Stephen, the author of that
commit.) The commit message does not quote a bug number, and the only
bug I have found that might be related to this issue is bug#39609, which
seems to be a duplicate of this one.
Please advise how to continue here. I can live with this issue and, as
a work-around for my package, prepare file "README-elpa.md" as a copy of
my "README.md" when ELPA processes the :make property. (That should
work, shouldn't it?)
Thanks!
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Thu, 11 Sep 2025 21:39:01 GMT) Full text and rfc822 format available.Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Philip Kaludercic <philipk <at> posteo.net> To: Jens Schmidt via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> Cc: Stephen Leake <stephen_leake <at> stephe-leake.org>, Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>, 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Thu, 11 Sep 2025 21:38:28 +0000
Jens Schmidt via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org> writes: > On 2025-09-08 22:56, Philip Kaludercic wrote: > >> Hi, if you have a reasonable patch, I would gladly review it. The >> behaviour you describe does fundamentally sound confusing, and it >> would be nice to come up with a solution. > > Thanks for your quick reply and for caring about ELPA, package.el, and > the packaging system in general! Thanks! And sorry for the delay this time around, I didn't have access to my laptop until now :) > Only having a "reasonable" solution is more difficult than I initially > thought ... I started edebugging and eyeballing that code only after > filing this bug, sorry. > > So here are some facts, not to lecture you, but to have them summarized > and probably corrected, if I got them wrong: > > - I have been hoping on the ELPA metadata, like, :news, :doc:, :readme > etc., but that's not part of the archive web server contract (as in > (elisp) Archive Web Server). > > The only thing we can get from an archive web server to help with this > issue is file <package name>-readme.txt. > > - For the following reasons it is not reasonable to access that file > online *for installed packages*: > > + The user might be offline. > + A package, once installed, forgets about its originating archive, > and determining a matching archive might be difficult. > + The file on the archive web server is not versioned, so it might not > match the version of the installed package. 100% agree here. > - So the only thing that seems reasonable is to download <package > name>-readme.txt during package installation and store it below > `package-user-dir'. And remove it during package deinstallation. > > Well, and Emacs did exactly that already until commit > d4fb2690702fbd348977fc94a9f7a99c00cc3010 removed it. Does anybody have > an idea as to why that was removed? (CCing Stephen, the author of that > commit.) The commit message does not quote a bug number, and the only > bug I have found that might be related to this issue is bug#39609, which > seems to be a duplicate of this one. On a quick glance, I cannot see the reason either. But it seems like the reasonable approach, and I don't see a reason why we shouldn't be able to revert that part of the commit. > Please advise how to continue here. I can live with this issue and, as > a work-around for my package, prepare file "README-elpa.md" as a copy of > my "README.md" when ELPA processes the :make property. (That should > work, shouldn't it?) I would like to avoid :make properties in package specifications. To build on your last suggestion, we can just make package.el download the -readme.txt as README-elpa in the package directory (if it doesn't already exist). This would also have the advantage of not complicating the cleanup procedure, as removing the directory would automatically clean up the README file. > Thanks!
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Thu, 11 Sep 2025 21:39:02 GMT) Full text and rfc822 format available.bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Thu, 11 Sep 2025 22:54:01 GMT) Full text and rfc822 format available.Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Stephen Leake <stephen_leake <at> stephe-leake.org> To: Philip Kaludercic <philipk <at> posteo.net> Cc: "Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>, Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>, 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Thu, 11 Sep 2025 15:53:34 -0700
Philip Kaludercic <philipk <at> posteo.net> writes: >> Well, and Emacs did exactly that already until commit >> d4fb2690702fbd348977fc94a9f7a99c00cc3010 removed it. Does anybody have >> an idea as to why that was removed? (CCing Stephen, the author of that >> commit.) The commit message does not quote a bug number, and the only >> bug I have found that might be related to this issue is bug#39609, which >> seems to be a duplicate of this one. > > On a quick glance, I cannot see the reason either. But it seems like > the reasonable approach, and I don't see a reason why we shouldn't be > able to revert that part of the commit. I don't really remember, but I think the problem was there were old readme's hanging around, and the local file was prefered over network access, so when you asked for the readme for a package, you got the wrong one. If you can _guarrantee_ that the file is deleted when it's old, that would be ok. But that's pretty hard to do. -- -- Stephe
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Thu, 11 Sep 2025 22:54:02 GMT) Full text and rfc822 format available.bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Fri, 12 Sep 2025 09:24:02 GMT) Full text and rfc822 format available.Message #26 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Philip Kaludercic <philipk <at> posteo.net> To: Stephen Leake <stephen_leake <at> stephe-leake.org> Cc: "Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs <at> gnu.org>, Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>, 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Fri, 12 Sep 2025 09:23:41 +0000
[Message part 1 (text/plain, inline)]
Stephen Leake <stephen_leake <at> stephe-leake.org> writes: > Philip Kaludercic <philipk <at> posteo.net> writes: > >>> Well, and Emacs did exactly that already until commit >>> d4fb2690702fbd348977fc94a9f7a99c00cc3010 removed it. Does anybody have >>> an idea as to why that was removed? (CCing Stephen, the author of that >>> commit.) The commit message does not quote a bug number, and the only >>> bug I have found that might be related to this issue is bug#39609, which >>> seems to be a duplicate of this one. >> >> On a quick glance, I cannot see the reason either. But it seems like >> the reasonable approach, and I don't see a reason why we shouldn't be >> able to revert that part of the commit. > > I don't really remember, but I think the problem was there were old > readme's hanging around, and the local file was prefered over network > access, so when you asked for the readme for a package, you got the > wrong one. > > If you can _guarrantee_ that the file is deleted when it's old, that > would be ok. But that's pretty hard to do. In my previous message I suggested something like:
[Message part 2 (text/x-patch, inline)]
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index ba9999c20e6..b9e2eb96389 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2162,7 +2162,15 @@ package-install-from-archive
;; Update the new (activated) pkg-desc as well.
(when-let* ((pkg-descs (cdr (assq (package-desc-name pkg-desc)
package-alist))))
- (setf (package-desc-signed (car pkg-descs)) t))))))))))
+ (setf (package-desc-signed (car pkg-descs)) t)))))))
+ ;; fetch a backup of the readme file from the server
+ (let ((readme (expand-file-name "README-elpa" (package-desc-dir pkg-desc))))
+ (unless (file-readable-p readme)
+ (package--with-response-buffer (package-archive-base pkg-desc)
+ :file (format "%s-readme.txt" (package-desc-name pkg-desc))
+ :noerror t
+ (write-region nil nil readme)))))))
+
;;;###autoload
(defun package-installed-p (package &optional min-version)
[Message part 3 (text/plain, inline)]
As we store the README file inside the package directory, it should also be deleted when we delete the package -- unless I am missing something?
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Fri, 12 Sep 2025 09:25:01 GMT) Full text and rfc822 format available.bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Sat, 13 Sep 2025 10:05:01 GMT) Full text and rfc822 format available.Message #32 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> To: Philip Kaludercic <philipk <at> posteo.net>, Stephen Leake <stephen_leake <at> stephe-leake.org> Cc: 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Sat, 13 Sep 2025 12:04:04 +0200
On 2025-09-12 11:23, Philip Kaludercic wrote: > In my previous message I suggested something like: > > diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el > index ba9999c20e6..b9e2eb96389 100644 > --- a/lisp/emacs-lisp/package.el > +++ b/lisp/emacs-lisp/package.el > @@ -2162,7 +2162,15 @@ package-install-from-archive > ;; Update the new (activated) pkg-desc as well. > (when-let* ((pkg-descs (cdr (assq (package-desc-name pkg-desc) > package-alist)))) > - (setf (package-desc-signed (car pkg-descs)) t)))))))))) > + (setf (package-desc-signed (car pkg-descs)) t))))))) > + ;; fetch a backup of the readme file from the server > + (let ((readme (expand-file-name "README-elpa" (package-desc-dir pkg-desc)))) > + (unless (file-readable-p readme) > + (package--with-response-buffer (package-archive-base pkg-desc) > + :file (format "%s-readme.txt" (package-desc-name pkg-desc)) > + :noerror t > + (write-region nil nil readme))))))) > + > > ;;;###autoload > (defun package-installed-p (package &optional min-version) > > As we store the README file inside the package directory, it should also > be deleted when we delete the package -- unless I am missing something? I like that approach, it should fix this issue, and it nicely complements what elpa-admin.el already does for some readmes on server side. Some notes: 1. You probably should not write README-elpa when it would be empty (which can happen, see https://elpa.gnu.org/packages/bicep-ts-mode-readme.txt), as that would block the search of `package--get-description' for more readmes. 2. Alternatively or in addition, one could extend `package--get-description' to not consider empty files in its search for a readme. 3. I think a paragraph in "(elisp) Packaging Basics" and some tests in package-tests.el would still be required. Do you want me to supply these? Thanks!
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Sat, 13 Sep 2025 10:40:02 GMT) Full text and rfc822 format available.Message #35 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Philip Kaludercic <philipk <at> posteo.net> To: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> Cc: Stephen Leake <stephen_leake <at> stephe-leake.org>, 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Sat, 13 Sep 2025 10:39:36 +0000
[Message part 1 (text/plain, inline)]
Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> writes: > On 2025-09-12 11:23, Philip Kaludercic wrote: > >> In my previous message I suggested something like: >> >> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el >> index ba9999c20e6..b9e2eb96389 100644 >> --- a/lisp/emacs-lisp/package.el >> +++ b/lisp/emacs-lisp/package.el >> @@ -2162,7 +2162,15 @@ package-install-from-archive >> ;; Update the new (activated) pkg-desc as well. >> (when-let* ((pkg-descs (cdr (assq (package-desc-name pkg-desc) >> package-alist)))) >> - (setf (package-desc-signed (car pkg-descs)) t)))))))))) >> + (setf (package-desc-signed (car pkg-descs)) t))))))) >> + ;; fetch a backup of the readme file from the server >> + (let ((readme (expand-file-name "README-elpa" (package-desc-dir pkg-desc)))) >> + (unless (file-readable-p readme) >> + (package--with-response-buffer (package-archive-base pkg-desc) >> + :file (format "%s-readme.txt" (package-desc-name pkg-desc)) >> + :noerror t >> + (write-region nil nil readme))))))) >> + >> >> ;;;###autoload >> (defun package-installed-p (package &optional min-version) >> >> As we store the README file inside the package directory, it should also >> be deleted when we delete the package -- unless I am missing something? > > I like that approach, it should fix this issue, and it nicely > complements what elpa-admin.el already does for some readmes on server > side. Some notes: > > 1. You probably should not write README-elpa when it would be empty > (which can happen, see > https://elpa.gnu.org/packages/bicep-ts-mode-readme.txt), as that > would block the search of `package--get-description' for more > readmes. > > 2. Alternatively or in addition, one could extend > `package--get-description' to not consider empty files in its > search for a readme. I think the former is preferable. My suggestion would be as follows:
[Message part 2 (text/x-patch, inline)]
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index ba9999c20e6..0885f1a5a35 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -2162,7 +2162,18 @@ package-install-from-archive
;; Update the new (activated) pkg-desc as well.
(when-let* ((pkg-descs (cdr (assq (package-desc-name pkg-desc)
package-alist))))
- (setf (package-desc-signed (car pkg-descs)) t))))))))))
+ (setf (package-desc-signed (car pkg-descs)) t)))))))
+ ;; fetch a backup of the readme file from the server
+ (let ((readme (expand-file-name "README-elpa" (package-desc-dir pkg-desc))))
+ (unless (file-readable-p readme)
+ (package--with-response-buffer (package-archive-base pkg-desc)
+ :file (format "%s-readme.txt" (package-desc-name pkg-desc))
+ :noerror t
+ (unless (save-excursion
+ (goto-char (point-min))
+ (looking-at-p "\\`[[:space:]]*\\'"))
+ (write-region nil nil readme))))))))
+
;;;###autoload
(defun package-installed-p (package &optional min-version)
[Message part 3 (text/plain, inline)]
> 3. I think a paragraph in "(elisp) Packaging Basics" and some tests in > package-tests.el would still be required. Do you want me to supply > these? That would be great! > Thanks!
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Tue, 30 Sep 2025 21:29:01 GMT) Full text and rfc822 format available.Message #38 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> To: Philip Kaludercic <philipk <at> posteo.net> Cc: 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Tue, 30 Sep 2025 23:27:51 +0200
[Message part 1 (text/plain, inline)]
Here comes a first implementation. I do not consider it final yet, but I'd like to clarify a couple of questions before continuing. Means: Please do not go into "full and detailed review mode" yet. 1. I'm not quite confident about the documentation I added to package.texi, it feels a bit out of place there. The rest of that section is rather terse and does not go into that level of detail as the new paragraph goes. OTOH I haven't found any other place where to document these details. I'm also fine with NOT documenting anything w.r.t this change in the Elisp manual. 2. It turned out that the central test macro, `with-package-test' could be simplified a lot. Mostly to replace the hand-made temporary directory handling by macro `ert-with-temp-directory'. For the time being I kept that in a separate commit 0002-Simplify-macro-with-package-test.patch. Should I include that change? If yes, I'd merge both commits and brush them up where still needed. WDYT?
[0002-Simplify-macro-with-package-test.patch (text/x-patch, attachment)]
[0001-Use-a-consistent-package-description.patch (text/x-patch, attachment)]
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Sun, 12 Oct 2025 13:46:02 GMT) Full text and rfc822 format available.Message #41 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> To: Philip Kaludercic <philipk <at> posteo.net> Cc: 79411 <at> debbugs.gnu.org Subject: Bump on bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Sun, 12 Oct 2025 15:44:38 +0200
Hi Philip, any chance to have a look at this? Thanks! On 2025-09-30 23:27, Jens Schmidt wrote: > Here comes a first implementation. I do not consider it final > yet, but I'd like to clarify a couple of questions before > continuing. Means: Please do not go into "full and detailed > review mode" yet. > > 1. I'm not quite confident about the documentation I added to > package.texi, it feels a bit out of place there. The rest of > that section is rather terse and does not go into that level > of detail as the new paragraph goes. OTOH I haven't found any > other place where to document these details. > > I'm also fine with NOT documenting anything w.r.t this change > in the Elisp manual. > > 2. It turned out that the central test macro, `with-package-test' > could be simplified a lot. Mostly to replace the hand-made > temporary directory handling by macro > `ert-with-temp-directory'. For the time being I kept that in > a separate commit 0002-Simplify-macro-with-package-test.patch. > Should I include that change? > > If yes, I'd merge both commits and brush them up where still > needed. > > WDYT?
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Sun, 19 Oct 2025 18:33:02 GMT) Full text and rfc822 format available.Message #44 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Philip Kaludercic <philipk <at> posteo.net> To: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> Cc: 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Sun, 19 Oct 2025 18:32:08 +0000
Sorry for the delay, I am not that familiar with package-tests.el so I
had to plan in more time to take a proper look at the patches.
Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> writes:
> Here comes a first implementation. I do not consider it final
> yet, but I'd like to clarify a couple of questions before
> continuing. Means: Please do not go into "full and detailed
> review mode" yet.
>
> 1. I'm not quite confident about the documentation I added to
> package.texi, it feels a bit out of place there. The rest of
> that section is rather terse and does not go into that level
> of detail as the new paragraph goes. OTOH I haven't found any
> other place where to document these details.
>
> I'm also fine with NOT documenting anything w.r.t this change
> in the Elisp manual.
>
> 2. It turned out that the central test macro, `with-package-test'
> could be simplified a lot. Mostly to replace the hand-made
> temporary directory handling by macro
> `ert-with-temp-directory'. For the time being I kept that in
> a separate commit 0002-Simplify-macro-with-package-test.patch.
> Should I include that change?
>
> If yes, I'd merge both commits and brush them up where still
> needed.
>
> WDYT?
>
> From 764be4cc063cc0d5af788986922249f0b36fe599 Mon Sep 17 00:00:00 2001
> From: Jens Schmidt <farblos <at> vodafonemail.de>
> Date: Tue, 30 Sep 2025 22:46:07 +0200
> Subject: [PATCH 2/2] Simplify macro with-package-test
>
> From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
>
> * test/lisp/emacs-lisp/package-tests.el (with-package-test): Remove
> unused keyword :update-news, its documentation, and its implementation.
> Redo implementation of keyworf :upload-base to use equivalent macro
> `ert-with-temp-directory' macro.
> ---
> test/lisp/emacs-lisp/package-tests.el | 53 ++++++++-------------------
> 1 file changed, 16 insertions(+), 37 deletions(-)
>
> diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el
> index 95fde634f70..27aa0eb438e 100644
> --- a/test/lisp/emacs-lisp/package-tests.el
> +++ b/test/lisp/emacs-lisp/package-tests.el
> @@ -110,7 +110,6 @@ with-package-test
> basedir
> install
> location
> - update-news
> upload-base)
> &rest body)
> "Set up temporary locations and variables for testing.
> @@ -132,9 +131,6 @@ with-package-test
> :location ARCHIVE-DIR - Use directory ARCHIVE-DIR as package archive
> directory instead of `package-test-user-dir'.
>
> -:update-news UPDATE-NEWS - If UPDATE-NEWS is non-nil, bind
> - `package-update-news-on-upload' to t while executing BODY.
> -
> :upload-base UPDATE-BASE - If UPDATE-BASE is non-nil, create a temporary
> directory, bind `package-archive-upload-base' to the location of that
> while executing BODY, and clean it up after that."
> @@ -149,42 +145,25 @@ with-package-test
> abbreviated-home-dir
> package--initialized
> package-alist
> - package-selected-packages
> - ,@(if update-news
> - '(package-update-news-on-upload t)
> - (list (gensym)))
> - ,@(if upload-base
> - '((package-test-archive-upload-base (make-temp-file "pkg-archive-base-" t))
> - (package-archive-upload-base package-test-archive-upload-base))
> - (list (gensym)))) ;; Dummy value so `let' doesn't try to bind nil
> + package-selected-packages)
> (let ((buf (get-buffer "*Packages*")))
> (when (buffer-live-p buf)
> (kill-buffer buf)))
> - (unwind-protect
> - (progn
> - (unless (file-directory-p package-user-dir)
> - (mkdir package-user-dir))
> - (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest _) t))
> - ((symbol-function 'y-or-n-p) (lambda (&rest _) t)))
> - ,@(when install
> - `((package-initialize)
> - (package-refresh-contents)
> - (mapc 'package-install ,install)))
> - (with-temp-buffer
> - ,(if basedir `(cd ,basedir))
> - ,(if file
> - `(insert-file-contents ,file))
> - ,@body)))
> -
> - (when ,upload-base
> - (dolist (f '("archive-contents"
> - "simple-single-1.3.el"
> - "simple-single-1.4.el"
> - "simple-single-readme.txt"))
> - (ignore-errors
> - (delete-file
> - (expand-file-name f package-test-archive-upload-base))))
> - (delete-directory package-test-archive-upload-base))))))
I see, so the code here was just not using the RECURCIVE flag.
> + (unless (file-directory-p package-user-dir)
> + (mkdir package-user-dir))
> + (cl-letf (((symbol-function 'y-or-n-p) (lambda (&rest _) t)))
> + ,@(when install
> + `((package-initialize)
> + (package-refresh-contents)
> + (mapc 'package-install ,install)))
> + (with-temp-buffer
> + ,(if basedir `(cd ,basedir))
> + ,(if file
> + `(insert-file-contents ,file))
> + ,(if upload-base
> + `(ert-with-temp-directory package-archive-upload-base
> + ,@body)
> + `(progn ,@body)))))))
>
> (defmacro with-fake-help-buffer (&rest body)
> "Execute BODY in a temp buffer which is treated as the \"*Help*\" buffer."
> --
> 2.39.5
LGTM
>
> From 800686d052f2933fe43b0b09f22916f5a698d910 Mon Sep 17 00:00:00 2001
> From: Jens Schmidt <farblos <at> vodafonemail.de>
> Date: Tue, 30 Sep 2025 22:05:53 +0200
> Subject: [PATCH 1/2] Use a consistent package description
>
> From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de>
>
> Ensure that the long description of a package is the same regardless of
> originating package archive and package installation state.
>
> * doc/lispref/package.texi (Packaging Basics): Describe file
> 'README-elpa' and others that might get created during package
> installation.
> * lisp/emacs-lisp/package.el (package-desc): Updated description of slot
> `kind'.
> (package-install-from-archive): Download '*-readme.txt' from the archive
> and save it as 'README-elpa'.
> * test/lisp/emacs-lisp/package-resources/multi-file-readme.txt:
> * test/lisp/emacs-lisp/package-resources/simple-single-readme.txt:
> Updated readmes to mark them as "server readmes" and distinguish them
> from what the packages themselves provide in their documentation.
> * test/lisp/emacs-lisp/package-tests.el (with-package-test): Add
> documentation. Move `cd' call to where it belongs to, since in the old
> place it affected the only semi-guaranteed temporary buffer provided by
> `ert--run-test-internal'. Remove duplicate directory cleanup code.
> (package-test-install-file, package-test-bug58367, package-test-bug65475)
> (package-test-install-file-EOLs, package-test-install-multifile): Remove
> superfluous :basedir keyword from `with-package-test' calls.
> (package-test-install-file): Fix typo.
> (package-test-describe-installed-with-ws-only-readme)
> (package-test-install-singlefile): Add test.
> (package-test-install-multifile): Test more files for presence.
> (package-test-describe-package)
> (package-test-describe-installed-multi-file-package)
> (package-test-describe-non-installed-package)
> (package-test-describe-non-installed-multi-file-package): Test for
> server readme being used as long description. (Bug#79411)
> ---
> doc/lispref/package.texi | 9 ++
> lisp/emacs-lisp/package.el | 21 ++-
> .../package-resources/multi-file-readme.txt | 2 +-
> .../simple-single-readme.txt | 1 +
> test/lisp/emacs-lisp/package-tests.el | 124 +++++++++++++++---
> 5 files changed, 137 insertions(+), 20 deletions(-)
>
> diff --git a/doc/lispref/package.texi b/doc/lispref/package.texi
> index 41fc6c77dd6..dbf15784983 100644
> --- a/doc/lispref/package.texi
> +++ b/doc/lispref/package.texi
> @@ -95,6 +95,15 @@ Packaging Basics
> package's contents (the single Lisp file for a simple package, or the
> files extracted from a multi-file package).
>
> + If Emacs installs a package from a package archive, it might create
> +some files in addition to the package's contents. If the package
> +archive provides a non-trivial long description for some package, Emacs
> +stores it in a file named @file{README-elpa} in the package's content
> +directory, unless the package itself provides such a file. If a package
> +archive provides package signatures, Emacs stores information on the
> +signatures in files named @file{@var{name}-@var{version}.signed} below
> +directory @code{package-user-dir}.
I don't think that we need to document that here, having a comment in
package.el should be sufficient.
> @cindex package autoloads
> Emacs then searches every Lisp file in the content directory for
> autoload magic comments (@pxref{Autoload}). These autoload
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index ba9999c20e6..9987673d2ae 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -516,7 +516,9 @@ package-vc-p
> required version.
>
> `kind' The distribution format of the package. Currently, it is
> - either `single' or `tar'.
> + either `single', `tar', or (temporarily only `dir'). In
The parentheses here are confusing, what are they supposed to mean?
> + addition, there is distribution format `vc', which is
> + handled by package-vc.el.
>
> `archive' The name of the archive (as a string) whence this
> package came.
> @@ -2162,7 +2164,22 @@ package-install-from-archive
> ;; Update the new (activated) pkg-desc as well.
> (when-let* ((pkg-descs (cdr (assq (package-desc-name pkg-desc)
> package-alist))))
> - (setf (package-desc-signed (car pkg-descs)) t))))))))))
> + (setf (package-desc-signed (car pkg-descs)) t))))))))
> + ;; fetch a backup of the readme file from the server. Slot `dir' is
> + ;; not yet available in PKG-DESC, so cobble that up.
> + (let* ((dirname (package-desc-full-name pkg-desc))
> + (pkg-dir (expand-file-name dirname package-user-dir))
> + (readme (expand-file-name "README-elpa" pkg-dir)))
> + (unless (file-readable-p readme)
> + (package--with-response-buffer (package-archive-base pkg-desc)
> + :file (format "%s-readme.txt" (package-desc-name pkg-desc))
> + :noerror t
> + ;; do not write empty or whitespace-only readmes to give
> + ;; `package--get-description' a chance to find another readme
> + (unless (save-excursion
> + (goto-char (point-min))
> + (looking-at-p "[[:space:]]*\\'"))
> + (write-region nil nil readme)))))))
LGTM :)
> ;;;###autoload
> (defun package-installed-p (package &optional min-version)
> diff --git a/test/lisp/emacs-lisp/package-resources/multi-file-readme.txt b/test/lisp/emacs-lisp/package-resources/multi-file-readme.txt
> index affd2e96fb0..d35471eaf97 100644
> --- a/test/lisp/emacs-lisp/package-resources/multi-file-readme.txt
> +++ b/test/lisp/emacs-lisp/package-resources/multi-file-readme.txt
> @@ -1 +1 @@
> -This is a bare-bones readme file for the multi-file package.
> +This is a bare-bones server readme file for the multi-file package.
> diff --git a/test/lisp/emacs-lisp/package-resources/simple-single-readme.txt b/test/lisp/emacs-lisp/package-resources/simple-single-readme.txt
> index 25d3034032b..fa0662937f7 100644
> --- a/test/lisp/emacs-lisp/package-resources/simple-single-readme.txt
> +++ b/test/lisp/emacs-lisp/package-resources/simple-single-readme.txt
> @@ -1,3 +1,4 @@
> This package provides a minor mode to frobnicate and/or bifurcate
> any flanges you desire. To activate it, type "C-M-r M-3 butterfly"
> and all your dreams will come true.
> +This is a server readme file.
> diff --git a/test/lisp/emacs-lisp/package-tests.el b/test/lisp/emacs-lisp/package-tests.el
> index f22051774c8..95fde634f70 100644
> --- a/test/lisp/emacs-lisp/package-tests.el
> +++ b/test/lisp/emacs-lisp/package-tests.el
> @@ -113,7 +113,31 @@ with-package-test
> update-news
> upload-base)
> &rest body)
> - "Set up temporary locations and variables for testing."
> + "Set up temporary locations and variables for testing.
> +Create a temporary buffer and execute BODY in it.
> +
> +This macro interprets the following keywords:
> +
> +:basedir BASEDIR - Change directory to BASEDIR in the temporary buffer
> + before executing BODY.
> + You should use keyword :basedir only when BODY requires it; this macro
> + itself does not require its usage.
> +
> +:file FILE - Execute `insert-file-contents' on FILE in the temporary buffer
> + before executing BODY.
> +
> +:install PACKAGES - Execute `package-install' on each package in list
> + PACKAGES before executing BODY.
> +
> +:location ARCHIVE-DIR - Use directory ARCHIVE-DIR as package archive
> + directory instead of `package-test-user-dir'.
> +
> +:update-news UPDATE-NEWS - If UPDATE-NEWS is non-nil, bind
> + `package-update-news-on-upload' to t while executing BODY.
> +
> +:upload-base UPDATE-BASE - If UPDATE-BASE is non-nil, create a temporary
> + directory, bind `package-archive-upload-base' to the location of that
> + while executing BODY, and clean it up after that."
> (declare (indent 1) (debug (([&rest form]) body)))
> `(ert-with-temp-directory package-test-user-dir
> (let* ((process-environment (cons (format "HOME=%s" package-test-user-dir)
> @@ -138,7 +162,6 @@ with-package-test
> (kill-buffer buf)))
> (unwind-protect
> (progn
> - ,(if basedir `(cd ,basedir))
> (unless (file-directory-p package-user-dir)
> (mkdir package-user-dir))
> (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest _) t))
> @@ -148,6 +171,7 @@ with-package-test
> (package-refresh-contents)
> (mapc 'package-install ,install)))
> (with-temp-buffer
> + ,(if basedir `(cd ,basedir))
Why do we do this in the first place instead of binding default-directory?
> ,(if file
> `(insert-file-contents ,file))
> ,@body)))
> @@ -160,11 +184,7 @@ with-package-test
> (ignore-errors
> (delete-file
> (expand-file-name f package-test-archive-upload-base))))
> - (delete-directory package-test-archive-upload-base))
> -
> - (when (and (boundp 'package-test-archive-upload-base)
> - (file-directory-p package-test-archive-upload-base))
> - (delete-directory package-test-archive-upload-base t))))))
> + (delete-directory package-test-archive-upload-base))))))
>
> (defmacro with-fake-help-buffer (&rest body)
> "Execute BODY in a temp buffer which is treated as the \"*Help*\" buffer."
> @@ -269,7 +289,7 @@ package-test-install-single
>
> (ert-deftest package-test-install-file ()
> "Install files with `package-install-file'."
> - (with-package-test (:basedir (ert-resource-directory))
> + (with-package-test ()
> (package-initialize)
> (let* ((pkg-el "simple-single-1.3.el")
> (source-file (expand-file-name pkg-el (ert-resource-directory))))
> @@ -281,14 +301,14 @@ package-test-install-file
>
> (let* ((pkg-el "multi-file-0.2.3.tar")
> (source-file (expand-file-name pkg-el (ert-resource-directory))))
> - (should-not (package-installed-p 'multie-file))
> + (should-not (package-installed-p 'multi-file))
I would refrain from these kinds of little changes, as they make
git-blame(1) less informative.
> (package-install-file source-file)
> (should (package-installed-p 'multi-file))
> (package-delete (cadr (assq 'multi-file package-alist))))))
>
> (ert-deftest package-test-bug58367 ()
> "Check variations in tarball formats."
> - (with-package-test (:basedir (ert-resource-directory))
> + (with-package-test ()
> (package-initialize)
>
> ;; A package whose first entry is the main dir but without trailing /.
> @@ -310,7 +330,7 @@ package-test-bug58367
>
> (ert-deftest package-test-bug65475 ()
> "Deleting the last package clears `package-selected-packages'."
> - (with-package-test (:basedir (ert-resource-directory))
> + (with-package-test ()
> (package-initialize)
> (let* ((pkg-el "simple-single-1.3.el")
> (source-file (expand-file-name pkg-el (ert-resource-directory))))
> @@ -326,7 +346,7 @@ package-test-bug65475
> (ert-deftest package-test-install-file-EOLs ()
> "Install same file multiple time with `package-install-file'
> but with a different end of line convention (bug#48137)."
> - (with-package-test (:basedir (ert-resource-directory))
> + (with-package-test ()
> (package-initialize)
> (let* ((pkg-el "simple-single-1.3.el")
> (source-file (expand-file-name pkg-el (ert-resource-directory))))
> @@ -466,16 +486,48 @@ package-test-install-prioritized
> (should (version-list-= '(1 3)
> (package-desc-version installed)))))))
>
> +(ert-deftest package-test-install-singlefile ()
> + "Check properties of the installed single-file package."
> + (with-package-test (:install '(simple-single))
> + (let ((autoload-file
> + (expand-file-name "simple-single-autoloads.el"
> + (expand-file-name
> + "simple-single-1.3"
> + package-test-user-dir)))
> + (installed-files '("README-elpa"
> + "simple-single-autoloads.el"
> + "simple-single-pkg.el"
> + "simple-single.elc"))
> + (autoload-forms '("^(autoload 'simple-single-mode"))
> + (pkg-dir (file-name-as-directory
> + (expand-file-name
> + "simple-single-1.3"
> + package-test-user-dir))))
> + (package-refresh-contents)
> + (should (package-installed-p 'simple-single))
> + (with-temp-buffer
> + (dolist (fn installed-files)
> + (should (file-exists-p (expand-file-name fn pkg-dir))))
Shouldn't you move this out of the with-temp-buffer?
> + (insert-file-contents-literally autoload-file)
> + (dolist (re autoload-forms)
> + (goto-char (point-min))
> + (should (re-search-forward re nil t)))))))
> +
> (ert-deftest package-test-install-multifile ()
> "Check properties of the installed multi-file package."
> - (with-package-test (:basedir (ert-resource-directory) :install '(multi-file))
> + (with-package-test (:install '(multi-file))
> (let ((autoload-file
> (expand-file-name "multi-file-autoloads.el"
> (expand-file-name
> "multi-file-0.2.3"
> package-test-user-dir)))
> - (installed-files '("dir" "multi-file.info" "multi-file-sub.elc"
> - "multi-file-autoloads.el" "multi-file.elc"))
> + (installed-files '(;; already present in tar
> + "README" "dir" "multi-file.info"
> + ;; generated during installation
> + "README-elpa"
> + "multi-file-autoloads.el"
> + "multi-file-sub.elc"
> + "multi-file.elc"))
> (autoload-forms '("^(defvar multi-file-custom-var"
> "^(custom-autoload 'multi-file-custom-var"
> "^(autoload 'multi-file-mode"))
> @@ -695,6 +747,17 @@ package-test-package-installed-p
> (should (package-installed-p 'project nil))
> (should (not (package-installed-p 'imaginary-package nil)))))
>
> +;; The long description of installed packages should primarily come from
> +;; the package archive through file *-readme.txt stored in README-elpa,
> +;; and not from any README (or commentary) of the package itself. So
> +;; below we intentionally test for the contents of files *-readme.txt
> +;; ("*server* readme"), which differs from what the simple-single-1.3.el
> +;; or multi-file-0.2.3.tar/README contain.
> +;;
> +;; If the package archive provides a whitespace-only file *-readme.txt,
> +;; then that should *not* be used as README-elpa, so that
> +;; `describe-package' tries to come up with something reasonable itself.
> +
> (ert-deftest package-test-describe-package ()
> "Test displaying help for a package."
>
> @@ -725,8 +788,33 @@ package-test-describe-package
> (save-excursion (should (re-search-forward "Keywords: \\[?frobnicate\\]?" nil t)))
> (save-excursion (should (search-forward "This package provides a minor mode to frobnicate"
> nil t)))
> + (save-excursion (should (search-forward "This is a server readme file."
> + nil t)))
> )))
>
> +(ert-deftest package-test-describe-installed-with-ws-only-readme ()
> + "Test displaying of the readme for installed package with ws-only readme."
> +
> + (ert-with-temp-directory temp-archive
> + (copy-file (ert-resource-file "archive-contents") temp-archive)
> + (copy-file (ert-resource-file "simple-single-1.3.el") temp-archive)
> + (with-temp-buffer
> + (insert " \t\n\t \n")
> + (write-region nil nil (expand-file-name "simple-single-readme.txt"
> + temp-archive)))
> + (with-package-test (:location temp-archive)
> + (package-initialize)
> + (package-refresh-contents)
> + (package-install 'simple-single)
> + (with-fake-help-buffer
> + (describe-package 'simple-single)
> + (goto-char (point-min))
> + (should (search-forward "Package simple-single is installed." nil t))
> + (save-excursion (should (search-forward "This package provides a minor mode to frobnicate"
> + nil t)))
I'd break these lines, they appear to be too long. You don't have to do
that in other places, we can make those changes gradually over time.
> + (save-excursion (should-not (search-forward "This is a server readme file."
> + nil t)))))))
> +
> (ert-deftest package-test-describe-installed-multi-file-package ()
> "Test displaying of the readme for installed multi-file package."
>
> @@ -738,7 +826,7 @@ package-test-describe-installed-multi-file-package
> (describe-package 'multi-file)
> (goto-char (point-min))
> (should (search-forward "Website: http://puddles.li" nil t))
> - (should (search-forward "This is a bare-bones readme file for the multi-file"
> + (should (search-forward "This is a bare-bones server readme file for the multi-file"
> nil t)))))
>
> (ert-deftest package-test-describe-non-installed-package ()
> @@ -752,6 +840,8 @@ package-test-describe-non-installed-package
> (goto-char (point-min))
> (should (search-forward "Website: http://doodles.au" nil t))
> (should (search-forward "This package provides a minor mode to frobnicate"
> + nil t))
> + (should (search-forward "This is a server readme file."
> nil t)))))
>
> (ert-deftest package-test-describe-non-installed-multi-file-package ()
> @@ -764,7 +854,7 @@ package-test-describe-non-installed-multi-file-package
> (describe-package 'multi-file)
> (goto-char (point-min))
> (should (search-forward "Website: http://puddles.li" nil t))
> - (should (search-forward "This is a bare-bones readme file for the multi-file"
> + (should (search-forward "This is a bare-bones server readme file for the multi-file"
> nil t)))))
>
> (defvar epg-config--program-alist) ; Silence byte-compiler.
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Sun, 19 Oct 2025 19:56:02 GMT) Full text and rfc822 format available.Message #47 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> To: Philip Kaludercic <philipk <at> posteo.net> Cc: 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Sun, 19 Oct 2025 21:55:02 +0200
On 2025-10-19 20:32, Philip Kaludercic wrote:
> Sorry for the delay, I am not that familiar with package-tests.el so I
> had to plan in more time to take a proper look at the patches.
No problem, thanks for your review. I have been closely following
the `cond-let*' debate, which has helped shortening the waiting
time :-).
From your replies I get the impression that you'd rather have more
than one commit than all the changes in one. Is that so?
Here is what I would do, one commit per list item, with references
to my replies below.
1. The changes related to my bug [1].
2. My changes to function `with-package-test' plus your comment
on `(cd ,basedir)' [2].
3. The typo I spotted and other minor unrelated changes [3].
4. (Optionally) breaking up long lines not originating from my
code.
WDYT?
>> `kind' The distribution format of the package. Currently, it is
>> - either `single' or `tar'.
>> + either `single', `tar', or (temporarily only `dir'). In
>
> The parentheses here are confusing, what are they supposed to mean?
>
>> + addition, there is distribution format `vc', which is
>> + handled by package-vc.el.
[1] Would
> - either `single' or `tar'.
> + either `single', `tar', or (temporarily only) `dir'. In
be clearer? That's what I intended.
>> (with-temp-buffer
>> + ,(if basedir `(cd ,basedir))
>
> Why do we do this in the first place instead of binding default-directory?
I can change that as well, but that would be more changes that are
not related to the original bug. Should I, in commit [2]?
>> @@ -281,14 +301,14 @@ package-test-install-file
>>
>> (let* ((pkg-el "multi-file-0.2.3.tar")
>> (source-file (expand-file-name pkg-el (ert-resource-directory))))
>> - (should-not (package-installed-p 'multie-file))
>> + (should-not (package-installed-p 'multi-file))
>
> I would refrain from these kinds of little changes, as they make
> git-blame(1) less informative.
Right, but that's a typo, anyway, and one that renders the
test useless. So stuff it into [3]?
>> +(ert-deftest package-test-install-singlefile ()
>> + "Check properties of the installed single-file package."
>> + (with-package-test (:install '(simple-single))
>> + (let ((autoload-file
>> + (expand-file-name "simple-single-autoloads.el"
>> + (expand-file-name
>> + "simple-single-1.3"
>> + package-test-user-dir)))
>> + (installed-files '("README-elpa"
>> + "simple-single-autoloads.el"
>> + "simple-single-pkg.el"
>> + "simple-single.elc"))
>> + (autoload-forms '("^(autoload 'simple-single-mode"))
>> + (pkg-dir (file-name-as-directory
>> + (expand-file-name
>> + "simple-single-1.3"
>> + package-test-user-dir))))
>> + (package-refresh-contents)
>> + (should (package-installed-p 'simple-single))
>> + (with-temp-buffer
>> + (dolist (fn installed-files)
>> + (should (file-exists-p (expand-file-name fn pkg-dir))))
>
> Shouldn't you move this out of the with-temp-buffer?
Right. I kept it in the `with-temp-buffer' to be consistently
ugly with the test I copied from, `package-test-install-multifile'.
Should I fix it here as part of commit [1]?
And in `package-test-install-multifile' in commit [3]?
bug-gnu-emacs <at> gnu.org:bug#79411; Package emacs.
(Sun, 26 Oct 2025 13:03:02 GMT) Full text and rfc822 format available.Message #50 received at 79411 <at> debbugs.gnu.org (full text, mbox):
From: Philip Kaludercic <philipk <at> posteo.net> To: Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> Cc: 79411 <at> debbugs.gnu.org Subject: Re: bug#79411: 31.0.50; describe-package does not show :readme after package installation, but sth else Date: Sun, 26 Oct 2025 13:02:16 +0000
Jens Schmidt <jschmidt4gnu <at> vodafonemail.de> writes:
> On 2025-10-19 20:32, Philip Kaludercic wrote:
>
>> Sorry for the delay, I am not that familiar with package-tests.el so I
>> had to plan in more time to take a proper look at the patches.
>
> No problem, thanks for your review. I have been closely following
> the `cond-let*' debate, which has helped shortening the waiting
> time :-).
Oh, don't remind me that other people are reading along ^^
>>From your replies I get the impression that you'd rather have more
>> than one commit than all the changes in one. Is that so?
>
> Here is what I would do, one commit per list item, with references
> to my replies below.
>
> 1. The changes related to my bug [1].
>
> 2. My changes to function `with-package-test' plus your comment
> on `(cd ,basedir)' [2].
>
> 3. The typo I spotted and other minor unrelated changes [3].
>
> 4. (Optionally) breaking up long lines not originating from my
> code.
Having this is a separate commit is probably not necessary, but it
really depends on how much you end up re-structuring the code. There is
a point at which Git's line-oriented version history becomes inadequate
and we have to accept that fact.
> WDYT?
Sounds good.
>>> `kind' The distribution format of the package. Currently, it is
>>> - either `single' or `tar'.
>>> + either `single', `tar', or (temporarily only `dir'). In
>>
>> The parentheses here are confusing, what are they supposed to mean?
>>
>>> + addition, there is distribution format `vc', which is
>>> + handled by package-vc.el.
>
> [1] Would
(took me a while to parse this)
>> - either `single' or `tar'.
>> + either `single', `tar', or (temporarily only) `dir'. In
>
> be clearer? That's what I intended.
Yes, that is much clearer!
>>> (with-temp-buffer
>>> + ,(if basedir `(cd ,basedir))
>>
>> Why do we do this in the first place instead of binding default-directory?
>
> I can change that as well, but that would be more changes that are
> not related to the original bug. Should I, in commit [2]?
If it makes sense to change it along with the commit, that is fine.
BTW, I can also make adjustment to your patches just before pushing them
as long as you are fine with them, so we don't have to perfect and
pre-discuss everything.
>>> @@ -281,14 +301,14 @@ package-test-install-file
>>>
>>> (let* ((pkg-el "multi-file-0.2.3.tar")
>>> (source-file (expand-file-name pkg-el (ert-resource-directory))))
>>> - (should-not (package-installed-p 'multie-file))
>>> + (should-not (package-installed-p 'multi-file))
>>
>> I would refrain from these kinds of little changes, as they make
>> git-blame(1) less informative.
>
> Right, but that's a typo, anyway, and one that renders the
> test useless. So stuff it into [3]?
Oh, my bad, I misunderstood that this affects the test. Then you should
certainly fix it. Depending on what the other changes are in [3], it
might also be "critical" enough to have in a separate commit.
>>> +(ert-deftest package-test-install-singlefile ()
>>> + "Check properties of the installed single-file package."
>>> + (with-package-test (:install '(simple-single))
>>> + (let ((autoload-file
>>> + (expand-file-name "simple-single-autoloads.el"
>>> + (expand-file-name
>>> + "simple-single-1.3"
>>> + package-test-user-dir)))
>>> + (installed-files '("README-elpa"
>>> + "simple-single-autoloads.el"
>>> + "simple-single-pkg.el"
>>> + "simple-single.elc"))
>>> + (autoload-forms '("^(autoload 'simple-single-mode"))
>>> + (pkg-dir (file-name-as-directory
>>> + (expand-file-name
>>> + "simple-single-1.3"
>>> + package-test-user-dir))))
>>> + (package-refresh-contents)
>>> + (should (package-installed-p 'simple-single))
>>> + (with-temp-buffer
>>> + (dolist (fn installed-files)
>>> + (should (file-exists-p (expand-file-name fn pkg-dir))))
>>
>> Shouldn't you move this out of the with-temp-buffer?
>
> Right. I kept it in the `with-temp-buffer' to be consistently
> ugly with the test I copied from, `package-test-install-multifile'.
> Should I fix it here as part of commit [1]?
>
> And in `package-test-install-multifile' in commit [3]?
I leave that up to you.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.