From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#44500: 26.3; `prefix-command-echo-keystrokes-functions' causes regression Date: Fri, 6 Nov 2020 22:48:48 -0800 (PST) Message-ID: <31fd423d-02ea-4a0e-992e-d226108d1c07@default> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19351"; mail-complaints-to="usenet@ciao.gmane.io" To: 44500@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Nov 07 07:49:10 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1kbI2A-0004wI-2H for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Nov 2020 07:49:10 +0100 Original-Received: from localhost ([::1]:38858 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kbI28-0004VH-Tf for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 07 Nov 2020 01:49:08 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58516) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbI23-0004VA-1e for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 01:49:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:46273) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kbI22-0002sk-O6 for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 01:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kbI22-0000JN-Kq for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 01:49:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 07 Nov 2020 06:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 44500 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.16047317371184 (code B ref -1); Sat, 07 Nov 2020 06:49:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 7 Nov 2020 06:48:57 +0000 Original-Received: from localhost ([127.0.0.1]:57819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbI1w-0000J2-S8 for submit@debbugs.gnu.org; Sat, 07 Nov 2020 01:48:57 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:55858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kbI1u-0000Iu-Re for submit@debbugs.gnu.org; Sat, 07 Nov 2020 01:48:55 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbI1u-0004Uu-Jv for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 01:48:54 -0500 Original-Received: from aserp2120.oracle.com ([141.146.126.78]:34860) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kbI1s-0002pS-4w for bug-gnu-emacs@gnu.org; Sat, 07 Nov 2020 01:48:53 -0500 Original-Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0A76hub9194285 for ; Sat, 7 Nov 2020 06:48:49 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : subject : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=+i9Ipy76ID0hfGgMG2y1m3hUuRETy4yOf2A/Q54cRN4=; b=O5O9hy/6WGYdLQXOSu1w6T9x9rb8spf9aXsd1oPFMwy93ifgH5+YIopHPilsq/woKsKN XcjywMQrxqKPv7Jl1IMwcQdvb86OK+WtdBZ8vXhU0YB/KGPjoFUrPVW4jEHzCCxn1eKQ w20uq12dBSTR/7BoNAdHQQmGgrEeHeFNisroHbiDiTFY9XXUFVxyDdd/WcfyFQfaeHYs C3mT2w9OVl9+1z4UzqDZeeinrQl+zXsIbLUR7ggrIURXrn2Pwn3EZYQ3vN0Nh3LaBvIN u5nYxyMioVgVHRKEd3ZME/vF8Z8IKyVj5PZ2693LHEdFQikSUgDjUWjU9MBOPFYQShCw ng== Original-Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by aserp2120.oracle.com with ESMTP id 34nkhkg8yn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Sat, 07 Nov 2020 06:48:49 +0000 Original-Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 0A76il4H188564 for ; Sat, 7 Nov 2020 06:48:49 GMT Original-Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserp3020.oracle.com with ESMTP id 34nkcynrtd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 07 Nov 2020 06:48:49 +0000 Original-Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0A76mmMw020810 for ; Sat, 7 Nov 2020 06:48:48 GMT X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.5071.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9797 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxscore=0 bulkscore=0 phishscore=0 suspectscore=1 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011070039 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9797 signatures=668682 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 phishscore=0 priorityscore=1501 mlxscore=0 suspectscore=1 mlxlogscore=999 lowpriorityscore=0 spamscore=0 malwarescore=0 adultscore=0 clxscore=1015 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011070039 Received-SPF: pass client-ip=141.146.126.78; envelope-from=drew.adams@oracle.com; helo=aserp2120.oracle.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/11/07 01:48:50 X-ACL-Warn: Detected OS = Linux 3.1-3.10 [fuzzy] X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:192810 Archived-At: This variable was introduced in Emacs 25, apparently. I'm not happy that it's used/implemented the way it is, by default. I have a function that calls `read-char' in a loop, and it took me a while to figure out why this code broke starting with Emacs 25. That function is called by a command bound to `P B', where `P' is a prefix key. I'm not sure why, based on the doc of the variable etc., but even though `P B' is not itself a prefix key, the default value of the variable interfered with the normal behavior in the echo area. After finding out the cause, I now bind the var to nil in that part of my code. But this variable shouldn't have the effect it has, IMO. Here's the function I use: (defun bmkp-bmenu-read-filter-input () "Read input and add it to `bmkp-bmenu-filter-pattern'." (setq bmkp-bmenu-filter-pattern "") (let ((curr-bmk (bookmark-bmenu-bookmark))) (when (eq 'QUIT (let ((tmp-list ()) (bmkp-bmenu-title bmkp-bmenu-title) (bmkp-bmenu-filter-function bmkp-bmenu-filter-function) (inhibit-quit t) ;; Had to add this binding to counteract the regression= . ;; (prefix-command-echo-keystrokes-functions ()) char) (catch 'bmkp-bmenu-read-filter-input (while (condition-case nil (setq char (read-char (concat "Pattern: " bmkp-bmenu-filter-pattern)= )) ;; `read-char' raises an error for non-char even= t. (error (throw 'bmkp-bmenu-read-filter-input nil)= )) (unless (or (not (fboundp 'characterp)) (characterp char)) ; E.g. `M-x', `M-:' (throw 'bmkp-bmenu-read-filter-input nil)) (case char ((?\e ?\r) (throw 'bmkp-bmenu-read-filter-input nil)) (?\C-g (setq inhibit-quit nil) (throw 'bmkp-bmenu-read-filter-input 'QUIT= )) (?\d (or (null tmp-list) (pop tmp-list) t)) (t (push (text-char-description char) tmp-list))) (setq bmkp-bmenu-filter-pattern (mapconcat #'identity (reverse tmp-list) "")))))) (message "Restoring display prior to incremental filtering...") (bookmark-bmenu-list 'FILTEREDP) (bmkp-bmenu-goto-bookmark-named curr-bmk) (message "Restoring display prior to incremental filtering...done")))= ) This code worked fine prior to Emacs 25. Starting with that release I had to bind `prefix-command-echo-keystrokes-functions' to nil. I shouldn't have had to do that. If I don't add that binding, then: You don't always even see the prompt "Pattern: ". Dunno why. Instead, you see `P-', then `P B-', as if `P B' were a prefix key (only `P' is a prefix key), and each char you type is also echoed as if it were part of a prefix key, i.e., it's followed by a hyphen. So if you type "red" after the (invisible) prompt, you see `P B r-', then `P B r e-', then `P B r e d-'. You should instead see `Pattern: r', then `Pattern: re', then `Pattern: red'. Binding the variable to nil fixes the problem. But this behavior is a bug, IMO, and the introduction of the variable shouldn't have changed the default echo-area behavior of Emacs. Hope the problem description is clear enough. In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32) of 2019-08-29 Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd Windowing system distributor `Microsoft Corp.', version 10.0.18362 Configured using: `configure --without-dbus --host=3Dx86_64-w64-mingw32 --without-compress-install 'CFLAGS=3D-O2 -static -g3''