From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: The new keymap functions Date: Sun, 14 Nov 2021 19:00:14 +0100 Message-ID: <87zgq64nyp.fsf@gnus.org> References: <87mtm7h8kf.fsf@gnus.org> <87o86nbaio.fsf@gnus.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="27412"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: xenodasein@tutanota.de, Emacs Devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 14 19:01:35 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 1mmJot-0006xe-Al for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Nov 2021 19:01:35 +0100 Original-Received: from localhost ([::1]:50612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mmJos-00070A-16 for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Nov 2021 13:01:34 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52014) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmJnk-0006BJ-3e for emacs-devel@gnu.org; Sun, 14 Nov 2021 13:00:24 -0500 Original-Received: from [2a01:4f9:2b:f0f::2] (port=52764 helo=quimby.gnus.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mmJng-0004ce-JS for emacs-devel@gnu.org; Sun, 14 Nov 2021 13:00:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=qB5NCMu48Jh2hcqBDCI9Ze2GPZddETq19ktTGMoSzxI=; b=o/DtikYWeeCLlgAOK6kQqMz6eb +jfLT0yTiLPHJtfkYkpFF+ihppWun2nF+fbAhJP+/t6C7fuAW9uCKWfCfkK2oRElNPMoFylvmi1Sr 6UHqO/cN++RJJXcKPTjsYf7QJtw4IXoAnm6nexkBIsjPo0RZAyxXBp+roopZkIJ4uL2s=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mmJna-0005oz-JF; Sun, 14 Nov 2021 19:00:17 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEXu3QKgkgFcVAGF egH///9tNUTkAAAAAWJLR0QEj2jZUQAAAAd0SU1FB+ULDhEtCsBJHAUAAAGjSURBVDjLrZTblSMx CEQlO4FGJLCIBCzIP7ep0qPds9+jY//omgIK5FL+8DTJ6N/zr4xSPxOk5wPYazSLBe4zQcXHFhjz VhYDkLBKoCKKex7NsEuijxkx5D4T9O4T6ONeFComV3mAFceIhgpWHzzNVkyzGpkPqWREOAtyWVoL BCKiz8iM7PWWYrl9gqu80w4IBnQCtcout4moSYXlE8gIWV5B26dQzghI+ZFKyvRhLSnVfUnRKsW9 qri40nZpB2AEJpH46lSpu3MEoKxAf5L2puwGGC2bjm4EbHUlZ4YY0thI2oVxfXZVyBypnOyAu2dL lFIRKYMAbvRxm9g6fi9GF3POw49XQwjofNL2s3BwpIdMoASxIxBKdiIu7T5zNPwgPeKWgpt74YKb 8MixZ96SbsHAIwUfbpDqN6h21QW8DW0Abjp318NXDnSMCNhIkPa6pKyqBk1yzm31ccxqbLs7LeYO rXlsSwYfmzoeygDA/N5ndyGtGBNSixUvbc5XZXyfAaRe2Mb2/8MhKP1T1179AvmdYMvfEVN5Apj7 APgD2ODPzg8tvl9S/uy48AAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMS0xMS0xNFQxNzo0NToxMCsw MDowMICAYZ4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMTEtMTRUMTc6NDU6MTArMDA6MDDx3dki AAAAAElFTkSuQmCC X-Now-Playing: Snapped Ankles's _Come Play The Trees_: "Let's Revel" In-Reply-To: (Stefan Monnier's message of "Sun, 14 Nov 2021 10:41:58 -0500") X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a01:4f9:2b:f0f::2 (failed) Received-SPF: pass client-ip=2a01:4f9:2b:f0f::2; envelope-from=larsi@gnus.org; helo=quimby.gnus.org X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 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, RCVD_IN_DNSWL_MED=-2.3, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-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:279428 Archived-At: Stefan Monnier writes: >> We presumably want to keep doing this for backwards compatibility, so I >> guess adding a new optional parameter to `define-key' to really set it >> to nil if requested is the way to go? (And the same in the sparse-map >> case.) > > That's right: the best way to write a "remove key-binding" function is > most likely to make `define-key` accept a special > `:internal-remove-binding` value for the binding: for char-tables and > arrays you can just make it store a nil in the table, and for cons > cells, it should remove the cons-cell (which will probably require more > changes to the code, tho maybe you can get away with calling `delq` to > remove the cons cell rather than having to remember the previous > cons-cell so your can `setcdr` it). Yup. But I added a REMOVE parameter to `define-key' instead -- that seems cleaner than a new magical value. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no