jed-users mailing list

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

Re: Replace in a region only


On  4.05.06, Peter Bengtsson wrote:
> Is it possible to do a query replace (M-%) within a region, only? If so, 
> how?

Use 
  M-x narrow 
or
  M-x narrow_to_region
to confine all edition to the region.

Afterwards restore with 
  M-x widen  
.
 
> Whilst I'm on the subject, emacs has a cool feature where if I replace
> "peter" with "petter" in a text like this "peter Peter" the result is
> (after hitting y twice) "petter Petter". Would this be possible to do
> with jed?

Of course it is possible.

The magic variable is 

 Integer_Type `REPLACE_PRESERVE_CASE' == 0  Undocumented

Probabely also CASE_SEARCH (see Help>Describe Variable CASE_SEARCH).

Try playing with them, you can set a variable with evaluate_cmd(), by
default bound to  M-X:

 M-X CASE_SEARCH = 0
 M-X REPLACE_PRESERVE_CASE = 1

[ Advertisement:
  With http://jedmodes.sf.net/mode/hyperhelp/ you can use the function
  set_variable().
]
CASE_SEARCH can also be set with toggle_case_search(). 


Günter


-- 
Milde ife.et.tu-dresden.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>.


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