GNU bug report logs - #39805
describe-variable fails to print some circular list values

Previous Next

Package: emacs;

Reported by: No Wayman <iarchivedmywholelife <at> gmail.com>

Date: Wed, 26 Feb 2020 21:50:01 UTC

Severity: normal

Tags: confirmed, fixed, patch

Found in versions 28.0.50, 26.1

Fixed in version 27.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #15 received at 39805 <at> debbugs.gnu.org (full text, mbox):

From: No Wayman <iarchivedmywholelife <at> gmail.com>
To: Noam Postavsky <npostavs <at> gmail.com>
Cc: 39805 <at> debbugs.gnu.org
Subject: Re: bug#39805: 28.0.50; scan-sexps (scan_lists) incorrectly parsing
 circular list
Date: Thu, 27 Feb 2020 12:22:34 -0500
Noam Postavsky <npostavs <at> gmail.com> writes:

> It doesn't fail if the buffer is changed to emacs-lisp-mode 
> before the
> pp-buffer call.

In the meantime, I'd like to be able to offer the users of my 
package a solution if they hit this bug.
This seems to work for me, but I haven't written much, and am a 
bit leery of, elisp advice.
Would you consider this an appropriate workaround?:

(defun workaround/describe-variable-print-bug (original-function 
&rest args)
 "Put temp buffer in emacs-lisp before ORIGINAL-FUNCTION: 
 `pp-buffer'.
https://lists.gnu.org/archive/html/emacs-bug-tracker/2020-02/msg00376.html"
 (cl-flet ((pp-advice (original-function)
                      (when (string-prefix-p " *temp" 
                      (buffer-name))
                        (let ((mm major-mode))
                          (emacs-lisp-mode)
                          (funcall original-function)
                          (funcall mm)))))
   (advice-add #'pp-buffer :around #'pp-advice)
   (unwind-protect
       (progn
         (apply original-function args)
         nil)
     (advice-remove #'pp-buffer #'pp-advice))))

(advice-add #'describe-variable :around 
#'workaround/describe-variable-print-bug)




This bug report was last modified 5 years and 82 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.