From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Adam Funk Newsgroups: gmane.emacs.help Subject: Re: Telling auctex to format a user-defined command as \item ? Date: Sat, 20 Sep 2014 21:03:12 +0100 Message-ID: <0531fbx36a.ln2@news.ducksburg.com> References: NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1411244125 18669 80.91.229.3 (20 Sep 2014 20:15:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Sep 2014 20:15:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Sep 20 22:15:18 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XVR3t-0006Jz-Fe for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Sep 2014 22:15:17 +0200 Original-Received: from localhost ([::1]:35921 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XVR3t-0007Wa-2A for geh-help-gnu-emacs@m.gmane.org; Sat, 20 Sep 2014 16:15:17 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-X-Trace: individual.net 535nu1/1SfFHFU5Cy8p8+w8n3jSfI63Dnf1cdVZ0hSZRG8sT/C X-Orig-Path: news.ducksburg.com!not-for-mail Cancel-Lock: sha1:ZjFupOiIWntfXKSHLffpSHnHtok= sha1:VwnQGeMUr1Q5xfQCrT0Gev7DvgA= User-Agent: slrn/pre1.0.2-9 (Linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:207798 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:100072 Archived-At: On 2014-09-20, Tassilo Horn wrote: > Adam Funk 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