unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* cua-mode and cua-replace-region
@ 2008-11-13 19:20 bigfaceworm
  2008-11-13 19:39 ` bigfaceworm
  0 siblings, 1 reply; 2+ messages in thread
From: bigfaceworm @ 2008-11-13 19:20 UTC (permalink / raw)
  To: help-gnu-emacs

All,

Emacs 22.1

I started using cua-mode b/c the rectangle commands are really handy.
I tried disabling the C-z C-x C-c C-v bindings b/c I didn't want them,
but this leaves the following, disturbing behavior:

(setq cua-enable-cua-keys nil)
M-x cua-mode

now yank some text, and exchange point and mark.
the region is now highlighted, and the next key that would
normally be bound to 'self-insert-command will actually
execute 'cua-replace-region.  Any movement triggers something
that undoes the 'cua-replace-region binding, and

I dislike that behavior, but can't figure out where cua-mode is doing
the mapping/unmapping.

Any help?

basically, I want the cua-rectangle editing, and none of the rest.

thanks,

TJ


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cua-mode and cua-replace-region
  2008-11-13 19:20 cua-mode and cua-replace-region bigfaceworm
@ 2008-11-13 19:39 ` bigfaceworm
  0 siblings, 0 replies; 2+ messages in thread
From: bigfaceworm @ 2008-11-13 19:39 UTC (permalink / raw)
  To: help-gnu-emacs

On Nov 13, 11:20 am, bigfaceworm <bigfacew...@gmail.com> wrote:
> basically, I want the cua-rectangle editing, and none of the rest.

Modifying cua--select-keymaps to always set cua--ena-region-keymap to
nil seemed to have the effect I wanted.

Any better ways?


(defun cua--select-keymaps ()
  ;; Setup conditions for selecting the proper keymaps in cua--keymap-
alist.
  (setq cua--ena-region-keymap
        nil) ;; THIS IS THE CHANGE, was   (and mark-active (not
deactivate-mark))
  (setq cua--ena-prefix-override-keymap
	(and cua--ena-region-keymap
	     cua-enable-cua-keys
	     (not cua-inhibit-cua-keys)
	     (or (eq cua-enable-cua-keys t)
		 (not cua--explicit-region-start))
	     (not executing-kbd-macro)
	     (not cua--prefix-override-timer)))
  (setq cua--ena-prefix-repeat-keymap
	(and cua--ena-region-keymap
	     (or (timerp cua--prefix-override-timer)
		 (eq cua--prefix-override-timer 'shift))))
  (setq cua--ena-cua-keys-keymap
	(and cua-enable-cua-keys
	     (not cua-inhibit-cua-keys)
	     (or (eq cua-enable-cua-keys t)
		 cua--last-region-shifted)))
  (setq cua--ena-global-mark-keymap
	(and cua--global-mark-active
	     (not (window-minibuffer-p)))))

TJ


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-11-13 19:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-13 19:20 cua-mode and cua-replace-region bigfaceworm
2008-11-13 19:39 ` bigfaceworm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).