[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [AUCTeX] Italicizing user macros
From: |
Arash Esbati |
Subject: |
Re: [AUCTeX] Italicizing user macros |
Date: |
Thu, 28 Jul 2016 09:48:59 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 |
Ivan Andrus <address@hidden> writes:
> On Wed, Jul 27, 2016 at 6:51 AM, Arash Esbati <address@hidden> wrote:
>> Ognjen Maric <address@hidden> writes:
>>
>>> I'd like AUCTeX to render a particular macro I define (called inldef) the
>>> same way that it renders \emph. Looking through the documentation, I tried:
>>>
>>> (setq font-latex-match-italic-command-keywords '(("inldef" "{")))
>>>
>>> But this doesn't seem to affect the rendering (both the macro name and the
>>> argument are rendered as for any other user macro).
>>>
>>> My macro is defined simply as:
>>>
>>> \newcommand{\inldef}{\emph}
>>>
>>> This doesn't change anything either:
>>>
>>> \newcommand{\inldef}[1]{\emph{#1}}
>>
>> AUCTeX can parse defintions and add them to completion list, but
>> automatic catering for fontification is not possible.
>
> Are you sure?
I meant "automatic" addition for fontification when you hit C-c C-n. I
am not aware of such mechanism.
> Because I use `font-latex-match-bold-command-keywords' and
> fontification just happens. However, if you read the documentation
> for font-latex-*-command-keywords, you see that you can't simply set
> it. I used customize and have since restarted Emacs, so I don't know
> if customize can update it in the running instance of Emacs. You
> should be able to use setq as well, as long as you ensure you set it
> _before_ AUCTeX is loaded.
You are absolutely right, setting
(setq font-latex-match-italic-command-keywords '(("inldef" "{")))
in init file and restarting Emacs should just work. I simply prefer the
file local version since I can eval the expression and fontification is
in place and I don't have to restart Emacs. It is only a matter
preference.
Best, Arash