auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Parsing of \newcommand should detect when macro takes noarg


From: Adam Johnson
Subject: Re: [AUCTeX] Parsing of \newcommand should detect when macro takes noargument
Date: Thu, 30 Jun 2005 17:00:01 -0400

I'm using
   (setq TeX-insert-braces nil)
in my .emacs, it can automatically ignore any unnecessary braces.


BTW: I'm using AUCTeX 11.55
                        preview-latex 0.9.1
                        MikTeX 2.4
                        CVS Emacs 21.3.50.1
                        Windows XP.
--------
Best Regards,
Adam

----- Original Message ----- From: ""Frank Küster"" <address@hidden>
To: <address@hidden>
Sent: Thursday, June 30, 2005 10:02 AM
Subject: [AUCTeX] Parsing of \newcommand should detect when macro takes noargument



In my document preamble, I have a couple of abbreviation macros, e.g.

\newcommand{\dtmax}{\ensuremath{\Delta t_\mathrm{max}}}
\newcommand{\proxx}{\texorpdfstring{\chemical{Pro_{20}AA}}{Pro\_20AA}}

Due to AUCTeX's fabulous parsing ability, I can enter these macros with
C-c RET etc.  However, after that I always get \proxx{} with point
inside the braces, which doesn't make sense.  On the other hand, the
syntax for \newcommand is clear - possible arguments are indicated by
its optional argument, and a situation like

\newcommand{\myCommandWithArgs}{%
 \somecommands%
 \builtinCommandWithArgs%
}

should be fairly rare in actual LaTeX documents, although it might
occur more often in style files.

I suggest to put point right after the closing brace for such macros; I
prefer to add one (or a couple of) pairs of braces in the rare cases when
they are needed, instead of having to move point all the time.

Alternatively, this could be made customizable - in this case, the
customization could perhaps only be activated when interactively editing
a buffer (as opposed to running commands like TeX-auto-generate in batch
mode).

Thanks for considering,
Frank


Emacs  : GNU Emacs 21.4.1 (i386-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
of 2005-03-17 on trouble, modified by Debian
Package: AUCTeX 11.55

current state:
==============
(setq
window-system 'x
LaTeX-version "2e"
TeX-style-path '("style/" "auto/" "/home/frank/texmf/tex/latex/style/" "/home/frank/texmf/tex/latex/auto/" "/usr/share/emacs21/site-lisp/auctex/style/" "/var/lib/auctex/emacs21/" "/home/frank/.auctex-styles/" "/home/frank/.auctex-styles/" "/home/frank/.auctex-styles/" "/home/frank/.auctex-styles/" "/home/frank/.auctex-styles/" "/home/frank/.auctex-styles/" "/home/frank/.auctex-styles/"
 "/home/frank/.auctex-styles/" "/home/frank/.auctex-styles/")
TeX-auto-save t
TeX-parse-self t
TeX-master "Laborbuch"
)
--
Frank Küster
Inst. f. Biochemie der Univ. Zürich
Debian Developer



_______________________________________________
auctex mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/auctex




reply via email to

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