bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#39805: 28.0.50; scan-sexps (scan_lists) incorrectly parsing circular


From: No Wayman
Subject: bug#39805: 28.0.50; scan-sexps (scan_lists) incorrectly parsing circular list
Date: Thu, 27 Feb 2020 12:22:34 -0500
User-agent: mu4e 1.3.9; emacs 28.0.50


Noam Postavsky <npostavs@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)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]