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

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

RE: [External] : Re: Is it possible to make M-C-p and M-C-n global alias


From: Drew Adams
Subject: RE: [External] : Re: Is it possible to make M-C-p and M-C-n global aliases for M-down and M-up?
Date: Fri, 26 Feb 2021 18:41:52 +0000

> > (define-key minibuffer-local-map [C-p] 'previous-history-element)
> > (define-key minibuffer-local-map [C-n] 'next-history-element)
> 
> The C-n and C-p keys normally don't generate events `C-p` and `C-n`
> (which are symbols) but `?\C-p` and `?\C-n` instead (which are
> characters).  So use
> 
>     (define-key minibuffer-local-map [?\C-p] 'previous-history-element)
>     (define-key minibuffer-local-map [?\C-n] 'next-history-element)
> or
>     (define-key minibuffer-local-map (kbd "C-p") 'previous-history-
> element)
>     (define-key minibuffer-local-map (kbd "C-n") 'next-history-element)
> 
> since `kbd` is reasonably good at hiding those ugly internal details.
> or
>     (define-key minibuffer-local-map [(control p)] 'previous-history-
> element)
>     (define-key minibuffer-local-map [(control n)] 'next-history-
> element)

Also: 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Key-Sequences.html



reply via email to

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