From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#73872: 30.0.91; emacs-lisp-mode-syntax-table active when calling `describe-variable' on variable with textually large value. Date: Sat, 30 Nov 2024 11:49:12 +0200 Message-ID: <867c8l9hlz.fsf@gnu.org> References: <86wmhlyhng.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="364"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 73872@debbugs.gnu.org To: sigurddam@hotmail.com, Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 30 10:50:10 2024 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 1tHK77-000ARK-Ql for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 30 Nov 2024 10:50:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tHK71-0007Qt-M1; Sat, 30 Nov 2024 04:50:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHK70-0007QT-CO for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 04:50:02 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tHK70-0005V0-2i for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 04:50:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-version:References:In-Reply-To:From:Date:To:Subject; bh=GbudRZ21Clyp/bHzIGva1wUfDbNVRGe8vj3hrix4FeI=; b=dkf6B79kk75yBrR9fCFagOCrMVyaMSVLsnx7+jUxODkUJKAA/n6hhUpMDwU6Y6qK505XLVSvInpQaw1eZ0M98MJQ5y/lGKFrL79rgLRTDU6N+Y8mrdYoiZS0kYiyComWfanI3WBEypUjrwNENrHEAfE6kkM8xS2DYgBwYxkNzEF2Se2sbzT/3LKrK4qAovbArrg6XuCBw84ZnqevK1Lg/xf9QSRq/GxvO/s2WJ7c6qsUckiLfzNEO5trXxh2Ygq7oRaC50MWzo2aohvwMF2EUyaRg56jW28D9Zji3pHjgy8U+qaVjKq7oyH5MM2uST08TMxqm0w8H4qNkzp7qg9JyA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tHK6z-0006Rz-TU for bug-gnu-emacs@gnu.org; Sat, 30 Nov 2024 04:50:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 30 Nov 2024 09:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73872 X-GNU-PR-Package: emacs Original-Received: via spool by 73872-submit@debbugs.gnu.org id=B73872.173296016424723 (code B ref 73872); Sat, 30 Nov 2024 09:50:01 +0000 Original-Received: (at 73872) by debbugs.gnu.org; 30 Nov 2024 09:49:24 +0000 Original-Received: from localhost ([127.0.0.1]:45454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHK6O-0006Qh-0k for submit@debbugs.gnu.org; Sat, 30 Nov 2024 04:49:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34030) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tHK6L-0006QP-NP for 73872@debbugs.gnu.org; Sat, 30 Nov 2024 04:49:22 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tHK6F-00059k-BP; Sat, 30 Nov 2024 04:49:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=GbudRZ21Clyp/bHzIGva1wUfDbNVRGe8vj3hrix4FeI=; b=KdaxkNO5zOXbkDP5zEht hFkt8GPGVLDvV1oIfDF52yAPSqbf/z4JmhwteNaiZhGvpsouAYGmDW1wtI56iYOpmBicM/ie7/Pqf XxrkxkfruxbJ+/m9vuWLrJtSDd6KaM6I+07kuY6DC7dvE68qczoaT6ZayvLPH8I4bI3ETdZ1WiOm9 SUD5OHwxg/sgxEuLaRE7AiwcEMfAqYXegKoNKiqdoHfE/5aQNsm2TSkV3fI/hMpzESXHJ0UvksubO kfsXXYBBdhRjG/jiTzMns0Gg9+ImIoQdyupeaJFuTkXlkDkmPZGXSLFXPKyL8Bvpen6Q+VSUWqxMk mCOiHr+0k+Qhpg==; In-Reply-To: (message from Stefan Monnier on Thu, 14 Nov 2024 09:40:48 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296127 Archived-At: Ping! Sigurd, could you please answer Stefan's questions? > Cc: Sigurd Dam Sonniks , 73872@debbugs.gnu.org > From: Stefan Monnier > Date: Thu, 14 Nov 2024 09:40:48 -0500 > > >> When you call `describle-variable' on a variable with a value that's > >> large enough that it's moved to the end of the help buffer, the syntax > >> table is changed to `emacs-lisp-mode-syntax-table' but never changed > >> back. There is a very easy fix where you just set it back to > >> `help-mode-syntax-table' at the end of the enclosing > >> `with-current-buffer', but I guess you could also switch to a > >> temporary buffer instead. Below is the relevant code snippet with the > >> first suggested fix applied. > > I'm curious: in which context did you notice this? > Does it lead to an undesirable behavior in a specific case? > > > Shouldn't the syntax table be left at that value until the buffer is > > reused for another variable/function? Otherwise, why do we set the > > syntax table to this value? Stefan, do you know the reason? > > FWIW, according to my reading of the Git history, this behavior dates > back at least to 2001 when Miles split `help.el` into several files > (I didn't bother to check the previous history of that code on > `help.el`), so it's far from new. > > AFAICT the syntax-table of the *Help* buffer shouldn't matter very much > once the buffer is filled: it affects only navigation by the user, where > the prose part would presumably prefer a syntax-table somewhat like that > of `text-mode` whereas the var's value part would prefer something like > that of `elisp-mode`. > > But, AFAICT the `help-mode-syntax-table` happens to be a derivative of > `emacs-lisp-mode-syntax-table` just with extra matching of ‘...’, so > reverting to it would be safe enough in most cases. This said, I think > The Right Thing™ would be to add a `syntax-table` property on the > printed value (regardless if it stays at the beginning or is moved to > the end of the buffer) so it's not affected by the syntax-table used in > the rest of the buffer. > > > Stefan > > > > >