From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Howard Melman Newsgroups: gmane.emacs.bugs Subject: bug#67700: 29.1; Minor keymap- commands documention issues Date: Thu, 7 Dec 2023 16:53:34 -0500 Message-ID: <5320A546-FCE6-4131-B3F9-AFC8513D034D@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18819"; mail-complaints-to="usenet@ciao.gmane.io" To: 67700@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 07 22:55:28 2023 Return-path: Envelope-to: geb-bug-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 1rBMLA-0004ex-2y for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 07 Dec 2023 22:55:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBMKd-0004Sg-Dr; Thu, 07 Dec 2023 16:54:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBMKY-0004ST-HA for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 16:54:50 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBMKY-000748-47 for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 16:54:50 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBMKk-0004dp-17 for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 16:55:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Howard Melman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 07 Dec 2023 21:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67700 X-GNU-PR-Package: emacs X-Debbugs-Original-To: GNU Emacs Original-Received: via spool by submit@debbugs.gnu.org id=B.170198605417742 (code B ref -1); Thu, 07 Dec 2023 21:55:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Dec 2023 21:54:14 +0000 Original-Received: from localhost ([127.0.0.1]:43279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBMJy-0004c6-9N for submit@debbugs.gnu.org; Thu, 07 Dec 2023 16:54:14 -0500 Original-Received: from lists.gnu.org ([2001:470:142::17]:37988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBMJs-0004bg-Uy for submit@debbugs.gnu.org; Thu, 07 Dec 2023 16:54:13 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBMJa-0004Ov-R2 for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 16:53:50 -0500 Original-Received: from mail-yw1-x1130.google.com ([2607:f8b0:4864:20::1130]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rBMJZ-0006yw-BG for bug-gnu-emacs@gnu.org; Thu, 07 Dec 2023 16:53:50 -0500 Original-Received: by mail-yw1-x1130.google.com with SMTP id 00721157ae682-5b383b4184fso12087077b3.1 for ; Thu, 07 Dec 2023 13:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701986026; x=1702590826; darn=gnu.org; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:from:to:cc:subject:date:message-id:reply-to; bh=RGQIdosTCtsTEXCLR1cYpW95dLj++u69fKYWl9zENjY=; b=e/HpvPG4g2k0a5byj59Dxkv+Cou/yab2F5jWmqn/2n4pyHtXCZAZji3X0+w0x6SQh0 f2b35IJpj3bk8vEaXA5UjdMz8xpMhBz2Famd6+QKNLXZicR4aYYBZeYNMCJj3ufemjRj cGng4YRIBcu08PgU0rQF4AlPLtaDqX5HIlh51v1ek/PNUlaC0nPLi0wMC+ZAmRygK46z 8Y51FWj4sNW18ZW2k1TDIVn/Avnw/OmGAN9AYf6rxT540bgX5YYImWLF0ZWBlPYzvsZE tL1BxHWFR1Qc4fkZ3ZzyF+mCljdIsJHLerL2nPOQ5X8Slpc2zeBkgZSvDeqq/VetQasU C8rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701986026; x=1702590826; h=to:date:message-id:subject:mime-version:content-transfer-encoding :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=RGQIdosTCtsTEXCLR1cYpW95dLj++u69fKYWl9zENjY=; b=TlKUT7N9CYIqcvO6l0q57MYqx4gNnoyq9p2ajRowXwgOCxSTX2sDS/fjeWTJj1D/lz 6JgA7LR2f8lOpOOzlq6ir/LIy49qNOcQP63fxKKiSS63O4X+i80LR9Mye/6YKpUmuZLd fHpMYsCy1ndXpG5qlSkz9p0YbMjLavF+IfcscOShhT7badEcJyq0SXIWCSoPzkSue/Yn OyizuxAHBYWDt0h7Zjyp7YQvwnP6VStHOVlTqqIF+cQSe0gY7DmP/SDwF0nlt0O1PPHo +gPpBpGpfdntBlmXn4RBBNua8EQxo2YYcXT1h8kv4kCufeW5dc8fXoPgTP7c36qDPr24 B3ew== X-Gm-Message-State: AOJu0YzIeqaQtC7vHzyU8ef/mpSG6eWuvAcnGdqGEWWvPwpRTTIDFL7/ r8EZKTPMPMHMV45Oujh570ee8Un+7Ag= X-Google-Smtp-Source: AGHT+IFz94fEPmkZzT2tszQ6R5xqIb/wxsfhjKGPwPEhnTSt7c9kXWwMFtLHxhNgfyedhfPNCQnYbQ== X-Received: by 2002:a81:9f11:0:b0:5d7:1940:7d8f with SMTP id s17-20020a819f11000000b005d719407d8fmr2919271ywn.102.1701986026278; Thu, 07 Dec 2023 13:53:46 -0800 (PST) Original-Received: from smtpclient.apple (pool-108-26-231-137.bstnma.fios.verizon.net. [108.26.231.137]) by smtp.gmail.com with ESMTPSA id p15-20020a0cf68f000000b0066d12d1351fsm226650qvn.143.2023.12.07.13.53.45 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Dec 2023 13:53:45 -0800 (PST) X-Mailer: Apple Mail (2.3731.700.6) Received-SPF: pass client-ip=2607:f8b0:4864:20::1130; envelope-from=hmelman@gmail.com; helo=mail-yw1-x1130.google.com 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, 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: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:275707 Archived-At: Is there an advantage to calls to keymap-set (and keymap-global-set) using #' for the command definition? IIUC it is a compiler hint that the symbol is a function. Most examples in the emacs manual (e.g., 50.3.6 Rebinding Keys in Your Init File) just use ' not #', but the 50.3.7 Modifier Keys section says: (keymap-global-set "C-S-n" #'previous-line) Grepping the emacs sources shows both styles are used in code. If #' is preferred with the keymap commands, the examples should use it and if not, IMHO it's worth mentioning in the manual that using #' is unnecessary as this was a common question of newbies copying config snippets before the keymap commands. Also, I found the following idiom useful in my init for defining several bindings at once in an existing map: (define-keymap :keymap (current-global-map) "M-u" #'upcase-dwim ; was upcase-word "M-l" #'downcase-dwim ; was downcase-word "M-/" #'hippie-expand ; was dabbrev-expand "M-$" #'lookup-word-at-point) I didn't see anywhere in the emacs manual on keybinding customization an example of how to define multiple bindings at once in the same keymap. This terse style is IMHO cleaner than repeated calls to keymap-global-set. When reading the docs on the new keymap commands, how to do this on an existing keymap wasn't obvious to me. It is mentioned in the elisp manual but just in the description of :keymap which is the 3rd keyword in a list of 6, without any example. I think it would be useful to have an example of doing this some place (maybe section 50.3.6 in the emacs manual); that is calling define-keymap with :keymap and perhaps specifically using (current-global-map) as that wasn't on my radar before either. In GNU Emacs 29.1 (build 1, x86_64-apple-darwin21.6.0, Carbon Version 165 AppKit 2113.6) of 2023-08-08 built on Mac-1691500888998.local -- Howard