auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] save-excursion and Emacs 25


From: Mosè Giordano
Subject: Re: [AUCTeX-devel] save-excursion and Emacs 25
Date: Tue, 26 Jan 2016 11:05:10 +0100

Hi Nicholas,

2016-01-25 10:57 GMT+01:00 Nicolas Richard <address@hidden>:
> Hi Mosè,
>
>> Did you notice some glitches when using AUCTeX due to this change?
>
> There is (at least) one occurrence (which I mentionned on emacs-devel
> http://lists.gnu.org/archive/html/emacs-devel/2015-05/msg00856.html) :
>
> It happens in LaTeX-fill-environment :
>
> (defun LaTeX-fill-environment (justify)
>   "Fill and indent current environment as LaTeX text."
>   (interactive "*P")
>   (save-excursion
>     (LaTeX-mark-environment) ;; <= this activates the mark
>     (re-search-forward "{\\([^}]+\\)}")
>     (LaTeX-fill-region (region-beginning) (region-end) justify
>                        (concat " environment " (TeX-match-buffer 1))))
>
> The mark ends up being active when it was not.

I managed to build Emacs 25.1.50.4 and I cannot reproduce your
problem, as reported later.

> I believe this is wrong use of the mark, and we should instead have a
> `LaTeX-bounds-of-environement function, which could be used both by
> LaTeX-mark-environment and LaTeX-fill-environment.

I agree that marking the environment doesn't appear to be needed for
filling purposes.

> If we're going through such a rewrite, I'd like to mention that I have a
> local patch where I remove the use of (line-beginning-position 2) in
> LaTeX-mark-environment. I don't really know why it's there and it
> usually gets in my way (some people end multiple environments on the
> same line, and I have to work with their code). I suggest using
> (skip-chars-forward "\n") instead (but I didn't include that in the above
> patch because it's a different kind of change)

Yes, please, go ahead if you already started working on this your
contribution would be really useful!

Bye,
Mosè



reply via email to

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