GNU bug report logs - #70525
[PATCH] Make auto-reveal customizations easier to extend

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: auctex; Reported by: Paul Nelson <ultrono@HIDDEN>; Keywords: patch; Done: Arash Esbati <arash@HIDDEN>; Maintainer for auctex is bug-auctex@HIDDEN.

Message received at 70525-done <at> debbugs.gnu.org:


Received: (at 70525-done) by debbugs.gnu.org; 1 May 2024 16:11:13 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 01 12:11:13 2024
Received: from localhost ([127.0.0.1]:38159 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s2CY4-0000Sq-QM
	for submit <at> debbugs.gnu.org; Wed, 01 May 2024 12:11:13 -0400
Received: from mail-io1-xd2a.google.com ([2607:f8b0:4864:20::d2a]:44088)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@HIDDEN>) id 1s2CY2-0000Si-U6
 for 70525-done <at> debbugs.gnu.org; Wed, 01 May 2024 12:11:12 -0400
Received: by mail-io1-xd2a.google.com with SMTP id
 ca18e2360f4ac-7decd8cd028so151572339f.0
 for <70525-done <at> debbugs.gnu.org>; Wed, 01 May 2024 09:10:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714579844; x=1715184644; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=NlkRtz5xA9bf5m2M97EbXuDkBm61UtqXAtasajssAKk=;
 b=iW91O4mExvQbOXl3zh87a+rTs+w+/9vlaYh8+V8+qh6e0TdFRuE4f5CNC0s/je4E1/
 c0rqrIM17GQLu8hn+4YCFptTm1VuSygzJECOU7f5vO9RgLk/nWJSgZ8RbYgfiqOuPCrN
 ATFnGQvrABXIdbXs2pT5xQ9lrK7gF7sbyzmrEKmKP3hPlhUC5s/GaQ6K9TxNQ2AkW1U8
 9XX+399RRiW1EdsX/+KQCKogNw7403pd4Qc2dLJYi53wdEUP97BCswxs7s4+JdrQCXSx
 hET1SYidzGC5m4V0DwBnZYh6ZzTFviVhXx1hiMbpBgVcGIwsbD/yDtvGWOHmelzHwsjh
 D2xA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714579844; x=1715184644;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=NlkRtz5xA9bf5m2M97EbXuDkBm61UtqXAtasajssAKk=;
 b=nuBpWMn0RtdVgzwoAXuvzpfaJGVZuMSeCPws41M356HXKNMoQzTmJZfds6BxYbOd7v
 bXVcXhgP7JCiGhb6kPPPt4gyofN4W4Gd4nBjDkLCaxzd6Q5ScfmAezk46QdJvmrdiNCq
 JcZ94sBtszXh29tYHCaz22Tc7xK5DVTm0ZhRdaHNRYB+1vG7oQDZbW3+pqU8f7ZHPnNg
 +Lxp28KENrbizjwpbdWOpOD/R2HS8sD82YJweIHJbYgtWoAs1PFd74DgCxiEFcztl6W5
 T477nmtPpV+0ai6I+f5UusXn9MpLawexNEayLZz529Kn3LZSkxBuXI4vaSZzscT25fQe
 eAjA==
X-Gm-Message-State: AOJu0Yx8XwtQwC+eBX0BFYnmuXKsxQP6Nf+Qz9KJp/JYFXLuZye2zTvN
 CmyaeORGJj1hU3bXooEvz4AOdWMEcqMweGfoouKmJIJIbqVrNwK4BGX5qwt0vxiK+wTDeZpJLZ+
 3TG7ktRWgef3TgA+yMTw3kTB1rUzLMyaa
X-Google-Smtp-Source: AGHT+IFzdjxAo4pW+0bDoYfkgSMZHxcZ+qgngBe7ML7dhnceA3z4XB68vYAxnuGLLLBnpxSTUuegJ7tRxUcVr4Dky8A=
X-Received: by 2002:a6b:650b:0:b0:7da:4135:89be with SMTP id
 z11-20020a6b650b000000b007da413589bemr3982245iob.17.1714579843810; Wed, 01
 May 2024 09:10:43 -0700 (PDT)
MIME-Version: 1.0
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 <m2ttjjwcxn.fsf@HIDDEN>
 <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
 <m2plu7w9cg.fsf@HIDDEN>
 <CAOA-32P4yBz7WZ++P-7Anv-ErcWWjNgrK_e6e7ekw3X3_Jq_hQ@HIDDEN>
 <m2le4vw264.fsf@HIDDEN>
 <CAOA-32N0JiaEYUih_itnT96pMqnUq+jSRZj0+khTEyL0JAW3BA@HIDDEN>
 <m2ttjix5ur.fsf@HIDDEN>
 <CAOA-32Om7iQm0FMMko0xXCBw0ikEo5wsriOaAMxH0dMYjVeYVA@HIDDEN>
 <m2h6fhprb6.fsf@HIDDEN>
In-Reply-To: <m2h6fhprb6.fsf@HIDDEN>
From: Paul Nelson <ultrono@HIDDEN>
Date: Wed, 1 May 2024 18:10:32 +0200
Message-ID: <CAOA-32PVEzGsTmE8WPOKPa7wLheaJt-0_Pixh=jYFJ1X-UqRPA@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
To: Arash Esbati <arash@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70525-done
Cc: 70525-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Many thanks, Arash, for the explanation.  I'll be happy to adjust my
patch as you suggest if/when this is revisited.

For now, I wanted to remark that I don't see the patch installed when
I do git pull (or at https://git.savannah.gnu.org/cgit/auctex.git, for
that matter).

I have one minor follow-up to this patch that I hoped to submit, and
then a bug-fix that I'll submit (after bug#70607 is closed, to avoid
merge conflicts), and then (fingers crossed) will lay off with the
patches for a bit.

Thanks again and best,

Paul

On Wed, May 1, 2024 at 3:58=E2=80=AFPM Arash Esbati <arash@HIDDEN> wrote:
>
> Paul Nelson <ultrono@HIDDEN> writes:
>
> > Do you see an advantage to modifying the behavior of the function
> > rather than the default customization value?
>
> I think it is cleaner; we have this sort of parsing also in other places
> around within AUCTeX.  But since I'm currently not able to change this,
> I've installed your patch.  We can revisit this later if necessary.
>
> Again, thanks for the patch and also responding to my messages.
> Closing.
>
> Best, Arash




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525-done <at> debbugs.gnu.org:


Received: (at 70525-done) by debbugs.gnu.org; 1 May 2024 13:58:57 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 01 09:58:57 2024
Received: from localhost ([127.0.0.1]:37616 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s2AU5-0007WD-9j
	for submit <at> debbugs.gnu.org; Wed, 01 May 2024 09:58:57 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:59478)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arash@HIDDEN>) id 1s2AU2-0007W7-Fg
 for 70525-done <at> debbugs.gnu.org; Wed, 01 May 2024 09:58:56 -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 <arash@HIDDEN>)
 id 1s2ATZ-0005RM-N4; Wed, 01 May 2024 09:58:26 -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=ZGhqyHWYIQstI4nyEiBZLkK6y6hi2HMsSsG47KWogR4=; b=LVDjnaJkjLCzY3YY4UCh
 cLJIBb/+kH4Nqqb8ih1HECfkhDbuwVbMAtLLqtlrK0AJbCjHqfYpxYO3bLqBh5BLX/uSXhVtFgZ9p
 2VZeHxo8b6Q4z74wSnpL+azIcUCjh06a3/bfjdVbc7PFEo/8CYNEnMfvVb3YtC2dIP3wVoOL99eEk
 vO0q/N4ntjeP5bCxybQSWDIPG7k64SgQ2+IwnjtUw5ddC5jMPeC+IOA2yRAvcDmM/KFpQHJNEmNSK
 XqMfkdQm9Vmc8I4XEoMLM1rWQwDCgoHIO5+XQDVRwfasX+7AJ0r7VtMLJMmi/TI0lKWSzYLYTV8/S
 ejhiU9UiUt5KJg==;
