From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.help Subject: Re: define-key upon common-lisp-mode and inferior-lisp-mode Date: Tue, 30 Aug 2022 15:51:07 +0300 Message-ID: <835yi9vqro.fsf@gnu.org> References: <83o7w2ufa6.fsf@gnu.org> <7W8YIKpAyrHUHX3SntrisHnwBBj7wgmuFM_7SxKRuyyo1SeYNsqCgL4QAqmVoJ2n0YivGF1mUvpcaZi6mCDhD_6-O7Yzwj1WSBgriV2FQHI=@proton.me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16581"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 30 14:51:55 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 1oT0if-000481-2v for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 14:51:53 +0200 Original-Received: from localhost ([::1]:40866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oT0ie-0001Rj-6o for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 30 Aug 2022 08:51:52 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT0hY-0001RR-7x for help-gnu-emacs@gnu.org; Tue, 30 Aug 2022 08:50:44 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:42530) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT0hX-0005z2-UV for help-gnu-emacs@gnu.org; Tue, 30 Aug 2022 08:50:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=YQNjSV1wUs+qLjtZnXn8+P+R9QGP+4+vUkY47Wk2MKg=; b=pgiubwWxaeQR3hEyEFVE 01ZJIXmHfahXb40VBeur15P6q7Koytcw5e01EuROF7bPQJWfgZntNnWsA4ZIrezhqyqCr2W4cfQnf kBg90u7xcKdml4lZEnyTg1xMoDAM2tHzLIvw6ym0cpweRaspitXI3exUej7SF8GjMgXUxx81nT5qq 6BF2KLpg0mWrvbXApgMajrT72ROKOyqKhEQy359+lRDf30E2jpGBIwzFcaZayDN2cqRghO3deIVz5 JtGaqxIlQ8g+h9Sp5AMk3FkeNNHGNwnblTQ6YR4+NceMzvhNFURQxHbRtn496tgKfnIYvwJAh8obD kcjvPdKlvQo4VA==; Original-Received: from [87.69.77.57] (port=3233 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oT0hX-0006tL-3G for help-gnu-emacs@gnu.org; Tue, 30 Aug 2022 08:50:43 -0400 In-Reply-To: <7W8YIKpAyrHUHX3SntrisHnwBBj7wgmuFM_7SxKRuyyo1SeYNsqCgL4QAqmVoJ2n0YivGF1mUvpcaZi6mCDhD_6-O7Yzwj1WSBgriV2FQHI=@proton.me> (message from uzibalqa on Tue, 30 Aug 2022 12:26:42 +0000) 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:139162 Archived-At: > Date: Tue, 30 Aug 2022 12:26:42 +0000 > From: uzibalqa > 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.