jed-users mailing list

[2005 Date Index] [2005 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: mark deleted when using narrow()/widen()?


On 18.07.05, Mack Stevenson wrote:
> Howdy
> 
> I am trying to use an update_hook to perform some processing on highlighted 
> regions. The code I've come up with looks as follows

...
 
> My problem is that the moment narrow() is called the selection terminates: 
> the mark is no longer set 

This is the normal behaviour, like most functions acting on a region,
narrow() pops the mark. If you need the mark later on (after widening),
you can duplicate it with dupmark() before narrowing.

 
> Is this (ie, using an update_hook) even the right approach to perform
> simple actions on text being selected?

This depends very much on the action. If it should apply to every
selection (and with every update), ok. Otherwise you might consider
defining a function that selects the region and does the action and bind
this to your mark-region key.

Guenter


-- 
G.Milde web.de

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2005 date index] [2005 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]