[Top][All Lists]

[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 <address@hidden> 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'.
 (cl-flet ((pp-advice (original-function)
(when (string-prefix-p " *temp" (buffer-name))
                        (let ((mm major-mode))
                          (funcall original-function)
                          (funcall mm)))))
   (advice-add #'pp-buffer :around #'pp-advice)
         (apply original-function args)
     (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]