[Top][All Lists]

[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: Sun, 23 May 2010 15:13:42 -0400

On May 23, 2010, at 1:26 PM, Eli Zaretskii wrote:
> I have one request, though: could you (or someone else) please post
> requirements for what these functions should do?  That is, of course,
> trivial with unidirectional text, but what about reordered text?
> Let's say we have buffer text
>  abcde ABCDE FGHIJ xyz
> which will be displayed under Visual Line mode as
>  abcde JIHGF
>  EDCBA xyz
> Where should beginning/end-of-visual-line put point in each one of
> these two screen lines?

The first use case would be to jump to beginning and end of a visual line.  
That means, if point is at any of {abcde JIHGF}, beginning would be at "a" and 
the end at " " (between "E " and "F").
If point is at any of {ABCDE xyz}, then beginning would be at "E" and end would 
be after "z".

This would cover my use case and C-a, C-e.

C-k (kill-visual-line) would probably need to be rewritten anyway.

A quick grep through the Emacs and Aquamacs source codes does not reveal uses 
in different contexts.

The second use case would be to actually capture a whole line.  I have 
functions that kill the whole line (from left to right).   They would use 
`kill-region' from X to Y.   The same goes for hl-line-mode, where ONE overlay 
is drawn.
So, these functions would need a new function such as 
"regions-within-visual-line" or so, returning a list of (from . to) regions, or 
some other means of identifying the region. 

So far for two requirements.

Are we going to have discontinuous regions?  When I set the Mark at "c" in your 
example, and point at "G", what is highlighted (transient-mark-mode), and what 
is killed?

I'm not quite sure what the general interface will be for other functions in 
such situations, so I can't help further with that...  (NB You're throwing some 
of the most basic assumptions away.   This could get interesting.)

reply via email to

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