help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Ctrl-x Ctrl-x (exchange-point-and-mark)


From: Uday S Reddy
Subject: Re: Ctrl-x Ctrl-x (exchange-point-and-mark)
Date: Sun, 16 May 2010 11:50:05 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4

On 5/10/2010 8:42 PM, Harry Putnam wrote:
I see there are no customizing option matching
`exchange-point-and-mark' (Ctrl-x Ctrl-x)

I wondered if I can do anyghing about the current behavior where when
the exchange is made, the area in between is selected and highlighted.

If you put the following advice in your .emacs file, normal C-x C-x will have 
the effect of C-u C-x C-x and vice versa.

(defadvice exchange-point-and-mark (before toggled-mark activate)
  "Toggle activation of mark for exchange-point-and-mark."
  (interactive "P")
  (ad-set-arg 0 (null (ad-get-arg 0))))

This doesn't quite do what I would have liked myself.  Ideally, C-x C-x should 
keep the mark active if it is already active and refrain from activating it 
afresh.  This advice ends up deactivating the mark.  Can anybody beef up the 
advice more to get the better behavior?

Cheers,
Uday






reply via email to

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