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

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

Re: define-key upon common-lisp-mode and inferior-lisp-mode


From: uzibalqa
Subject: Re: define-key upon common-lisp-mode and inferior-lisp-mode
Date: Tue, 30 Aug 2022 12:26:42 +0000

------- Original Message -------
On Tuesday, August 30th, 2022 at 11:44 AM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Tue, 30 Aug 2022 06:59:01 +0200 (CEST)
> > From: wilnerthomas--- via Users list for the GNU Emacs text editor 
> > help-gnu-emacs@gnu.org
> > 
> > Have encountered "common-lisp-mode" but there does not exist 
> > "common-lisp-mode-map".
> > 
> > Thusly (define-key common-lisp-mode-map KEY DEF) fails
> 
> 
> Its doc string says:
> 
> In addition to any hooks its parent mode ‘lisp-data-mode’ might have
> run, this mode runs the hook ‘lisp-mode-hook’, as the final or
> penultimate step during initialization.
> 
> So this mode inherits the keymap from its parent, lisp-data-mode.
> 
> As for binding keys, it is better to use local-define-key, I think.
> It will figure out the keymap for you.

Like below?

(local-define-key common-lisp-mode-map (kbd "H-e") #'eval-last-sexp)

A bit non-standard compared to other modes.





reply via email to

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