unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Marcin Borkowski <mbork@wmi.amu.edu.pl>
To: GNU Emacs users list <help-gnu-emacs@gnu.org>
Cc: Nicolas Richard <theonewiththeevillook@yahoo.fr>
Subject: Re: My humble additions to AUCTeX
Date: Wed, 15 Jan 2014 18:58:21 +0100	[thread overview]
Message-ID: <20140115185821.1ed7b503@aga-netbook> (raw)
In-Reply-To: <87iotm6emi.fsf@yahoo.fr>

Dnia 2014-01-14, o godz. 11:29:09
Nicolas Richard <theonewiththeevillook@yahoo.fr> napisał(a):

> Marcin Borkowski <mbork@wmi.amu.edu.pl> writes:
> > Do I guess correctly that you did some (or more) LaTeX typesetting,
> > but not too much low-level TeX programming, dear Watson? ;)
> 
> 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.
> 
> 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.
> 
> 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.)
> 
> 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,

-- 
Marcin Borkowski
http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski
Adam Mickiewicz University



  reply	other threads:[~2014-01-15 17:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-12 23:28 My humble additions to AUCTeX Marcin Borkowski
2014-01-13 16:49 ` Nicolas Richard
2014-01-13 18:16   ` Marcin Borkowski
2014-01-13 20:47     ` Stefan Monnier
2014-01-14  9:57       ` Marcin Borkowski
2014-01-14 10:16         ` Marcin Borkowski
2014-01-15 13:26         ` Stefan Monnier
2015-01-20 15:25       ` Marcin Borkowski
2015-01-20 16:32         ` Artur Malabarba
2015-01-20 16:45           ` Marcin Borkowski
2015-01-20 18:42           ` Stefan Monnier
     [not found]           ` <mailman.18220.1421779378.1147.help-gnu-emacs@gnu.org>
2015-01-21  2:34             ` Rusi
2014-01-14 10:29     ` Nicolas Richard
2014-01-15 17:58       ` Marcin Borkowski [this message]
     [not found] <mailman.11758.1389569313.10748.help-gnu-emacs@gnu.org>
2014-01-13 16:35 ` jack-mac
2014-01-13 18:11   ` Marcin Borkowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140115185821.1ed7b503@aga-netbook \
    --to=mbork@wmi.amu.edu.pl \
    --cc=help-gnu-emacs@gnu.org \
    --cc=theonewiththeevillook@yahoo.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).