CUA mode, turn off Shift+Curvor Move to Select
  Home FAQ Contact Sign in
gnu.emacs.help only
 
Advanced search
POPULAR GROUPS

more...

gnu.emacs.help Profile…
 Up
CUA mode, turn off Shift+Curvor Move to Select         


Author: Xah
Date: Aug 30, 2008 05:51

in CUA mode, is there a way to make it so that when Shift key is down
and cursor is move, it doesn't select?

That is, i want it to do

(transient-mark-mode t)
(delete-selection-mode t)

and Ctrl+ZXCV for undo cut copy paste, but i don't want the Shift
+CursorMove to Select behavior. (because that behavior is incompatible
with my ergonomic keybinding. I need to suggest to users a way to turn
this this off)

Alternatively, is there a way that only turn on the Ctrl+ZXCV
shortcuts without all the other features?

Thanks in advance again.

Xah
http://xahlee.org/

12 Comments
Re: CUA mode, turn off Shift+Curvor Move to Select         


Author: Lennart Borgman (gmail)
Date: Aug 30, 2008 07:00

Xah wrote:
> in CUA mode, is there a way to make it so that when Shift key is down
> and cursor is move, it doesn't select?

That would not really be CUA mode ...
> That is, i want it to do
>
> (transient-mark-mode t)
> (delete-selection-mode t)
>
> and Ctrl+ZXCV for undo cut copy paste, but i don't want the Shift
> +CursorMove to Select behavior. (because that behavior is incompatible
> with my ergonomic keybinding. I need to suggest to users a way to turn
> this this off)

There is a property on the command symbol that controls this.
Show full article (0.74Kb)
no comments
Re: CUA mode, turn off Shift+Curvor Move to Select         


Author: Xah
Date: Aug 30, 2008 14:34

2008-08-30

Thanks Lennart.

Now I'm trying to make the following keybindings:

