From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alessandro Bertulli Newsgroups: gmane.emacs.help Subject: Re: define-key upon common-lisp-mode and inferior-lisp-mode Date: Wed, 31 Aug 2022 14:04:50 +0200 Message-ID: <87h71sr4wv.fsf@gmail.com> References: <83o7w2ufa6.fsf@gnu.org> <7W8YIKpAyrHUHX3SntrisHnwBBj7wgmuFM_7SxKRuyyo1SeYNsqCgL4QAqmVoJ2n0YivGF1mUvpcaZi6mCDhD_6-O7Yzwj1WSBgriV2FQHI=@proton.me> <835yi9vqro.fsf@gnu.org> <831qsxvo20.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11156"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.9; emacs 29.0.50 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 Wed Aug 31 14:12:58 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 1oTMaY-0002jX-LY for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 14:12:58 +0200 Original-Received: from localhost ([::1]:54356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oTMaW-0005v2-N3 for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 31 Aug 2022 08:12:56 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oTMWs-0003H9-RA for help-gnu-emacs@gnu.org; Wed, 31 Aug 2022 08:09:13 -0400 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:35676) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oTMWr-0001BU-92; Wed, 31 Aug 2022 08:09:10 -0400 Original-Received: by mail-ed1-x52c.google.com with SMTP id y64so6284724ede.2; Wed, 31 Aug 2022 05:09:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:from:to:cc; bh=dNpfLmScUlfDwm7lC8QF0UMsgqc3lVz1hXf9iPZoqZc=; b=MFXJWQJ/ULTkIQ/Jwar8RxJJ2qef5P9sKLD+nP8GdMmoNTzFOSH8LdlJKxeFN1W3gV utNzPHTGWMJSN2bPcluq+kSxTbgtXgxwSWmSmD5BZhksX96LLvvbHaeKsT1wrRSnIRqf zYrVkmDVDFPkrLUGlCVlkD6DTaQFIVPsm8bExUvdinU7SG2WX8HU87bugvSc/wAbyewe fG7ZSgSP531hZNIP7j1K6qirsCcPyfGr1UhcM/8mzad1LE6yVIyZ2EAAYeeIFZrnsN5A 2dHtgMRLXzY5vxagAOoxTtGjgNghVGanL0YjQArGNGdIn+5VQeqyR/R61PFYtAUjYHyx pviw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :user-agent:references:x-gm-message-state:from:to:cc; bh=dNpfLmScUlfDwm7lC8QF0UMsgqc3lVz1hXf9iPZoqZc=; b=xHEhvHjii39JqgGyxJetdqvKBla4gFZ1aadZbF0poD1BeOPS4LAQ+jY57hldA11o1L m4Qyca2/+lb8Tt1F3mucLYgYv+ZbxCPgElZ7Zj3CL/JGaY/HfsolZBkrDlGs2tgAd469 Px06jmFZunj7WL0P0pumS531LDsQrnF2FsfP4d+vlA2h/XwXk/cDqTpcbew1S/ton2mz 4f6TFobLu3TxwcylUtyo/dWUqNJsSTmYfkqT2WDwvwSj0zrTTjL3Mv/Ambhwtrvo3O8B sW127Htqu9GhUFdE0O4rlb01z7aAqMnZsMzuraR3Nk12fcqlth3T+cnDtvEiDKzA6NxP uMcg== X-Gm-Message-State: ACgBeo1NK7dgWVuBhUBeiaxzUZXhGRj+Pqv6UiAvBU3hvvVmWky+fS7D xN6Je1SqNRwL7Y2UnJU4eGe/NIYEuG4= X-Google-Smtp-Source: AA6agR6wcYDZs3TBt755gIhMbLtsOmmiZFwvdPklZrHq52MPZGyP4UDRLGUcP3vadMBNzWGVl9Q+4A== X-Received: by 2002:a05:6402:35cf:b0:448:84a9:12cf with SMTP id z15-20020a05640235cf00b0044884a912cfmr10633177edc.51.1661947746567; Wed, 31 Aug 2022 05:09:06 -0700 (PDT) Original-Received: from commodoroII (2-235-154-9.ip228.fastwebnet.it. [2.235.154.9]) by smtp.gmail.com with ESMTPSA id eq23-20020a170907291700b0073d234e994csm7061266ejc.185.2022.08.31.05.09.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Aug 2022 05:09:06 -0700 (PDT) In-reply-to: <831qsxvo20.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=alessandro.bertulli96@gmail.com; helo=mail-ed1-x52c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:139195 Archived-At: Eli Zaretskii writes: > Use local-set-key instead. > >> 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. > > I can only show you the better solutions, I cannot force you use them. The documentation says local-set-key is legacy, and should be replaced by keymap-local-set. But aside from that, I only use define-key, and it works pretty good. What are the advantages of using keymap-local-set? When using define-key with the mode specific map, I'm not polluting other keymaps. So why the need for a local function? Alessandro