From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Marcin Borkowski Newsgroups: gmane.emacs.help Subject: Re: My humble additions to AUCTeX Date: Wed, 15 Jan 2014 18:58:21 +0100 Organization: WMI UAM Message-ID: <20140115185821.1ed7b503@aga-netbook> References: <20140113002818.77105028@aga-netbook> <87y52j6d3g.fsf@yahoo.fr> <20140113191650.0fce85c1@aga-netbook> <87iotm6emi.fsf@yahoo.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1389808736 18425 80.91.229.3 (15 Jan 2014 17:58:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Jan 2014 17:58:56 +0000 (UTC) Cc: Nicolas Richard To: GNU Emacs users list Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 15 18:59:02 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 1W3Ujz-0002Fv-PU for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Jan 2014 18:59:00 +0100 Original-Received: from localhost ([::1]:56386 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Ujz-0007oa-GD for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Jan 2014 12:58:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42397) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3Ujg-0007n8-Uv for help-gnu-emacs@gnu.org; Wed, 15 Jan 2014 12:58:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W3UjU-00071y-EK for help-gnu-emacs@gnu.org; Wed, 15 Jan 2014 12:58:40 -0500 Original-Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:59646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W3UjU-000709-3y for help-gnu-emacs@gnu.org; Wed, 15 Jan 2014 12:58:28 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by msg.wmi.amu.edu.pl (Postfix) with ESMTP id 99D9077B79; Wed, 15 Jan 2014 18:58:25 +0100 (CET) Original-Received: from msg.wmi.amu.edu.pl ([127.0.0.1]) by localhost (msg.wmi.amu.edu.pl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DAiv5My1q3sc; Wed, 15 Jan 2014 18:58:25 +0100 (CET) Original-Received: from aga-netbook (101-138.echostar.pl [213.156.101.138]) by msg.wmi.amu.edu.pl (Postfix) with ESMTPSA id DCCBC77B77; Wed, 15 Jan 2014 18:58:24 +0100 (CET) In-Reply-To: <87iotm6emi.fsf@yahoo.fr> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.17; i686-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:808:114:2::50 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:95424 Archived-At: Dnia 2014-01-14, o godz. 11:29:09 Nicolas Richard napisa=C5=82(a): > Marcin Borkowski writes: > > Do I guess correctly that you did some (or more) LaTeX typesetting, > > but not too much low-level TeX programming, dear Watson? ;) >=20 > Indeed : I did some lower level (albeit trivial) TeX programming at > some point, but not recently -- that might explain why I thought the > problems had disappeared. Another reason is that I had changed the > syntax class of backslash character in my .emacs (I made it ".", i.e. > punctuation), which explains why I use C-M-f (but that doesn't > address most of the points you raised). Exactly. So I guess that now you can see the problem I'm solving;). (Though I didn't really know about C-M-f, so thanks for that tip, too. I'm quite used to edit human-language documents in Emacs, but not as good as editing programs, it seems. I'll have to reread the relevant portions of the manual.) > > Imagine this: \these\are\four\tokens, where denotes the > > point. Then, C-M-f moves too far; I want to move by one token (i.e. > > to get \these\are\four\tokens), not by a whole string of them at > > the same level of curly braces. >=20 > In order to move by token, I made one further change this morning in > my local setup: > (modify-syntax-entry ?\\ ". p" LaTeX-mode-syntax-table) > which lets C-M-b skip the backslash ("p" here means "prefix"). Interesting. It solves *some* problems, but not all. For instance, it does not (obviously) see that the second backslash in "\\whatever" is escaped and should not be treated as the first character of a token. > > Also, I want to level up the word commands to token-aware commands. > > Imagine this: \these\are\four\tokens. Now, if you press M-DEL, > > the backslash does not get deleted; if I made its syntax "word", > > pressing M-DEL would kill *everything* shown here. And I want to be > > able to kill just the string "\tokens" with one keystroke. >=20 > C-M-b C-M-k would work with the above modification. Not exactly "one > keystroke", indeed, but close enough for me. Right, though definitely not close enough for me. Especially that e.g. M-b doesn't do *anything* reasonable when used on a token beginning with a backslash, and (at least for me) it begs for a suitable modification. As Stefan pointed out, this is a bad idea outside my personal setup, so I'm going to examine superword-mode to incorporate TeX's meaning of "symbol" into its "superword" notion. > > Last but not least, I aim at commands to work on matching pairs of > > \left...\right, \bigl...\bigr etc. delimiters. Therefore, I want > > to be able to walk through the text token by token. (I did look > > into smartparen, and it doesn't seem to be sophisticated enough to > > do what I need.) >=20 > To work around that problem, I write this: > \paren{foobar} or \paren*{foobar} > which gives (foobar) (Starred version says to adapt height to the > content) It's as simple as loading mathtools and having > \DeclarePairedDelimiter{\paren}{(}{)} > in the preamble. Interesting, I completely forgot about this feature of mathtools. Thanks! This, however, still does not solve the problem. It has an advantage of replacing the (very plain-TeX-like) \left..\right, \bigl..\bigr etc. syntax with something much more LaTeX-y, but is not widespread enough. Though I might change my TeX habits, people who send their papers to the journal I'm working for probably won't. And making authors stick to *any* LaTeX conventions is, well, somewhere between impossible and inconceivable;). (I still quite often get papers written using LaTeX 2.09 commands. They should have been dead for some fifteen years now... I also get papers with hand-crafted section titles, complete with all caps, \vskips and of course hardcoded section numbers, footnotes numbered by hand and inserted using the $^1$, $^2$ syntax and similar things.) (Also, \DeclarePairedDelimiter does not help when the delimiters *do not pair up*, like in the left-open interval $(0,1]$, though probably defining macros like \lointerval for that purpose would be the right way to deal with that kind of situation, especially that you could easily change the appearance of the parens in the intervals globally.) Best, --=20 Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Adam Mickiewicz University