From: Arash Esbati <arash@HIDDEN>
To: Paul Nelson <ultrono@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
In-Reply-To: <CAOA-32Om7iQm0FMMko0xXCBw0ikEo5wsriOaAMxH0dMYjVeYVA@HIDDEN>
 (Paul Nelson's message of "Tue, 30 Apr 2024 17:10:20 +0200")
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 <m2ttjjwcxn.fsf@HIDDEN>
 <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
 <m2plu7w9cg.fsf@HIDDEN>
 <CAOA-32P4yBz7WZ++P-7Anv-ErcWWjNgrK_e6e7ekw3X3_Jq_hQ@HIDDEN>
 <m2le4vw264.fsf@HIDDEN>
 <CAOA-32N0JiaEYUih_itnT96pMqnUq+jSRZj0+khTEyL0JAW3BA@HIDDEN>
 <m2ttjix5ur.fsf@HIDDEN>
 <CAOA-32Om7iQm0FMMko0xXCBw0ikEo5wsriOaAMxH0dMYjVeYVA@HIDDEN>
Date: Wed, 01 May 2024 15:58:21 +0200
Message-ID: <m2h6fhprb6.fsf@HIDDEN>
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: 70525-done
Cc: 70525-done <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Paul Nelson <ultrono@HIDDEN> writes:

> Do you see an advantage to modifying the behavior of the function
> rather than the default customization value?

I think it is cleaner; we have this sort of parsing also in other places
around within AUCTeX.  But since I'm currently not able to change this,
I've installed your patch.  We can revisit this later if necessary.

Again, thanks for the patch and also responding to my messages.
Closing.

Best, Arash




Notification sent to Paul Nelson <ultrono@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Arash Esbati <arash@HIDDEN>:
You have taken responsibility. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 30 Apr 2024 15:11:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 11:11:08 2024
Received: from localhost ([127.0.0.1]:59887 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1p8K-0004hk-Qt
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 11:11:07 -0400
Received: from mail-io1-xd36.google.com ([2607:f8b0:4864:20::d36]:61735)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@HIDDEN>) id 1s1p8E-0004hN-LW
 for 70525 <at> debbugs.gnu.org; Tue, 30 Apr 2024 11:11:03 -0400
Received: by mail-io1-xd36.google.com with SMTP id
 ca18e2360f4ac-7d86adab5a7so267592239f.3
 for <70525 <at> debbugs.gnu.org>; Tue, 30 Apr 2024 08:10:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714489832; x=1715094632; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=b+149p9Ffzk/VNCyGaDSSqMtEcMnM0N6WX4GzbE89wY=;
 b=MuohyUt5iTpV+u8k9FZm181FOfgrBNIjp83SKIUNeh6BvCOod2FriqiorsuSgcn+3U
 OJgeRGd8SVTlnGrObOlT/mw8nAExv7uBykuAyHwhH0neFDrlmclAUmtLxh69hEimKO5A
 rrd1Zi6CSkozCa3LclpuEwQY0XOYmnowki//0idXVjkG0/5S5zaI6dLBVHipH4wDryLz
 /8fJnc5HLjRbcCtA9zZISTigMfMpAQZJTzrb8R0LWys8P6wC/MkBfZF8IGNSAfaZ6AkG
 1CglAZHT37H5N1NK7d5eup4lBTpmtvdm0XEsxhYn1qeYwH59mxIsnbP4ncYBFvNRRYkl
 N66g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714489832; x=1715094632;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=b+149p9Ffzk/VNCyGaDSSqMtEcMnM0N6WX4GzbE89wY=;
 b=e8TVvU2Pop1UGJAn6X20/N+gCmP7DyHUTP5QOMZM6OuhY4d+nLIcBJlJbX+DFfXlaD
 eLEaYcgB9jRwH3t5kBwm8nvgk52bb2Zko4gWCmRMkdw4BqOdefxnPECNIklDne8J+Zo4
 eo6v+gpUKebpmh3gfEV4ZQfX/6GDKUru3rWooQjcNQpQ39RkZANer77giTJ7w1s2kJ6M
 z4yjZJ/AaQcWirIAtmlm+pffpUfLXh9jsiCTJ8CgwBjuWUCuTJqivtzQRv0FbXy4jWOl
 YV9eYTBdPhdjjOrxXrXQhi+UFfGRdh0HFtoR0CHwDfOPE0YeniNogLl9fuS+xmO507/X
 qHbw==
X-Gm-Message-State: AOJu0YyW1xcqJwi4jhCGPk1KFG0nbC9w8dJoVVlG13DO0G7vGwpkCVzE
 tvVIsnTgzWLqXlhNnBOaRngTFnAmaJM+8I5jKLgwvBQppqAiaCkTdGtTPpehOExlOXZRArS3L77
 GalQTf7QCd/4Dw/ucdoaUK9Cs6LJCOtZ+
X-Google-Smtp-Source: AGHT+IFutYFCrjgrqVFe76AT5j3Zk8QMFCfyvnt+0aKHadOIbDcP7NRD2dx998u42arvKLmcPIrnbN/Z+55CnXD/7Y0=
X-Received: by 2002:a05:6602:6393:b0:7de:dbcf:b67f with SMTP id
 gb19-20020a056602639300b007dedbcfb67fmr63963iob.21.1714489832195; Tue, 30 Apr
 2024 08:10:32 -0700 (PDT)
MIME-Version: 1.0
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 <m2ttjjwcxn.fsf@HIDDEN>
 <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
 <m2plu7w9cg.fsf@HIDDEN>
 <CAOA-32P4yBz7WZ++P-7Anv-ErcWWjNgrK_e6e7ekw3X3_Jq_hQ@HIDDEN>
 <m2le4vw264.fsf@HIDDEN>
 <CAOA-32N0JiaEYUih_itnT96pMqnUq+jSRZj0+khTEyL0JAW3BA@HIDDEN>
 <m2ttjix5ur.fsf@HIDDEN>
In-Reply-To: <m2ttjix5ur.fsf@HIDDEN>
From: Paul Nelson <ultrono@HIDDEN>
Date: Tue, 30 Apr 2024 17:10:20 +0200
Message-ID: <CAOA-32Om7iQm0FMMko0xXCBw0ikEo5wsriOaAMxH0dMYjVeYVA@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
To: Arash Esbati <arash@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

> --8<---------------cut here---------------start------------->8---
> diff --git a/tex-fold.el b/tex-fold.el
> index 62f0834c..cb0f4592 100644
> --- a/tex-fold.el
> +++ b/tex-fold.el
> @@ -910,6 +910,11 @@ See `TeX-fold-auto-reveal' for definitions of MODE."
>  Return non-nil if called by one of the commands in LIST."
>    (memq this-command list))
>
> +(defvar-local TeX-fold-auto-reveal-external-commands nil
> +  "List of external commands which may cause a fold to be revealed.
> +This is list is intended for external packages where they can add their
> +functions to.")
> +
>  ;; Copy and adaption of `reveal-post-command' from reveal.el in GNU
>  ;; Emacs on 2004-07-04.
>  (defun TeX-fold-post-command ()
> @@ -932,7 +937,8 @@ Return non-nil if called by one of the commands in LIST."
>                (setq TeX-fold-open-spots (cdr spots))
>                (when (or disable-point-adjustment
>                          global-disable-point-adjustment
> -                        (TeX-fold-auto-reveal-p TeX-fold-auto-reveal))
> +                        (TeX-fold-auto-reveal-p TeX-fold-auto-reveal)
> +                        (TeX-fold-auto-reveal-p TeX-fold-auto-reveal-external-commands))
>                  ;; Open new overlays.
>                  (dolist (ol (nconc (when (and TeX-fold-unfold-around-mark
>                                                (TeX-active-mark))
> --8<---------------cut here---------------end--------------->8---
>
> So we don't touch `TeX-fold-auto-reveal' and just check if
> `TeX-fold-auto-reveal-external-commands' contains code, just like
> `TeX-fold-auto-reveal'.  WDYT?

This would need a bit of tweaking (since TeX-fold-auto-reveal doesn't
accept a list argument), but assuming that tweak:

I think with most use cases (including mine), there's no functional
difference between this last proposal and the original patch.  The
comparison, as I see it, is that this last proposal
(1) uses defvar-local rather than defcustom, and
(2) hard-codes the "external-commands" alternative.

My reason for preferring the alternative to (1) is that users might
wish to add their own navigation-based commands, so making it a
defcustom would improve discoverability.  Also, I don't foresee
defvar-local giving an advantage over defvar here, but might have
missed something.

For (2), I didn't want to deny the user of the flexibility that they
currently enjoy, where they could customize the reveal behavior to
depend upon the moon cycle.

Finally, I'll remark that I planned to submit a follow-up patch to
this one slightly expanding the default collection of reveal commands
(adding #'undo and #'pop-to-mark-command).

Do you see an advantage to modifying the behavior of the function
rather than the default customization value?

Thanks, best,

Paul




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 30 Apr 2024 14:50:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 10:50:37 2024
Received: from localhost ([127.0.0.1]:59780 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1ooX-0004R7-7X
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 10:50:37 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:50236)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arash@HIDDEN>) id 1s1ooV-0004R0-D2
 for 70525 <at> debbugs.gnu.org; Tue, 30 Apr 2024 10:50:36 -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 <arash@HIDDEN>)
 id 1s1oo3-00059X-Ke; Tue, 30 Apr 2024 10:50:08 -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=U9qlkhy2I1BAWSag0MFAVKBcsv/MHyoMy/8O1qu0Koc=; b=T5FESyvQ3bQl58XXxf8m
 bYpQR7yacJx41nA0zeIt2G8fAL04WshNft0wsp6rnYVAPS+B61qIvMBSwqkX9ZiSfKmb47HKlTn3E
 QnCMronqReZNO8vns+qIjjiKC6zd1DDYZr4dTbuDHtxrQaVLwL/0m5nBi96G2XKXKX2pYY088jTSa
 u1vRWBmz2RshP+rbMjgx+jT8Gj/enAGF8W8yxPxyxWbPy5vjJV1EIxe/bN+x4l0zahwtu3zr7lDMp
 G/1xBJ6kgvRLTWjHnWgrk8MUq/IgKmzLkkd68jWqStxycMec1wpJsyNN6gfSwe5DtkYgLL4fF9uAr
 441ndwIbz4kG+g==;
From: Arash Esbati <arash@HIDDEN>
To: Paul Nelson <ultrono@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
In-Reply-To: <CAOA-32N0JiaEYUih_itnT96pMqnUq+jSRZj0+khTEyL0JAW3BA@HIDDEN>
 (Paul Nelson's message of "Tue, 30 Apr 2024 16:12:31 +0200")
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 <m2ttjjwcxn.fsf@HIDDEN>
 <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
 <m2plu7w9cg.fsf@HIDDEN>
 <CAOA-32P4yBz7WZ++P-7Anv-ErcWWjNgrK_e6e7ekw3X3_Jq_hQ@HIDDEN>
 <m2le4vw264.fsf@HIDDEN>
 <CAOA-32N0JiaEYUih_itnT96pMqnUq+jSRZj0+khTEyL0JAW3BA@HIDDEN>
Date: Tue, 30 Apr 2024 16:50:04 +0200
Message-ID: <m2ttjix5ur.fsf@HIDDEN>
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: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Paul Nelson <ultrono@HIDDEN> writes:

> I don't see how this helps.  We can't add commands as additional
> arguments to the user-provided my-cool-function, because we don't know
> its semantics.  (Maybe it only takes two arguments, and maybe those
> arguments are strings or the time of day or the moon cycle rather than
> commands that should be compared against this-command.)

You're a tough customer ;-)  What about this approach:

--8<---------------cut here---------------start------------->8---
diff --git a/tex-fold.el b/tex-fold.el
index 62f0834c..cb0f4592 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -910,6 +910,11 @@ See `TeX-fold-auto-reveal' for definitions of MODE."
 Return non-nil if called by one of the commands in LIST."
   (memq this-command list))

+(defvar-local TeX-fold-auto-reveal-external-commands nil
+  "List of external commands which may cause a fold to be revealed.
+This is list is intended for external packages where they can add their
+functions to.")
+
 ;; Copy and adaption of `reveal-post-command' from reveal.el in GNU
 ;; Emacs on 2004-07-04.
 (defun TeX-fold-post-command ()
@@ -932,7 +937,8 @@ Return non-nil if called by one of the commands in LIST."
               (setq TeX-fold-open-spots (cdr spots))
               (when (or disable-point-adjustment
                         global-disable-point-adjustment
-                        (TeX-fold-auto-reveal-p TeX-fold-auto-reveal))
+                        (TeX-fold-auto-reveal-p TeX-fold-auto-reveal)
+                        (TeX-fold-auto-reveal-p TeX-fold-auto-reveal-external-commands))
                 ;; Open new overlays.
                 (dolist (ol (nconc (when (and TeX-fold-unfold-around-mark
                                               (TeX-active-mark))
--8<---------------cut here---------------end--------------->8---

So we don't touch `TeX-fold-auto-reveal' and just check if
`TeX-fold-auto-reveal-external-commands' contains code, just like
`TeX-fold-auto-reveal'.  WDYT?

Best, Arash




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 30 Apr 2024 14:13:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 10:13:12 2024
Received: from localhost ([127.0.0.1]:59625 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1oEJ-00041B-TI
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 10:13:12 -0400
Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]:55451)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@HIDDEN>) id 1s1oEH-000415-7u
 for 70525 <at> debbugs.gnu.org; Tue, 30 Apr 2024 10:13:11 -0400
Received: by mail-il1-x133.google.com with SMTP id
 e9e14a558f8ab-36c5eedd124so1183135ab.2
 for <70525 <at> debbugs.gnu.org>; Tue, 30 Apr 2024 07:12:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714486363; x=1715091163; darn=debbugs.gnu.org;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:from:to:cc:subject:date
 :message-id:reply-to;
 bh=tOkrW5hAsmwf5AwqkDzttTCOZsauAvKeOQE0IvYjyX4=;
 b=XCsfyQ4A941dwM39AopcJeAwHoJgSIjqscL0fQU9+PpdZC2xDZsYeqGeHyP+VW8rlC
 D/Lc5OvqoDcMXWn3tgqclHicIk5HKi7NI9hE4t5xl9GwDhYOUeScXKmL6e3CUDVmNXFj
 1FYxGri9woigZOLuTBxpBuIUFhm/vBMkFTIarlDtSwSpJyysQqlbLu0h1+Ws4gk7Kmda
 HnXVDIJRqRLFLj0nGvLu3WkTmtsi+r9MU5blhQSvoRdkUVG2OYbJxtkC+xXR4YdqEAAr
 DjiHUmOsgdQdRpcGx8066odM1kLNewwCu9sm0G1LvCk6sGmwDMMuBV9J/X5hyMRge2If
 B/Lw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714486363; x=1715091163;
 h=content-transfer-encoding:cc:to:subject:message-id:date:from
 :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc
 :subject:date:message-id:reply-to;
 bh=tOkrW5hAsmwf5AwqkDzttTCOZsauAvKeOQE0IvYjyX4=;
 b=mYOdWrNb3PeVEFaGmXHFHlaUjnSERGlmw1Q6eMkmu9mf45SsZ4EQlJXuTeblVMuyHO
 4AINugtfQon//ttN2wSB7TlwyZvB0Tx7vWHhtd8ZWDUXxoOuvTm+jh4FJqw+vw472WnY
 oRmc5aafqOBnryJu8xGv5uBomTG6ItytRnLP4n9Ig/S1Wz1I1G0qctGTdBjQEmen14wF
 XR7zoDQKeEP3lu3QpNUoluM2Mpn+emGO3TYbSk9JLL/lrQExMXWiz6rMWcnvfRLnYeSJ
 FybgtH7F2ruJlrBKv4xtIM+MoCgMHFYmgRp7rN/JlDNwkagbVqLhtLJtWBKUI7Kqd8ID
 vaog==
X-Gm-Message-State: AOJu0YxhlvyE12IzJ2ABT40r7VI/SeRICHAc/AXHdRJ/lN0Asrc6qyZt
 Iik8Lhn89uQoHjI77f9edpFPjM6YHULIDkhzsmMRKP71CC1mnUxLsFrh4k82gj222YYr+1AQR53
 6NRqHiWZuwpn77cZ6uXlD/eSH5SRsjl66
X-Google-Smtp-Source: AGHT+IH3xXbIWDKTwWPp8aFX5DNRHFufAYsc3VlapG1b7zUAYMYXi7tlleiNfaHAciSOHIdac8b91JUdWCqXHAhVCUY=
X-Received: by 2002:a05:6e02:160a:b0:369:940b:2cd4 with SMTP id
 t10-20020a056e02160a00b00369940b2cd4mr19106620ilu.5.1714486362748; Tue, 30
 Apr 2024 07:12:42 -0700 (PDT)
MIME-Version: 1.0
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 <m2ttjjwcxn.fsf@HIDDEN>
 <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
 <m2plu7w9cg.fsf@HIDDEN>
 <CAOA-32P4yBz7WZ++P-7Anv-ErcWWjNgrK_e6e7ekw3X3_Jq_hQ@HIDDEN>
 <m2le4vw264.fsf@HIDDEN>
In-Reply-To: <m2le4vw264.fsf@HIDDEN>
From: Paul Nelson <ultrono@HIDDEN>
Date: Tue, 30 Apr 2024 16:12:31 +0200
Message-ID: <CAOA-32N0JiaEYUih_itnT96pMqnUq+jSRZj0+khTEyL0JAW3BA@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
To: Arash Esbati <arash@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

(Sorry Arash, I noticed just now that I forgot to reply-all)

On Tue, Apr 30, 2024 at 12:55=E2=80=AFPM Arash Esbati <arash@HIDDEN> wrote=
:
>
> Paul Nelson <ultrono@HIDDEN> writes:
>
> > I think essentially the same criticism applies.  What if the user has
> > customized *-reveal to, say, '(eval (my-cool-function (my-arg-1
> > my-arg-2))), with totally different semantics than the default?  Then
> > the tweaks under "Clause added" would become meaningless.
>
> Well, my answer would be: Don't use `eval' and do
>
>   '(my-cool-function (my-arg-1 my-arg-2))

I don't see how this helps.  We can't add commands as additional
arguments to the user-provided my-cool-function, because we don't know
its semantics.  (Maybe it only takes two arguments, and maybe those
arguments are strings or the time of day or the moon cycle rather than
commands that should be compared against this-command.)


>
> > Is the intent behind your suggestions that you'd like to keep the
> > number of customizable variables low, or something else?
>
> No, I think I'm trying to avoid the case where we introduce a new list
> (custom option) which is probably not needed and we have to deal with it
> only because of that `eval'.  Is that eval actually needed at all?

I suppose the "eval" could be moved from the customization option into
*-reveal-p function, but I don't see what this gains (other than
forcing anyone who has customized this option to adjust their config).

I don't see any way to allow the user to do everything they want (the
current behavior), keep the interface the same, and make the list of
commands easily extensible other than by adding an additional list
variable.  The variable seemed best to me as a customization option,
since the user might wish to add to it in their own config, but could
just as well be a defvar as far as I'm concerned.  Other suggestions
would be welcome.

Thanks, best,

Paul




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 30 Apr 2024 10:55:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 06:55:34 2024
Received: from localhost ([127.0.0.1]:59362 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1l93-0004Mx-Uw
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 06:55:34 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40980)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arash@HIDDEN>) id 1s1l91-0004Mp-4T
 for 70525 <at> debbugs.gnu.org; Tue, 30 Apr 2024 06:55:33 -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 <arash@HIDDEN>)
 id 1s1l8Z-00017b-J3; Tue, 30 Apr 2024 06:55:03 -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=WvDRp7aAiN1mjQulDqNqEtuLAlnYoLsfJyOtdomYLgk=; b=phUeMTOuIhzyVags924S
 HPeX5Y/9iJXVNvWbjWk5KweuJeBPR9gza4J2iDfaI9KX9ecpYEjPb1u3LtgcW7ndjnbPb9eBT+aZ1
 yeTSSzENHgNsTuCnRF+R4EU6O7EpeiwiFN7xRFAPTp1sXgxxqgB9wrDoCE53ANjIPzXnim+RttIka
 wc0187/KolaIheJlmYShc+1vQEgeBXYz4v1/aksGJuW3EWo5LmiMSMHi9wm1YzCo0+awWo7i66boy
 4N5+tpOyaypP7tWxJRgJW6eGGJVXXIa+0CmOnZcGuJLPWngrSWG1e6e53Ir3C8w5ckPatWgm3Z4/X
 EdOir9TXsTqGVA==;
From: Arash Esbati <arash@HIDDEN>
To: Paul Nelson <ultrono@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
In-Reply-To: <CAOA-32P4yBz7WZ++P-7Anv-ErcWWjNgrK_e6e7ekw3X3_Jq_hQ@HIDDEN>
 (Paul Nelson's message of "Tue, 30 Apr 2024 10:32:35 +0200")
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 <m2ttjjwcxn.fsf@HIDDEN>
 <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
 <m2plu7w9cg.fsf@HIDDEN>
 <CAOA-32P4yBz7WZ++P-7Anv-ErcWWjNgrK_e6e7ekw3X3_Jq_hQ@HIDDEN>
Date: Tue, 30 Apr 2024 12:54:59 +0200
Message-ID: <m2le4vw264.fsf@HIDDEN>
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: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Paul Nelson <ultrono@HIDDEN> writes:

> I think essentially the same criticism applies.  What if the user has
> customized *-reveal to, say, '(eval (my-cool-function (my-arg-1
> my-arg-2))), with totally different semantics than the default?  Then
> the tweaks under "Clause added" would become meaningless.

Well, my answer would be: Don't use `eval' and do

  '(my-cool-function (my-arg-1 my-arg-2))

> Is the intent behind your suggestions that you'd like to keep the
> number of customizable variables low, or something else?

No, I think I'm trying to avoid the case where we introduce a new list
(custom option) which is probably not needed and we have to deal with it
only because of that `eval'.  Is that eval actually needed at all?

Best, Arash




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 30 Apr 2024 08:33:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 04:33:15 2024
Received: from localhost ([127.0.0.1]:59211 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1ivL-0002sw-6e
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 04:33:15 -0400
Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]:57751)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@HIDDEN>) id 1s1ivJ-0002sq-6j
 for 70525 <at> debbugs.gnu.org; Tue, 30 Apr 2024 04:33:13 -0400
Received: by mail-il1-x12e.google.com with SMTP id
 e9e14a558f8ab-36c50653eb6so7915705ab.3
 for <70525 <at> debbugs.gnu.org>; Tue, 30 Apr 2024 01:32:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714465967; x=1715070767; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=tjFMdiHX3HvI2h4SjfUhvnIp4K6O75FN47jypboJkK0=;
 b=aqSc2HDDpUqJpzQWsYOIFRuAYerMt30C++LyxWRTM4fMs2CkjT4yM8tvjdbo81FBB/
 M9BLmbqk6erG2NP290l3KV1bXgKFf61BIkgeCzI1iTo8XNCPU8Igr60waz6hR3BWXRaA
 hDaOKVyPBN5dirJ6OZTT/W51quWssBBvYDjcg+jDjQRF052fxVrJvTA+U6I8hOtSorD9
 rOQwz5hgE+hC29I70NOOv5OWPLx7bxJNdrImo9roQakAeXgrk49muMlxTmc2Ri88cv0K
 yyiXfG77V5l/NNYjP4gn1fLar+Q/0BbE786wTNldcmaGooE8mz5yKU58LUYw3La4+zQQ
 M0IQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714465967; x=1715070767;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=tjFMdiHX3HvI2h4SjfUhvnIp4K6O75FN47jypboJkK0=;
 b=m4eyUS9Pu6lnUOc+NzkbLp+t/ESPRCULZ3wZtOpQD+a7NUH60qHaOFEhfuJ0kQ1FDW
 9FT1bWgjaa2O5TYxEWmu9Y2JZENMa8Yl2uaK7frEVBQ0XnUpdTKPBfrJb0yWLAmmZANA
 6LRqWuiEC+TjEnNA2haQ5kLHUrWngmCSLFtZhZ3yOzow7+cY4H65amN2hYmWe1yLUNsH
 /QtrgNpitnZYeGssazTfRh5PMtfUDlmlqD5tKspg0eTlrmadRt/LXJjlRpB0WGpx5iCV
 jfrahY1EueznSezFP/UFfKpgFE0t4QGc2FtRmzm/sfFV6MaagruM4wCtqykjnm5HM6cv
 iULw==
X-Gm-Message-State: AOJu0YxcRHVh7kIXEYh7zFt+MBZGWq2yu4UMu6fgsdD7vO+6ybszs9fX
 QQLDD26/jgpZ/RrFamd8vnMcvOfAnMbXig4ZHq3fhjhPf7mIFNMF0stK2xytO2p+q2m2Mhsrhza
 aNptsoX3XJcvJ4lrVob27W8peCwc=
X-Google-Smtp-Source: AGHT+IHW/aAqcH4/WOjC53CSiJfe1pya8Jlsfj6HHGApqTwumHxLfEaddjE3T/Bovo3zEJyHxiYlbrOZE1X8g+SniQQ=
X-Received: by 2002:a05:6e02:12ca:b0:36b:fffc:73bb with SMTP id
 i10-20020a056e0212ca00b0036bfffc73bbmr15093006ilm.7.1714465966853; Tue, 30
 Apr 2024 01:32:46 -0700 (PDT)
MIME-Version: 1.0
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 <m2ttjjwcxn.fsf@HIDDEN>
 <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
 <m2plu7w9cg.fsf@HIDDEN>
In-Reply-To: <m2plu7w9cg.fsf@HIDDEN>
From: Paul Nelson <ultrono@HIDDEN>
Date: Tue, 30 Apr 2024 10:32:35 +0200
Message-ID: <CAOA-32P4yBz7WZ++P-7Anv-ErcWWjNgrK_e6e7ekw3X3_Jq_hQ@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
To: Arash Esbati <arash@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Arash,

> --8<---------------cut here---------------start------------->8---
> (defun TeX-fold-auto-reveal-p (mode)
>   "Decide whether to auto-reveal.
> Return non-nil if folded region should be auto-opened.
> See `TeX-fold-auto-reveal' for definitions of MODE."
>   (cond ((symbolp mode)
>          (and (boundp mode)
>               (symbol-value mode)))
>         ;; Clause modified:
>         ((and (consp mode)
>               (null TeX-fold-auto-reveal-external-commands))
>          (apply (car mode) (cdr mode)))
>         ;; Clause added:
>         ((and (consp mode) TeX-fold-auto-reveal-external-commands)
>          (if (eq (car mode) #'eval)
>              (apply (car mode) (cons (caadr mode)
>                                      (append TeX-fold-auto-reveal-external-commands
>                                              (cdadr mode))))
>            (apply (car mode) (append TeX-fold-auto-reveal-external-commands
>                                      (cdr mode)))))
>         (t mode)))
> --8<---------------cut here---------------end--------------->8---

I think essentially the same criticism applies.  What if the user has
customized *-reveal to, say, '(eval (my-cool-function (my-arg-1
my-arg-2))), with totally different semantics than the default?  Then
the tweaks under "Clause added" would become meaningless.

Is the intent behind your suggestions that you'd like to keep the
number of customizable variables low, or something else?

Thanks, best,

Paul




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 30 Apr 2024 08:20:36 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 04:20:36 2024
Received: from localhost ([127.0.0.1]:59186 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1ij5-0002kw-VP
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 04:20:36 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:49252)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arash@HIDDEN>) id 1s1ij2-0002kp-II
 for 70525 <at> debbugs.gnu.org; Tue, 30 Apr 2024 04:20:34 -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 <arash@HIDDEN>)
 id 1s1iic-0002ej-MK; Tue, 30 Apr 2024 04:20:06 -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=xDNeTrmonT+Qw7jXfHkZsiMRC/AL3xJ0H0OGWGZbunc=; b=GYPkYYZqXOHn7j8pEYB6
 d8nTlBdl6fmUJhs6rKMNZPYd+4vHEoynP3CsfE4L3T3dRRcB0FhSZnN/lrBIA42sng8gYKT8Q6Szw
 ZcwWODIkJcnzh5copqYdgkshfLgLqUZLgFnCZIG3WpqMls54wBdTahLanjhyw1qY4q/EJgHaZFe3H
 09mC1E16Bxjsjruesre/nNwLUI2JmiNAo4wsxZj4KlylV9HYLYoINquHHxptcCUEyxArkn9iMLn2s
 qPCRQSH/bzxNHDe+NyAYKp3OuG6t9ZLFv2qCLLsgY9bz6QK6IPSxrkiB+pjj5zUN0rHG/a/BasjRu
 3h+WZ9pq6sOojQ==;
From: Arash Esbati <arash@HIDDEN>
To: Paul Nelson <ultrono@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
In-Reply-To: <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
 (Paul Nelson's message of "Tue, 30 Apr 2024 09:29:59 +0200")
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 <m2ttjjwcxn.fsf@HIDDEN>
 <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
Date: Tue, 30 Apr 2024 10:19:59 +0200
Message-ID: <m2plu7w9cg.fsf@HIDDEN>
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: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Paul Nelson <ultrono@HIDDEN> writes:

> Currently, the user is promised that if *-reveal is a cons cell, then
> *-reveal-p determines whether to reveal or not by applying CAR to CDR.
> With the proposal in your email, it seems to me that that promise is
> invalidated: the "Clause Added" branch in your proposal would behave
> in strange ways when TeX-fold-auto-reveal-external-commands is non-nil
> and *-reveal is not of the same pattern as the default (in particular,
> its CDR should be a list of commands).  Conceivably some users have
> customized this variable in other ways while keeping it a cons cell.

I saw that, I think the issue is usage of `eval' in the default :-(
What about this?

--8<---------------cut here---------------start------------->8---
(defun TeX-fold-auto-reveal-p (mode)
  "Decide whether to auto-reveal.
Return non-nil if folded region should be auto-opened.
See `TeX-fold-auto-reveal' for definitions of MODE."
  (cond ((symbolp mode)
         (and (boundp mode)
              (symbol-value mode)))
        ;; Clause modified:
        ((and (consp mode)
              (null TeX-fold-auto-reveal-external-commands))
         (apply (car mode) (cdr mode)))
        ;; Clause added:
        ((and (consp mode) TeX-fold-auto-reveal-external-commands)
         (if (eq (car mode) #'eval)
             (apply (car mode) (cons (caadr mode)
                                     (append TeX-fold-auto-reveal-external-commands
                                             (cdadr mode))))
           (apply (car mode) (append TeX-fold-auto-reveal-external-commands
                                     (cdr mode)))))
        (t mode)))
--8<---------------cut here---------------end--------------->8---

Best, Arash




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 30 Apr 2024 07:30:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 03:30:41 2024
Received: from localhost ([127.0.0.1]:59159 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1hwm-0002FJ-SW
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 03:30:41 -0400
Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]:55615)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@HIDDEN>) id 1s1hwk-0002FC-3C
 for 70525 <at> debbugs.gnu.org; Tue, 30 Apr 2024 03:30:39 -0400
