all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Heerdegen <michael_heerdegen@web.de>
To: Noam Postavsky <npostavs@gmail.com>
Cc: Lars Ingebrigtsen <larsi@gnus.org>,
	36324@debbugs.gnu.org, Davor Rotim <rotim.davor@gmail.com>
Subject: bug#36324: 27.0.50; Error in savehist-save: (wrong-type-argument listp t)
Date: Sat, 22 Jun 2019 19:51:59 +0200	[thread overview]
Message-ID: <87lfxtece8.fsf@web.de> (raw)
In-Reply-To: <87a7e9v7pe.fsf@gmail.com> (Noam Postavsky's message of "Sat, 22 Jun 2019 13:41:17 -0400")

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.





  reply	other threads:[~2019-06-22 17:51 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2019-06-23 12:01           ` Lars Ingebrigtsen
2019-06-23 15:27             ` Michael Heerdegen
2019-06-22  9:20     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87lfxtece8.fsf@web.de \
    --to=michael_heerdegen@web.de \
    --cc=36324@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=npostavs@gmail.com \
    --cc=rotim.davor@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this 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.