GNU bug report logs - #21434
BUG Report: "mark-sexp" function disable.

Previous Next

Package: auctex;

Reported by: 赵瑞昌 <zhaoruichang <at> tsinghua.org.cn>

Date: Tue, 8 Sep 2015 07:03:02 UTC

Severity: normal

Tags: wontfix

Done: Arash Esbati <arash <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #26 received at 21434 <at> debbugs.gnu.org (full text, mbox):

From: Tassilo Horn <tsdh <at> gnu.org>
To: 赵瑞昌 <zhaoruichang <at> tsinghua.org.cn>
Cc: 21434 <at> debbugs.gnu.org
Subject: Re: bug#21434: BUG Report: "mark-sexp" function disable.
Date: Fri, 11 Sep 2015 14:42:55 +0200
赵瑞昌 <zhaoruichang <at> tsinghua.org.cn> writes:

> I have updated the emacs to 24.5.1, and installed auctex 11.88.8 by
> `package-list-packages'.  however, the problem seems still exist: when
> `C-M-@' (mark-sexp) at the beginning of a `\begin{...', only `\begin'
> canbe marked, instead of the whole env.  And also the
> `forward/backward-sexp' can only effect to the `\begin'.

Ah, now I get what you are saying.  Well, (La)TeX has no real notion of
a sexp, so `forward-sexp' and `backward-sexp' basically move over words
and symbols (TeX macros), or from one (, [, or { to the respective
closing paren/bracket.

But you can give Magnar's awesome expand-region a try.

  https://github.com/magnars/expand-region.el

That has support for expanding the current region also in LaTeX specific
ways.  E.g. with

\begin{enumerate}
\item foo
\item _b_ar
\end{enumerate}

where the _b_ means point is on the b in bar, calling er/expand-region
results in

\begin{enumerate}
\item foo
\item _bar_
\end{enumerate}

where the complete _bar_ is marked, another call gives

\begin{enumerate}
\item foo
_\item bar_
\end{enumerate}

where the complete \item ... is marked, another two calls mark all
items, and a final call markes the complete environment.

I think that's exactly what you want, right?  And expand-region.el can
do this magic not only for latex but also for lisp, ruby, python, xml,
javascript, CSS, and what not.

Bye,
Tassilo




This bug report was last modified 1 year and 142 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.