From debbugs-submit-bounces@debbugs.gnu.org Sun Aug 04 08:17:41 2024 Received: (at submit) by debbugs.gnu.org; 4 Aug 2024 12:17:42 +0000 Received: from localhost ([127.0.0.1]:55604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saaBB-00024x-EE for submit@debbugs.gnu.org; Sun, 04 Aug 2024 08:17:41 -0400 Received: from lists.gnu.org ([209.51.188.17]:47298) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1saaB9-00024o-N4 for submit@debbugs.gnu.org; Sun, 04 Aug 2024 08:17:40 -0400 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 1saaAo-0004iT-BP for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 08:17:18 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1saaAm-0004BA-AM for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 08:17:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Type:Message-ID:Subject:To:From:Date:MIME-Version: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=2JXDXp4jIaLs4AxvayS1YEjfDCqxJLqw1dIiaxtRHjc=; b=qzaMt4mMyAVgoNos33ITh+aSVJ mi7+83AL0br3OenjOooNupKqWes58zqfYseQ6TZBbl8uCziH+03PgGjz84SCoq0ctzhSR3NZUiSKG cXHi+b6T+HNg6LriDkjiRAhSlB28JcMwMLJwX7SDMa8cUBK05E+a/7SG3w+s/W8WFbJKYtrbJ1bYm vAVV90R9xiDjuyVdbwIICEs1T2bgsCG1n0+95DZMI2qYdsXZER2g8AmPXEAK3lEjWqCkyAfsobw/n I7TzmcP8ISNHStspAArTiRn48FBKwGciiuY2jlxyJF/8hJVFAnxBB4vPyPCrT3yW6ZPNDtWWTNl+8 4cRfyitw==; Received: from [::1] (port=42772 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.97.1) (envelope-from ) id 1saaA3-00000000cLa-1oyU for bug-gnu-emacs@gnu.org; Sun, 04 Aug 2024 13:16:31 +0100 MIME-Version: 1.0 Date: Sun, 04 Aug 2024 13:16:29 +0100 From: hugo@heagren.com To: bug-gnu-emacs@gnu.org Subject: [patch] add commands for setting keyboard translations interactively User-Agent: Roundcube Webmail/1.6.6 Message-ID: X-Sender: hugo@heagren.com Content-Type: multipart/mixed; boundary="=_fb3e12df896daec6f068e4a6fdad815d" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: Received-SPF: pass client-ip=5.77.41.174; envelope-from=hugo@heagren.com; helo=whuk14.whukhost.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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=_fb3e12df896daec6f068e4a6fdad815d Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Dear all, The attached patch adds commands for adding and removing entries in `keyboard-translate-table' interactively: - add an interactive spec to `key-translate' - add a new command `key-translate-remove', which does the opposite of `key-translate'. - add an option for users to customise how the latter function prompts for which from/to pair is removed. The default just lists them with `completing-read'. I find this sort of thing useful for cases where I want to use something other than space as a word separator (e.g. when typing lots of function names), or when for a long period I want to use the symbol which is usually on the shift of a key (i.e. I know I want to type "+" a lot, but not "="). The patch doesn't contain a NEWS entry yet -- I wanted to get the greenlight on the code first. Best, Hugo --=_fb3e12df896daec6f068e4a6fdad815d Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Add-commands-to-interactively-set-unset-keyboard-tra.patch Content-Disposition: attachment; filename=0001-Add-commands-to-interactively-set-unset-keyboard-tra.patch; size=3772 RnJvbSBiNWIwZDZlNGM1M2ZjZWRlYTkyZGYwM2U4NmM1N2FmODU2YzlmYmI3IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBIdWdvIEhlYWdyZW4gPGh1Z29AaGVhZ3Jlbi5jb20+CkRhdGU6 IFN1biwgNCBBdWcgMjAyNCAxMjo1NDoyNyArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIEFkZCBjb21t YW5kcyB0byBpbnRlcmFjdGl2ZWx5IHNldC91bnNldCBrZXlib2FyZCB0cmFuc2xhdGlvbnMKCiog bGlzcC9rZXltYXAuZWwgKGtleS10cmFuc2xhdGUpOiBBZGQgYW4gaW50ZXJhY3RpdmUgZm9ybSwg cHJvbXB0aW5nIGZvcgprZXlzIHRvIHRyYW5zbGF0ZSwgYW5kIHVwZGF0ZSBkb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itcIj1cIiB0byBcIitcIiwgdGhlIGZ1bmN0aW9uIHNob3VsZCBy ZXR1cm4gdGhlIHZlY3RvciBbNjFdKSIKKyAgOnR5cGUgJ2Z1bmN0aW9uCisgIDpncm91cCAna2V5 Ym9hcmQpCisKKyhkZWZ1biBrZXktc2VsZWN0LXRyYW5zbGF0aW9uICgpCisgICJQcm9tcHQgZm9y IGEgY3VycmVudCBrZXlib2FyZCB0cmFuc2xhdGlvbiBwYWlyIHdpdGggYCdjb21wbGV0aW5nLXJl YWQnLgorCitFYWNoIHBhaXIgaXMgZm9ybWF0dGVkIGFzIFwiRlJPTSAtPiBUT1wiLiIKKyAgKGxl dCogKChtaW5pYnVmZmVyLWFsbG93LXRleHQtcHJvcGVydGllcyB0KQorICAgICAgICAgKGNvbGxl Y3Rpb24pCisgICAgICAgICA7OyBBbGlnbm1lbnQgaGVscGVycworICAgICAgICAgKHBhZCAwKQor ICAgICAgICAgKF8gKG1hcC1jaGFyLXRhYmxlCisgICAgICAgICAgICAgKGxhbWJkYSAoayBfKQor ICAgICAgICAgICAgICAgKHdoZW4gKD4gKGxlbmd0aCAoa2V5LWRlc2NyaXB0aW9uIGBbLGtdKSkg cGFkKQorICAgICAgICAgICAgICAgICAoc2V0cSBwYWQgKGxlbmd0aCAoa2V5LWRlc2NyaXB0aW9u IGBbLGtdKSkpKSkKKyAgICAgICAgICAgICBrZXlib2FyZC10cmFuc2xhdGUtdGFibGUKKyAgICAg ICAgICAgICApKQorICAgICAgICAgKGZvcm1hdC1mdW5jCisgICAgICAgICAgKGxhbWJkYSAoayB2 KQorICAgICAgICAgICAgKHNldHEgY29sbGVjdGlvbgorICAgICAgICAgICAgICAgICAgKGNvbnMK KyAgICAgICAgICAgICAgICAgICAocHJvcGVydGl6ZQorICAgICAgICAgICAgICAgICAgICAoZm9y bWF0CisgICAgICAgICAgICAgICAgICAgICAiJXMgLT4gJXMiCisgICAgICAgICAgICAgICAgICAg ICAoc3RyaW5nLXBhZCAoa2V5LWRl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YXVsdCBuby1y ZW1hcCBwb3NpdGlvbikKICAgIlJldHVybiB0aGUgYmluZGluZyBmb3IgY29tbWFuZCBLRVkgaW4g S0VZTUFQLgogS0VZIGlzIGEgc3RyaW5nIHRoYXQgc2F0aXNmaWVzIGBrZXktdmFsaWQtcCcuCi0t IAoyLjIwLjEKCg== --=_fb3e12df896daec6f068e4a6fdad815d-- From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 17 04:47:32 2024 Received: (at 72460) by debbugs.gnu.org; 17 Aug 2024 08:47:32 +0000 Received: from localhost ([127.0.0.1]:53454 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfF5v-0001NF-Tq for submit@debbugs.gnu.org; Sat, 17 Aug 2024 04:47:32 -0400 Received: from eggs.gnu.org ([209.51.188.92]:41146) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sfF5u-0001N2-R7 for 72460@debbugs.gnu.org; Sat, 17 Aug 2024 04:47:31 -0400 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 1sfF5B-00076m-Ui; Sat, 17 Aug 2024 04:46:46 -0400 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=FSk5luykG0SpVidLUDpUYBaAWEiuatutxZQYT7T0D98=; b=QMM48/zPBuGH 88j5vTMhv9Bxy3wgpDqOoYKKShsk/tSrgpi07FYalm97pAHflFgFqxvuanm1Q0JdWFZZJEMzqjuj/ 3anKMyvfU72SyRpTMzra2QpUh87UAhQyIXOk3y9usnwiDokmQGUefiiD5yCX/Fv3vAYJ/i/XKLlIS JDRF64oZnD+6RIZaLQw+jvQxf0/zblyBtjGhH3+fladOQhJp7y2rgNi4nWRRiI3LhdlcGxpy1XbJl Xe3KOIy45Tiktd+dHjv6WhRCAWeX2PTW8zvnzET91eP2H9+tPwqIdZiz97ap4jKrLC6c0lNtbEWeE DsbGY9esIm1xBWs45Rzo0g==; Date: Sat, 17 Aug 2024 11:46:42 +0300 Message-Id: <86cym74jv1.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com, Stefan Monnier In-Reply-To: (hugo@heagren.com) Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Sun, 04 Aug 2024 13:16:29 +0100 > From: hugo@heagren.com > > The attached patch adds commands for adding and removing entries in > `keyboard-translate-table' interactively: > - add an interactive spec to `key-translate' > - add a new command `key-translate-remove', which does the opposite of > `key-translate'. > - add an option for users to customise how the latter function prompts > for which from/to pair is removed. The default just lists them with > `completing-read'. > > I find this sort of thing useful for cases where I want to use > something other than space as a word separator (e.g. when typing lots > of function names), or when for a long period I want to use the symbol > which is usually on the shift of a key (i.e. I know I want to type "+" > a lot, but not "="). > > The patch doesn't contain a NEWS entry yet -- I wanted to get the > greenlight on the code first. Thanks. Stefan, any comments? From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 19 10:43:40 2024 Received: (at 72460) by debbugs.gnu.org; 19 Aug 2024 14:43:40 +0000 Received: from localhost ([127.0.0.1]:58915 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sg3bg-0006S8-5t for submit@debbugs.gnu.org; Mon, 19 Aug 2024 10:43:40 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:61090) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sg3be-0006Rm-94 for 72460@debbugs.gnu.org; Mon, 19 Aug 2024 10:43:39 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 9C589441BF6; Mon, 19 Aug 2024 10:42:49 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1724078568; bh=aNHRY/kGONHXEeSTX5zgkXd/wvthXqWW7jG33EnjuOQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=geOKPsoupJFe3Yi3RcaER5GFnBSbZVcgRcTcqSgxpab1QIBayF9CMB8h8NWq2jlSC D/Nq2yt7Hn80x9wlY6Oi6mK4P9aNKYVBNv8lBXKONbGj/6KYTXC+N3xnTuh9f9DPho 7RrPqy+hgjD2gKXMSZtJIgeYc/I+xFYIkqH4yrOxs5r5WdV1uRepZ7bg37GLWOGspr +pvINltQZ35nJ0kuaowDWF3UsVw22Ie0C4ln4ZuVv8PI87A7lA1Sig3Llh2VBocqkd nvCtxlULx/qyZ5fKrPtt7RKQbU8h3qSyjjuFeby98KIOtx1uCQCP665nWbT8DIEdIF OajeCeiIK3t6Q== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 0150B441B16; Mon, 19 Aug 2024 10:42:48 -0400 (EDT) Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id E5E0612045A; Mon, 19 Aug 2024 10:42:47 -0400 (EDT) From: Stefan Monnier To: hugo@heagren.com Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively In-Reply-To: (hugo@heagren.com's message of "Sun, 04 Aug 2024 13:16:29 +0100") Message-ID: References: Date: Mon, 19 Aug 2024 10:42:43 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.149 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > I find this sort of thing useful for cases where I want to use > something other than space as a word separator (e.g. when typing lots > of function names), or when for a long period I want to use the symbol > which is usually on the shift of a key (i.e. I know I want to type "+" > a lot, but not "="). Interesting. I can see that `keyboard-translate-table` is indeed a cheap way to implement it. [ This said, it applies at a very low level (directly inside `read-event`) and only to "characters" (e.g. not to the `tab` or `return` keys), which can make it both maybe too powerful and yet not flexible enough. ] > + (interactive `(,(key-description `[,(read-char "From: ")]) > + ,(key-description `[,(read-char "To: ")]))) [ Personally, I'd add a comment lamenting the fact that `keymap-*` functions force us to use `key-description` here only for that to be undone by `key-parse`. ] > +(defcustom key-translate-selection-function #'key-select-translation Do we need this? > +pair in `keyboard-translate-table', and return a vector containing only > +the FROM key of the selected pair (e.g. if the selected pair translates > +\"=\" to \"+\", the function should return the vector [61])" Why not return just the char rather than a vector containing the char? > +(defun key-translate-remove (from) > + "Remove translation of FROM from `keyboard-translate-table'. > + > +FROM must satisfy `key-valid-p'. If FROM has no entry in > +`keyboard-translate-table', this has no effect." > + (interactive (list (key-description > + (funcall key-translate-selection-function)))) > + (set-char-table-range > + keyboard-translate-table (aref (key-parse from) 0) nil)) If FROM maps to a sequence of length != 1, we'll either signal an ugly error or silently ignore the rest. Any reason why you didn't make FROM be a simple character? Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 31 04:09:09 2024 Received: (at 72460) by debbugs.gnu.org; 31 Aug 2024 08:09:09 +0000 Received: from localhost ([127.0.0.1]:53868 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skJAS-0006Rl-S4 for submit@debbugs.gnu.org; Sat, 31 Aug 2024 04:09:09 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55018) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skJAR-0006RZ-LG for 72460@debbugs.gnu.org; Sat, 31 Aug 2024 04:09:08 -0400 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 1skJ9Q-000759-6f; Sat, 31 Aug 2024 04:08:04 -0400 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=CEAUW5VQJMyuzkM4w5H9wDouzyPli82drfuw/sVr9TU=; b=cifCirze0ML6 4OE/Kp4QIjH0XheFt4Yf84nuDzA96rAFXCSmN+3dQoVPI1Vz3/vBBOlMvufXR1RSDajLDbiqTlMgG Pj+s58epYvyhcUtebgopIunAuB14VkRqWrKHtOJ40sh/sL9NbxvAsGN0bG2uopTVOaBWcQhEF7Rbo 2djbZNKG/morGs8JbpTXoT1qJQNT2qk+ZSnITEWyrpDq4z5QMAEDUjlyv11Ur04Eggt2RwIBXUu6W A/C6sp/9Txd/S6Ccsk2Wk6leDXCLcyrlPzi3V/YHsb2yDxmtGpZEBTBxI/pHd2ffMOtMhafcj/YFO OWlyeP5pvDbAiqQGQ8qUAQ==; Date: Sat, 31 Aug 2024 11:08:02 +0300 Message-Id: <86o759cdy5.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com, Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! Hugo, can you please respond to Stefan's review comments, so we could make progress here? > Cc: 72460@debbugs.gnu.org > Date: Mon, 19 Aug 2024 10:42:43 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > I find this sort of thing useful for cases where I want to use > > something other than space as a word separator (e.g. when typing lots > > of function names), or when for a long period I want to use the symbol > > which is usually on the shift of a key (i.e. I know I want to type "+" > > a lot, but not "="). > > Interesting. I can see that `keyboard-translate-table` is indeed > a cheap way to implement it. > > [ This said, it applies at a very low level (directly inside > `read-event`) and only to "characters" (e.g. not to the `tab` or > `return` keys), which can make it both maybe too powerful and yet not > flexible enough. ] > > > + (interactive `(,(key-description `[,(read-char "From: ")]) > > + ,(key-description `[,(read-char "To: ")]))) > > [ Personally, I'd add a comment lamenting the fact that `keymap-*` > functions force us to use `key-description` here only for that to be > undone by `key-parse`. ] > > > +(defcustom key-translate-selection-function #'key-select-translation > > Do we need this? > > > +pair in `keyboard-translate-table', and return a vector containing only > > +the FROM key of the selected pair (e.g. if the selected pair translates > > +\"=\" to \"+\", the function should return the vector [61])" > > Why not return just the char rather than a vector containing the char? > > > +(defun key-translate-remove (from) > > + "Remove translation of FROM from `keyboard-translate-table'. > > + > > +FROM must satisfy `key-valid-p'. If FROM has no entry in > > +`keyboard-translate-table', this has no effect." > > + (interactive (list (key-description > > + (funcall key-translate-selection-function)))) > > + (set-char-table-range > > + keyboard-translate-table (aref (key-parse from) 0) nil)) > > If FROM maps to a sequence of length != 1, we'll either signal an ugly > error or silently ignore the rest. > Any reason why you didn't make FROM be a simple character? > > > Stefan > > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Aug 31 09:58:21 2024 Received: (at 72460) by debbugs.gnu.org; 31 Aug 2024 13:58:21 +0000 Received: from localhost ([127.0.0.1]:55316 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skOcO-00005m-T3 for submit@debbugs.gnu.org; Sat, 31 Aug 2024 09:58:21 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:52884) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1skOcL-00005R-TJ for 72460@debbugs.gnu.org; Sat, 31 Aug 2024 09:58:19 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 96B5E442234; Sat, 31 Aug 2024 09:57:13 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1725112627; bh=f7xekDPrJuDOY5YOj25ir8ZIm5TnFZgPtfLzBXhe//g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=HNlpOmToQ8bV2MhKJbI0GSquXba1a1hjK8xlmQZ94Aem4YGOKRBh0c4gGqwwyQ4xw jfCXM6C1FMmLe9K0zr/Kx4hMozGailpre2OLFOwS443gJmFBNNsnxrMJWy6Q9DwEou Ww72MH2OVMHDjf9pD3vmROiC6MkifuiLZgiKZGw92dNst4qstirzZOVZ2sJe03U8Wi CtnptJ/4EaZjro52CAkDLs/fYOSJlC158+bJWW76MO36r9791VvukBGIY+B4LcH7jU d6XPCa6mNEkDClg8/W98MwVQW9W7g0r2CI0RFOBp28saJzRJap1xtjSwoylPiYWFOC UWo4ziEmoE4HA== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 55D91441548; Sat, 31 Aug 2024 09:57:07 -0400 (EDT) Received: from pastel (unknown [216.154.9.87]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 29F1D120C5D; Sat, 31 Aug 2024 09:57:07 -0400 (EDT) From: Stefan Monnier To: hugo@heagren.com Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively In-Reply-To: (hugo@heagren.com's message of "Tue, 20 Aug 2024 14:01:53 +0100") Message-ID: References: Date: Sat, 31 Aug 2024 09:56:58 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.164 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain T_SCC_BODY_TEXT_LINE -0.01 - X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) >> > +(defcustom key-translate-selection-function #'key-select-translation >> Do we need this? > Short answer: yes. > > I wanted a way for users to customise how the current translation > pairs are presented when they choose one to remove. The initial > motivation was that some users might want to customise the formatting > of the pairs; "X -> Y" vs "X =E2=86=92 Y" vs "X Y" etc. (I'm the sort of = user > who cares about this sort of thing a lot). Rewriting a whole new `key-translate-selection-function` function for that is not significantly easier than rewriting a whole new `key-translate-remove`, so I think this is firmly in the overengineering side of the camp. > I also envisage that many users will want to use/expect > completing-read (as in the default) and will want the from/to elements > vertically aligned (again, I am this user). AFAICT, you're the first user to propose this functionality in Emacs's 40 years life, so I wouldn't bet on "many users". BTW, I just noticed: > + ;; Populate collection > + (map-char-table format-func keyboard-translate-table) > + (get-text-property 0 'key-translate-from > + (completing-read "Key Translation: " collection))= )) You can't trust `get-text-property` here (especially since you don't even force `completing-read` to `require-match`). Instead you should do something like `key-parse`. > I think here I was just copying the current calling convention for the > existing (non-interactive) `key-translate'. Its docstring reads: > >> Both FROM and TO should be specified by strings that satisfy >> `key-valid-p'. > > I sort of assumed someone cleverer than me had a good reason. I suspect this is because we expect this function to be called from a `~/.emacs` with a literal constant as argument, and we've tried to unify on using the "KBD" syntax for those cases, since it's a friendlier syntax than the "vector of events" where you need to distinguish between symbols and chars with/without modifiers. Since the arg of `key-translate` can be only a valid char (rather than any arbitrary key potentially with modifiers), the argument is much less strong, but my guess is that it was uniformity. In the case of `key-translate-remove` I don't expect the arg to be a literal constant in the code, so "nice/uniform syntax to write the argument value" shouldn't be a concern. =F0=9F=99=82 Stefan From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 14 03:38:26 2024 Received: (at 72460) by debbugs.gnu.org; 14 Sep 2024 07:38:26 +0000 Received: from localhost ([127.0.0.1]:44668 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spNMQ-0002v8-0W for submit@debbugs.gnu.org; Sat, 14 Sep 2024 03:38:26 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46034) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1spNMN-0002uu-Tw for 72460@debbugs.gnu.org; Sat, 14 Sep 2024 03:38:24 -0400 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 1spNM7-0001AY-Vb; Sat, 14 Sep 2024 03:38:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=HDUUhGNKYPUXiUjLgix1LoVPevKGe3X0W94OOhnuGQE=; b=Rg6rGMG2xNRfWPiNF1Qg oW4MRV2ZiV9C2bkDO+oaNxQTReCwp0LNBcfF5w/r5WVuveGFzv0mzATIyB/VwwmTL8mYHhMcQ+1jy C083Xy1gUw60WH08ameDJI+JSqCfqZQWCDEaAa7kBEBABWjgvhBpMDRFQPa9Denpxmd3DbwAlIUoJ iFT314mkDbBW9z/aUuVUnPvYiwQxvUR0OOmfLiGqlE8QEH3qNaMaNBVkovOxr8PgzDh3y4axl9tZy wGBKRTWoSoPWLzaHwHK2EFsGvsP8V8dk9QRAPl5f3cnlcktHsKSh32c9CoXX8o0EM3efj28nu4zYe t9gujzPLdBJscQ==; Date: Sat, 14 Sep 2024 10:38:04 +0300 Message-Id: <86bk0qit2b.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com, Stefan Monnier In-Reply-To: (bug-gnu-emacs@gnu.org) Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively References: MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hugo, Any followups to Stefan's comments? > Cc: 72460@debbugs.gnu.org > Date: Sat, 31 Aug 2024 09:56:58 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > >> > +(defcustom key-translate-selection-function #'key-select-translation > >> Do we need this? > > Short answer: yes. > > > > I wanted a way for users to customise how the current translation > > pairs are presented when they choose one to remove. The initial > > motivation was that some users might want to customise the formatting > > of the pairs; "X -> Y" vs "X → Y" vs "X Y" etc. (I'm the sort of user > > who cares about this sort of thing a lot). > > Rewriting a whole new `key-translate-selection-function` function for > that is not significantly easier than rewriting a whole new > `key-translate-remove`, so I think this is firmly in the overengineering > side of the camp. > > > I also envisage that many users will want to use/expect > > completing-read (as in the default) and will want the from/to elements > > vertically aligned (again, I am this user). > > AFAICT, you're the first user to propose this functionality in Emacs's > 40 years life, so I wouldn't bet on "many users". > > BTW, I just noticed: > > > + ;; Populate collection > > + (map-char-table format-func keyboard-translate-table) > > + (get-text-property 0 'key-translate-from > > + (completing-read "Key Translation: " collection)))) > > You can't trust `get-text-property` here (especially since you don't > even force `completing-read` to `require-match`). > Instead you should do something like `key-parse`. > > > I think here I was just copying the current calling convention for the > > existing (non-interactive) `key-translate'. Its docstring reads: > > > >> Both FROM and TO should be specified by strings that satisfy > >> `key-valid-p'. > > > > I sort of assumed someone cleverer than me had a good reason. > > I suspect this is because we expect this function to be called from > a `~/.emacs` with a literal constant as argument, and we've tried to > unify on using the "KBD" syntax for those cases, since it's a friendlier > syntax than the "vector of events" where you need to distinguish between > symbols and chars with/without modifiers. > > Since the arg of `key-translate` can be only a valid char (rather than > any arbitrary key potentially with modifiers), the argument is much less > strong, but my guess is that it was uniformity. > > In the case of `key-translate-remove` I don't expect the arg to be > a literal constant in the code, so "nice/uniform syntax to write the > argument value" shouldn't be a concern. 🙂 > > > Stefan > > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 04:50:04 2024 Received: (at 72460) by debbugs.gnu.org; 28 Sep 2024 08:50:04 +0000 Received: from localhost ([127.0.0.1]:51769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suT9P-00059u-D3 for submit@debbugs.gnu.org; Sat, 28 Sep 2024 04:50:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:35592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suT9N-000595-6l for 72460@debbugs.gnu.org; Sat, 28 Sep 2024 04:50:01 -0400 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 1suT8n-0001A7-G5; Sat, 28 Sep 2024 04:49:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=fr/zAnbam2jDvXzcMtC8ofD+pf5qH5pqZZvzOR8lEuQ=; b=kRHfJd8xnrpJTVnRNMZ+ RJ5EeuPV75q3W74QM7XwqECozx7OEGIanpVbuwqGUUL5hB+sCtQcIoVBP0UhuHHlQtLFzvSayAQic fT6ba5Pbs10tEwA8afY11hpCRHrTsK0eQhx7wnExSfvu9ywj/V+mY4kikTTmiyUO6yxWCniNmieCC zZ/5ZT2sC+/YcsHx6+GYrXaRmiKIXXg/81UkDw329tG+UK8T2fKW7YrNNXeejXKUZXGNz9p/kRZS+ qG1kDpHrdvS0/oPIxx6m+kP94q+t/dKHSgoEgrXVYhKAhEwvwUZKPq2QWcfNHkvmQjYknWcOLdNwD I6qEVubbb0WxmQ==; Date: Sat, 28 Sep 2024 11:49:20 +0300 Message-Id: <86o7486u3z.fsf@gnu.org> From: Eli Zaretskii To: hugo@heagren.com In-Reply-To: <86bk0qit2b.fsf@gnu.org> (message from Eli Zaretskii on Sat, 14 Sep 2024 10:38:04 +0300) Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively References: <86bk0qit2b.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! Hugo, please respond. > Cc: 72460@debbugs.gnu.org > Date: Sat, 14 Sep 2024 10:38:04 +0300 > From: Eli Zaretskii > > Hugo, > > Any followups to Stefan's comments? > > > Cc: 72460@debbugs.gnu.org > > Date: Sat, 31 Aug 2024 09:56:58 -0400 > > From: Stefan Monnier via "Bug reports for GNU Emacs, > > the Swiss army knife of text editors" > > > > >> > +(defcustom key-translate-selection-function #'key-select-translation > > >> Do we need this? > > > Short answer: yes. > > > > > > I wanted a way for users to customise how the current translation > > > pairs are presented when they choose one to remove. The initial > > > motivation was that some users might want to customise the formatting > > > of the pairs; "X -> Y" vs "X → Y" vs "X Y" etc. (I'm the sort of user > > > who cares about this sort of thing a lot). > > > > Rewriting a whole new `key-translate-selection-function` function for > > that is not significantly easier than rewriting a whole new > > `key-translate-remove`, so I think this is firmly in the overengineering > > side of the camp. > > > > > I also envisage that many users will want to use/expect > > > completing-read (as in the default) and will want the from/to elements > > > vertically aligned (again, I am this user). > > > > AFAICT, you're the first user to propose this functionality in Emacs's > > 40 years life, so I wouldn't bet on "many users". > > > > BTW, I just noticed: > > > > > + ;; Populate collection > > > + (map-char-table format-func keyboard-translate-table) > > > + (get-text-property 0 'key-translate-from > > > + (completing-read "Key Translation: " collection)))) > > > > You can't trust `get-text-property` here (especially since you don't > > even force `completing-read` to `require-match`). > > Instead you should do something like `key-parse`. > > > > > I think here I was just copying the current calling convention for the > > > existing (non-interactive) `key-translate'. Its docstring reads: > > > > > >> Both FROM and TO should be specified by strings that satisfy > > >> `key-valid-p'. > > > > > > I sort of assumed someone cleverer than me had a good reason. > > > > I suspect this is because we expect this function to be called from > > a `~/.emacs` with a literal constant as argument, and we've tried to > > unify on using the "KBD" syntax for those cases, since it's a friendlier > > syntax than the "vector of events" where you need to distinguish between > > symbols and chars with/without modifiers. > > > > Since the arg of `key-translate` can be only a valid char (rather than > > any arbitrary key potentially with modifiers), the argument is much less > > strong, but my guess is that it was uniformity. > > > > In the case of `key-translate-remove` I don't expect the arg to be > > a literal constant in the code, so "nice/uniform syntax to write the > > argument value" shouldn't be a concern. 🙂 > > > > > > Stefan > > > > > > > > > > > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 11:33:51 2024 Received: (at 72460) by debbugs.gnu.org; 28 Sep 2024 15:33:51 +0000 Received: from localhost ([127.0.0.1]:36244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suZSA-0007cn-RZ for submit@debbugs.gnu.org; Sat, 28 Sep 2024 11:33:51 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]:60230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suZS7-0007cK-QK for 72460@debbugs.gnu.org; Sat, 28 Sep 2024 11:33:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To: From:Date:MIME-Version: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=7kMsfmUu3CGTlPv+AZ2jVXlVXZLJdRijtPUVh1mrOQ4=; b=mkGFJX7c8It4TymS5lNA2I76Te TVgMZ8erMEnvJitXX4ekWN1RpgSBS9QjoYGVUluKlZ4YR/PvaCOvENNAO+N/4jD0J6XZ7+rygB+Nq WlzhaKHk3RNl8OHMp3pKfhG/Pdm/5atk6+R24RCv56UN18iEbWjxA+aCU1lBff8IIo81G5Wgfp3sc BMt0qZ14Xdqu129T1YKjIKStipG7M0rR++WqxSVwtpeTEZTFQY1xtNHDJR3kj0PMdm6Gd6kPWiomw 1dqkQlggDiswOF0MXKKP8zOY7TxHjYT4ZVRrJKDezCYvwCUtObgOzmZnGhRlfJKEmM3DvT5Rc28tK k1GktqUQ==; Received: from [::1] (port=49668 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.97.1) (envelope-from ) id 1suZRX-000000037R0-27HM; Sat, 28 Sep 2024 16:33:11 +0100 MIME-Version: 1.0 Date: Sat, 28 Sep 2024 16:33:09 +0100 From: hugo@heagren.com To: Eli Zaretskii Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively In-Reply-To: <86o7486u3z.fsf@gnu.org> References: <86bk0qit2b.fsf@gnu.org> <86o7486u3z.fsf@gnu.org> User-Agent: Roundcube Webmail/1.6.8 Message-ID: X-Sender: hugo@heagren.com Content-Type: multipart/mixed; boundary="=_dbc61c6def83ef56a0159613aa6373a9" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org, monnier@iro.umontreal.ca X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=_dbc61c6def83ef56a0159613aa6373a9 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed Hi all, sorry, I was working on this last night , had the patch sorted, and then somehow my browser crashed and I couldn't get to my email. Apologies for all the delays. > Rewriting a whole new `key-translate-selection-function` function for > that is not significantly easier than rewriting a whole new > `key-translate-remove`, so I think this is firmly in the > overengineering > side of the camp. Fair enough, I've got rid of the defcustom. > You can't trust `get-text-property` here (especially since you don't > even force `completing-read` to `require-match`). > Instead you should do something like `key-parse`. Good spot. > In the case of `key-translate-remove` I don't expect the arg to be > a literal constant in the code, so "nice/uniform syntax to write the > argument value" shouldn't be a concern. 🙂 Nice, removing the defcustom makes the whole thing simpler anyway. The way it works now is that `key-select-translation' returns a string (which passes `key-valid-p'). I went with this because then it's very straightforward to pass the result to `key-translate' in `key-translate-remove'. The alternative would be to parse a key vector out of the string at the end of `key-select-translation', but then immediately convert this back into a string (a string like the one I went with in the end) in the interactive form of `key-translate-remove'. New patch attached. Hugo --=_dbc61c6def83ef56a0159613aa6373a9 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Add-commands-to-interactively-set-unset-keyboard-tra.patch Content-Disposition: attachment; filename=0001-Add-commands-to-interactively-set-unset-keyboard-tra.patch; size=3338 RnJvbSA1NmU5MjcwZGMyMDJiOTQwZDE4ZjVjMzQ4MDdhNmY3MTlmYWE5OTA5IE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBIdWdvIEhlYWdyZW4gPGh1Z29AaGVhZ3Jlbi5jb20+CkRhdGU6 IFN1biwgNCBBdWcgMjAyNCAxMjo1NDoyNyArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIEFkZCBjb21t YW5kcyB0byBpbnRlcmFjdGl2ZWx5IHNldC91bnNldCBrZXlib2FyZCB0cmFuc2xhdGlvbnMKCiog bGlzcC9rZXltYXAuZWwgKGtleS10cmFuc2xhdGUpOiBBZGQgYW4gaW50ZXJhY3RpdmUgZm9ybSwg cHJvbXB0aW5nIG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y4iCisgIChsZXQqICgobWluaWJ1 ZmZlci1hbGxvdy10ZXh0LXByb3BlcnRpZXMgdCkKKyAgICAgICAgIChjb2xsZWN0aW9uKQorICAg ICAgICAgOzsgQWxpZ25tZW50IGhlbHBlcnMKKyAgICAgICAgIChwYWQgMCkKKyAgICAgICAgIChf IChtYXAtY2hhci10YWJsZQorICAgICAgICAgICAgIChsYW1iZGEgKGsgXykKKyAgICAgICAgICAg ICAgICh3aGVuICg+IChsZW5ndGggKGtleS1kZXNjcmlwdGlvbiBgWyxrXSkpIHBhZCkKKyAgICAg ICAgICAgICAgICAgKHNldHEgcGFkIChsZW5ndGggKGtleS1kZXNjcmlwdGlvbiBgWyxrXSkpKSkp CisgICAgICAgICAgICAga2V5Ym9hcmQtdHJhbnNsYXRlLXRhYmxlCisgICAgICAgICAgICAgKSkK KyAgICAgICAgIChmb3JtYXQtZnVuYworICAgICAgICAgIChsYW1iZGEgKGsgdikKKyAgICAgICAg ICAgIChzZXRxIGNvbGxlY3Rpb24KKyAgICAgICAgICAgICAgICAgIChjb25zCisgICAgICAgICAg ICAgICAgICAgKHByb3BlcnRpemUKKyAgICAgICAgICAgICAgICAgICAgKGZvcm1hdAorICAgICAg ICAgICAgICAgICAgICAgIiVzIC0+ICVzIgorICAgICAgICAgICAgICAgICAgICAgKHN0cmluZy1w YWQgKGtleS1kZXNjcmlwdGlvbiBgWyxrXSkgcGFkKQorICAgICAgICAgICAgICAgICAgICAgKGtl eS1kZXNjcmlwdGlvbiBgWyx2XSkpCisgICAgICAgICAgICAgICAgICAgICdrZXktdHJhbnNsYXRl LWZyb20gaykKKyAgICAgICAgICAgICAgICAgICBjb2xsZWN0aW9uKSkpKSkKKyAgICA7OyBQb3B1 bGF0ZSBjb2xsZWN0aW9uCisgICAgKG1hcC1jaGFyLXRhYmxlIGZvcm1hdC1mdW5jIGtleWJvYXJk LXRyYW5zbGF0ZS10YWJsZSkKKyAgICAoY2FyCisgICAgIChzcGxpdC1zdHJpbmcKKyAgICAgIChj b21wbGV0aW5nLXJlYWQKKyAgICAgICAiS2V5IFRyYW5zbGF0aW9uOiAiIGNvbGxlY3Rpb24gbmls IHQpKSkpKQorCisoZGVmdW4ga2V5LXRyYW5zbGF0ZS1yZW1vdmUgKGZyb20pCisgICJSZW1vdmUg dHJhbnNsYXRpb24gb2YgRlJPTSBmcm9tIGBrZXlib2FyZC10cmFuc2xhdGUtdGFibGUnLgorCitG Uk9NIG11c3Qgc2F0aXNmeSBga2V5LXZhbGlkLXAnLiAgSWYgRlJPTSBoYXMgbm8gZW50cnkgaW4K K2BrZXlib2FyZC10cmFuc2xhdGUtdGFibGUnLCB0aGlzIGhhcyBubyBlZmZlY3QuIgorICAoaW50 ZXJhY3RpdmUgKGxpc3QgKGtleS1zZWxlY3QtdHJhbnNsYXRpb24pKSkKKyAgKGtleS10cmFuc2xh dGUgZnJvbSBuaWwpKQorCiAoZGVmdW4ga2V5bWFwLWxvb2t1cCAoa2V5bWFwIGtleSAmb3B0aW9u YWwgYWNjZXB0LWRlZmF1bHQgbm8tcmVtYXAgcG9zaXRpb24pCiAgICJSZXR1cm4gdGhlIGJpbmRp bmcgZm9yIGNvbW1hbmQgS0VZIGluIEtFWU1BUC4KIEtFWSBpcyBhIHN0cmluZyB0aGF0IHNhdGlz ZmllcyBga2V5LXZhbGlkLXAnLgotLSAKMi4yMC4xCgo= --=_dbc61c6def83ef56a0159613aa6373a9-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 12:03:26 2024 Received: (at 72460) by debbugs.gnu.org; 28 Sep 2024 16:03:26 +0000 Received: from localhost ([127.0.0.1]:37587 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suZun-0001Qb-RF for submit@debbugs.gnu.org; Sat, 28 Sep 2024 12:03:26 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:47013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suZum-0001QF-71 for 72460@debbugs.gnu.org; Sat, 28 Sep 2024 12:03:24 -0400 Received: from pmg2.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 4455A8081F; Sat, 28 Sep 2024 12:02:48 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1727539367; bh=zQP82SOrvY2G/BmB7M7FBrfldGiNJOncWG2yOoA66nk=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Fmkzzsn3RzHo3C1tuI+VBWVoxTdUHA2yGKgAMQoObyMkvJaNdwA0HwGM1bcZL1jSv 6Zu2vgU+LxzegmO1C/kyoNFHr6XWJRKUcFQfIcWPjoqtQk+XrrphtOpRnxg8AeO/96 lVQNVYD2SIDZvUIeMHfPLqa6a6uicuG87wnGcqqF7RQTX30BfwWNn2258kKvjzyICt 2oMsUYXl4bbe7z2DIBOMHY15o7Ud1XcuCDJ99Xh1m+SHD5HwpIgUg+TtHXJm8ItVqv hVk6fUnZjhbLorzdfHxgLSqK6ACUfnrs7OhANXGyXPLgB0hTB+F+47o2y5a1DvXR6r j5ZR3WqLzRwXg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg2.iro.umontreal.ca (Proxmox) with ESMTP id 55AD2803CA; Sat, 28 Sep 2024 12:02:47 -0400 (EDT) Received: from pastel (unknown [216.154.18.220]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1C0A4120799; Sat, 28 Sep 2024 12:02:47 -0400 (EDT) From: Stefan Monnier To: hugo@heagren.com Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively In-Reply-To: (hugo@heagren.com's message of "Sat, 28 Sep 2024 16:33:09 +0100") Message-ID: References: <86bk0qit2b.fsf@gnu.org> <86o7486u3z.fsf@gnu.org> Date: Sat, 28 Sep 2024 12:02:45 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.156 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > New patch attached. Thanks Hugo, LGTM. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Oct 02 22:45:39 2024 Received: (at 72460) by debbugs.gnu.org; 3 Oct 2024 02:45:40 +0000 Received: from localhost ([127.0.0.1]:59572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swBqV-0002M1-Ak for submit@debbugs.gnu.org; Wed, 02 Oct 2024 22:45:39 -0400 Received: from whuk14.whukhost.com ([5.77.41.174]:52084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swBqS-0002Ll-U7 for 72460@debbugs.gnu.org; Wed, 02 Oct 2024 22:45:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=heagren.com ; s=default; h=Content-Type:Message-ID:References:In-Reply-To:Subject:Cc:To: From:Date:MIME-Version: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=dEv/pehFHoWWzItNgGMNIRmncj2OfGjclL0r/7ea39g=; b=bJbRmrLeJPVtFzrV19SkGd/+Gx 7hyOfsAXPukjNMzGtGUqbOgMxLBraSMwMbl+vYJ0ExzQRfKgajS8uRwX8KMoZMSZufTpV8KsqynQR 2L/zA3uqaUvzCw7f3rUoBqZ1c5eCpxaZgVF3fKwdvzEFzVorHYN2tm5sKWmQEkDzDHMQwZgF3n4jT uATrVWgrb5gRQayrtLN99b6rVvjAfnBZMM4rfZqZOjFFTBf1PsLxuPGN9DkrzNf0XVvMGr8qfUxdQ TwOVJjEh8r8aJXnkCH/IRgzt5TC+l7DfG5GpGOpgcENiFCKhxk9bVaB3Xda8qTsJRW2LmwdTNn0eT YZj6cXpw==; Received: from [::1] (port=40590 helo=whuk14.whukhost.com) by whuk14.whukhost.com with esmtpa (Exim 4.97.1) (envelope-from ) id 1swBpw-0000000CUas-1aeT; Thu, 03 Oct 2024 03:45:23 +0100 MIME-Version: 1.0 Date: Thu, 03 Oct 2024 03:45:02 +0100 From: hugo@heagren.com To: Stefan Monnier Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively In-Reply-To: References: <86bk0qit2b.fsf@gnu.org> <86o7486u3z.fsf@gnu.org> User-Agent: Roundcube Webmail/1.6.8 Message-ID: <57d837226be0ce82a6340658b1297445@heagren.com> X-Sender: hugo@heagren.com Content-Type: multipart/mixed; boundary="=_81e85bd4b66b3956f797dbc2453ab6f1" X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - whuk14.whukhost.com X-AntiAbuse: Original Domain - debbugs.gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - heagren.com X-Get-Message-Sender-Via: whuk14.whukhost.com: authenticated_id: hugo@heagren.com X-Authenticated-Sender: whuk14.whukhost.com: hugo@heagren.com X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=_81e85bd4b66b3956f797dbc2453ab6f1 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Hi all, following some short comments from Stefan, a better patch is now attached. The new version accounts for the case where multiple adjacent characters have the same translation and are thus presented as a range in `map-char-table'. I've dealt with this by displaying each one individually in the prompt, since: - the user probably *initially set* them separately if they are using the interactive functions - if they aren't using the interactive functions, the prompt doesn't matter Since this is the only substantive change since I was last told this looked good, I've also included a NEWS entry. I have already assigned my copyright to the FSF. Best, Hugo --=_81e85bd4b66b3956f797dbc2453ab6f1 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=0001-Add-commands-to-interactively-set-unset-keyboard-tra.patch Content-Disposition: attachment; filename=0001-Add-commands-to-interactively-set-unset-keyboard-tra.patch; size=4151 RnJvbSA3ZjQ4NjdlY2JkOTcxZTFkMTM4NjhlOTlmM2FlYTVkOWZhNGIwN2MzIE1vbiBTZXAgMTcg MDA6MDA6MDAgMjAwMQpGcm9tOiBIdWdvIEhlYWdyZW4gPGh1Z29AaGVhZ3Jlbi5jb20+CkRhdGU6 IFN1biwgNCBBdWcgMjAyNCAxMjo1NDoyNyArMDEwMApTdWJqZWN0OiBbUEFUQ0hdIEFkZCBjb21t YW5kcyB0byBpbnRlcmFjdGl2ZWx5IHNldC91bnNldCBrZXlib2FyZCB0cmFuc2xhdGlvbnMKCiog bGlzcC9rZXltYXAuZWwgKGtleS10cmFuc2xhdGUpOiBBZGQgYW4gaW50ZXJhY3RpdmUgZm9ybSwg cHJvbXB0aW5nIGZvcgprZXlzIHRvIHRyYW5zbGF0ZSwgYW5kIHVwZGF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gdGhhdCB0 aGUKKyAgOzsgdmFsdWVzIGNhbiBiZSBwYXNzZWQgdG8ga2V5bWFwLSogZnVuY3Rpb25zLCBldmVu IHRob3VnaCB0aG9zZQorICA7OyBmdW5jdGlvbnMgaW1tZWRpYXRlbHkgdW5kbyBpdCB3aXRoIGBr ZXktcGFyc2UnLgorICAoaW50ZXJhY3RpdmUgYCgsKGtleS1kZXNjcmlwdGlvbiBgWywocmVhZC1j aGFyICJGcm9tOiAiKV0pCisgICAgICAgICAgICAgICAgICwoa2V5LWRlc2NyaXB0aW9uIGBbLChy ZWFkLWNoYXIgIlRvOiAiKV0pKSkKICAgKGtleW1hcC0tY2hlY2sgZnJvbSkKICAgKHdoZW4gdG8K ICAgICAoa2V5bWFwLS1jaGVjayB0bykpCkBAIC00MTcsNiArNDI0LDU1IEBAIGtleS10cmFuc2xh dGUKICAgICAgICAgICAoYXJlZiBmcm9tLWtleSAwKQogICAgICAgICAgIChhbmQgdG8gKGFyZWYg dG8ta2V5IDApKSkpKQogCisoZGVmdW4ga2V5LXNlbGVjdC10cmFuc2xhdGlvbiAoKQorICAiUHJv bXB0IGZvciBhIGN1cnJlbnQga2V5Ym9hcmQgdHJhbnNsYXRpb24gcGFpciB3aXRoIGBjb21wbGV0 aW5nLXJlYWQnLgorCitFYWNoIHBhaXIgaXMgZm9ybWF0dGVkIGFzIFwiRlJPTSAtPiBUT1wiLgor CitSZXR1cm4gdGhlIFwiRlJPTVwiIGFzIGEga2V5IHN0cmluZy4iCisgIChsZXQqICgoZm9ybWF0 dGVkLXRyYW5zLWFsaXN0IG5pbCkKKyAgICAgICAgIDs7IEFsaWdubWVudCBoZWxwZXJzCisgICAg ICAgICAocGFkIDApCisgICAgICAgICAoa2V5LWNvZGUtZnVuYworICAgICAgICAgIChsYW1iZGEg KGtjIHRyYW5zKQorICAgICAgICAgICAgKGxldCogKChkZXNjIChrZXktZGVzY3JpcHRpb24gYFss a2NdKSkKKyAgICAgICAgICAgICAgICAgICAobGVuIChsZW5ndGggZGVzYykpKQorICAgICAgICAg ICAgICAod2hlbiAoPiBsZW4gcGFkKQorICAgICAgICAgICAgICAgIChzZXRxIHBhZCBsZW4pKQor ICAgICAgICAgICAgICAocHVzaAorICAgICAgICAgICAgICAgYCgsZGVzYyAuICwoa2V5LWRlc2Ny aXB0aW9uIGBbLHRyYW5zXSkpCisgICAgICAgICAgICAgICBmb3JtYXR0ZWQtdHJhbnMtYWxpc3Qp KSkpCisgICAgICAgICAoZm9ybWF0LWZ1bmMKKyAgICAgICAgICAobGFtYmRhIChwYWlyKSA7OyAo a2V5IC4gdmFsdWUpCisgICAgICAgICAgICAoZm9ybWF0CisgICAgICAgICAgICAgIiVzIC0+ICVz IgorICAgICAgICAgICAgIChzdHJpbmctcGFkIChrZXktZGVzY3JpcHRpb24gYFssKGNhciBwYWly KV0pIHBhZCkKKyAgICAgICAgICAgICAoa2V5LWRlc2NyaXB0aW9uIGBbLChjZHIgcGFpcildKSkp KSkKKyAgICA7OyBTZXQgYHBhZCcgYW5kIGBmb3JtYXR0ZWQtdHJhbnMtYWxpc3QnCisgICAgKG1h cC1jaGFyLXRhYmxlCisgICAgIChsYW1iZGEgKGNociB0cmFucykKKyAgICAgICAoaWYgKGNoYXJh Y3RlcnAgY2hyKQorICAgICAgICAgICAoZnVuY2FsbCBrZXktY29kZS1mdW5jIGNociB0cmFucykK KyAgICAgICAgIChyZXF1aXJlICdyYW5nZSkKKyAgICAgICAgIChyYW5nZS1tYXAKKyAgICAgICAg ICAobGFtYmRhIChrYykgKGZ1bmNhbGwga2V5LWNvZGUtZnVuYyBrYyB0cmFucykpCisgICAgICAg ICAgY2hyKSkpCisgICAgIGtleWJvYXJkLXRyYW5zbGF0ZS10YWJsZSkKKyAgICAoY2FyCisgICAg IChzcGxpdC1zdHJpbmcKKyAgICAgIChjb21wbGV0aW5nLXJlYWQKKyAgICAgICAiS2V5IFRyYW5z bGF0aW9uOiAiCisgICAgICAgKG1hcGNhciBmb3JtYXQtZnVuYyBmb3JtYXR0ZWQtdHJhbnMtYWxp c3QpCisgICAgICAgbmlsIHQpKSkpKQorCisoZGVmdW4ga2V5LXRyYW5zbGF0ZS1yZW1vdmUgKGZy b20pCisgICJSZW1vdmUgdHJhbnNsYXRpb24gb2YgRlJPTSBmcm9tIGBrZXlib2FyZC10cmFuc2xh dGUtdGFibGUnLgorCitGUk9NIG11c3Qgc2F0aXNmeSBga2V5LXZhbGlkLXAnLiAgSWYgRlJPTSBo YXMgbm8gZW50cnkgaW4KK2BrZXlib2FyZC10cmFuc2xhdGUtdGFibGUnLCB0aGlzIGhhcyBubyBl ZmZlY3QuIgorICAoaW50ZXJhY3RpdmUgKGxpc3QgKGtleS1zZWxlY3QtdHJhbnNsYXRpb24pKSkK KyAgKGtleS10cmFuc2xhdGUgZnJvbSBuaWwpKQorCiAoZGVmdW4ga2V5bWFwLWxvb2t1cCAoa2V5 bWFwIGtleSAmb3B0aW9uYWwgYWNjZXB0LWRlZmF1bHQgbm8tcmVtYXAgcG9zaXRpb24pCiAgICJS ZXR1cm4gdGhlIGJpbmRpbmcgZm9yIGNvbW1hbmQgS0VZIGluIEtFWU1BUC4KIEtFWSBpcyBhIHN0 cmluZyB0aGF0IHNhdGlzZmllcyBga2V5LXZhbGlkLXAnLgotLSAKMi4yMC4xCgo= --=_81e85bd4b66b3956f797dbc2453ab6f1-- From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 03 11:56:52 2024 Received: (at 72460) by debbugs.gnu.org; 3 Oct 2024 15:56:52 +0000 Received: from localhost ([127.0.0.1]:33765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swOCC-0003mA-5e for submit@debbugs.gnu.org; Thu, 03 Oct 2024 11:56:52 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64385) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swOCA-0003ly-DB for 72460@debbugs.gnu.org; Thu, 03 Oct 2024 11:56:50 -0400 Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0DEA7100043; Thu, 3 Oct 2024 11:56:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1727971002; bh=iNS23ODmKpWIH1hFRHdftSvZEIdBS46M9w336Bau9sQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Yj+hp/JhgaMHrXFfw0HZtwlFMzg61q/wMeAfS1qGLJ57gnk+XNxk5xkzKuYT6pC91 vdVak4JPon7TvV0ODPpWFq4mvHRiWx7NJ9JtA182/coGB8gR8VmzPz66AHNfVxLqvK hV1uScph+ZMkws7jc+t50r0bCrR7ODF4jOnViy6PlKp1Gfds7xI+hbtxwcvl903Yvr 1byVJ8AdfmFMKDMnEgYPoX3SQgbUseILyLXf4WQTZotXa0u5suYbIn9UrSrmBPDcN8 dmFiGhYBONz4+Bc6o9btGE2Zey/X+/bVGFdjAi8kkySbOPVoEmLY7dZ1dbkYzInNQX G6fF6eBlMalzQ== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 57BDB10002E; Thu, 3 Oct 2024 11:56:42 -0400 (EDT) Received: from alfajor (modemcable005.21-80-70.mc.videotron.ca [70.80.21.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 34E051205EF; Thu, 3 Oct 2024 11:56:42 -0400 (EDT) From: Stefan Monnier To: hugo@heagren.com Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively In-Reply-To: <57d837226be0ce82a6340658b1297445@heagren.com> (hugo@heagren.com's message of "Thu, 03 Oct 2024 03:45:02 +0100") Message-ID: References: <86bk0qit2b.fsf@gnu.org> <86o7486u3z.fsf@gnu.org> <57d837226be0ce82a6340658b1297445@heagren.com> Date: Thu, 03 Oct 2024 11:56:41 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.299 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72460 Cc: 72460@debbugs.gnu.org, Eli Zaretskii X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Since this is the only substantive change since I was last told this > looked good, I've also included a NEWS entry. Thank you. Pushed to `master`! Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu Oct 03 11:59:12 2024 Received: (at control) by debbugs.gnu.org; 3 Oct 2024 15:59:13 +0000 Received: from localhost ([127.0.0.1]:33770 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swOES-0003q3-Lf for submit@debbugs.gnu.org; Thu, 03 Oct 2024 11:59:12 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:62482) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1swOEQ-0003pp-Dr for control@debbugs.gnu.org; Thu, 03 Oct 2024 11:59:11 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 247DF44552A for ; Thu, 3 Oct 2024 11:59:03 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1727971142; bh=iyP9saVVuqXdAIW3TA1LjBnLOEtJQ/p0enU8JoVOCXE=; h=From:To:Subject:In-Reply-To:References:Date:From; b=OcRKd8jOMNRKs6fP5hG9CW4URV2HDDpWNyYrz9tIbvUZmtwOrwbVWhRETSuyJNaQQ kN/Sznvv2hhtTVJ00ta9wo5bh8lr27Tt4nBojjIRxorTQmSo2hVBFVrsLYEv1tUrWR 7xxhwbmxsUk2T+odmOYT4oRc/qLuUP8/1zBgMoLX+D4bzyDqj4g9257Vge457LybeZ SaDu7UpISbT5DqlnQG58VaLcNI2wVnBT0qZO6b2LS7OIM7snaOLP9kvNX6WukuOjoM 2/avpEqGtsSKjWwc7vSD9EG1q59R7FYCuLl1yRdBxJzsD8NUgDBJjqOJD6NLqF5fKV txkKonHd0rHDg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 4908E445527 for ; Thu, 3 Oct 2024 11:59:02 -0400 (EDT) Received: from alfajor (modemcable005.21-80-70.mc.videotron.ca [70.80.21.5]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 349CA12082A for ; Thu, 3 Oct 2024 11:59:02 -0400 (EDT) From: Stefan Monnier To: control@debbugs.gnu.org Subject: Re: bug#72460: [patch] add commands for setting keyboard translations interactively In-Reply-To: (Stefan Monnier's message of "Thu, 03 Oct 2024 11:56:41 -0400") Message-ID: References: <86bk0qit2b.fsf@gnu.org> <86o7486u3z.fsf@gnu.org> <57d837226be0ce82a6340658b1297445@heagren.com> Date: Thu, 03 Oct 2024 11:59:01 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.102 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) close 72460 From unknown Sun Jun 22 03:58:20 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 01 Nov 2024 11:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator