From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#39805: 28.0.50; scan-sexps (scan_lists) incorrectly parsing circular list Date: Thu, 27 Feb 2020 21:34:07 -0500 Message-ID: <87a753a19c.fsf@gmail.com> References: <87wo89ghix.fsf@gmail.com> <87pne0ajy3.fsf@gmail.com> <87mu94kkrq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="9454"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 39805@debbugs.gnu.org To: No Wayman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 28 03:35:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j7VUe-0002LK-3z for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 28 Feb 2020 03:35:12 +0100 Original-Received: from localhost ([::1]:40818 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7VUc-0001IB-PL for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 27 Feb 2020 21:35:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54701) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j7VUV-0001Hp-IG for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2020 21:35:04 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j7VUU-0008Bp-3T for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2020 21:35:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54518) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j7VUT-0008BI-V0 for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2020 21:35:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j7VUT-00036S-S4 for bug-gnu-emacs@gnu.org; Thu, 27 Feb 2020 21:35:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 28 Feb 2020 02:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 39805 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 39805-submit@debbugs.gnu.org id=B39805.158285725711872 (code B ref 39805); Fri, 28 Feb 2020 02:35:01 +0000 Original-Received: (at 39805) by debbugs.gnu.org; 28 Feb 2020 02:34:17 +0000 Original-Received: from localhost ([127.0.0.1]:60491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j7VTk-00035L-QQ for submit@debbugs.gnu.org; Thu, 27 Feb 2020 21:34:17 -0500 Original-Received: from mail-qv1-f65.google.com ([209.85.219.65]:33187) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j7VTj-000353-49; Thu, 27 Feb 2020 21:34:15 -0500 Original-Received: by mail-qv1-f65.google.com with SMTP id p3so178268qvq.0; Thu, 27 Feb 2020 18:34:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=bOskhrwXQP/uiq1H8U+zpNuGzOY6GEa+nWXSRDX1ey0=; b=AWPIHf7n98ZPV2Zf33JtlpRWtFrTHyvN7lV5cK2lEmWhrSMyI4+C3wJ3WTWA16Uo11 tuUYN7H0Sc2Spsl4Lt02Qx+JJwOYQF2DZ3SYeNU3f2kZ1arGcRaWIkxwr2BOm3hyONxZ wVF/SuK9i13s8bepd9DOrnrHgzbBQiu1qQV136WXNzB5nIUUFlNm9i/FQE44IuTSuzyP 6eK18gBTT3tWuA/Tqx4j3iaah8DBhN9s/b67DmIABeorJ8aVJI2oR5sDkGwP6NyOqRnt WZmuxsI8q6SrDFOr6/fAflJcKEMfmfkc3RyLuQpxC5oso9gsHEoG1I0C4OxIqRv0BooV Y9Fg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=bOskhrwXQP/uiq1H8U+zpNuGzOY6GEa+nWXSRDX1ey0=; b=qlVrf7HxJa7Yydqp/1yTUoBhOaJUDBAI+SbldeOLiDxD+BQG1r93IwfAcT1EinJPX2 2nQiGaEHL5FhtHTDSINuQ4ZJnhcTi4A1cUuLeUlNiATAJkhikv7FXFU9FN1VG+lj+c6+ pvgTZMjdtZTBzEuMz6erLZuEdwAxJxzomjN7hgnbw4PvgI+3K/ERYkHuTn1MYs7CYy7S Y4bd62LA9sJKBlBF6FwQnLpXz7jbDzCztaJPYROIFXzc1cTgIHGfWIrmS/3Imau8THGs i73R4hT7ZePg1BAoBCbnzxl9akD4/anaQ2QMDqp5VR5pw/JqZ3xa0drpY7mKUHCF+TTD QJvA== X-Gm-Message-State: APjAAAVvvkzM/acjTptlqNyJjPIbY6Bn/bPA8qYMt2beVMcafbE+87Np PnND8CxkUv40djfovi2Okh2ffXHtT1A= X-Google-Smtp-Source: APXvYqxqXQnIUZtxdbeV9vVDGmTffG3zfhL23hOZ1SiF0+EFKL1cjiZh/wtgf9R59TXbq2h4JPzzzw== X-Received: by 2002:ad4:55e8:: with SMTP id bu8mr2020047qvb.61.1582857249264; Thu, 27 Feb 2020 18:34:09 -0800 (PST) Original-Received: from minid (cbl-45-2-119-47.yyz.frontiernetworks.ca. [45.2.119.47]) by smtp.gmail.com with ESMTPSA id x131sm4211803qka.1.2020.02.27.18.34.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 27 Feb 2020 18:34:08 -0800 (PST) In-Reply-To: <87mu94kkrq.fsf@gmail.com> (No Wayman's message of "Thu, 27 Feb 2020 12:22:34 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176548 Archived-At: --=-=-= Content-Type: text/plain retitle 39805 describe-variable fails to print some circular list values # describe-variable only fails starting from 26.1 notfound 39805 25.3 found 39805 26.1 tags 39805 + patch quit For the record, the pp-buffer call in the original report fails in Emacs 25 (and earlier, I assume), but the describe-variable case only fails starting from 26.1, specifically commit 2c18969c81. [1: 2c18969c81]: 2017-03-02 02:08:32 -0500 * lisp/help-fns.el (describe-variable): Use cl-print for the value https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=2c18969c810f338d73beda592ee5af7103132e97 Here is the patch intended for emacs-27: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-Fix-describe-variable-on-values-with-circular-syntax.patch Content-Description: patch >From 3b0b1b17c59341b12a502c0ea87c6125cc445494 Mon Sep 17 00:00:00 2001 From: Noam Postavsky Date: Thu, 27 Feb 2020 21:09:59 -0500 Subject: [PATCH] Fix describe-variable on values with circular syntax (Bug#39805) * lisp/help-fns.el (describe-variable): Set syntax tables before calling pp-buffer. --- lisp/help-fns.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 0e2ae6b3c3..1be8e0ab08 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1000,6 +1000,8 @@ describe-variable (terpri) (let ((buf (current-buffer))) (with-temp-buffer + (lisp-mode-variables nil) + (set-syntax-table emacs-lisp-mode-syntax-table) (insert print-rep) (pp-buffer) (let ((pp-buffer (current-buffer))) -- 2.11.0 --=-=-= Content-Type: text/plain No Wayman writes: > 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?: Mostly yes, but IMO it's kind of over-engineered. I would do just: (defun workaround/describe-variable-print-bug (original-function &rest args) "Put temp buffer in emacs-lisp-mode before `pp-buffer'. https://debbugs.gnu.org/39805#8" (advice-add #'pp-buffer :before #'emacs-lisp-mode) (unwind-protect (apply original-function args) (advice-remove #'pp-buffer #'emacs-lisp-mode))) (when (= emacs-major-version 26) ;; Work around Bug#39805. (advice-add #'describe-variable :around #'workaround/describe-variable-print-bug)) --=-=-=--