From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Bob Rogers Newsgroups: gmane.emacs.devel Subject: Re: The new keymap functions Date: Wed, 17 Nov 2021 15:57:26 -0500 Message-ID: <24981.27830.730338.79875@orion.rgrjr.com> References: <87zgq8sfw3.fsf@gnus.org> <86k0h8ts66.fsf@mail.linkov.net> <87r1bfp72g.fsf@gnus.org> Mime-Version: 1.0 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="19940"; mail-complaints-to="usenet@ciao.gmane.io" To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Nov 17 21:59:05 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mnS1I-00051N-Mw for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Nov 2021 21:59:04 +0100 Original-Received: from localhost ([::1]:54048 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnS1H-0001J4-PR for ged-emacs-devel@m.gmane-mx.org; Wed, 17 Nov 2021 15:59:03 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:35546) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mnS02-0007NR-5k for emacs-devel@gnu.org; Wed, 17 Nov 2021 15:57:46 -0500 Original-Received: from li126-47.members.linode.com ([69.164.211.47]:35752 helo=rgrjr.com) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mnRzo-0001Ls-Kl for emacs-devel@gnu.org; Wed, 17 Nov 2021 15:57:44 -0500 Original-Received: from rgrjr.com (c-73-16-206-7.hsd1.ma.comcast.net [73.16.206.7]) by rgrjr.com (Postfix on openSUSE) with ESMTP id 53B391D6BB2 for ; Wed, 17 Nov 2021 20:57:45 +0000 (UTC) Original-Received: from orion.rgrjr.com (orion.rgrjr.com [192.168.0.3]) by scorpio.rgrjr.com (Postfix on openSUSE GNU/Linux) with ESMTP id 7F28960016; Wed, 17 Nov 2021 15:57:30 -0500 (EST) In-Reply-To: <87r1bfp72g.fsf@gnus.org> X-Mailer: VM 7.19 under Emacs 28.0.60 Received-SPF: none client-ip=69.164.211.47; envelope-from=rogers-emacs@rgrjr.homedns.org; helo=rgrjr.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, KHOP_HELO_FCRDNS=0.007, NICE_REPLY_A=-1.009, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:279644 Archived-At: From: Lars Ingebrigtsen Date: Wed, 17 Nov 2021 08:36:23 +0100 Juri Linkov writes: > Whereas the name `defvar-keymap' is nice since it's a top-level macro, > `define-keymap' looks out of place in the same group of functions. > And indeed, such mismatch looks odd: > > (define-keymap "C-c C-c" #'quit-buffer) > (keymap-set map "C-c C-c" #'quit-buffer) > > What about renaming it to `keymap-define'? Then: > > (keymap-define "C-c C-c" #'quit-buffer) > (keymap-set map "C-c C-c" #'quit-buffer) I like that all the `keymap-*' functions take a map as the first parameter (except the commands that have the map "in the name", like `keymap-global-set'). And using `define-*' for a form that defines something (and has a (potentially) long body) is a very long-standing tradition in Emacs, so I'd prefer to keep it as is. The purist in me can't resist pointing out that these are not so much defining something as making a binding between an existing command and a given key sequence. But using binding in the naming may be too geeky even for the average Emacs user, so FWIW I agree "keymap-" is a good choice, but "define-" is too grand. -- Bob Rogers http://www.rgrjr.com/