Received: by mail-oo1-xc33.google.com with SMTP id
 006d021491bc7-5ad2da2196bso2963064eaf.3
 for <70525 <at> debbugs.gnu.org>; Tue, 30 Apr 2024 00:30:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714462212; x=1715067012; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=+epFYpzbzBzuV7jCGvbbl7KaPPbz70AAZfypIvX+DcE=;
 b=ZqtAJ2OJfwxjKFtffxejtKRbwvSzt9ml02RcEifi2HPMSqsO3E1qawZukyuy8bEYJc
 nyIdNS6hu+586l23sVlfAKplQDVYPFO3n5Q5uZgF/1F5t5Iq5P3y6VQHF/m3JU1KrKV6
 OmrOCH3DV8ucjKgOOaDPnlJRLpa3zbq7ZgigX0tu8S0zaKHciSYMPhAFpGdyDf97QLpk
 RUnDtlfCo5nzpnhF70TG7KbsDckzHRysuJbibsvUEcvYHT6bkyzlqndiQkLDQdBejVvc
 gl55R+qKKiiao2meVqutJHuXfnxJz+LPj+X3nqjgirQdEmWJKEneOlXzxh7uhZ3+MJpE
 rZbQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714462212; x=1715067012;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=+epFYpzbzBzuV7jCGvbbl7KaPPbz70AAZfypIvX+DcE=;
 b=QFhQBzfjRllOidpDNWfMg3UVE1PACkox7C2ZQALjtPvv+z3niSpz1+oGnQJgwJ8SKn
 0ZkhfgxYMEUQuFAFkswiEQByFezITtbmW2sMPbpdyzu81fJXrxP7XjUeolvn/CZD7j84
 yJdBG9l7ONMcpwLES3y+2d4tcYMaBw4vWEUVucaLqIURrM4uzNZ5XyAP+F/bLJ3shYEV
 NUGFZ/0j252oUf0bZJSb3dzN6g8lCJWSnb4WRpdWS16w/SPw+guCIQ/kuDqUlTY049A/
 cEaFupsIfF/SG/tevMvqo/R2rau6QFPYH2jwAI6QE738gPivk9j/PlmGXHz27hCmkJI/
 +mJw==
