* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
@ 2019-06-21 16:04 Michael Heerdegen
2019-06-21 16:16 ` Lars Ingebrigtsen
2019-06-21 19:22 ` Davor Rotim
0 siblings, 2 replies; 15+ messages in thread
From: Michael Heerdegen @ 2019-06-21 16:04 UTC (permalink / raw)
To: 36324
Hi,
didn't check if it's my fault since I didn't change something in my init
file. Since some days whenever savehist-save is triggered I get this
error:
Debugger entered--Lisp error: (wrong-type-argument listp t)
car(t)
(let ((elt (car --dolist-tail--))) (let ((start (point))) (insert " ") (condition-case nil (progn (prin1 elt (current-buffer)) (save-excursion (goto-char start) (read (current-buffer)))) (error (goto-char start) (insert "\n") (while (not (eobp)) (insert ";;; ") (forward-line 1)) (insert "\n"))) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--)))
(while --dolist-tail-- (let ((elt (car --dolist-tail--))) (let ((start (point))) (insert " ") (condition-case nil (progn (prin1 elt (current-buffer)) (save-excursion (goto-char start) (read (current-buffer)))) (error (goto-char start) (insert "\n") (while (not (eobp)) (insert ";;; ") (forward-line 1)) (insert "\n"))) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--))))
(let ((--dolist-tail-- value)) (while --dolist-tail-- (let ((elt (car --dolist-tail--))) (let ((start (point))) (insert " ") (condition-case nil (progn (prin1 elt (current-buffer)) (save-excursion (goto-char start) (read ...))) (error (goto-char start) (insert "\n") (while (not ...) (insert ";;; ") (forward-line 1)) (insert "\n"))) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
(progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let ((elt (car --dolist-tail--))) (let ((start (point))) (insert " ") (condition-case nil (progn (prin1 elt ...) (save-excursion ... ...)) (error (goto-char start) (insert "\n") (while ... ... ...) (insert "\n"))) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (save-excursion (goto-char excess-space) (if (eq (following-char) 32) (delete-region (point) (1+ (point))))) (insert "))\n"))
(if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let ((elt (car --dolist-tail--))) (let ((start ...)) (insert " ") (condition-case nil (progn ... ...) (error ... ... ... ...)) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (save-excursion (goto-char excess-space) (if (eq (following-char) 32) (delete-region (point) (1+ (point))))) (insert "))\n")))
(let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let ((elt ...)) (let (...) (insert " ") (condition-case nil ... ...) (goto-char ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (save-excursion (goto-char excess-space) (if (eq (following-char) 32) (delete-region (point) (1+ (point))))) (insert "))\n"))))
(progn (let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let (...) (let ... ... ... ...) (setq --dolist-tail-- ...)))) (save-excursion (goto-char excess-space) (if (eq (following-char) 32) (delete-region (point) (1+ ...)))) (insert "))\n")))))
(if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let ... ... ...))) (save-excursion (goto-char excess-space) (if (eq ... 32) (delete-region ... ...))) (insert "))\n"))))))
(let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let (...) (while --dolist-tail-- ...)) (save-excursion (goto-char excess-space) (if ... ...)) (insert "))\n")))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
(while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol ...) (insert " '(") (setq excess-space ...) (let ... ...) (save-excursion ... ...) (insert "))\n")))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
(let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let ((value ...) excess-space) (if value (progn ... ... ... ... ... ... ...))))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
(progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list 'quote savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let (... excess-space) (if value ...)))) (setq --dolist-tail-- (cdr --dolist-tail--))))))
(if savehist-save-minibuffer-history (progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list 'quote savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not ...)) (progn (let ... ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))
(let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list 'quote savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ((symbol ...)) (if (and ... ...) (progn ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (boundp symbol) (progn (let (...) (if ... ...)))) (setq --dolist-tail-- (cdr --dolist-tail--))))))
(progn (insert (format-message (concat ";; -*- mode: emacs-lisp; coding: %s -*-\n" ";; Minibuffer history file, automatically generate..." "\n") savehist-coding-system)) (run-hooks 'savehist-save-hook) (let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list 'quote savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let (...) (if ... ...) (setq --dolist-tail-- ...)))))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (boundp symbol) (progn (let ... ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (let ((checksum (md5 (current-buffer) nil nil savehist-coding-system))) (if (and auto-save (equal checksum savehist-last-checksum)) nil (let ((file-precious-flag t) (coding-system-for-write savehist-coding-system)) (write-region (point-min) (point-max) savehist-file nil (if (called-interactively-p 'interactive) nil 'quiet))) (if savehist-file-modes (progn (set-file-modes savehist-file savehist-file-modes))) (setq savehist-last-checksum checksum))))
(unwind-protect (progn (insert (format-message (concat ";; -*- mode: emacs-lisp; coding: %s -*-\n" ";; Minibuffer history file, automatically generate..." "\n") savehist-coding-system)) (run-hooks 'savehist-save-hook) (let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list ... savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ... ... ...))))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let ((symbol ...)) (if (boundp symbol) (progn ...)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (let ((checksum (md5 (current-buffer) nil nil savehist-coding-system))) (if (and auto-save (equal checksum savehist-last-checksum)) nil (let ((file-precious-flag t) (coding-system-for-write savehist-coding-system)) (write-region (point-min) (point-max) savehist-file nil (if (called-interactively-p ...) nil 'quiet))) (if savehist-file-modes (progn (set-file-modes savehist-file savehist-file-modes))) (setq savehist-last-checksum checksum)))) (and (buffer-name #:temp-buffer) (kill-buffer #:temp-buffer)))
(save-current-buffer (set-buffer #:temp-buffer) (unwind-protect (progn (insert (format-message (concat ";; -*- mode: emacs-lisp; coding: %s -*-\n" ";; Minibuffer history file, automatically generate..." "\n") savehist-coding-system)) (run-hooks 'savehist-save-hook) (let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 (list ... ... ...) (current-buffer)) (insert 10) (let (...) (while --dolist-tail-- ...)))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let (...) (if ... ...) (setq --dolist-tail-- ...))))) (let ((checksum (md5 (current-buffer) nil nil savehist-coding-system))) (if (and auto-save (equal checksum savehist-last-checksum)) nil (let ((file-precious-flag t) (coding-system-for-write savehist-coding-system)) (write-region (point-min) (point-max) savehist-file nil (if ... nil ...))) (if savehist-file-modes (progn (set-file-modes savehist-file savehist-file-modes))) (setq savehist-last-checksum checksum)))) (and (buffer-name #:temp-buffer) (kill-buffer #:temp-buffer))))
(let ((#:temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer #:temp-buffer) (unwind-protect (progn (insert (format-message (concat ";; -*- mode: emacs-lisp; coding: %s -*-\n" ";; Minibuffer history file, automatically generate..." "\n") savehist-coding-system)) (run-hooks 'savehist-save-hook) (let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 ... ...) (insert 10) (let ... ...))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let ... ... ...)))) (let ((checksum (md5 ... nil nil savehist-coding-system))) (if (and auto-save (equal checksum savehist-last-checksum)) nil (let (... ...) (write-region ... ... savehist-file nil ...)) (if savehist-file-modes (progn ...)) (setq savehist-last-checksum checksum)))) (and (buffer-name #:temp-buffer) (kill-buffer #:temp-buffer)))))
savehist-save(t)
(progn (savehist-save t))
(if savehist-mode (progn (savehist-save t)))
savehist-autosave()
apply(savehist-autosave nil)
timer-event-handler([t 23820 65317 431948 300 savehist-autosave nil nil 856000])
I couldn't find an obvious related change in savehist.el. When I load,
say, the version of the file from one month ago, the issue is still
there. I thought it would have been one of Lars' changes causing this,
but I didn't find something obvious quickly.
TIA,
Michael.
In GNU Emacs 27.0.50 (build 52, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
of 2019-06-21 built on drachen
Repository revision: da9ecd9c0b28a6f0139a8227c9d5e2ed944f53f7
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-21 16:04 bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t) Michael Heerdegen
@ 2019-06-21 16:16 ` Lars Ingebrigtsen
2019-06-21 16:40 ` Michael Heerdegen
2019-06-21 19:22 ` Davor Rotim
1 sibling, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-21 16:16 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: 36324
Michael Heerdegen <michael_heerdegen@web.de> writes:
> didn't check if it's my fault since I didn't change something in my init
> file. Since some days whenever savehist-save is triggered I get this
> error:
>
> Debugger entered--Lisp error: (wrong-type-argument listp t)
Does reverting a97ba6eb305c9db8641c0e65748907cd53dbfa5e fix the problem?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-21 16:16 ` Lars Ingebrigtsen
@ 2019-06-21 16:40 ` Michael Heerdegen
2019-06-21 16:50 ` Lars Ingebrigtsen
0 siblings, 1 reply; 15+ messages in thread
From: Michael Heerdegen @ 2019-06-21 16:40 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 36324
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Does reverting a97ba6eb305c9db8641c0e65748907cd53dbfa5e fix the
> problem?
I'm a bit short on time (going on a bike tour) so I just reverted
autosave.el to that commits parent. The issue seems then to be gone
indeed. Though, what the commit does didn't seem suspicious to me.
Anyway - bike tour!
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-21 16:40 ` Michael Heerdegen
@ 2019-06-21 16:50 ` Lars Ingebrigtsen
2019-06-21 17:05 ` Michael Heerdegen
0 siblings, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-21 16:50 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: 36324
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Lars Ingebrigtsen <larsi@gnus.org> writes:
>
>> Does reverting a97ba6eb305c9db8641c0e65748907cd53dbfa5e fix the
>> problem?
>
> I'm a bit short on time (going on a bike tour) so I just reverted
> autosave.el to that commits parent. The issue seems then to be gone
> indeed. Though, what the commit does didn't seem suspicious to me.
You mean savehist.el?
I don't see the problem either, but I'm reverting the change and will
examine later.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-21 16:50 ` Lars Ingebrigtsen
@ 2019-06-21 17:05 ` Michael Heerdegen
0 siblings, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2019-06-21 17:05 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 36324
Lars Ingebrigtsen <larsi@gnus.org> writes:
> You mean savehist.el?
Yes, of course.
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-21 16:04 bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t) Michael Heerdegen
2019-06-21 16:16 ` Lars Ingebrigtsen
@ 2019-06-21 19:22 ` Davor Rotim
2019-06-21 23:23 ` Michael Heerdegen
1 sibling, 1 reply; 15+ messages in thread
From: Davor Rotim @ 2019-06-21 19:22 UTC (permalink / raw)
To: larsi; +Cc: 36324
[-- Attachment #1: Type: text/plain, Size: 5939 bytes --]
I can trigger it reliably using the following skeleton init.el:
(setq savehist-autosave-interval 10)
(savehist-mode)
(setq epg-pinentry-mode 'loopback)
Visiting a test.gpg file and afterwards encrypting it symmetrically
gives the following error:
Debugger entered--Lisp error: (wrong-type-argument listp t)
savehist-save(t)
savehist-autosave()
apply(savehist-autosave nil)
timer-event-handler([t 23821 9812 623801 10 savehist-autosave nil nil
712000])
read-string("Confirm password: " nil t nil)
read-passwd("Confirm password: " nil nil)
read-passwd("Passphrase for symmetric encryption for /home/drot..." t)
epa-passphrase-callback-function(#s(epg-context :protocol OpenPGP
:program "/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil
:include-certs nil :cipher-algorithm nil :digest-algorithm nil
:compress-algorithm nil :passphrase-callback
(epa-file-passphrase-callback-function . "/home/drot/test.gpg")
:progress-callback (epa-progress-callback-function . "Encrypting
/home/drot/test.gpg") :edit-callback nil :signers nil :sig-notations nil
:process #<process epg> :output-file "/tmp/epg-outputk8NwaR" :result nil
:operation encrypt :pinentry-mode loopback :error-output "" :error-buffer
#<buffer *epg-error*>) SYM "/home/drot/test.gpg")
epa-file-passphrase-callback-function(#s(epg-context :protocol OpenPGP
:program "/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil
:include-certs nil :cipher-algorithm nil :digest-algorithm nil
:compress-algorithm nil :passphrase-callback
(epa-file-passphrase-callback-function . "/home/drot/test.gpg")
:progress-callback (epa-progress-callback-function . "Encrypting
/home/drot/test.gpg") :edit-callback nil :signers nil :sig-notations nil
:process #<process epg> :output-file "/tmp/epg-outputk8NwaR" :result nil
:operation encrypt :pinentry-mode loopback :error-output "" :error-buffer
#<buffer *epg-error*>) SYM "/home/drot/test.gpg")
epg--status-GET_HIDDEN(#s(epg-context :protocol OpenPGP :program
"/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs
nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil
:passphrase-callback (epa-file-passphrase-callback-function .
"/home/drot/test.gpg") :progress-callback (epa-progress-callback-function .
"Encrypting /home/drot/test.gpg") :edit-callback nil :signers nil
:sig-notations nil :process #<process epg> :output-file
"/tmp/epg-outputk8NwaR" :result nil :operation encrypt :pinentry-mode
loopback :error-output "" :error-buffer #<buffer *epg-error*>)
"passphrase.enter")
epg--process-filter(#<process epg> "[GNUPG:] INQUIRE_MAXLEN 100\n[GNUPG:]
GET_HIDDEN pa...")
accept-process-output(#<process epg> 1)
epg-wait-for-status(#s(epg-context :protocol OpenPGP :program
"/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs
nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil
:passphrase-callback (epa-file-passphrase-callback-function .
"/home/drot/test.gpg") :progress-callback (epa-progress-callback-function .
"Encrypting /home/drot/test.gpg") :edit-callback nil :signers nil
:sig-notations nil :process #<process epg> :output-file
"/tmp/epg-outputk8NwaR" :result nil :operation encrypt :pinentry-mode
loopback :error-output "" :error-buffer #<buffer *epg-error*>)
("BEGIN_ENCRYPTION"))
epg-start-encrypt(#s(epg-context :protocol OpenPGP :program
"/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs
nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil
:passphrase-callback (epa-file-passphrase-callback-function .
"/home/drot/test.gpg") :progress-callback (epa-progress-callback-function .
"Encrypting /home/drot/test.gpg") :edit-callback nil :signers nil
:sig-notations nil :process #<process epg> :output-file
"/tmp/epg-outputk8NwaR" :result nil :operation encrypt :pinentry-mode
loopback :error-output "" :error-buffer #<buffer *epg-error*>) #s(epg-data
:file nil :string "hello") nil nil nil)
epg-encrypt-string(#s(epg-context :protocol OpenPGP :program
"/usr/bin/gpg2" :home-directory nil :armor nil :textmode nil :include-certs
nil :cipher-algorithm nil :digest-algorithm nil :compress-algorithm nil
:passphrase-callback (epa-file-passphrase-callback-function .
"/home/drot/test.gpg") :progress-callback (epa-progress-callback-function .
"Encrypting /home/drot/test.gpg") :edit-callback nil :signers nil
:sig-notations nil :process #<process epg> :output-file
"/tmp/epg-outputk8NwaR" :result nil :operation encrypt :pinentry-mode
loopback :error-output "" :error-buffer #<buffer *epg-error*>) "hello" nil)
epa-file-write-region(nil nil "/home/drot/test.gpg" nil t "~/test.gpg"
nil)
apply(epa-file-write-region (nil nil "/home/drot/test.gpg" nil t
"~/test.gpg" nil))
epa-file-handler(write-region nil nil "/home/drot/test.gpg" nil t
"~/test.gpg" nil)
write-region(nil nil "/home/drot/test.gpg" nil t "~/test.gpg")
basic-save-buffer-2()
basic-save-buffer-1()
basic-save-buffer(t)
save-buffer(1)
funcall-interactively(save-buffer 1)
call-interactively(save-buffer nil nil)
command-execute(save-buffer)
Attempting to quit Emacs after that gives the following error:
Debugger entered--Lisp error: (wrong-type-argument listp t)
savehist-save(t)
savehist-autosave()
kill-emacs()
save-buffers-kill-emacs(nil)
save-buffers-kill-terminal(nil)
funcall-interactively(save-buffers-kill-terminal nil)
call-interactively(save-buffers-kill-terminal nil nil)
command-execute(save-buffers-kill-terminal)
These errors start to happen every time there's a minibuffer prompt for GPG
decryption.
In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5,
cairo version 1.16.0)
of 2019-06-21 built on lambda
Repository revision: 869cf5cbc0721bbe9e4df557f4ed3633fb13c05f
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12004000
System Description: Debian GNU/Linux 10 (buster)
[-- Attachment #2: Type: text/html, Size: 6855 bytes --]
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-21 19:22 ` Davor Rotim
@ 2019-06-21 23:23 ` Michael Heerdegen
2019-06-22 2:35 ` Michael Heerdegen
2019-06-22 9:20 ` Lars Ingebrigtsen
0 siblings, 2 replies; 15+ messages in thread
From: Michael Heerdegen @ 2019-06-21 23:23 UTC (permalink / raw)
To: Davor Rotim; +Cc: larsi, 36324
Davor Rotim <rotim.davor@gmail.com> writes:
> read-string("Confirm password: " nil t nil)
> read-passwd("Confirm password: " nil nil)
Ah - AFAIU this binds `minibuffer-history-variable' to t in the
minibuffer.
So this part of Lars' commit:
- (unless (or (eq minibuffer-history-variable t)
- ;; XEmacs sets minibuffer-history-variable to t to mean "no
- ;; history is being recorded".
- (memq minibuffer-history-variable savehist-ignored-variables))
+ (unless (memq minibuffer-history-variable savehist-ignored-variables)
is the culprit. We should only update the comment since Gnu Emacs is
doing this as well.
Lars, if you agree, could you please do this?
Thanks,
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-21 23:23 ` Michael Heerdegen
@ 2019-06-22 2:35 ` Michael Heerdegen
2019-06-22 9:33 ` Lars Ingebrigtsen
2019-06-22 9:20 ` Lars Ingebrigtsen
1 sibling, 1 reply; 15+ messages in thread
From: Michael Heerdegen @ 2019-06-22 2:35 UTC (permalink / raw)
To: Davor Rotim; +Cc: larsi, 36324
Though ...
> > read-string("Confirm password: " nil t nil)
Is it officially allowed to use t as histvar arg? It doesn't seem to be
documented.
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-21 23:23 ` Michael Heerdegen
2019-06-22 2:35 ` Michael Heerdegen
@ 2019-06-22 9:20 ` Lars Ingebrigtsen
1 sibling, 0 replies; 15+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-22 9:20 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: 36324, Davor Rotim
Michael Heerdegen <michael_heerdegen@web.de> writes:
> So this part of Lars' commit:
>
> - (unless (or (eq minibuffer-history-variable t)
> - ;; XEmacs sets minibuffer-history-variable to t to mean "no
> - ;; history is being recorded".
> - (memq minibuffer-history-variable savehist-ignored-variables))
> + (unless (memq minibuffer-history-variable savehist-ignored-variables)
>
> is the culprit. We should only update the comment since Gnu Emacs is
> doing this as well.
Yes, that looks like a likely culprit -- but just to confirm, after
pulling master now, the bug is gone? I reverted the patch.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-22 2:35 ` Michael Heerdegen
@ 2019-06-22 9:33 ` Lars Ingebrigtsen
2019-06-22 15:29 ` Michael Heerdegen
0 siblings, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-22 9:33 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: 36324, Davor Rotim
Michael Heerdegen <michael_heerdegen@web.de> writes:
> Though ...
>
>> > read-string("Confirm password: " nil t nil)
>
> Is it officially allowed to use t as histvar arg? It doesn't seem to be
> documented.
Yup; this is the way to reproduce the bug simply (with the patch
unreverted):
(savehist-mode)
(read-string "foo" nil t)
(savehist-save t)
I've now reapplied the patch, but restored the t check in the hook and
updated the comment.
The doc string for `read-from-minibuffer' doesn't document the t value
for HISTORY at all -- perhaps that should also be fixed?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-22 9:33 ` Lars Ingebrigtsen
@ 2019-06-22 15:29 ` Michael Heerdegen
2019-06-22 17:41 ` Noam Postavsky
2019-06-23 12:01 ` Lars Ingebrigtsen
0 siblings, 2 replies; 15+ messages in thread
From: Michael Heerdegen @ 2019-06-22 15:29 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 36324, Davor Rotim
Lars Ingebrigtsen <larsi@gnus.org> writes:
> I've now reapplied the patch, but restored the t check in the hook and
> updated the comment.
Fixed for me, thanks.
> The doc string for `read-from-minibuffer' doesn't document the t value
> for HISTORY at all -- perhaps that should also be fixed?
It's also not hardcoded AFAIK. t is non-nil so Qminibuffer_history
isn't substituted in `read-from-minibuffer', and it's not listp so
`add-to-history' ignores it silently. AFAIU other values V with these
properties would also work this way but still provoke the
(wrong-type-argument listp V) error.
Having some input not recorded in a history is a useful feature. IMHO
this should be doable in an official way, and be documented.
If we don't solve this here, I can also open a new report.
Thanks,
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-22 15:29 ` Michael Heerdegen
@ 2019-06-22 17:41 ` Noam Postavsky
2019-06-22 17:51 ` Michael Heerdegen
2019-06-23 12:01 ` Lars Ingebrigtsen
1 sibling, 1 reply; 15+ messages in thread
From: Noam Postavsky @ 2019-06-22 17:41 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: Lars Ingebrigtsen, 36324, Davor Rotim
Michael Heerdegen <michael_heerdegen@web.de> writes:
> It's also not hardcoded AFAIK. t is non-nil so Qminibuffer_history
> isn't substituted in `read-from-minibuffer', and it's not listp so
> `add-to-history' ignores it silently. AFAIU other values V with these
> properties would also work this way but still provoke the
> (wrong-type-argument listp V) error.
No, any variable with a non-list value will silently do nothing, e.g.,
(defvar foo 1)
(read-string "q? " nil 'foo)
`t' is just a (constant) variable with a non-list (symbol) value.
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-22 17:41 ` Noam Postavsky
@ 2019-06-22 17:51 ` Michael Heerdegen
0 siblings, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2019-06-22 17:51 UTC (permalink / raw)
To: Noam Postavsky; +Cc: Lars Ingebrigtsen, 36324, Davor Rotim
Noam Postavsky <npostavs@gmail.com> writes:
> No, any variable with a non-list value will silently do nothing, e.g.,
>
> (defvar foo 1)
> (read-string "q? " nil 'foo)
>
> `t' is just a (constant) variable with a non-list (symbol) value.
Sure. But (savehist-save) afterwards gives
Debugger entered--Lisp error: (wrong-type-argument listp 1)
car(1)
(let ((elt (car --dolist-tail--))) (let ((start (point))) (insert " ") (condition-case nil (progn (prin1 elt (current-buffer)) (save-excursion (goto-char start) (read (current-buffer)))) (error (goto-char start) (insert "\n") (while (not (eobp)) (insert ";;; ") (forward-line 1)) (insert "\n"))) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--)))
(while --dolist-tail-- (let ((elt (car --dolist-tail--))) (let ((start (point))) (insert " ") (condition-case nil (progn (prin1 elt (current-buffer)) (save-excursion (goto-char start) (read (current-buffer)))) (error (goto-char start) (insert "\n") (while (not (eobp)) (insert ";;; ") (forward-line 1)) (insert "\n"))) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--))))
(let ((--dolist-tail-- value)) (while --dolist-tail-- (let ((elt (car --dolist-tail--))) (let ((start (point))) (insert " ") (condition-case nil (progn (prin1 elt (current-buffer)) (save-excursion (goto-char start) (read ...))) (error (goto-char start) (insert "\n") (while (not ...) (insert ";;; ") (forward-line 1)) (insert "\n"))) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
(progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let ((elt (car --dolist-tail--))) (let ((start (point))) (insert " ") (condition-case nil (progn (prin1 elt ...) (save-excursion ... ...)) (error (goto-char start) (insert "\n") (while ... ... ...) (insert "\n"))) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (save-excursion (goto-char excess-space) (if (eq (following-char) 32) (delete-region (point) (1+ (point))))) (insert "))\n"))
(if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let ((elt (car --dolist-tail--))) (let ((start ...)) (insert " ") (condition-case nil (progn ... ...) (error ... ... ... ...)) (goto-char (point-max))) (setq --dolist-tail-- (cdr --dolist-tail--))))) (save-excursion (goto-char excess-space) (if (eq (following-char) 32) (delete-region (point) (1+ (point))))) (insert "))\n")))
(let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let ((elt ...)) (let (...) (insert " ") (condition-case nil ... ...) (goto-char ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) (save-excursion (goto-char excess-space) (if (eq (following-char) 32) (delete-region (point) (1+ (point))))) (insert "))\n"))))
(progn (let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let (...) (let ... ... ... ...) (setq --dolist-tail-- ...)))) (save-excursion (goto-char excess-space) (if (eq (following-char) 32) (delete-region (point) (1+ ...)))) (insert "))\n")))))
(if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let ((--dolist-tail-- value)) (while --dolist-tail-- (let ... ... ...))) (save-excursion (goto-char excess-space) (if (eq ... 32) (delete-region ... ...))) (insert "))\n"))))))
(let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol (current-buffer)) (insert " '(") (setq excess-space (point)) (let (...) (while --dolist-tail-- ...)) (save-excursion (goto-char excess-space) (if ... ...)) (insert "))\n")))))) (setq --dolist-tail-- (cdr --dolist-tail--)))
(while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let ((value (symbol-value symbol)) excess-space) (if value (progn (insert "(setq ") (prin1 symbol ...) (insert " '(") (setq excess-space ...) (let ... ...) (save-excursion ... ...) (insert "))\n")))))) (setq --dolist-tail-- (cdr --dolist-tail--))))
(let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let ((value ...) excess-space) (if value (progn ... ... ... ... ... ... ...))))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
(progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list 'quote savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not (memq symbol savehist-ignored-variables))) (progn (let (... excess-space) (if value ...)))) (setq --dolist-tail-- (cdr --dolist-tail--))))))
(if savehist-save-minibuffer-history (progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list 'quote savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (and (boundp symbol) (not ...)) (progn (let ... ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))))
(let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list 'quote savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ((symbol ...)) (if (and ... ...) (progn ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (boundp symbol) (progn (let (...) (if ... ...)))) (setq --dolist-tail-- (cdr --dolist-tail--))))))
(progn (insert (format-message (concat ";; -*- mode: emacs-lisp; coding: %s -*-\n" ";; Minibuffer history file, automatically generate..." "\n") savehist-coding-system)) (run-hooks 'savehist-save-hook) (let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list 'quote savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let (...) (if ... ...) (setq --dolist-tail-- ...)))))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let ((symbol (car --dolist-tail--))) (if (boundp symbol) (progn (let ... ...))) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (let ((checksum (md5 (current-buffer) nil nil savehist-coding-system))) (if (and auto-save (equal checksum savehist-last-checksum)) nil (let ((file-precious-flag t) (coding-system-for-write savehist-coding-system)) (write-region (point-min) (point-max) savehist-file nil (if (called-interactively-p 'interactive) nil 'quiet))) (if savehist-file-modes (progn (set-file-modes savehist-file savehist-file-modes))) (setq savehist-last-checksum checksum))))
(unwind-protect (progn (insert (format-message (concat ";; -*- mode: emacs-lisp; coding: %s -*-\n" ";; Minibuffer history file, automatically generate..." "\n") savehist-coding-system)) (run-hooks 'savehist-save-hook) (let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 (list 'setq 'savehist-minibuffer-history-variables (list ... savehist-minibuffer-history-variables)) (current-buffer)) (insert 10) (let ((--dolist-tail-- savehist-minibuffer-history-variables)) (while --dolist-tail-- (let ... ... ...))))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let ((symbol ...)) (if (boundp symbol) (progn ...)) (setq --dolist-tail-- (cdr --dolist-tail--)))))) (let ((checksum (md5 (current-buffer) nil nil savehist-coding-system))) (if (and auto-save (equal checksum savehist-last-checksum)) nil (let ((file-precious-flag t) (coding-system-for-write savehist-coding-system)) (write-region (point-min) (point-max) savehist-file nil (if (called-interactively-p ...) nil 'quiet))) (if savehist-file-modes (progn (set-file-modes savehist-file savehist-file-modes))) (setq savehist-last-checksum checksum)))) (and (buffer-name #:temp-buffer) (kill-buffer #:temp-buffer)))
(save-current-buffer (set-buffer #:temp-buffer) (unwind-protect (progn (insert (format-message (concat ";; -*- mode: emacs-lisp; coding: %s -*-\n" ";; Minibuffer history file, automatically generate..." "\n") savehist-coding-system)) (run-hooks 'savehist-save-hook) (let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 (list ... ... ...) (current-buffer)) (insert 10) (let (...) (while --dolist-tail-- ...)))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let (...) (if ... ...) (setq --dolist-tail-- ...))))) (let ((checksum (md5 (current-buffer) nil nil savehist-coding-system))) (if (and auto-save (equal checksum savehist-last-checksum)) nil (let ((file-precious-flag t) (coding-system-for-write savehist-coding-system)) (write-region (point-min) (point-max) savehist-file nil (if ... nil ...))) (if savehist-file-modes (progn (set-file-modes savehist-file savehist-file-modes))) (setq savehist-last-checksum checksum)))) (and (buffer-name #:temp-buffer) (kill-buffer #:temp-buffer))))
(let ((#:temp-buffer (generate-new-buffer " *temp*"))) (save-current-buffer (set-buffer #:temp-buffer) (unwind-protect (progn (insert (format-message (concat ";; -*- mode: emacs-lisp; coding: %s -*-\n" ";; Minibuffer history file, automatically generate..." "\n") savehist-coding-system)) (run-hooks 'savehist-save-hook) (let ((print-length nil) (print-level nil) (print-quoted t)) (if savehist-save-minibuffer-history (progn (prin1 ... ...) (insert 10) (let ... ...))) (let ((--dolist-tail-- savehist-additional-variables)) (while --dolist-tail-- (let ... ... ...)))) (let ((checksum (md5 ... nil nil savehist-coding-system))) (if (and auto-save (equal checksum savehist-last-checksum)) nil (let (... ...) (write-region ... ... savehist-file nil ...)) (if savehist-file-modes (progn ...)) (setq savehist-last-checksum checksum)))) (and (buffer-name #:temp-buffer) (kill-buffer #:temp-buffer)))))
savehist-save()
I guess I was not clear enough. Any non-nil symbol with a non-listp
value will do, but currently we only check for t in
`savehist-minibuffer-hook'.
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-22 15:29 ` Michael Heerdegen
2019-06-22 17:41 ` Noam Postavsky
@ 2019-06-23 12:01 ` Lars Ingebrigtsen
2019-06-23 15:27 ` Michael Heerdegen
1 sibling, 1 reply; 15+ messages in thread
From: Lars Ingebrigtsen @ 2019-06-23 12:01 UTC (permalink / raw)
To: Michael Heerdegen; +Cc: 36324, Davor Rotim
Michael Heerdegen <michael_heerdegen@web.de> writes:
>> The doc string for `read-from-minibuffer' doesn't document the t value
>> for HISTORY at all -- perhaps that should also be fixed?
>
> It's also not hardcoded AFAIK. t is non-nil so Qminibuffer_history
> isn't substituted in `read-from-minibuffer', and it's not listp so
> `add-to-history' ignores it silently. AFAIU other values V with these
> properties would also work this way but still provoke the
> (wrong-type-argument listp V) error.
>
> Having some input not recorded in a history is a useful feature. IMHO
> this should be doable in an official way, and be documented.
Yes, it's a useful feature, and it should be documented, but before
doing that, I wonder how this feature developed.
It was developed in 2012, apparently, when `read-passwd' changed from
this ad-hoc way to the `t':
- (read-string prompt nil
- (let ((sym (make-symbol "forget-history")))
- (set sym nil)
- sym)
- default)
+ (read-string prompt nil t default) ; t = "no history"
This apparently came from an XEmacs convention, which explains this 2005
change to savehist.el:
- (add-to-list 'savehist-minibuffer-history-variables
- minibuffer-history-variable))
+ ;; XEmacs sets minibuffer-history-variable to t to mean "no history
+ ;; is being recorded".
+ (unless (eq minibuffer-history-variable t)
+ (add-to-list 'savehist-minibuffer-history-variables
+ minibuffer-history-variable)))
So the `t' being the "no history" signal isn't just some random
artefact, but is the design, so I'm just going to go ahead and document
that in `read-from-minibuffer', which explains all the details about
HISTORY. I'll add it to `minibuffer-history-variable' for completeness'
sake, too.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
^ permalink raw reply [flat|nested] 15+ messages in thread
* bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
2019-06-23 12:01 ` Lars Ingebrigtsen
@ 2019-06-23 15:27 ` Michael Heerdegen
0 siblings, 0 replies; 15+ messages in thread
From: Michael Heerdegen @ 2019-06-23 15:27 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 36324, Davor Rotim
Lars Ingebrigtsen <larsi@gnus.org> writes:
> So the `t' being the "no history" signal isn't just some random
> artefact, but is the design, so I'm just going to go ahead and
> document that in `read-from-minibuffer', which explains all the
> details about HISTORY. I'll add it to `minibuffer-history-variable'
> for completeness' sake, too.
Ok, thanks Lars.
Michael.
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2019-06-23 15:27 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-06-21 16:04 bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t) Michael Heerdegen
2019-06-21 16:16 ` Lars Ingebrigtsen
2019-06-21 16:40 ` Michael Heerdegen
2019-06-21 16:50 ` Lars Ingebrigtsen
2019-06-21 17:05 ` Michael Heerdegen
2019-06-21 19:22 ` Davor Rotim
2019-06-21 23:23 ` Michael Heerdegen
2019-06-22 2:35 ` Michael Heerdegen
2019-06-22 9:33 ` Lars Ingebrigtsen
2019-06-22 15:29 ` Michael Heerdegen
2019-06-22 17:41 ` Noam Postavsky
2019-06-22 17:51 ` Michael Heerdegen
2019-06-23 12:01 ` Lars Ingebrigtsen
2019-06-23 15:27 ` Michael Heerdegen
2019-06-22 9:20 ` Lars Ingebrigtsen
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.