auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] TeX-insert-macro-default-style not applied?


From: Arash Esbati
Subject: Re: [AUCTeX] TeX-insert-macro-default-style not applied?
Date: Tue, 13 Nov 2018 21:59:12 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1

Arash Esbati <address@hidden> writes:

> I'm not sure if I can give it a roll in near future, but I will add it
> to my todo list.

Following up myself, I had a look at this and it seems a little harder
than I thought.  At the end, I had to carve out some code from
`TeX-parse-arguments' and write a macro in order to simulate
`TeX-parse-arguments'.

Manuel, can you please try the attached style files and report back if
they work as expected?  The recipe is:

1) Save the style files in a directory of your choice,
   e.g. "~/.emacs.d/private-styles"

2) Restart Emacs and in scratch, eval this (i.e., put cursor after the
   last paren and hit `C-x C-e'):
   (setq TeX-style-private
         (expand-file-name "~/.emacs.d/private-styles"))

3) Also in scratch, eval this macro:
   (defmacro LaTeX-check-insert-macro-default-style (&rest body)
     `(unless (if (eq TeX-insert-macro-default-style 'show-all-optional-args)
                  (equal current-prefix-arg '(4))
                (or
                 (and (eq TeX-insert-macro-default-style 'show-optional-args)
                      (equal current-prefix-arg '(4)))
                 (and (eq TeX-insert-macro-default-style 'mandatory-args-only)
                      (null (equal current-prefix-arg '(4))))
                 last-optional-rejected))
        ,@body))

4) Open your .tex file and insert the macros in question.

TIA.

Best, Arash

Attachment: style.zip
Description: Updated styles


reply via email to

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