(add-hook 'cua-mode-hook
(lambda ()
(define-key cua-global-keymap (kbd "M-C") 'scroll-down)
(define-key cua-global-keymap (kbd "M-T") 'scroll-up)
)
) ; Dvorak keyboard

So that, M-C will run scroll-down, instead of cua-scroll-down.
However, it doesn't work.

Apparently, the cua-mode uses some mechanism that simply alias scroll-
down to cua-scroll-down.

in cua-base.el, there's this line:

;; scrolling
(define-key cua-global-keymap [remap scroll-up] 'cua-scroll-up)
(define-key cua-global-keymap [remap scroll-down] 'cua-scroll-down)

What's the remap in the vector there?

How to do what i want?
Show full article (1.60Kb)
1 Comment
Re: CUA mode, turn off Shift+Curvor Move to Select         


Author: Lennart Borgman (gmail)
Date: Aug 30, 2008 16:35

Xah wrote:
> 2008-08-30
>
> Thanks Lennart.
>
> Now I'm trying to make the following keybindings:
>
> (add-hook 'cua-mode-hook
> (lambda ()
> (define-key cua-global-keymap (kbd "M-C") 'scroll-down)
> (define-key cua-global-keymap (kbd "M-T") 'scroll-up)
> )
> ) ; Dvorak keyboard
>
> So that, M-C will run scroll-down, instead of cua-scroll-down.
> However, it doesn't work.
>
> Apparently, the cua-mode uses some mechanism that simply alias scroll-
> down to cua-scroll-down.
> ...
Show full article (1.81Kb)
no comments
Re: CUA mode, turn off Shift+Curvor Move to Select         


Author: Xah
Date: Sep 1, 2008 09:57

Xah wrote: «CUA mode, turn off Shift+Curvor Move to Select»

Thanks Lennart...

I've now solved my problem by attaching a deactivate-mark as a hook to
every command.

See the code below:

;;; --------------------------------------------------
;;; FIX cua-mode

;; prevent cua-mode from going into selection mode when
;; commands with Shift key is used.
Show full article (3.23Kb)
1 Comment
Re: CUA mode, turn off Shift+Curvor Move to Select         


Author: Lennart Borgman (gmail)
Date: Sep 1, 2008 14:03

Xah wrote:
> Xah wrote: «CUA mode, turn off Shift+Curvor Move to Select»
>
> Thanks Lennart...
>
> I've now solved my problem by attaching a deactivate-mark as a hook to
> every command.

I am glad it helped, but I can't understand why you want to do this ... ;-)
no comments
Re: CUA mode, turn off Shift+Curvor Move to Select         


Author: Xah
Date: Sep 1, 2008 19:13

On Sep 1, 2:03 pm, "Lennart Borgman (gmail)"
gmail.com> wrote:
> Xahwrote:
>>Xahwrote: «CUA mode, turn off Shift+Curvor Move to Select»
>
>> Thanks Lennart...
>
>> I've now solved my problem by attaching a deactivate-mark as a hook to
>> every command.
>
> I am glad it helped, but I can't understand why you want to do this ... ;-)

is that a joke?? :)

when cua-mode is on, any shift key with cursor movement will start to
select text. But my ergo map has some bindings with the shift key.
e.g. page up and down is meta shift I/K. So, when used with cua mode,
it starts to select text when paging up, which is annoying. But now,
with the above, it's fixed.

Xah
http://xahlee.org/
Show full article (0.72Kb)
1 Comment
Re: CUA mode, turn off Shift+Curvor Move to Select         


Author: Lennart Borgman (gmail)
Date: Sep 2, 2008 02:43

Xah wrote:
> On Sep 1, 2:03 pm, "Lennart Borgman (gmail)"
> gmail.com> wrote:
>> Xahwrote:
>>> Xahwrote: «CUA mode, turn off Shift+Curvor Move to Select»
>>> Thanks Lennart...
>>> I've now solved my problem by attaching a deactivate-mark as a hook to
>>> every command.
>> I am glad it helped, but I can't understand why you want to do this ... ;-)
>
> is that a joke?? :)

Sorry, only partly ;-)

What I really wondered was why you do not change the property I
mentioned instead:

(put 'cua-scroll-up 'CUA 'move)
Show full article (0.91Kb)
no comments
Re: CUA mode, turn off Shift+Curvor Move to Select         


Author: Xah
Date: Sep 2, 2008 05:58

Xah wrote: «CUA mode, turn off Shift+Curvor Move to Select»

Lennart Borgman wrote: « (put 'cua-scroll-up 'CUA 'move)»

Damn. Why didn't u be explicit before?

Ok, so if i want to use that, how excatly do i change it? remove the
property? change it to some other value?

am not familiar with lisp's function's properties. Will have to spend
a couple hours on this... but seems the solution i have works now. I
looked at cua-mode source code trying to find some comment or doc
about it but didn't see much... if you can give direct pointer,
that'll be great. Thanks.

Xah
http://xahlee.org/

1 Comment
Re: CUA mode, turn off Shift+Curvor Move to Select         


Author: Lennart Borgman (gmail)
Date: Sep 2, 2008 09:12

Xah wrote:
> Xah wrote: «CUA mode, turn off Shift+Curvor Move to Select»
>
> Lennart Borgman wrote: « (put 'cua-scroll-up 'CUA 'move)»
>
> Damn. Why didn't u be explicit before?

Sorry, I did not remember the name then and thought I gave you enough info.
> Ok, so if i want to use that, how excatly do i change it? remove the
> property? change it to some other value?

I have never done it, but I guess changing it to something else will do,
for example

(put 'cua-scroll-up 'CUA nil)
> am not familiar with lisp's function's properties. Will have to spend
> a couple hours on this... but seems the solution i have works now. I
> looked at cua-mode source code trying to find some comment or doc
> about it but didn't see much... if you can give direct pointer,
> that'll be great. Thanks.

There is only symbol properties, not functions or variables dito.

There is not much to learn
Show full article (0.99Kb)
no comments

RELATED THREADS
SubjectArticles qty Group
Re: How to do Selective Desaturation (Selective Black and White) in video?rec.video.desktop ·
1 2