From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: uzibalqa Newsgroups: gmane.emacs.help Subject: Re: define-key upon common-lisp-mode and inferior-lisp-mode Date: Tue, 30 Aug 2022 13:22:48 +0000 Message-ID: References: <83o7w2ufa6.fsf@gnu.org> <7W8YIKpAyrHUHX3SntrisHnwBBj7wgmuFM_7SxKRuyyo1SeYNsqCgL4QAqmVoJ2n0YivGF1mUvpcaZi6mCDhD_6-O7Yzwj1WSBgriV2FQHI=@proton.me> <835yi9vqro.fsf@gnu.org> Reply-To: uzibalqa Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22267"; mail-complaints-to="usenet@ciao.gmane.io" Cc: help-gnu-emacs@gnu.org To: Eli Zaretskii Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 30 15:23:40 2022 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oT1DP-0005Wg-H9 for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 15:23:39 +0200 Original-Received: from localhost ([::1]:45460 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT1DO-0004kr-1L for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 09:23:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT1Cr-0004k0-9v for help-gnu-emacs@gnu.org; Tue, 30 Aug 2022 09:23:05 -0400 Original-Received: from mail-4324.protonmail.ch ([185.70.43.24]:23741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT1Co-0003W2-4K; Tue, 30 Aug 2022 09:23:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1661865779; x=1662124979; bh=UotgNS4gY51ft2J++yFARSTX10cFJ4JtH6BUk3oPw4s=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=j/W7bteHBjTHGwPMK0dS17gmwkxuz937Jife+NTcbkN4R3Q+iitSUAHhfbXCqvk3R cLyggpsAqVJFFRtgt2CugdvCpQP9gNr6vTGFg55VchMzBb+3JRbz3Cv1cLSfepXgK+ FQDrjZaKL3kAffRXqxkleAzOUE37td/CX3lDqMMk5SJV0gjFqVPBuClEQ0PyUaT33e 9YE+sTOlY1Q109TVL5auUrVKBQLt7xgufi9Si+CKLJ7euGiuc9L2bnj/pmCuVbgvk0 M3kfO1mjJ8Uk4glR52jY1x5GwephtwIGJJ6Z7L6xBdaxuc/uc2q+rr2hL/A0iWCOe8 Mv74bide8YoTg== In-Reply-To: <835yi9vqro.fsf@gnu.org> Feedback-ID: 52887082:user:proton Received-SPF: pass client-ip=185.70.43.24; envelope-from=uzibalqa@proton.me; helo=mail-4324.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.io gmane.emacs.help:139164 Archived-At: ------- Original Message ------- On Tuesday, August 30th, 2022 at 12:51 PM, Eli Zaretskii wro= te: > > Date: Tue, 30 Aug 2022 12:26:42 +0000 > > From: uzibalqa uzibalqa@proton.me > > Cc: help-gnu-emacs@gnu.org > >=20 > > > > Thusly (define-key common-lisp-mode-map KEY DEF) fails > > >=20 > > > Its doc string says: > > >=20 > > > In addition to any hooks its parent mode =E2=80=98lisp-data-mode= =E2=80=99 might have > > > run, this mode runs the hook =E2=80=98lisp-mode-hook=E2=80=99, as the= final or > > > penultimate step during initialization. > > >=20 > > > So this mode inherits the keymap from its parent, lisp-data-mode. > > >=20 > > > As for binding keys, it is better to use local-define-key, I think. > > > It will figure out the keymap for you. > >=20 > > Like below? > >=20 > > (local-define-key common-lisp-mode-map (kbd "H-e") #'eval-last-sexp) >=20 >=20 > Yes. >=20 > > A bit non-standard compared to other modes. >=20 >=20 > 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=20 (define-key emacs-lisp-mode-map (kbd "H-e") #'eval-last-sexp) The last seems more standard for many modes.