From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs Subject: bug#5923: 23.1.95; minibuffer-message discards input events Date: Sat, 10 Apr 2010 12:59:48 -0700 Message-ID: <7C90907943E64115BA7CFABFB144BD24@us.oracle.com> References: <6ED90800C89F408BB0C3F86660BB4C10@us.oracle.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0049_01CAD8AD.B4247370" X-Trace: dough.gmane.org 1270931336 15018 80.91.229.12 (10 Apr 2010 20:28:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Apr 2010 20:28:56 +0000 (UTC) Cc: 5923@debbugs.gnu.org To: "'Stefan Monnier'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 10 22:28:54 2010 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O0hIQ-0001mH-Vd for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Apr 2010 22:28:51 +0200 Original-Received: from localhost ([127.0.0.1]:56529 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0hIQ-0006Nh-Bg for geb-bug-gnu-emacs@m.gmane.org; Sat, 10 Apr 2010 16:28:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O0hIK-0006Mh-Vl for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 16:28:45 -0400 Original-Received: from [140.186.70.92] (port=51195 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O0hIJ-0006Ll-MP for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 16:28:44 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O0hII-00060y-9I for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 16:28:43 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44941) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0hII-00060r-5E for bug-gnu-emacs@gnu.org; Sat, 10 Apr 2010 16:28:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1O0grW-00042I-HX; Sat, 10 Apr 2010 16:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: "Drew Adams" Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 10 Apr 2010 20:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5923 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5923-submit@debbugs.gnu.org id=B5923.127092965015506 (code B ref 5923); Sat, 10 Apr 2010 20:01:02 +0000 Original-Received: (at 5923) by debbugs.gnu.org; 10 Apr 2010 20:00:50 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0grK-000423-1q for submit@debbugs.gnu.org; Sat, 10 Apr 2010 16:00:50 -0400 Original-Received: from acsinet12.oracle.com ([141.146.126.234]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O0grH-00041y-Bt for 5923@debbugs.gnu.org; Sat, 10 Apr 2010 16:00:48 -0400 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet12.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o3AK0h3C021882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sat, 10 Apr 2010 20:00:44 GMT Original-Received: from acsmt353.oracle.com (acsmt353.oracle.com [141.146.40.153]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o3AIrlaB001045; Sat, 10 Apr 2010 20:00:42 GMT Original-Received: from abhmt017.oracle.com by acsmt354.oracle.com with ESMTP id 151124211270929579; Sat, 10 Apr 2010 12:59:39 -0700 Original-Received: from dradamslap1 (/141.144.224.6) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sat, 10 Apr 2010 12:59:39 -0700 X-Mailer: Microsoft Office Outlook 11 In-Reply-To: X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcrY4iw+Fucd0mIKSEOT+jf+V5mF7gAATd6g X-Source-IP: acsmt353.oracle.com [141.146.40.153] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090207.4BC0D8EA.01DB:SCFMA4539814,ss=1,fgs=0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Sat, 10 Apr 2010 16:01:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:36174 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_0049_01CAD8AD.B4247370 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit > > Prior to Emacs 23, a user can hit `C-RET' after `C-u' and while > > `[prefix (4)]' is displayed, and the `sit-for' is interrupted and > > the action is executed immediately. Starting with Emacs 23, the > > `C-RET' is ignored. A `C-RET' doesn't take effect until the > > `sit-for' timeout is finished (as if it were `sleep-for'). > > I can't reproduce exactly your test case because I don't know > what code is run by your C-u (and because I'm on GNU/Linux, > ...), but at least when I start "emacs23 -Q" and do C-x C-f > TAB TAB, the first tab outputs a minibuffer-message but the > second TAB is executed immediately (interrupts the > minibuffer-message). So I don't see that problematic > behavior you're seeing. > > Can you check whether my test case works for you as well? I confirm that your test case works for me also. The second tab has its effect - it is not lost. [However, the minibuffer message remains displayed for the full timeout period. That seems wrong - why not stop displaying the msg as soon as the tab event arrives? Unless `Complete but not unique' is perhaps redisplayed by another call or something? IOW, after the second tab, *Completions* is shown, indicating that the tab did take effect, and the message `Complete but not unique' is briefly removed - replaced by the message `Making completion list...'. But the `Complete but not unique' message then reappears for the duration of the `minibuffer-message' timeout. Is this the behavior you see also? Anyway, this is not the problematic behavior I get with my code, and which this bug report is about.] Attached is the code I use for `C-u' in the minibuffer. I hope it helps. I should have mentioned that the same problem occurs when I use `C-u' in the minibuffer at any time, not just in the scenario where I follow it by `C-RET'. IOW, it has nothing to do with the particular user event that follows. And as I said, in Emacs 22 and before there is no such problem: any user event immediately interrupts the message display and its timeout, and no such event is lost (so you don't need to hit the key multiple times). ------=_NextPart_000_0049_01CAD8AD.B4247370 Content-Type: application/octet-stream; name="bug-5923-emacs.el" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="bug-5923-emacs.el" (defvar icicle-universal-argument-map=0A= (let ((map (make-sparse-keymap)))=0A= (define-key map [t] 'icicle-universal-argument-other-key)=0A= (define-key map (vector meta-prefix-char t) = 'icicle-universal-argument-other-key)=0A= (define-key map [switch-frame] nil)=0A= (define-key map [?\C-u] 'icicle-universal-argument-more)=0A= (define-key map [?-] 'icicle-universal-argument-minus)=0A= (define-key map [?0] 'icicle-digit-argument)=0A= (define-key map [?1] 'icicle-digit-argument)=0A= (define-key map [?2] 'icicle-digit-argument)=0A= (define-key map [?3] 'icicle-digit-argument)=0A= (define-key map [?4] 'icicle-digit-argument)=0A= (define-key map [?5] 'icicle-digit-argument)=0A= (define-key map [?6] 'icicle-digit-argument)=0A= (define-key map [?7] 'icicle-digit-argument)=0A= (define-key map [?8] 'icicle-digit-argument)=0A= (define-key map [?9] 'icicle-digit-argument)=0A= (define-key map [kp-0] 'icicle-digit-argument)=0A= (define-key map [kp-1] 'icicle-digit-argument)=0A= (define-key map [kp-2] 'icicle-digit-argument)=0A= (define-key map [kp-3] 'icicle-digit-argument)=0A= (define-key map [kp-4] 'icicle-digit-argument)=0A= (define-key map [kp-5] 'icicle-digit-argument)=0A= (define-key map [kp-6] 'icicle-digit-argument)=0A= (define-key map [kp-7] 'icicle-digit-argument)=0A= (define-key map [kp-8] 'icicle-digit-argument)=0A= (define-key map [kp-9] 'icicle-digit-argument)=0A= (define-key map [kp-subtract] 'icicle-universal-argument-minus)=0A= map)=0A= "Keymap used while processing `C-u' during Icicles completion.")=0A= =0A= (defun icicle-universal-argument () ; Bound to `C-u' in minibuffer.=0A= "`universal-argument', but also echo the prefix."=0A= (interactive)=0A= (setq prefix-arg (list 4)=0A= universal-argument-num-events (length (this-command-keys)))=0A= (icicle-ensure-overriding-map-is-bound)=0A= (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg))=0A= =0A= ;; Bound to `C-<0-9>', `M-<0-9>', `C-M-<0-9>' in minibuffer.=0A= (defun icicle-digit-argument (arg)=0A= "`digit-argument', but also echo the prefix."=0A= (interactive "P")=0A= (let* ((char (if (integerp last-command-char)=0A= last-command-char=0A= (get last-command-char 'ascii-character)))=0A= (digit (- (logand char ?\177) ?0)))=0A= (cond ((integerp arg)=0A= (setq prefix-arg (+ (* arg 10) (if (< arg 0) (- digit) = digit))))=0A= ((eq arg '-)=0A= ;; Treat -0 as just -, so that -01 will work.=0A= (setq prefix-arg (if (zerop digit) '- (- digit))))=0A= (t=0A= (setq prefix-arg digit))))=0A= (setq universal-argument-num-events (length (this-command-keys)))=0A= (icicle-ensure-overriding-map-is-bound)=0A= (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg))=0A= =0A= (defun icicle-negative-argument (arg) ; Bound to `M--', `C-M--' in = minibuffer.=0A= "`negative-argument', but also echo the prefix."=0A= (interactive "P")=0A= (cond ((integerp arg) (setq prefix-arg (- arg)))=0A= ((eq arg '-) (setq prefix-arg nil))=0A= (t (setq prefix-arg '-)))=0A= (setq universal-argument-num-events (length (this-command-keys)))=0A= (icicle-ensure-overriding-map-is-bound)=0A= (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg))=0A= =0A= (defun icicle-universal-argument-more (arg)=0A= "`universal-argument-more', but also echo the prefix."=0A= (interactive "P")=0A= (universal-argument-more arg)=0A= (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg))=0A= =0A= (defun icicle-universal-argument-other-key (arg)=0A= "`universal-argument-other-key', but also echo the prefix."=0A= (interactive "P")=0A= (universal-argument-other-key arg)=0A= (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg))=0A= =0A= (defun icicle-universal-argument-minus (arg)=0A= "`universal-argument-minus', but also echo the prefix."=0A= (interactive "P")=0A= (universal-argument-minus arg)=0A= (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg))=0A= =0A= (defun icicle-ensure-overriding-map-is-bound ()=0A= "Set `overriding-terminal-local-map' to = `icicle-universal-argument-map'."=0A= (if (not (boundp 'overriding-map-is-bound)) ; Emacs 20, 21.=0A= (setq overriding-terminal-local-map icicle-universal-argument-map)=0A= (unless overriding-map-is-bound ; Emacs 22+.=0A= (setq saved-overriding-map overriding-terminal-local-map=0A= overriding-terminal-local-map icicle-universal-argument-map=0A= overriding-map-is-bound t))))=0A= =0A= (defun icicle-msg-maybe-in-minibuffer (format-string &rest args)=0A= "Display FORMAT-STRING as a message.=0A= If called with the minibuffer inactive, use `message'.=0A= Otherwise:=0A= If `icicle-minibuffer-message-ok-p', then use `minibuffer-message'.=0A= Else do nothing (no message display)."=0A= (if (active-minibuffer-window)=0A= (when icicle-minibuffer-message-ok-p=0A= (save-selected-window=0A= (select-window (minibuffer-window))=0A= (minibuffer-message (apply #'format (concat " [" = format-string "]") args))))=0A= (apply #'message format-string args)))=0A= ------=_NextPart_000_0049_01CAD8AD.B4247370--