auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] Re: Fontifying of titles...


From: David Kastrup
Subject: Re: [AUCTeX-devel] Re: Fontifying of titles...
Date: Sat, 09 Apr 2005 15:53:40 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Ralf Angeli <address@hidden> writes:

> * David Kastrup (2005-04-09) writes:
>
>> Ralf Angeli <address@hidden> writes:
>>
>>> (vertical-motion 1) returns something smaller than 1 when invoked on
>>> a wrapped line?
>>
>> Who said that?
>
> Sorry, I misunderstood the code.
>
> Maybe because it will not work in every case.  Here is the full
> version again:
>
> (save-excursion

Looks like (move-to-column col) is missing here.

>   (let ((oldpoint (point)))
>     (move-beginning-of-line)
>     (if (or (< (vertical-motion 1) 1)
>             (> (point) oldpoint))
>         col
>       (backward-char)
>       (current-column))))
>
> IIUC the code assumes that point is located on the second screen line
> of a wrapped line.

Well, it assumes that point is set to something relevant, anyway.
Sorry for that.

Perhaps easier would be:

(save-excursion
  (move-beginning-of-line)
  (if (< (vertical-motion 1) 1)
      col
    (backward-char)
    (min (current-column) col)))

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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