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.bugs Subject: bug#67700: 29.1; Minor keymap- commands documention issues Date: Fri, 08 Dec 2023 08:27:29 +0200 Message-ID: <83msul1a5q.fsf@gnu.org> References: <5320A546-FCE6-4131-B3F9-AFC8513D034D@gmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4673"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67700@debbugs.gnu.org To: Howard Melman Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 08 07:27:59 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 1rBUL9-00013h-3D for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 08 Dec 2023 07:27:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rBUL0-0008Mf-Pr; Fri, 08 Dec 2023 01:27:50 -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 1rBUKz-0008MT-EP for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 01:27:49 -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 1rBUKy-0006bl-U6 for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 01:27:49 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rBULB-0007An-LA for bug-gnu-emacs@gnu.org; Fri, 08 Dec 2023 01:28:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 08 Dec 2023 06:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67700 X-GNU-PR-Package: emacs Original-Received: via spool by 67700-submit@debbugs.gnu.org id=B67700.170201685627505 (code B ref 67700); Fri, 08 Dec 2023 06:28:01 +0000 Original-Received: (at 67700) by debbugs.gnu.org; 8 Dec 2023 06:27:36 +0000 Original-Received: from localhost ([127.0.0.1]:43642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBUKl-00079V-9b for submit@debbugs.gnu.org; Fri, 08 Dec 2023 01:27:35 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33472) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rBUKj-00079H-G2 for 67700@debbugs.gnu.org; Fri, 08 Dec 2023 01:27:33 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rBUKR-0006Za-C8; Fri, 08 Dec 2023 01:27:15 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=xKTfMOApw1rjuPe1bn0ybjdjIg6FzJL7itW7IiteAco=; b=anJXEMM8VR8m eCi6FBykaK61Y8yb9dA0+vO7aHHHUMtVliTJQuMe/EgDIYocBAUhFYnJPs86sZxzuwUxoW1/vEjPX sfVpIZVGj1C3haYBr96QeMjy8dDtbpRFBw8LzVQAJnsLpf4VIrzUPN5YDU+qPcQwoYpByB4A0PYjf jNPKCETn4bmcPfO0nC5J6tIgIeQyPnbJ+Ck+tQJOOqBzRtOVq8MK/3gkIg7Y8k0YldCL9rVN7iWL/ GU1ArMFL1VeS/5ezIm+UdOyPTdYlwmh/N7n16W/Y7frM75/y1XBZtDl5UrupNXHhkkCJ5dtK4iyn4 s5kfyfgfqIel9vI2ZANhIQ==; In-Reply-To: <5320A546-FCE6-4131-B3F9-AFC8513D034D@gmail.com> (message from Howard Melman on Thu, 7 Dec 2023 16:53:34 -0500) 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:275720 Archived-At: > From: Howard Melman > Date: Thu, 7 Dec 2023 16:53:34 -0500 > > 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. Thanks. Patches for the manual to improve these parts will be very welcome.