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

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

RE: C-Ret: cua and icicles


From: Drew Adams
Subject: RE: C-Ret: cua and icicles
Date: Sat, 22 May 2010 08:35:04 -0700

Hi Dirk,

> I'm using cua and I started to use icicles which is really 
> great. I know that using cua and icicles at the same time
> is not really recommended. But at the moment I only have
> problems with C-Ret. In Emacswiki I found the following text:
> 
> 6. I expect that you will need to bind one or more keys 
> differently, to accommodate both CUA mode and Icicles.
> At a minimum, you will need to either (a) bind
> 'cua-set-rectangle-mark' to something besides 'C-RET' in
> CUA mode or (b) bind 'icicle-candidate-action' to something
> besides 'C-RET' in each of the minibuffer completion maps
> when you are in Icicle mode.
> 
> I'd like to have the following behaviour:
> When I am in a normal buffer then I want that C-RET is bound to
> 'cua-set-rectangle-mark'. When I'm in minibuffer or 
> *completion* buffer then I want that C-RET is bound to
> 'icicle-candidate-action'.
> 
> Would be great if you can help me to get this desired behaviour.
> 
> And then another question to this topic:
> Are there more key combination where cua and icicles conflict?

Starting with the last question first:
I don't know. I'm not very familiar with CUA-mode.

A good way to discover key conflicts is to load my library `help-fns+.el' and
use `C-h C-k' (`describe-keymap') to list the key bindings of any keymap you're
interested in, in a user-friendly format.

You can do that for the CUA-mode map and for `icicle-mode-map', to see where
there might be conflicts outside the minibuffer. You can do that for the
minibuffer maps with Icicle mode turned off and on, comparing the two, to see
whether CUA-mode has any minibuffer key conflicts. (To see the names of the
minibuffer keymaps, do `C-h v minibuffer.*-map S-TAB'.)


The most important things to know about Icicles key bindings are these:

0. The complete key-binding doc is here:
http://www.emacswiki.org/emacs/Icicles_-_Key_Bindings

1. When you exit Icicle mode (`M-x icy-mode') you get back your normal key
bindings again.

2. Icicle mode is a global minor mode. And in Emacs, minor-mode key bindings
take precedence over major-mode and global key bindings. So regardless of what
bindings you define globally or in a major mode, if Icicle mode binds the same
key, it wins (unless some other minor mode binds it...).

3. The Icicle-mode key bindings (`icicle-mode-map') are top-level bindings.
Besides these, Icicles also binds some keys in the standard minibuffer keymaps
(not in `icicle-mode-map').

4. *You* control the Icicle-mode bindings using user option
`icicle-top-level-key-bindings'. You can easily delete any default bindings you
do not want, change the default `icicle-mode' bindings, or add new ones. You do
not need to know Emacs Lisp to configure key bindings using this user option -
it is straightforward. And if you set option `icicle-top-level-key-bindings' to
nil, then Icicles binds *no* top-level keys (it binds only minibuffer keys).

6. In some cases, Icicle mode remaps some top-level keys only if they are bound
to certain functions provided other libraries (e.g. ibuffer, ess, dired). That
is, Icicles provides enhanced behavior for some commands from other libraries.
If you load such a library after turning on Icicle mode, you can toggle Icicle
mode twice to make Icicles recognize that the library has been loaded and remap
such keys to their Icicles enhancements. Again, whether Icicles remaps a given
key is controlled by option `icicle-top-level-key-bindings'.

7. There are also some Icicles user options that let you control some of the
Icicles minibuffer bindings. To change any other minibuffer bindings (not
associated with user options) you might need to resort to some Emacs-Lisp code.
Those user options all have `key' in their name, so `C-h v icicle-.*key S-TAB'
will show you all of them - just use `C-M-next' to see the doc string for each
in turn, etc.

For example, that will show that the (default) value of option
`icicle-apropos-cycle-next-keys' is the list ([next]), meaning that there is
only one key, `next' (PageDown) bound to cycle to the next candidate. You
customize these key options the same way you customize option
`icicle-top-level-key-bindings'. In this case, you could add more keys to the
list or change [next] to some other key.


Wrt your question about C-RET:

Icicles does not bind C-RET outside of the minibuffer, where you say you do want
Icicles to bind it anyway. So I do not see the problem you are having with
C-RET.  Please let me know just what happens that you would like to change -
give me a step-by-step description (recipe) so I can understand. You can mail me
off list.

HTH - Drew





reply via email to

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