Re: [AUCTeX] Auctex prompting for optional arguments

2018-11-16 Thread Arash Esbati
Santiago Mejia  writes:

> A so refreshing to have this working now!  Thanks so much for the
> tip Mose.  It took me a while to implement it since I am not too fluent
> with the file system in AuCTeX and needed to figure out where to find the
> file ("sudo find / -iname "beamer.el").   Fixing this was easier than I
> expected, but I could not anticipate when I got your e-mail in what was a
> pretty busy week.

Hi all,

I've just pushed a fix to master which makes
`TeX-arg-beamer-overlay-spec' behave more friendly in the style hook.
Now it respects the value of OPTIONAL argument and can be used as a
vector in the style hook which I also changed [1].

> If you (or anyone else in the list) happens to have time, I would
> appreciate knowing how can one know in a more general fashion what
> controls whether AUCTeX prompts for optional arguments or not.

AUCTeX has an option called `TeX-insert-macro-default-style':

,[ C-h v TeX-insert-macro-default-style RET ]
| TeX-insert-macro-default-style is a variable defined in ‘tex.el’.
| Its value is ‘show-optional-args’
| 
| Documentation:
| Specifies whether ‘TeX-insert-macro’ will ask for all optional arguments.
| 
| If set to the symbol ‘show-optional-args’, ‘TeX-insert-macro’
| asks for optional arguments of TeX marcos, unless the previous
| optional argument has been rejected.  If set to
| ‘show-all-optional-args’, ‘TeX-insert-macro’ asks for all
| optional arguments.  If set to ‘mandatory-args-only’,
| ‘TeX-insert-macro’ asks only for mandatory argument.
| 
| When ‘TeX-insert-macro’ is called with C-u, it’s the other
| way round.
| 
| Note that for some macros, there are special mechanisms, see e.g.
| ‘LaTeX-includegraphics-options-alist’ and ‘TeX-arg-cite-note-p’.
| 
| You can customize this variable.
`

It doesn't help if functions don't respect it, though.

Best, Arash

Footnotes: 
[1]  
http://git.savannah.gnu.org/cgit/auctex.git/commit/?id=da4cb3dcb8b122f81b387b533cdb8bfb6121ba0a


___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex


Re: [AUCTeX] Auctex prompting for optional arguments

2018-09-22 Thread Santiago Mejia
A so refreshing to have this working now!  Thanks so much for the
tip Mose.  It took me a while to implement it since I am not too fluent
with the file system in AuCTeX and needed to figure out where to find the
file ("sudo find / -iname "beamer.el").   Fixing this was easier than I
expected, but I could not anticipate when I got your e-mail in what was a
pretty busy week.

If you (or anyone else in the list) happens to have time, I would
appreciate knowing how can one know in a more general fashion what controls
whether AUCTeX prompts for optional arguments or not.

Santiago.

On Mon, Sep 17, 2018 at 7:35 PM Mosè Giordano  wrote:

> Hi Santiago,
>
> On Mon, Sep 17, 2018 at 4:33 AM Santiago Mejia 
> wrote:
> >
> > I've been trying to find information about this in the manual and
> online, but have not had any luck so far.
> >
> > My general question: is there a way to get AUCTeX to always prompt me
> for an optional argument of a specific command when I invoke it with
> TeX-insert-macro (i.e. C-c )? (like it does when you invoke, for instance,
> \newcommand)
> >
> > My specific question: is there a way to get Auctex to prompt me
> automatically for an optional overlay specification when I invoke the
> \alert command with TeX-insert-macro (i.e. C-c "alert")?
>
> You have to manually patch the file style/beamer.el in your AUCTeX
> installation.  Replace the line
>
> '("alert" 1)
>
> with
>
> '("alert" TeX-arg-beamer-overlay-spec 1)
>
> Remember to byte-recompile the file with M-x byte-recompile-file RET RET.
>
> Bye,
> Mosè
>
___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex


Re: [AUCTeX] Auctex prompting for optional arguments

2018-09-17 Thread Denis Bitouzé
Hi Santiago and Mosè,

Le 18/09/18 à 01h34, Mosè Giordano a écrit :

>> My specific question: is there a way to get Auctex to prompt me
>> automatically for an optional overlay specification when I invoke the
>> \alert command with TeX-insert-macro (i.e. C-c "alert")?
>
> You have to manually patch the file style/beamer.el in your AUCTeX
> installation.  Replace the line
>
> '("alert" 1)
>
> with
>
> '("alert" TeX-arg-beamer-overlay-spec 1)
>
> Remember to byte-recompile the file with M-x byte-recompile-file RET
> RET.

BTW, AUCTeX by default prompts for an optional overlay specification
with the \structure command, but not with \alert (as noticed by
Santiago) which is however similar. And, from my experience, an overlay
specification is much more often used with \alert than with \structure.

All the best.
-- 
Denis

___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex


Re: [AUCTeX] Auctex prompting for optional arguments

2018-09-17 Thread Mosè Giordano
Hi Santiago,

On Mon, Sep 17, 2018 at 4:33 AM Santiago Mejia  wrote:
>
> I've been trying to find information about this in the manual and online, but 
> have not had any luck so far.
>
> My general question: is there a way to get AUCTeX to always prompt me for an 
> optional argument of a specific command when I invoke it with 
> TeX-insert-macro (i.e. C-c )? (like it does when you invoke, for instance, 
> \newcommand)
>
> My specific question: is there a way to get Auctex to prompt me automatically 
> for an optional overlay specification when I invoke the \alert command with 
> TeX-insert-macro (i.e. C-c "alert")?

You have to manually patch the file style/beamer.el in your AUCTeX
installation.  Replace the line

'("alert" 1)

with

'("alert" TeX-arg-beamer-overlay-spec 1)

Remember to byte-recompile the file with M-x byte-recompile-file RET RET.

Bye,
Mosè

___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex


[AUCTeX] Auctex prompting for optional arguments

2018-09-16 Thread Santiago Mejia
I've been trying to find information about this in the manual and online,
but have not had any luck so far.

My general question: is there a way to get AUCTeX to always prompt me for
an optional argument of a specific command when I invoke it with
TeX-insert-macro (i.e. C-c )? (like it does when you invoke, for instance,
\newcommand)

My specific question: is there a way to get Auctex to prompt me
automatically for an optional overlay specification when I invoke the
\alert command with TeX-insert-macro (i.e. C-c "alert")?

Any help would be much appreciated.
Santiago.
___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex