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 13:22:48 +0000

------- Original Message -------
On Tuesday, August 30th, 2022 at 12:51 PM, Eli Zaretskii <eliz@gnu.org> wrote:


> > Date: Tue, 30 Aug 2022 12:26:42 +0000
> > From: uzibalqa uzibalqa@proton.me
> > Cc: help-gnu-emacs@gnu.org
> > 
> > > > 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)
> 
> 
> Yes.
> 
> > A bit non-standard compared to other modes.
> 
> 
> AFAIU, you are a user, not a programmer who defines a new mode. the
> above is the standard way for users to define key bindings for the
> current mode.

Most of my time is spent doing programming work for others.

Have got "Lisp error: (void-function local-define-key)" for "Emacs 27.2".

On the other modes I have been using 

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

The last seems more standard for many modes.



reply via email to

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