X-Gm-Message-State: AOJu0Yyno8rBXT29vOBNAtkiaUXDNuA+tup3J73RzrYIlLKE1S8uIUD3
 z1JriK3GcpgNUojit0u02WxvIVF5RvBakfpAQ0CnOz8bsr2jVKxUVwyLPx6rZqCrZREYkQM2Y/G
 4oGZciitPVol66OYM/BafoWvMkiZTfdY6
X-Google-Smtp-Source: AGHT+IGKlmX4LNdhm0enFwACZCQZwhySdTG0uDq/3dT+TzdbtxNNFYmsNc9G0ddo7ir4QkbmSU8hytTaAVG31gqM96A=
X-Received: by 2002:a05:6870:2055:b0:229:e6c6:1f13 with SMTP id
 l21-20020a056870205500b00229e6c61f13mr14889756oad.14.1714462211793; Tue, 30
 Apr 2024 00:30:11 -0700 (PDT)
MIME-Version: 1.0
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 <m2ttjjwcxn.fsf@HIDDEN>
In-Reply-To: <m2ttjjwcxn.fsf@HIDDEN>
From: Paul Nelson <ultrono@HIDDEN>
Date: Tue, 30 Apr 2024 09:29:59 +0200
Message-ID: <CAOA-32Mp-BuKU_v0bHFNpX9321wfS15VcO7Ss0-Qu6yBR2gB4A@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
To: Arash Esbati <arash@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Arash,

