emacs-devel
[Top][All Lists]
Advanced

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

Re: move-beginning-of-line


From: David Kastrup
Subject: Re: move-beginning-of-line
Date: Mon, 14 Mar 2005 18:31:17 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Ralf Angeli <address@hidden> writes:

> * Kim F. Storm (2005-03-14) writes:
>
>> I wonder how preview-latex handles this, as it uses images over
>> multiline text _a lot_ ...?
>
> A typical example would be LaTeX code like
>
> Foo\footnote{Bar
> baz} blah
>
> which, with the help of preview-latex (or AUCTeX's folding
> functionality), will get displayed as
>
> Foo┬╣ blah
>
>> Does beginning-of-line work ok
>> with images in the middle of lines?  If so, how?
>
> That depends.  With point at the end of the line in the example
> `C-a' will move to the beginning of the line.  With
> `beginning-of-line' point will end up inside of the overlay.
>
> One can test this quite easily (circumventing preview-latex's
> provisions for playing with point)

But preview-latex's provisions for playing with point are actually
what is interesting to the user.

preview-latex uses post-command-hook to move point out of images after
each command.  It also uses pre-command-hook to remember point before
each command.  If the command moved backwards when ending up inside of
the image, preview-latex will move it to the start of the image,
otherwise to the end of the image.  As a result, pressing C-a to the
right of a multi-line image should move point to the front of the
image.  Similar with pressing C-e to the left of such an image.

> with code like
>
> (progn
>   (insert "\nwww xxx\nyyy zzz")
>   (overlay-put (make-overlay (- (point) 11) (- (point) 4)) 'display "111"))
>
> If found it a bit peculiar that `M-x beginning-of-line RET' and `M-:
> (beginning-of-line) RET' yielded different results.  In the former
> case point will end up on the first "1" and in the latter case after
> the last "1".

Hm, no idea about that one.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum




reply via email to

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