From unknown Sat Jun 14 19:34:59 2025 X-Loop: help-debbugs@gnu.org Subject: bug#78698: 14.0.9; Folding of math macros with a function spec is broken Resent-From: Rahguzar Original-Sender: "Debbugs-submit" Resent-CC: bug-auctex@gnu.org Resent-Date: Thu, 05 Jun 2025 03:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78698 X-GNU-PR-Package: auctex X-GNU-PR-Keywords: To: "Paul D. Nelson" Cc: 78698@debbugs.gnu.org X-Debbugs-Original-Cc: bug-auctex@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.174909569416489 (code B ref -1); Thu, 05 Jun 2025 03:55:01 +0000 Received: (at submit) by debbugs.gnu.org; 5 Jun 2025 03:54:54 +0000 Received: from localhost ([127.0.0.1]:56749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uN1gq-0004Hn-V4 for submit@debbugs.gnu.org; Wed, 04 Jun 2025 23:54:54 -0400 Received: from lists.gnu.org ([2001:470:142::17]:60572) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uN1gn-0004H0-Uq for submit@debbugs.gnu.org; Wed, 04 Jun 2025 23:54:50 -0400 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 1uN1gh-0000zm-9F for bug-auctex@gnu.org; Wed, 04 Jun 2025 23:54:43 -0400 Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1uN1gd-0004KO-7L for bug-auctex@gnu.org; Wed, 04 Jun 2025 23:54:40 -0400 Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4bCVvB07f4z9ssx; Thu, 5 Jun 2025 05:54:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1749095670; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zlJc5R/LRAnlC53mv1ymn9YWgmNHxa2CTER3lwGv2HU=; b=qH9Y63QAY7SCfZ15cqlWY1MOT+QH2xho8PqJBEqy6je7WAXG8k7U7ObUpN5bsFzhngdUj6 f5MmUCpxXqcCqUMdYNeAqGVQLSf4Vq8haGTzKjuB2K8uC62+daIs4gWBr/UkCKWIqKos+E 0b6C4EknMEuptkBp2aCooQnNsp0rVhDTFiaaVx+h3ufe5+/w1NNPo/GvqFICuWbXCZH6NP SxChvTniWWhkMZXj7gHHVLnIRGqL/58wmiytiLLJLnmJ2ZXdrZ7ACQyRgzVK5z9y+IuJ4s GnDzFN4yNuTsXeo4nkXhSs3A+rZbxRP0ekkZlVJRQ2s2m5HVzmDPMaJI3e+Tjw== From: Rahguzar In-Reply-To: (Paul D. Nelson's message of "Thu, 05 Jun 2025 01:40:14 +0200") References: Date: Thu, 05 Jun 2025 08:54:26 +0500 Message-ID: <877c1qlu6l.fsf@mailbox.org> MIME-Version: 1.0 Content-Type: text/plain X-MBO-RS-META: sacin878f3kpt9mrck9h6m1m8scuih9w X-MBO-RS-ID: f0c276007820de0e3ba Received-SPF: pass client-ip=2001:67c:2050:0:465::101; envelope-from=rahguzar@mailbox.org; helo=mout-p-101.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) "Paul D. Nelson" writes: > Hi Rahguzar, > >>>> (setq TeX-fold-math-spec-list `((,(lambda (text) (propertize text 'face '(underline))) ("underline")))) >>> >>> Is there a reason to prefer this vs. the same with >>> TeX-fold-macro-spec-list in place of TeX-fold-math-spec-list? >> >> The reason for why it is in TeX-fold-math-spec-list is that when I >> started with Emacs I stole it from Tecosaur's config. There are quite a >> few function specs in my TeX-fold-math-spec-list e.g. for sqrt, frac, >> mathcal, mathfrak and mathbb etc and most of them are relevant only for >> math. Should they be moved to TeX-fold-macro-spec-list? > > I think one can use TeX-fold-macro-spec-list for all of these. In > particular, your underline example works fine there for me. > > It's not clear to me from those what exactly are the intended purposes > of the various spec lists (macro/env/math). My impression from the > built-in examples was that the math list is for macros like "alpha" that > accept no arguments. Yes, it would be good to make this clear in the documentation. > The motivation for the offending patch was to make it so folding "\in > [0, 1]" doesn't hide the "[0, 1]" as if it were an optional arg. To > give a more robust fix that works with your code sample, we would need a > more robust way to detect when a macro is not intended to have any > (optional) arguments. The implemented approach was to just assume that > all the "math" macros accept no arguments. Do you or does anyone have > other suggestions? I have also seen the problem you are encountering so it is good to have a fix for that. I think to preserve breakage and preserve backward compatibility it would be better to either: 1) Assume that there is no white-space between the macro name and the brackets enclosing the arguments. This is probably not how TeX syntax works but I think (not too sure about this) it is the usual style. This behavior can be controlled by a custom variable. 2) Since the problem is with optional arguments we can allow { after the macro name but not [. 3) Another option can be to introduce a new spec alist for macros without optional args. > Paul Rahguzar From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 11 03:33:16 2025 Received: (at control) by debbugs.gnu.org; 11 Jun 2025 07:33:16 +0000 Received: from localhost ([127.0.0.1]:46098 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uPFxU-0005ss-F1 for submit@debbugs.gnu.org; Wed, 11 Jun 2025 03:33:16 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50748) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uPFxC-0005r6-EA; Wed, 11 Jun 2025 03:32:59 -0400 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 1uPFx5-0003Ly-GT; Wed, 11 Jun 2025 03:32:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=NysgRVepcoa4om6ZRH31MxnH0ZdI8rt6BaILKhV3idM=; b=eQ0B1IC3y/Rw+zl8WN+G 32R8aJbyodcIp/fG4eWBWaMy2o4wucASCsEJHYpf+FT9HnX5A/d250nTgzOxB+RsrrEjlJ2+InV7+ MSJnsqhIj35/S3PAZvqxT6rk7pzgyuJxZUTtmX1+JDdjb6R45Tpc9KL9KWh9bQyGY7fUfbrmTmqVu taNNBRYiNkzBHrbPzn5VLS9Bw7R8LHmOMi4wXa7D1R0GGkaNZckWTQdbZlXH675ODGwtr8r5CAH1s 7AJnuWfOZ+Hv6jpZCfmv87csYGC34IOUeKmHvemhtLjZEt+4bnPC3WtlK98SQD7YE9XLiBzKlOetw XkPqZzmQwrRDSg==; From: Arash Esbati To: Rahguzar via bug-auctex via Bug reporting list for AUCTeX Subject: Re: bug#78693: 14.0.9; Folding of math macros with a function spec is broken In-Reply-To: <87bjr3nb8j.fsf@mailbox.org> References: <87bjr3nb8j.fsf@mailbox.org> Date: Wed, 11 Jun 2025 09:32:47 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control Cc: 78693@debbugs.gnu.org, Rahguzar , ultrono@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) forcemerge 78693 78696 78698 thanks Rahguzar via bug-auctex via Bug reporting list for AUCTeX writes: > Dear AucTeX maintainers, > > The commits > > d0a57d8d Fix math macro folding to not consume subsequent brackets > 33f9eb07 Fix TeX macro end detection in some edge cases > > break the folding of math macros with a function spec. Gents, somehow 3 bug reports where opened for this report which I'm merging now. Please try to avoid this in future. TIA. Best, Arash