> Thanks.  In this case, I think we can have a sort of API by patching the
> function `TeX-fold-auto-reveal-p' and declaring a standard var like this:
>
> --8<---------------cut here---------------start------------->8---
> (defvar-local TeX-fold-auto-reveal-external-commands nil
>   "List of external commands which may cause a fold to be revealed.
> This is list is intended for external packages ...")
>
> (defun TeX-fold-auto-reveal-p (mode)
>   "Decide whether to auto-reveal.
> Return non-nil if folded region should be auto-opened.
> See `TeX-fold-auto-reveal' for definitions of MODE."
>   (cond ((symbolp mode)
>          (and (boundp mode)
>               (symbol-value mode)))
>         ;; Clause modified:
>         ((and (consp mode)
>               (null TeX-fold-auto-reveal-external-commands))
>          (apply (car mode) (cdr mode)))
>         ;; Clause added:
>         ((and (consp mode) TeX-fold-auto-reveal-external-commands)
>          (apply (car mode) (cons (caadr mode)
>                                  (append TeX-fold-auto-reveal-external-commands
>                                          (cdadr mode)))))
>         (t mode)))
> --8<---------------cut here---------------end--------------->8---
>
> Does this make sense?  The question would then be: Should
> `TeX-fold-auto-reveal-external-commands' be a regualar var or a custom
> one?

Currently, the user is promised that if *-reveal is a cons cell, then
*-reveal-p determines whether to reveal or not by applying CAR to CDR.
With the proposal in your email, it seems to me that that promise is
invalidated: the "Clause Added" branch in your proposal would behave
in strange ways when TeX-fold-auto-reveal-external-commands is non-nil
and *-reveal is not of the same pattern as the default (in particular,
its CDR should be a list of commands).  Conceivably some users have
customized this variable in other ways while keeping it a cons cell.

With my patch, I wanted to keep the existing interface the same, so
that nobody would need to update their config (unless they have
already explicitly customized *-reveal and choose to install a package
that introduces commands that would make sense to include there, in
which case they presumably know what they're doing and can add such
commands on their own), but the default behavior would improve with
external packages.

Happy to discuss further.

Thanks, best,

Paul




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 30 Apr 2024 07:03:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 30 03:03:03 2024
Received: from localhost ([127.0.0.1]:59130 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1hW3-0001zX-IO
	for submit <at> debbugs.gnu.org; Tue, 30 Apr 2024 03:03:03 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51290)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arash@HIDDEN>) id 1s1hVy-0001zA-Jt
 for 70525 <at> debbugs.gnu.org; Tue, 30 Apr 2024 03:03:02 -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 <arash@HIDDEN>)
 id 1s1hVY-0006am-OK; Tue, 30 Apr 2024 03:02:32 -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=ZuNLV4iJ8DMRUDyudlUCp3kxy3NuzB/W9E5PFrk0eNI=; b=eXVYsLLrGpuBog5vw3K6
 /c6QiWxjaXtXp+ewnMHu9jFhqV6128C4+H3NZA0oQfNs2PdQVDzk0f/y96A8gVh6AQJXMvc7wwk/S
 oudIFPAVr37nushT9XhrHRqXKsfs62DR0clGms37YJoZq8UX0lFfkATbpJQke6SPOOyEn3X+AFZd6
 dkTZsYFi/Ej3PmUr/ZAMBjpm3GTqpcENZYhrw1rb1u7exZfiXmAr6AOytv70HMlnFwMEeoTnOGTKF
 hUHBLgf1e5BeCLVqnVrgIxStF9hT6LJYS+qFOCVpovSx9urvnWQ4fKA2ExThbFSk/7EsgG1ZXXA+6
 nNNbHkHqIOcvrg==;
From: Arash Esbati <arash@HIDDEN>
To: Paul Nelson <ultrono@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
In-Reply-To: <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
 (Paul Nelson's message of "Mon, 29 Apr 2024 14:24:51 +0200")
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
 <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
Date: Tue, 30 Apr 2024 09:02:28 +0200
Message-ID: <m2ttjjwcxn.fsf@HIDDEN>
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: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Hi Paul,

Paul Nelson <ultrono@HIDDEN> writes:

> I think what you describe is indeed the plan, but I'll elaborate just
> in case.  I had in mind that external packages would add to
> *-reveal-commands via setup functions, with lines such as
>
>   (add-to-list 'preview-auto-reveal-commands #'tex-parens-down-list)
>
> Users can similarly add their own commands in their own config.  This
> is simpler than adding to the internals of the lisp form in the
> current default value of *-reveal.
>
> Of course, this is only for users who use the default setting.  Other
> users can continue to customize the *-reveal behavior however they
> prefer.

Thanks.  In this case, I think we can have a sort of API by patching the
function `TeX-fold-auto-reveal-p' and declaring a standard var like this:

