all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: No Wayman <iarchivedmywholelife@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 39805@debbugs.gnu.org
Subject: bug#39805: 28.0.50; scan-sexps (scan_lists) incorrectly parsing circular list
Date: Thu, 27 Feb 2020 12:22:34 -0500	[thread overview]
Message-ID: <87mu94kkrq.fsf@gmail.com> (raw)
In-Reply-To: <87pne0ajy3.fsf@gmail.com>


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	other threads:[~2020-02-27 17:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26 21:33 bug#39805: 28.0.50; scan-sexps (scan_lists) incorrectly parsing circular list No Wayman
2020-02-27  1:38 ` Noam Postavsky
2020-02-27 17:22   ` No Wayman [this message]
2020-02-28  2:34     ` Noam Postavsky
2020-02-28  4:01       ` No Wayman
2020-03-04  3:09       ` Noam Postavsky

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=87mu94kkrq.fsf@gmail.com \
    --to=iarchivedmywholelife@gmail.com \
    --cc=39805@debbugs.gnu.org \
    --cc=npostavs@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.