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 05:56:31 +0100 Message-ID: <87o86nbaio.fsf@gnus.org> References: <87mtm7h8kf.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35115"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: monnier@iro.umontreal.ca, Emacs Devel To: xenodasein@tutanota.de Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 14 05:57:20 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 1mm7Zw-0008x3-FQ for ged-emacs-devel@m.gmane-mx.org; Sun, 14 Nov 2021 05:57:20 +0100 Original-Received: from localhost ([::1]:56716 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mm7Zu-00045x-Fz for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Nov 2021 23:57:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:37852) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mm7ZH-0003OM-1p for emacs-devel@gnu.org; Sat, 13 Nov 2021 23:56:39 -0500 Original-Received: from [2a01:4f9:2b:f0f::2] (port=45984 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 1mm7ZF-0005vD-GQ for emacs-devel@gnu.org; Sat, 13 Nov 2021 23:56:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:Cc:To:From:Sender:Reply-To: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=ynseY3t2JxIP3MQjnpjIMqsOfksf0mgxWzr6S2DzcRw=; b=k5ZQmFPpWeKQzuardUJIUOggwl Sh+7c0JFrLhDYuIUCVu18dmbp1lHM0elYa/AOsBSJP9Hf6xXxErED/zIl8xhEmJNEfzpTM376Wa5U n+oCB8nkWum0cLX5uzG+0GFKL4naCpRmBc3wbs9MTHv73qb9R9rcHxO+aWko6gA+m7Do=; 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 1mm7Z9-0000eM-Qu; Sun, 14 Nov 2021 05:56:34 +0100 Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAElBMVEUaFxQvLChDPztc WVOUkYr///9D/Lt8AAAAAWJLR0QF+G/pxwAAAAd0SU1FB+ULDgQyAPcrmh4AAAGHSURBVDjLZZKL kYMwDERl0oBkGgC5gWDRQa7/mk4/m0A8mQzys3ZXBgDEQnVnETn/fH1OfRYgKkTc7Dn2/yQB0HrY ecmeTzw66C2KJrbv1RuQqKqSFZ3l/PQ4sxgI1A3kau8TKIAuk0oDqRKAqv7C3PffqwIdI9jQ6b0X FkC4QHrwsTDfgGQ43KuBJFWYEZTwtjJ/AV07wKIA9chuwAh6aIBXb8fSLymLZv1Q8bU1BQS29J8M yKHFsnTeiYaUg90KaLZPGddvjL0dOluRV+LjV2+A9RtEqt3BS9jnKC5jgnVLoLPMAe2LaC5ViuSA lJPrKU9PYnntDWbeekAzYDdicSOK3RSWw0FjGgMaUeuVzB4rJTAh/UeIuHOFt3USOyp4g1a1I/3S A8a5tk0J90g1PYs34BmfpnOnhH0ZJgOkyE9HoRlgRMwbvYPpGgYB8DZgACx4z3fZBsACj1VCB+nZ k4BuchgeDmiiy7xQDgjz6/1+OxOEsHXQA5QhRT8d+ADj64G89AH+AYM9S8q3C9arAAAAJXRFWHRk YXRlOmNyZWF0ZQAyMDIxLTExLTE0VDA0OjUwOjAwKzAwOjAwS0j4PAAAACV0RVh0ZGF0ZTptb2Rp ZnkAMjAyMS0xMS0xNFQwNDo1MDowMCswMDowMDoVQIAAAAAASUVORK5CYII= X-Now-Playing: Fire!'s _Defeat_: "Alien (to my feet)" In-Reply-To: <87mtm7h8kf.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 14 Nov 2021 01:42:08 +0100") 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:279371 Archived-At: Lars Ingebrigtsen writes: > So, I've had a look at the chartable stuf -- and... is the structure of > a chartable documented anywhere? Because skimming that file wasn't super > enlightening. =F0=9F=A4=A8 But as I guessed, there doesn't seem to be a= ny way to > remove a chartable entry? (As opposed to making the entry nil.) Reading the code helps sometimes, but only if you're reading the correct code. The problem is with define-key itself, or rather store_in_keymap: /* Character codes with modifiers are not included in a char-table. All character codes without modifiers are included. */ if (FIXNATP (idx) && !(XFIXNAT (idx) & CHAR_MODIFIER_MASK)) { Faset (elt, idx, /* nil has a special meaning for char-tables, so we use something else to record an explicitly unbound entry. */ NILP (def) ? Qt : def); return def; } else if (CONSP (idx) && CHARACTERP (XCAR (idx))) { Fset_char_table_range (elt, idx, NILP (def) ? Qt : def); return def; } If you give a definition of nil, then it stores t, so you can never actually get back the inheritance. (If it's nil, then it looks it up in the parent map.) 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.) --=20 (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no