GNU bug report logs -
#49924
28.0.50; `package-quickstart-refresh' fails for "long" (according to `print-length') `package-alist'
Previous Next
Reported by: Pal Gloss <pcfeb0009 <at> gmx.com>
Date: Sat, 7 Aug 2021 08:46:02 UTC
Severity: normal
Found in version 28.0.50
Fixed in version 28.1
Done: Lars Ingebrigtsen <larsi <at> gnus.org>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 49924 in the body.
You can then email your comments to 49924 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#49924
; Package
emacs
.
(Sat, 07 Aug 2021 08:46:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Pal Gloss <pcfeb0009 <at> gmx.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Sat, 07 Aug 2021 08:46:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Following #49922, I was able to diagnose & fix an issue with
`package-quickstart-refresh' when `print-length' is lower than
`(length package-activated-list)'. There are two possible
user-visible symptoms, caused by the presence of the "..." ellipsis
in the `package-quickstart-file':
1. A warning in *Compile-Log* about a free variable ‘\.\.\.’
2. When restarting emacs, an error message about a missing package
named "..."
I did not make any experiments, but I am pretty sure that it also would
be possible to produce a broken `package-quickstart-file' with
`print-level' suitably low (1 or 2, maybe even 3?).
;; !!! This reproduction scenario ruins your !!!
;; !!! $HOME/.emacs.d/package-quickstart.el unless you are careful !!!
;; !!! Run it with: !!!
;; env HOME=/tmp emacs -Q
(let ((print-length 2))
(require 'package)
(package-quickstart-refresh))
;; There is a warning in *Compile-Log*
;;
;; Compiling file c:/msys64/tmp/.emacs.d/package-quickstart.el at Sat Aug 7 10:09:10 2021
;; Entering directory ‘c:/msys64/tmp/.emacs.d/’
;; package-quickstart.el:4:30: Warning: reference to free variable ‘\.\.\.’
Now look inside the generated "package-quickstart.el" with
(find-file package-quickstart-file)
And you will see "(setq package-activated-list ...)" (literally with 3
dots) instead of "(setq package-activated-list (append <text elided for brevity>))".
There is another way to reproduce it that can work with a more "likely"
(or reasonable) value of `print-length', but this is not with `emacs -Q'
because it requires a non-NIL `package-alist', i.e. an existing emacs
configuration with some outside packages:
;; !!! This reproduction scenario ruins your !!!
;; !!! `package-quickstart-file'. Regenerate it afterwards. !!!
;; Assuming you have at least 4 external packages activated in
;; your configuration
(progn
(package-initialize)
(let ((print-length (- (length package-alist) 1)))
(package-quickstart-refresh)))
Now look inside the generated "package-quickstart.el" with
(find-file package-quickstart-file)
And you will see that a package named "..." is added to the
`package-activated-list'. Next time you start emacs, the package
initialization will fail because there is no such package.
My work-around is to rebind `print-level' and `print-length' before
calling `package-quickstart-refresh' (I do so periodically in the
background):
;; -------- From my early-init.el file --------
;; Enable package quickstart ...
(funcall (or (get 'package-quickstart 'custom-set)
'set-default)
'package-quickstart t)
;; ... and make sure it stays up to date
(run-with-idle-timer
120 ; seconds
'repeat
(lambda ()
(let (;; don't abbreviate lists: the `package-activated-list' is long and
;; needs to be complete, otherwise Emacs will search for a package
;; called "...".
(print-length nil)
;; I haven't had a problem with it yet, but better safe than sorry.
(print-level nil))
(package-quickstart-refresh))))
;; -------- End of my early-init.el file --------
In GNU Emacs 28.0.50 (build 1, x86_64-w64-mingw32)
of 2021-08-06 built on <hostname>
Repository revision: 0afab352e02d7070a8ced2af53c1d01217400cdf
Repository branch: master
Windowing system distributor 'Microsoft Corp.', version 6.3.9600
System Description: Microsoft Windows 8.1 (v6.3.0.9600.20069)
Configured using:
'configure --with-xml2 --with-zlib --without-pop
--prefix=/home/username/emacs-native-comp/dest
--without-compress-install --without-dbus --with-native-compilation
--with-modules 'CFLAGS=-O2 -g3'
PKG_CONFIG_PATH=/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig'
Configured features:
ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP
NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS
XPM ZLIB
Important settings:
value of $LC_CTYPE: fr_FR.UTF-8
value of $LANG: en_US.UTF-8
locale-coding-system: cp1252
Major mode: ELisp/l
Minor modes in effect:
tooltip-mode: t
global-eldoc-mode: t
eldoc-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
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
line-number-mode: t
transient-mark-mode: t
Load-path shadows:
None found.
Features:
(shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs
rfc822 mml mml-sec epa derived epg epg-config gnus-util rmail
rmail-loaddefs time-date mm-decode mm-bodies mm-encode mail-parse
rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mail-utils modus-vivendi-theme
modus-themes pcase compile text-property-search comint ansi-color ring
pp info finder-inf package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie url-domsuf url-util
mailcap url-handlers url-parse auth-source eieio eieio-core
eieio-loaddefs password-cache json map url-vars comp comp-cstr warnings
subr-x rx cl-seq cl-macs cl-extra help-mode seq byte-opt gv cl-loaddefs
cl-lib bytecomp byte-compile cconv iso-transl tooltip eldoc electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32 ls-lisp
disp-table term/w32-win w32-win w32-vars term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode elisp-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 cl-generic
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 charscript charprop
case-table epa-hook jka-cmpr-hook help simple abbrev obarray
cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages
mule custom widget hashtable-print-readable backquote threads w32notify
w32 lcms2 multi-tty make-network-process native-compile emacs)
Memory information:
((conses 16 174962 29708)
(symbols 48 12845 1)
(strings 32 34208 2217)
(string-bytes 1 1074693)
(vectors 16 20567)
(vector-slots 8 314808 27474)
(floats 8 82 46)
(intervals 56 304 0)
(buffers 992 15))
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#49924
; Package
emacs
.
(Sat, 07 Aug 2021 11:05:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 49924 <at> debbugs.gnu.org (full text, mbox):
Pal Gloss <pcfeb0009 <at> gmx.com> writes:
> Following #49922, I was able to diagnose & fix an issue with
> `package-quickstart-refresh' when `print-length' is lower than
> `(length package-activated-list)'.
Yup. I've now pushed a similar fix for this to the trunk.
Thanks for analysing and identifying these two problems. Perhaps we
should have a version of prin1-to-string that really did prin1 the
entire expression, because this problem comes up again and again...
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug marked as fixed in version 28.1, send any further explanations to
49924 <at> debbugs.gnu.org and Pal Gloss <pcfeb0009 <at> gmx.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 07 Aug 2021 11:05:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#49924
; Package
emacs
.
(Sat, 07 Aug 2021 14:03:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 49924 <at> debbugs.gnu.org (full text, mbox):
Hi,
Thank you for the quick response. Unfortunately, the proposed fix is not sufficient: the issue is not that `file' in `package-quickstart-refresh' is a long list (it's 1 string). I think that the problem is `pp' that calls `prin1' (through `pp-to-string') and `prin1' is controlled by `print-length' and `print-level', too.
> Thanks for analysing and identifying these two problems. Perhaps we
> should have a version of prin1-to-string that really did prin1 the
> entire expression, because this problem comes up again and again...
I don't know if `pp' is supposed to print "readably" (which I understand
as can be `read' again, resulting in `equalp' object). If it is, changing
`pp-to-string' to bind the `print-*' variables would at least solve #49924.
If changing `pp-to-string' (no idea who else uses it) is too risky can
`print-length' and `print-level' be rebound in the top `let' of
`package-quickstart-refresh'. Otherwise, rebind them locally around the
two calls to `pp'.
Kind regards.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#49924
; Package
emacs
.
(Mon, 09 Aug 2021 12:48:01 GMT)
Full text and
rfc822 format available.
Message #16 received at 49924 <at> debbugs.gnu.org (full text, mbox):
Pal Gloss <pcfeb0009 <at> gmx.com> writes:
> Thank you for the quick response. Unfortunately, the proposed fix is
> not sufficient: the issue is not that `file' in
> `package-quickstart-refresh' is a long list (it's 1 string). I think
> that the problem is `pp' that calls `prin1' (through `pp-to-string')
> and `prin1' is controlled by `print-length' and `print-level', too.
Oh, right, the problem is in the pp calls. I've now hoisted the print-*
bindings further up.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 07 Sep 2021 11:24:04 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 290 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.