--8<---------------cut here---------------start------------->8---
(defvar-local TeX-fold-auto-reveal-external-commands nil
  "List of external commands which may cause a fold to be revealed.
This is list is intended for external packages ...")

(defun TeX-fold-auto-reveal-p (mode)
  "Decide whether to auto-reveal.
Return non-nil if folded region should be auto-opened.
See `TeX-fold-auto-reveal' for definitions of MODE."
  (cond ((symbolp mode)
         (and (boundp mode)
              (symbol-value mode)))
        ;; Clause modified:
        ((and (consp mode)
              (null TeX-fold-auto-reveal-external-commands))
         (apply (car mode) (cdr mode)))
        ;; Clause added:
        ((and (consp mode) TeX-fold-auto-reveal-external-commands)
         (apply (car mode) (cons (caadr mode)
                                 (append TeX-fold-auto-reveal-external-commands
                                         (cdadr mode)))))
        (t mode)))
--8<---------------cut here---------------end--------------->8---

Does this make sense?  The question would then be: Should
`TeX-fold-auto-reveal-external-commands' be a regualar var or a custom
one?

> I'm not sure I understand what you mean when you say "that value is
> used when *-reveal is set".  The value would be used every time the
> lisp form in *-reveal is evaluated by the preview/folding libraries.

Yes, sorry, I should have looked more carefully.  I'm not that familiar
with the code, so bear with me.

Best, Arash




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 29 Apr 2024 12:25:32 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 08:25:32 2024
Received: from localhost ([127.0.0.1]:56976 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1Q4a-0001to-3b
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 08:25:32 -0400
Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]:56346)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@HIDDEN>) id 1s1Q4W-0001tg-NZ
 for 70525 <at> debbugs.gnu.org; Mon, 29 Apr 2024 08:25:29 -0400
Received: by mail-il1-x134.google.com with SMTP id
 e9e14a558f8ab-36a1b0777b7so17653785ab.0
 for <70525 <at> debbugs.gnu.org>; Mon, 29 Apr 2024 05:25:08 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1714393503; x=1714998303; darn=debbugs.gnu.org;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:from:to:cc:subject:date:message-id:reply-to;
 bh=rfXQl7muaaMJCVX5HXIcSyMO2XgOPvwo5jzJwCjhfGc=;
 b=kDRIeYQVxQK3ejGhZy/Gt1rU47mRH5KLHadCq8lbeYaL7bg9cjz7NvfFVqRtqha4p0
 JBIwyLPodrR3OxC5z0rqlM6h452+3MATFI7jMEtTmlnZ7HMktohUnHkPBYiaslpkjdFT
 5y6SmCTfhKHsc4YydBnBA6Abmvu0uTT8EoNGRqtcmy9p4Vn+MMYebr+FLfOnISmRPcr9
 EVScpK2/Q7UqPbI5lRfqpqGwM/BYqAJlv0+cXCA5TtvISVMnR25l51P8dG3JUS+0xwWJ
 3rmfasQkSsGokiTONct6pWMDZM8aEKOMn7CK1NqlAspUFbZ1EX3zCL+yHwhFxJLhum9R
 tG7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1714393503; x=1714998303;
 h=cc:to:subject:message-id:date:from:in-reply-to:references
 :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id
 :reply-to;
 bh=rfXQl7muaaMJCVX5HXIcSyMO2XgOPvwo5jzJwCjhfGc=;
 b=hRCpjD1C3PsEtcnkhnea2JurnZVd9XtUs1FwH79VBRiH5v1cNQrecAixsk5Y/Q8kF1
 W5++wzZbhvCng0MZMz03M6Idcvuqb3IzR5zCG82FQidJgIRHL6cwYIAWWbVMO6UwdGt2
 iXXzfYdbr10cyAUTW9u0zOSinH0XA57VxPqoRLrOWoym46WuXOM3sWdLHYr41AD9bQfR
 D45fcjB/wu3YLKnDSSyKC0vQxZ1/efR2alerw6e+OpICzYdZH725o+iZvi5KqXZ1Q7w6
 cDQIU5a9VbFAFmKYbT0LyDmkf4JbkDjZkClJS9BI5BEn+0a9bxWoSmOuJxJ5P9TZvVFT
 yhIw==
X-Gm-Message-State: AOJu0YwBgixwI0yEyNE/Qejdk1iKb1IaEF1dmi0TeKouGfyPKDjeqYL0
 x9uszyZYvoADYD2rnLVVMmVXIppRuK73fvqRnjLfXMi8wS4qdvT3BEDpRZqzTxNZEFkuelIHNX/
 8qipDYen1n5DEnvp1uMJ89zpQH7vgX992
X-Google-Smtp-Source: AGHT+IG4+ScV4tcMrrFk85vVUHQ4y2QNhccisLQbW4kpqtqaB3FBMsxNS7v/6zvEZCut0NgBpSoVeNq2sKfqqiOp3oc=
X-Received: by 2002:a05:6e02:12eb:b0:36c:2b26:5ac4 with SMTP id
 l11-20020a056e0212eb00b0036c2b265ac4mr12834319iln.0.1714393502837; Mon, 29
 Apr 2024 05:25:02 -0700 (PDT)
MIME-Version: 1.0
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 <m2bk5sv6hx.fsf@HIDDEN>
In-Reply-To: <m2bk5sv6hx.fsf@HIDDEN>
From: Paul Nelson <ultrono@HIDDEN>
Date: Mon, 29 Apr 2024 14:24:51 +0200
Message-ID: <CAOA-32NXMu5ffYCDXvCbK8-J1GtdR5On+ar_RX-4883kbaO=LQ@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
To: Arash Esbati <arash@HIDDEN>
Content-Type: text/plain; charset="UTF-8"
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Hi Arash,

> thanks for the patch.  I have one question: You suggest we introduce a
> new custom option `TeX-fold-auto-reveal-commands' which will be used in
> another custom option `TeX-fold-auto-reveal' in the setter?  Is the plan
> that users add functions provided by external packages to
> `TeX-fold-auto-reveal-commands' and then that value is used when
> `TeX-fold-auto-reveal' is set?  Basically this hunk:
>
> > diff --git a/tex-fold.el b/tex-fold.el
> > index 62f0834c..4f4ee377 100644
> > --- a/tex-fold.el
> > +++ b/tex-fold.el
> > @@ -257,10 +257,19 @@ After that, changing the prefix key requires manipulating keymaps."
> >      (define-key map "i"    #'TeX-fold-clearout-item)
> >      map))
> >
> > +(defcustom TeX-fold-auto-reveal-commands
> > +  '((key-binding [left])
> > +    (key-binding [right])
> > +    backward-char
> > +    forward-char
> > +    mouse-set-point)
> > +  "List of commands that may cause a fold to be revealed.
> > +This list is consulted by the default value of `TeX-fold-auto-reveal'."
> > +  :type '(repeat (choice (function :tag "Function")
> > +                         (sexp :tag "Key binding"))))
> > +
> >  (defcustom TeX-fold-auto-reveal
> > -  '(eval (TeX-fold-arrived-via (key-binding [left]) (key-binding [right])
> > -                               #'backward-char #'forward-char
> > -                               #'mouse-set-point))
> > +  '(eval (apply 'TeX-fold-arrived-via TeX-fold-auto-reveal-commands))
>

I think what you describe is indeed the plan, but I'll elaborate just
in case.  I had in mind that external packages would add to
*-reveal-commands via setup functions, with lines such as

  (add-to-list 'preview-auto-reveal-commands #'tex-parens-down-list)

Users can similarly add their own commands in their own config.  This
is simpler than adding to the internals of the lisp form in the
current default value of *-reveal.

Of course, this is only for users who use the default setting.  Other
users can continue to customize the *-reveal behavior however they
prefer.

I'm not sure I understand what you mean when you say "that value is
used when *-reveal is set".  The value would be used every time the
lisp form in *-reveal is evaluated by the preview/folding libraries.

Thanks, best,

Paul




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at 70525 <at> debbugs.gnu.org:


Received: (at 70525) by debbugs.gnu.org; 29 Apr 2024 09:55:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 29 05:55:15 2024
Received: from localhost ([127.0.0.1]:56267 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1s1Nj6-0005gu-A4
	for submit <at> debbugs.gnu.org; Mon, 29 Apr 2024 05:55:15 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:51964)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <arash@HIDDEN>) id 1s1Nj4-0005gk-9M
 for 70525 <at> debbugs.gnu.org; Mon, 29 Apr 2024 05:55:11 -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 <arash@HIDDEN>)
 id 1s1Nie-0002BF-QQ; Mon, 29 Apr 2024 05:54:44 -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=GWFjci83FXxvNtODjt4jqOIIkt0V7L88dyIE+Cg5SJI=; b=EYJ1urZeiEaAf2rC5GOG
 cX5sBjnWiyRcsBorfxPzG2G3LrEvK5oGlpxqSnmjrbiLQXZ0/kNWyV8nrHAqZrbugdPxzd8M6hILR
 nTq3sQoWKSHPOd651j1+ta0U0r5VjmBi5yoT3B3zhtiV/LB26q8+PN+lOtGD1/lN6aXB2nlplV4e3
 9L2tw5f5xIFPVQp29iadxCExeUDPDbnB1Xk1QTRnnPxPvxPn7R5NHmB39uza3OKpdhrbGkF2T20GA
 cuiyXs1cycHr6fasSngZ8KTS+hWLbZhJpdhLWkvA90fm+MatY/zMvjE56He/+79X6ouVOqPI3htvl
 RIFzg2mVVM3VAg==;
From: Arash Esbati <arash@HIDDEN>
To: Paul Nelson <ultrono@HIDDEN>
Subject: Re: bug#70525: [PATCH] Make auto-reveal customizations easier to
 extend
In-Reply-To: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
 (Paul Nelson's message of "Tue, 23 Apr 2024 05:54:51 +0200")
References: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
Date: Mon, 29 Apr 2024 11:54:34 +0200
Message-ID: <m2bk5sv6hx.fsf@HIDDEN>
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: 70525
Cc: 70525 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Paul Nelson <ultrono@HIDDEN> writes:

> External packages (e.g., a couple that I've written) may wish to
> provide navigation commands that automatically reveal previews and
> folds, but auto-reveal behavior is currently controlled by defcustoms,
> such as preview-auto-reveal, that are not easily extended:
>
> (defcustom preview-auto-reveal
>   '(eval (preview-arrived-via (key-binding [left]) (key-binding [right])
>                               #'backward-char #'forward-char))
>   "...")
>
> I attach a patch that addresses this, without affecting default
> behavior, by changing the default value of preview-auto-reveal so that
> it refers to a list, (defcustom preview-auto-reveal-commands).
> Similarly for TeX-fold-auto-reveal.

Hi Paul,

thanks for the patch.  I have one question: You suggest we introduce a
new custom option `TeX-fold-auto-reveal-commands' which will be used in
another custom option `TeX-fold-auto-reveal' in the setter?  Is the plan
that users add functions provided by external packages to
`TeX-fold-auto-reveal-commands' and then that value is used when
`TeX-fold-auto-reveal' is set?  Basically this hunk:

> diff --git a/tex-fold.el b/tex-fold.el
> index 62f0834c..4f4ee377 100644
> --- a/tex-fold.el
> +++ b/tex-fold.el
> @@ -257,10 +257,19 @@ After that, changing the prefix key requires manipulating keymaps."
>      (define-key map "i"    #'TeX-fold-clearout-item)
>      map))
>  
> +(defcustom TeX-fold-auto-reveal-commands
> +  '((key-binding [left])
> +    (key-binding [right])
> +    backward-char
> +    forward-char
> +    mouse-set-point)
> +  "List of commands that may cause a fold to be revealed.
> +This list is consulted by the default value of `TeX-fold-auto-reveal'."
> +  :type '(repeat (choice (function :tag "Function")
> +                         (sexp :tag "Key binding"))))
> +
>  (defcustom TeX-fold-auto-reveal
> -  '(eval (TeX-fold-arrived-via (key-binding [left]) (key-binding [right])
> -                               #'backward-char #'forward-char
> -                               #'mouse-set-point))
> +  '(eval (apply 'TeX-fold-arrived-via TeX-fold-auto-reveal-commands))

