emacs-devel
[Top][All Lists]
Advanced

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

Re: Hl-line and visual-line


From: David Reitter
Subject: Re: Hl-line and visual-line
Date: Thu, 20 May 2010 22:35:44 -0400

On May 20, 2010, at 5:02 PM, Eli Zaretskii wrote:
>> 
>> +    (cons (progn (vertical-motion 0) (point))
>> +         (progn (vertical-motion 1) (point)))))
> 
> This will do The Wrong Thing with bidirectional text, because
> vertical-motion puts you on column zero, which is not necessarily the
> first character after a newline, in buffer's order of increasing
> character positions (a.k.a. "logical order").  The net effect will be
> that only part of the screen line will be highlighted.
> 
> I just yesterday fixed a similar problem in move-end-of-line (see
> revno 100369).  You need to proactively get to the line's first
> character, with either skip-chars-backward or (per Stefan's
> suggestion) `(forward-line 0)'.

These two seem applicable to buffer lines; I'm not sure how I would do it with 
word-wrap without `vertical-motion'.

Should I just use `beginning-of-visual-line' and `end-of-visual-line'?

On another note, I first thought of just implementing hl-line in the redisplay 
code, or perhaps as an option to the cursor display.  When the cursor is drawn, 
we just highlight the line.  No moving around overlays in Lisp...


reply via email to

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