help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Telling auctex to format a user-defined command as \item ?


From: Adam Funk
Subject: Re: Telling auctex to format a user-defined command as \item ?
Date: Sat, 20 Sep 2014 21:03:12 +0100
User-agent: slrn/pre1.0.2-9 (Linux)

On 2014-09-20, Tassilo Horn wrote:

> Adam Funk <address@hidden> writes:
...
>> So I have lists with this sort of thing:
>>
>> #v+
>> \begin{itemize}
>>   \method{GET}{http://localhost:port/documents}{lists all document ids.}
>>   \method ...
>> #v-
>>
>> The formatting commands (indent-region, fill-region, etc.) aren't
>> keeping the \method commands on separate lines (like \item) because
>> latex-mode/auctex doesn't know what they are.  What magic do I need to
>> use to tell it to format \method like \item?
>
> Does it help to adapt `LaTeX-item-regexp' so that it also recognizes
> your \method macros at items?

Good suggestion!  I found the following in .emacs from a previous
customization to handle \boxedverbatim & such:

#v+
(defcustom LaTeX-verbatim-regexp ".*verbatim\\*?"
  "*Regexp matching environments with indentation at col 0 for begin/end."
  :group 'LaTeX-indentation
  :type 'regexp)
#v-

and, working from that & the output of C-h f LaTeX-item-regexp,
arrived at this

#v+
(defcustom LaTeX-item-regexp "\\(\\(bib\\)?item\\|method\\)\\b"
  "*Regular expression matching macros considered items."
  :group 'LaTeX-indentation
  :type 'regexp)
#v-

which works!  

Thanks very much for putting me on the right track.

Adam


reply via email to

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