1

In the minibuffer for Icicles when I press C-p or C-n the minibuffer says beginning of the buffer, end of the buffer respectively. Instead want to move around the found candidate using C-p and C-n instead of using arrow keys [up], [down].

I want to keep following setup (Using `C-n` and `C-p` to iterate as cycle in `find-file` instead of up/down arrow keys) for all the minibuffers except one for Icicles. If I have it for Icicles: C-n and C-p moves around the action keys as equivalent to M-n and M-p.


(define-key minibuffer-local-map (kbd "C-n") #'next-line-or-history-element)
(define-key minibuffer-local-map (kbd "C-p") #'previous-line-or-history-element)

I have also try to set from group-custumization adding [C-p] into the array list but it did not helped.

(custom-set-variables
   '(icicle-modal-cycle-down-keys (quote ([C-n] [down] [nil mouse-5] [mouse-5])))
  ...
1

In Icicles, like in vanilla Emacs, the minibuffer is a normal editing buffer in most respects, i.e., aside from keys that have particular behavior, such as TAB during completion.

In particular, Icicles does not bind keys such as C-p and C-n, so they have their usual, global behavior, including in the minibuffer: previous-line and next-line, respectively.

As such, they're useful when you have multiple-line minibuffer input and you want to move the cursor among the lines. That's an important use case, but otherwise, those keys aren't useful in the minibuffer.

So no, those keys don't "close" the minibuffer (unless you've got something else going on, e.g. your global binding of those keys causes the minibuffer to be exited).

Your real question, I guess, is how to "move among" the current completion candidates.

That can mean at least 3 things in Icicles (actually more):

  1. Cycle among them, make each in turn the current completion candidate. For this you use keys such as <up> and <down> (vertical arrows).

  2. Cycle among them (#1), and act on each of them in turn, using the command's action. For this you use keys such as <C-up> and <C-down> (Control + vertical arrows).

  3. Cycle among them (#1), and show help for each of them in turn. For this you use keys such as <C-M-up> and <C-M-down> (Control + Meta + vertical arrows).

The actual keys are the values of these user options:

  • icicle-modal-cycle-down-keys (down)
  • icicle-modal-cycle-up-keys (up)
  • icicle-modal-cycle-down-action-keys (C-down)
  • icicle-modal-cycle-up-action-keys (C-up)
  • icicle-modal-cycle-down-help-keys (C-M-down)
  • icicle-modal-cycle-up-help-keys (C-M-up)

This is all described clearly in the doc. Here's a page about customizing key bindings.


Update after you edited the question to ask how to customize option icicle-modal-cycle-down-keys:

You say that you set that option value to ([C-n] [down] [nil mouse-5] [mouse-5]), and that didn't help.

That's because [C-n] is not a valid key representation for C-n.

Instead, try "C-n", or [(control ?n)], or [?\C-n], or "^N" (where you use C-q C-n to insert the ^N (Control N) character - it's not the 2 chars ^N, but I can't show that here).

(And you need to toggle icy-mode off and on again, for the key-bindings change to take effect.)

See (emacs) Init Rebinding.

| improve this answer | |
  • Your real question, how to "move among", [Yes]. Please see my question I updated to be more clear. I want to achieve [up] with C-p and [down] with C-n – alper Jun 30 at 21:44
  • Ah I was pretty close I tried it (control n). Thanks it works now :-) – alper Jul 1 at 14:45
  • 1
    It should be (control ?n), not (control n). – Drew Jul 1 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.