bug-auctex
[Top][All Lists]
Advanced

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

[Bug-AUCTeX] Re: 11.85; TeX-format-filter incorrectly unbreaks lines


From: Ralf Angeli
Subject: [Bug-AUCTeX] Re: 11.85; TeX-format-filter incorrectly unbreaks lines
Date: Mon, 12 Apr 2010 16:28:52 +0200

* Ivan Andrus (2010-04-09) writes:

> It's copied from the output buffer in AUCTeX.  Indeed it does not
> remove (some of) the linebreaks, because the line contains
> e.g. \203 which is a single character, but adds 4
> to (current-column).
[...]
> Perhaps it would be better to use something like
>
> (when (and (= 79 (- (point) (line-beginning-position)))
>            ...)
>   (delete-char 1))
>
> which seems to do the right thing with respect to characters
> taking more than one column.

This would also be the implementation I would have proposed.

> Right now I am using
>
> (when (and (> (- (point) (line-beginning-position)) 0)
>            (= 0 (% (- (point) (line-beginning-position)) 79))
>            ...)
>   (delete-char 1))
>
> which seems to work in the very limited testing that I have done.
> Though it could obviously be optimized.

Is the simpler solution you presented farther above not working?

It should not be necessary to deal with multiples of 79 because the loop
removing the linebreaks moves point upwards in the buffer (via
(end-of-line 0)) and should not encounter lines which have been joined
before.

-- 
Ralf




reply via email to

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