'(eval (apply #'TeX-fold-arrived-via TeX-fold-auto-reveal-commands))

?

>    "Predicate to open a fold when entered.
>  Possibilities are:
>  t autoopens,

Best, Arash




Information forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 23 Apr 2024 03:55:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Apr 22 23:55:34 2024
Received: from localhost ([127.0.0.1]:49548 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1rz7Fl-0005ea-VM
	for submit <at> debbugs.gnu.org; Mon, 22 Apr 2024 23:55:34 -0400
Received: from lists.gnu.org ([2001:470:142::17]:44106)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ultrono@HIDDEN>) id 1rz7Fi-0005dL-Hx
 for submit <at> debbugs.gnu.org; Mon, 22 Apr 2024 23:55:32 -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 <ultrono@HIDDEN>) id 1rz7FM-0000vZ-Fr
 for bug-auctex@HIDDEN; Mon, 22 Apr 2024 23:55:08 -0400
Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <ultrono@HIDDEN>) id 1rz7FK-00018I-JH
 for bug-auctex@HIDDEN; Mon, 22 Apr 2024 23:55:08 -0400
Received: by mail-il1-x133.google.com with SMTP id
 e9e14a558f8ab-36b146836d7so19865435ab.3
 for <bug-auctex@HIDDEN>; Mon, 22 Apr 2024 20:55:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20230601; t=1713844504; x=1714449304; darn=gnu.org;
 h=to:subject:message-id:date:from:mime-version:from:to:cc:subject
 :date:message-id:reply-to;
 bh=cevC69HtR/GotN2880XVJ4ysB/XA7p1v/Ywj2Z/QZ4k=;
 b=elv5EZyyLvpi7lXL4Byi8fSbU+jx1bZdfNuWgWQK3XrGJgN74I7G2jxD5VUwCxtdAF
 1mQIEqneIA7kw7GyFO9F4p4sXVOZWdiaT3aKnww/qvfg/bzvT9se2bpIVO0RTk4gwGcn
 +wIXoyjyxJESKNn3UbS5EgA6onZSQO3g9AobbQGSWg+oEkXrtAZtfevEI4grlXBNezP7
 YTdCkRntAgPV2V7Hz5C5Zn8Ln8TPmTQ1zEyCR0N0VlkDQ3moXkxKVoUguh0wjQNWLyHp
 lC73DrM/I75VUg25Foiy11y4QNwIfay+T1etABOiEgLhfv7h3HMwShXrfduB2Arab71X
 Ebtg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20230601; t=1713844504; x=1714449304;
 h=to:subject:message-id:date:from:mime-version:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=cevC69HtR/GotN2880XVJ4ysB/XA7p1v/Ywj2Z/QZ4k=;
 b=FpPcjBz3cRi6ZYokmnVnEQmlrfFP9be+rYqrKaEFm+ESxZff8yPBtg4Nmar2Wpy43b
 k/QYukIHqzFd+Zor2GS8hHFOoyAwEFu+RFIZ1MWTLl+K3FqpsVPIv9kA42e+3L8nhMD5
 Yz8MC07/RwBqRWwGYxqwbLn2ipEoxxGaVqB/G6pqpi//prl8CcvyZba6d/j6hdAwfpAX
 vrpq8nRAyKRc3V0rcRCrK7zYVyfIPaxl/GuMNtWk4FIwxsKKaZNPzgpfciz/1p4Gr9q7
 VArGiTN9VRP8I2NmlhP/RaqDbnm1qE5jxAk9Q2VlUyMLcscom7v+4k+8vCtwnViSROg4
 i6Og==
X-Gm-Message-State: AOJu0YxoaJBPwAhcB6arU7tQNXDdEvhNR30Tm03D2oXDF5Rsx45lty4y
 hhzdR4Cf4SF+47g83yNNQ0DYv0p1BXauMGRKKyuVqbaVYaJuOPFyO4lfdnDJpBKbOUZlqpUDU8c
 qlxs2ECQQWlz/e/F7maByxj4DWjapQi0C
X-Google-Smtp-Source: AGHT+IGqCAepkbyhdQthC2xELiYLgYSbpACel1sI9C49q1BxHFnxT7ReBBwLUQmqdRqYk/KqbWUAI7WSdUNe26lAsm8=
X-Received: by 2002:a05:6e02:12cc:b0:36a:3769:9555 with SMTP id
 i12-20020a056e0212cc00b0036a37699555mr16270405ilm.20.1713844503879; Mon, 22
 Apr 2024 20:55:03 -0700 (PDT)
MIME-Version: 1.0
From: Paul Nelson <ultrono@HIDDEN>
Date: Tue, 23 Apr 2024 05:54:51 +0200
Message-ID: <CAOA-32PbaPMsDur0XoE8K+fTgae0B8qhwJAA__h1j3PDPjnhiA@HIDDEN>
Subject: [PATCH] Make auto-reveal customizations easier to extend
To: bug-auctex@HIDDEN
Content-Type: multipart/mixed; boundary="000000000000db49080616bb8431"
Received-SPF: pass client-ip=2607:f8b0:4864:20::133;
 envelope-from=ultrono@HIDDEN; helo=mail-il1-x133.google.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, 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-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.0 (/)

--000000000000db49080616bb8431
Content-Type: text/plain; charset="UTF-8"

