From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Christoph Arenz Newsgroups: gmane.emacs.devel Subject: Re: Severe regressions in context of keyboard macros Date: Thu, 26 Sep 2019 20:27:37 +0200 Message-ID: <830f19fe-20dd-b3a3-fc50-26573760dbff@web.de> References: <83a7aztoq9.fsf@gnu.org> <6b147564-cfea-1824-701f-33495958d304@web.de> <83d0fusvjd.fsf@gnu.org> <83wodynkuo.fsf@gnu.org> <83wodvl40w.fsf@gnu.org> <65332ac9-0e3f-fbd4-ac84-5ae4e7126d37@web.de> <83v9tfl0lc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="121865"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 26 20:28:35 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iDYVG-000VaX-A6 for ged-emacs-devel@m.gmane.org; Thu, 26 Sep 2019 20:28:34 +0200 Original-Received: from localhost ([::1]:42402 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDYVE-0003zF-UN for ged-emacs-devel@m.gmane.org; Thu, 26 Sep 2019 14:28:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39424) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iDYUl-0003o0-3z for emacs-devel@gnu.org; Thu, 26 Sep 2019 14:28:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iDYUj-00018V-VJ for emacs-devel@gnu.org; Thu, 26 Sep 2019 14:28:02 -0400 Original-Received: from mout.web.de ([212.227.15.3]:56815) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iDYUb-0000vt-FS; Thu, 26 Sep 2019 14:27:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1569522461; bh=y8Rc7pR++R0TCxWuvZfnqhU9IdRnoEntnSgO7mZegos=; h=X-UI-Sender-Class:Subject:To:Cc:References:From:Date:In-Reply-To; b=JThiGHgJO00hMpXFK/T+ncfsBMrh3J2R9h7nOynkh5WwxUqdZwcFED6PBHIzw5ylS qKOGmWfUcgOyZT47IUp0aH33e47VLb9Qcaz3CM2xCVfPJMzyrfHj9m81QescUF02Cg EXuTxbmyJk8YBxJ3D+jCqMA1hB9eNbh9W9D9JXtA= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from oc3710058320.ibm.com ([94.16.134.55]) by smtp.web.de (mrweb003 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MQNjQ-1ialoP35MS-00TmTs; Thu, 26 Sep 2019 20:27:41 +0200 In-Reply-To: <83v9tfl0lc.fsf@gnu.org> Content-Language: en-US X-Provags-ID: V03:K1:uEZlfOmH2wxAKN3lvB/szfL6i5iuksX0stWLZBut52ik2Kt4rwU bFpEXdKmmDMBKCXNfFUpEe20Vv3FiNIMFywvMFsb14TkTwR007nkxix3TQNPH4bhB1RrShh qsIvgQuTfOw/Iuut7kaG77Nt7KdZ3CAeghotEykFsUjQwabl5M/pZ+pfNUHeMOCKcCrX8u3 lPjXxzeo+WDdc+ULi+nXg== X-UI-Out-Filterresults: notjunk:1;V03:K0:HyDcjOOMEUQ=:wmMZo+h36yd2hP7VryryuK xyF3pgvO4aJOJgcNXH75X7YH9X3rspp+QU+dhDBENkXGdeZjR6i1OChOqYY6L7qLOofZIYpn4 QsRCa53775AtRrDq6FtuclXk8Cei9nQ+p0gJ4VdJ07ZrxXZKYW8b175FQB+DZ+pMe/RUfMr/2 5NA7zK3gqw0aU8Y0l/RtuYGmjwd6/UfCGMci9bI8njLR1hrCfyoHH7CCMCk2TC1uda3BkThf6 /sy0w9Jh8M3Yq5sKEy1Q4ptjMN6M/LrM7+1+7jiipZXImorsGDet7EY49siavgNXx3/6d+Jrm YONp0gitqhzgCVjIJlK+KJSxgS4u7HOdbaWHC6yzGEPMOGBjQdBoEqqK5v9JyHAkuFyS63TNi jkgKZ3CcbaM7UZwRpsBaNNvdh5cPhjyCPgvGPuq5SZMz4xf+1Yf95nHmNVCrcCzfJT4wEmYVr h4OjjDMXhU++Qp7bwDczPpkIlaEYOVi4qsj1YOpjkT4nhC4rLmdsYQYubswGsArJ0xpT+vgdC GrUFXDYylJ6kZ8gaVO6piG0OgyXvs3TD9HIIgpfLoqB/IKXoKvno1k1+Eqk/5yE7P0zfQGVlI i0IdiWXr4i34QdScx9n5iscEpyuPbsXeNf6I9Vqv4spJgGIpl0EHIi+PncACiJ488BxLDSP8D oeyJQZMYSq2Xnd2PGgg/qzOtosivq7AlmpBMZa0/rg/twcL7VYgUtKzhhvf8ki2smzMe/zJM7 FdACeOW/v3xanlJvmc+s4FsVa1WuaEzYke/1HzundD6CB+ml2N2sMOrFTBQA9SDGpgqWKSeg X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240316 Archived-At: On 9/26/19 2:10 PM, Eli Zaretskii wrote: >> Cc: emacs-devel@gnu.org >> From: Christoph Arenz >> Date: Thu, 26 Sep 2019 13:22:50 +0200 >> >> On 9/26/19 12:56 PM, Eli Zaretskii wrote: >>> What about the other facility -- could Calc use it to avoid recording >>> keys more than once? >> I have not yet looked into that -- as I am getting more time constraine= d. > Thanks. And the method used by quail.el -- did you actually try to > use it in Calc, or did you just look at what it does in the context of > input methods? Yes, I tried to get a grip on how inhibit--record-char should be used both by wrapping some parts in calc.el in a (let ((inhibit--record-char t)) ...= ) form, e.g. in calc-fancy-prefix-other-key and/or in calc-fancy-prefix but could not get it to work. At that point I tried to understand it better by code reading in quail.el and did some edebug tries with my simplified test case with (push ?a unread-command-events). In case of quail, I used french-prefix etc. input-methods and triggered tw= o keyboard events like (progn =C2=A0=C2=A0=C2=A0 (push ?, unread-command-events) =C2=A0=C2=A0=C2=A0 (push ?c unread-command-events)) which let me stumble across weird behavior, which again lead me to more closely do some simple tests as described in my former mail. Now, I started to get a closer look at the other facility you mentioned: '(no-record . KEY): Here is my current result. I did not have much time for tests, though. Does this go in the right direction? Thanks! working on master 07367e5b95fe31f3d4e994b42b081075501b9b60 modified=C2=A0=C2=A0 lisp/calc/calc.el @@ -3400,7 +3400,17 @@ calc-read-key =C2=A0=C2=A0=C2=A0=C2=A0 (cons key key))) =C2=A0(defun calc-unread-command (&optional input) -=C2=A0 (push (or input last-command-event) unread-command-events)) +=C2=A0 (let ((event (or input last-command-event))) +=C2=A0=C2=A0=C2=A0 ;; do not double-record key presses in calc when defin= ing a keyboard macro +=C2=A0=C2=A0=C2=A0 ;; FIXME: need to check if 'when form' is correct for = all calls of this function +=C2=A0=C2=A0=C2=A0 ;; seems to work for calls from calc-fancy-prefix-othe= r-key +=C2=A0=C2=A0=C2=A0 ;; checked for ` I S ' and ` I H P ' +=C2=A0=C2=A0=C2=A0 ;; more tests needed +=C2=A0=C2=A0=C2=A0 (when defining-kbd-macro +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 (setq event (cons 'no-record (if (consp ev= ent) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 (cdr event) +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 e= vent)))) +=C2=A0=C2=A0=C2=A0 (push event unread-command-events))) =C2=A0(defun calc-clear-unread-commands () =C2=A0=C2=A0 (setq unread-command-events nil))