auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Updating xparse.el


From: Arash Esbati
Subject: Re: Updating xparse.el
Date: Fri, 11 Sep 2020 13:40:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50

Hi Florent,

Florent Rougon <f.rougon@free.fr> writes:

> Arash Esbati <arash@gnu.org> wrote:
>
>> Sorry for my late response.  I had a second thought on this and came up
>> with the name `font-latex-fontify-replacement-text'.  A patch to
>> xparse.el can look like this:
>
> (...)
>
>> The variable will eventually land in font-latex.el, I put it in
>> xparse.el for testing purposes.  The style file is attached, do you want
>> to give it a roll?
>
> I couldn't apply the patch on top of current 'master'
> (087b0300012d14cc86dec946d6c225cdb06460a1) because it has had whitespace
> “cleaned up” (at least one tab replaced with spaces and the space above
> '(defun' at the end removed).

Sorry for the inconvenience; the inline diff was meant to be read :-)

> However, I could test with the complete xparse.el style file you
> attached, which appears to be precisely the desired result of this
> patch. It works perfectly.

Thanks for testing.

> If you allow me to suggest a few related possible improvements:
>
> - Maybe rename the variable to something like
>   `font-latex-fontify-replacement-text-in-single-color'. Rationale: when
>   the var is set to nil, the replacement text *does* get fontified...
>   in a better way IMO! :-)

I'm not sure about the name.  In this setup, every unknown macro \foo
gets fontified with `font-latex-sedate-face' like in your example here:

    https://imgur.com/a/7ADVb5e

I find your suggestion somewhat misleading.

> - My custom config does similar changes to a few basic LaTeX2e commands:
>
>     \newenvironment
>     \renewenvironment
>     \newcommand
>     \renewcommand
>     \providecommand
>     \fbox
>     \mbox
>     \sbox
>
>   Maybe you won't feel like doing it on the three *box commands, but I
>   think that at least the other ones (\newenvironment,...
>   \providecommand) should be handled in the same way as you did for
>   \NewDocumentCommand and friends from xparse.

I'm easy with adding them to the new setup.  My plan is to allow the
variable to be set as a file-local variables (as you may have seen in
the patch).  This should give users better control between normal
documents and package writing.

> - My custom config does similar changes to the following commands from
>   ltx-base.el:
>
>      \AtBeginDocument
>      \AtEndDocument
>      \AtEndOfPackage
>      \AtEndOfClass
>      \DeclareRobustCommand
>
>   Again, at your discretion but in particular, I think
>   \DeclareRobustCommand should be handled the same way as
>   \NewDocumentCommand and friends.

They are defined in ltx-base.el but not added to fontification.  They
can be added in this way.

> - My custom config does similar changes to the following commands from
>   environ.el:
>
>     \NewEnviron
>     \RenewEnviron
>
>   These commands are analogous to \NewDocumentEnvironment and
>   \RenewDocumentEnvironment.

Again, easy with me.

> I believe users who write macros or environments longer than a couple of
> lines will love these changes.

I'd like to hear some other comments on this.  Then we can proceed.

Best, Arash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]