External packages (e.g., a couple that I've written) may wish to
provide navigation commands that automatically reveal previews and
folds, but auto-reveal behavior is currently controlled by defcustoms,
such as preview-auto-reveal, that are not easily extended:

(defcustom preview-auto-reveal
  '(eval (preview-arrived-via (key-binding [left]) (key-binding [right])
                              #'backward-char #'forward-char))
  "...")

I attach a patch that addresses this, without affecting default
behavior, by changing the default value of preview-auto-reveal so that
it refers to a list, (defcustom preview-auto-reveal-commands).
Similarly for TeX-fold-auto-reveal.

Thanks, best,

Paul

--000000000000db49080616bb8431
Content-Type: application/x-patch; 
	name="0001-Make-auto-reveal-customizations-easier-to-extend.patch"
Content-Disposition: attachment; 
	filename="0001-Make-auto-reveal-customizations-easier-to-extend.patch"
Content-Transfer-Encoding: base64
Content-ID: <f_lvbupv9x0>
X-Attachment-Id: f_lvbupv9x0

RnJvbSA2OTc3MmM5NWMwYTBlYjdiNDE3YmJmMWU3ZTVmMjk1YTg4Njg1NzVjIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIE5lbHNvbiA8dWx0cm9ub0BnbWFpbC5jb20+CkRhdGU6
IFR1ZSwgMjMgQXByIDIwMjQgMDU6NDk6MDEgKzAyMDAKU3ViamVjdDogW1BBVENIXSBNYWtlIGF1
dG8tcmV2ZWFsIGN1c3RvbWl6YXRpb25zIGVhc2llciB0byBleHRlbmQKCiogcHJldmlldy5lbC5p
biAocHJldmlldy1hdXRvLXJldmVhbC1jb21tYW5kcyk6IE5ldyB1c2VyIG9wdGlvbi4KKHByZXZp
ZXctYXV0by1yZXZlYWwpOiBVc2UgaXQuCiogdGV4LWZvbGQuZWwgKFRlWC1mb2xkLWF1dG8tcmV2
ZWFsLWNvbW1hbmRzKTogTmV3IHVzZXIgb3B0aW9uLgooVGVYLWZvbGQtYXV0by1yZXZlYWwpOiBV
c2UgaXQuCihkb2MvYXVjdGV4LnRleGkpOiBEb2N1bWVudCBpdC4KLS0tCiBkb2MvYXVjdGV4LnRl
eGkgfCAxMiArKysrKysrKystLS0KIHByZXZpZXcuZWwuaW4gICB8IDEzICsrKysrKysrKysrLS0K
IHRleC1mb2xkLmVsICAgICB8IDE1ICsrKysrKysrKysrKy0tLQogMyBmaWxlcyBjaGFuZ2VkLCAz
MiBpbnNlcnRpb25zKCspLCA4IGRlbGV0aW9ucygtKQoKZGlmZiAtLWdpdCBhL2RvYy9hdWN0ZXgu
dGV4aSBiL2RvYy9hdWN0ZXgudGV4aQppbmRleCA0ZDMzOGMzOS4uMDU2OTVmMGYgMTAwNjQ0Ci0t
LSBhL2RvYy9hdWN0ZXgudGV4aQorKysgYi9kb2MvYXVjdGV4LnRleGkKQEAgLTI4NjQsOSArMjg2
NCwxNSBAQCBDb25zIGNlbGwgQGNvZGV7KEB2YXJ7RlVOQ1RJT059IC4gQHZhcntBUkdVTUVOVFN9
KX06IEBBVUNUZVh7fSBjYWxscyB0aGUKIGlzIHJlZ2FyZGVkIGFzIGEgYm9vbGVhbiBmbGFnLgog
QGVuZCBpdGVtaXplCiAKLUl0IGhhcyBhIHJlYXNvbmFibGUgZGVmYXVsdCB2YWx1ZSB0byByZXZl
YWwgd2hlbiB0aGUgcG9pbnQgZW50ZXJzIHRoZQotZm9sZGVkIHBvcnRpb24gd2l0aCBAa2Jke0Br
ZXl7bGVmdH19LCBAa2Jke0BrZXl7cmlnaHR9fSwgQGtiZHtDLWJ9LAotQGtiZHtDLWZ9IG9yIG1v
dXNlIGNsaWNrIHVuZGVyIHN0YW5kYXJkIGtleSBiaW5kaW5nLgorVGhlIGRlZmF1bHQgYmVoYXZp
b3IgaXMgdG8gcmV2ZWFsIHdoZW4gdGhlIHBvaW50IGVudGVycyB0aGUgZm9sZGVkIHBvcnRpb24K
K3ZpYSBvbmUgb2YgdGhlIGNvbW1hbmRzIHNwZWNpZmllZCBpbiBAY29kZXtUZVgtZm9sZC1hdXRv
LXJldmVhbC1jb21tYW5kc30uCitAZW5kIGRlZm9wdAorCitAZGVmb3B0IFRlWC1mb2xkLWF1dG8t
cmV2ZWFsLWNvbW1hbmRzCitUaGlzIGlzIGEgbGlzdCBvZiBjb21tYW5kcywgY29uc3VsdGVkIHVu
ZGVyIHRoZSBkZWZhdWx0IGJlaGF2aW9yIG9mCitAY29kZXtUZVgtZm9sZC1hdXRvLXJldmVhbH0u
ICBCeSBkZWZhdWx0LCBpdCBjb25zaXN0cyBvZiB0aGUgY29tbWFuZHMKK0BrYmR7QGtleXtsZWZ0
fX0sIEBrYmR7QGtleXtyaWdodH19LCBAa2Jke0MtYn0sIEBrYmR7Qy1mfSBvciBtb3VzZSBjbGlj
awordW5kZXIgc3RhbmRhcmQga2V5IGJpbmRpbmcuCiBAZW5kIGRlZm9wdAogCiAKZGlmZiAtLWdp
dCBhL3ByZXZpZXcuZWwuaW4gYi9wcmV2aWV3LmVsLmluCmluZGV4IDFmNjVmNzI4Li5jZGY3OWNj
NyAxMDA2NDQKLS0tIGEvcHJldmlldy5lbC5pbgorKysgYi9wcmV2aWV3LmVsLmluCkBAIC0xNjM1
LDkgKzE2MzUsMTggQEAgbnVtYmVycyAoY2FuIGJlIGZsb2F0IGlmIGF2YWlsYWJsZSkuIgogRmFs
bGJhY2sgdG8gOmluaGVyaXQgYW5kIFxcPSdkZWZhdWx0IGltcGxlbWVudGVkLiIKICAgOmdyb3Vw
ICdwcmV2aWV3LWFwcGVhcmFuY2UpCiAKKyhkZWZjdXN0b20gcHJldmlldy1hdXRvLXJldmVhbC1j
b21tYW5kcworICAnKChrZXktYmluZGluZyBbbGVmdF0pCisgICAgKGtleS1iaW5kaW5nIFtyaWdo
dF0pCisgICAgYmFja3dhcmQtY2hhcgorICAgIGZvcndhcmQtY2hhcikKKyAgIkxpc3Qgb2YgY29t
bWFuZHMgdGhhdCBtYXkgY2F1c2UgYSBwcmV2aWV3IHRvIGJlIHJldmVhbGVkLgorVGhpcyBsaXN0
IGlzIGNvbnN1bHRlZCBieSB0aGUgZGVmYXVsdCB2YWx1ZSBvZiBgcHJldmlldy1hdXRvLXJldmVh
bCcuIgorICA6dHlwZSAnKHJlcGVhdCAoY2hvaWNlIChmdW5jdGlvbiA6dGFnICJGdW5jdGlvbiIp
CisgICAgICAgICAgICAgICAgICAgICAgICAgKHNleHAgOnRhZyAiS2V5IGJpbmRpbmciKSkpKQor
CiAoZGVmY3VzdG9tIHByZXZpZXctYXV0by1yZXZlYWwKLSAgJyhldmFsIChwcmV2aWV3LWFycml2
ZWQtdmlhIChrZXktYmluZGluZyBbbGVmdF0pIChrZXktYmluZGluZyBbcmlnaHRdKQotICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgIydiYWNrd2FyZC1jaGFyICMnZm9yd2FyZC1jaGFyKSkK
KyAgJyhldmFsIChhcHBseSAncHJldmlldy1hcnJpdmVkLXZpYSBwcmV2aWV3LWF1dG8tcmV2ZWFs
LWNvbW1hbmRzKSkKICAgIkNhdXNlIHByZXZpZXdzIHRvIG9wZW4gYXV0b21hdGljYWxseSB3aGVu
IGVudGVyZWQuCiBQb3NzaWJpbGl0aWVzIGFyZToKIHQgYXV0b29wZW5zLApkaWZmIC0tZ2l0IGEv
dGV4LWZvbGQuZWwgYi90ZXgtZm9sZC5lbAppbmRleCA2MmYwODM0Yy4uNGY0ZWUzNzcgMTAwNjQ0
Ci0tLSBhL3RleC1mb2xkLmVsCisrKyBiL3RleC1mb2xkLmVsCkBAIC0yNTcsMTAgKzI1NywxOSBA
QCBBZnRlciB0aGF0LCBjaGFuZ2luZyB0aGUgcHJlZml4IGtleSByZXF1aXJlcyBtYW5pcHVsYXRp
bmcga2V5bWFwcy4iCiAgICAgKGRlZmluZS1rZXkgbWFwICJpIiAgICAjJ1RlWC1mb2xkLWNsZWFy
b3V0LWl0ZW0pCiAgICAgbWFwKSkKIAorKGRlZmN1c3RvbSBUZVgtZm9sZC1hdXRvLXJldmVhbC1j
b21tYW5kcworICAnKChrZXktYmluZGluZyBbbGVmdF0pCisgICAgKGtleS1iaW5kaW5nIFtyaWdo
dF0pCisgICAgYmFja3dhcmQtY2hhcgorICAgIGZvcndhcmQtY2hhcgorICAgIG1vdXNlLXNldC1w
b2ludCkKKyAgIkxpc3Qgb2YgY29tbWFuZHMgdGhhdCBtYXkgY2F1c2UgYSBmb2xkIHRvIGJlIHJl
dmVhbGVkLgorVGhpcyBsaXN0IGlzIGNvbnN1bHRlZCBieSB0aGUgZGVmYXVsdCB2YWx1ZSBvZiBg
VGVYLWZvbGQtYXV0by1yZXZlYWwnLiIKKyAgOnR5cGUgJyhyZXBlYXQgKGNob2ljZSAoZnVuY3Rp
b24gOnRhZyAiRnVuY3Rpb24iKQorICAgICAgICAgICAgICAgICAgICAgICAgIChzZXhwIDp0YWcg
IktleSBiaW5kaW5nIikpKSkKKwogKGRlZmN1c3RvbSBUZVgtZm9sZC1hdXRvLXJldmVhbAotICAn
KGV2YWwgKFRlWC1mb2xkLWFycml2ZWQtdmlhIChrZXktYmluZGluZyBbbGVmdF0pIChrZXktYmlu
ZGluZyBbcmlnaHRdKQotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMnYmFja3dhcmQt
Y2hhciAjJ2ZvcndhcmQtY2hhcgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICMnbW91
c2Utc2V0LXBvaW50KSkKKyAgJyhldmFsIChhcHBseSAnVGVYLWZvbGQtYXJyaXZlZC12aWEgVGVY
LWZvbGQtYXV0by1yZXZlYWwtY29tbWFuZHMpKQogICAiUHJlZGljYXRlIHRvIG9wZW4gYSBmb2xk
IHdoZW4gZW50ZXJlZC4KIFBvc3NpYmlsaXRpZXMgYXJlOgogdCBhdXRvb3BlbnMsCi0tIAoyLjM5
LjMgKEFwcGxlIEdpdC0xNDUpCgo=
--000000000000db49080616bb8431--




Acknowledgement sent to Paul Nelson <ultrono@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-auctex@HIDDEN. Full text available.
Report forwarded to bug-auctex@HIDDEN:
bug#70525; Package auctex. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 1 May 2024 16:15:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.