From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.bugs,gmane.emacs.pretest.bugs Subject: bug#3938: 23.0.96; regression: minibuffer-message interferes with C-u Date: Sun, 2 Aug 2009 22:14:59 -0700 Message-ID: Reply-To: Drew Adams , 3938@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1249277231 4759 80.91.229.12 (3 Aug 2009 05:27:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 3 Aug 2009 05:27:11 +0000 (UTC) To: , <3936@emacsbugs.donarmstrong.com> Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Aug 03 07:27:04 2009 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.50) id 1MXq4d-0001sv-9v for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Aug 2009 07:27:03 +0200 Original-Received: from localhost ([127.0.0.1]:47066 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXq4c-0004l8-Mj for geb-bug-gnu-emacs@m.gmane.org; Mon, 03 Aug 2009 01:27:02 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MXq4V-0004kr-94 for bug-gnu-emacs@gnu.org; Mon, 03 Aug 2009 01:26:55 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MXq4P-0004hz-RE for bug-gnu-emacs@gnu.org; Mon, 03 Aug 2009 01:26:54 -0400 Original-Received: from [199.232.76.173] (port=54477 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MXq4P-0004ho-Am for bug-gnu-emacs@gnu.org; Mon, 03 Aug 2009 01:26:49 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:42183) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MXq4O-0003em-LV for bug-gnu-emacs@gnu.org; Mon, 03 Aug 2009 01:26:49 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n735Qkuq015820; Sun, 2 Aug 2009 22:26:46 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n735P6fR015554; Sun, 2 Aug 2009 22:25:06 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: "Drew Adams" Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 03 Aug 2009 05:25:06 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3938 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.124927654115007 (code B ref -1); Mon, 03 Aug 2009 05:25:06 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 3 Aug 2009 05:15:41 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n735FUWY014998 for ; Sun, 2 Aug 2009 22:15:31 -0700 Original-Received: from mx10.gnu.org ([199.232.76.166]:38324) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MXptR-0005of-PI for emacs-pretest-bug@gnu.org; Mon, 03 Aug 2009 01:15:30 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MXptM-0001so-TW for emacs-pretest-bug@gnu.org; Mon, 03 Aug 2009 01:15:27 -0400 Original-Received: from rcsinet12.oracle.com ([148.87.113.124]:26664 helo=rgminet12.oracle.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MXptM-0001sa-Fi for emacs-pretest-bug@gnu.org; Mon, 03 Aug 2009 01:15:24 -0400 Original-Received: from rgminet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by rgminet12.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n735F5dE002180 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Aug 2009 05:15:06 GMT Original-Received: from abhmt005.oracle.com (abhmt005.oracle.com [141.146.116.14]) by rgminet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n735F67v003648; Mon, 3 Aug 2009 05:15:06 GMT Original-Received: from dradamslap1 (/141.144.224.143) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 02 Aug 2009 22:15:04 -0700 X-Mailer: Microsoft Office Outlook 11 Thread-Index: AcoP6Ifh6GuucQcbTZm8kQOaWrQRYgALcGMAAPdo3vAAARSS8A== X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: abhmt005.oracle.com [141.146.116.14] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010207.4A767259.01CD:SCFSTAT5015188,ss=1,fgs=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 03 Aug 2009 01:26:54 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list 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:29825 gmane.emacs.pretest.bugs:24909 Archived-At: Taking off the "3938-done" address, I forgot to add back the original recipients, so this would get to the bug list. So here it is again, with the bug list added back as recipient. [It is really a shame that once someone closes a bug you can no longer just reply to the message; you have to reopen the bug and change the recipients... I replied, and my reply was recorded as _me_ closing the bug. What a lame UI... And of course none of that meta-conversation was added to the bug thread, except for a bit by Stefan, who no doubt thought to add the bug list as recipient.] Anyway... -----Original Message----- From: Drew Adams Sent: Sunday, August 02, 2009 10:07 PM To: 'Chong Yidong' Subject: RE: bug#3938: 23.0.96; regression: minibuffer-message interferes with C-u > 1. That kind of thing should not be necessary. Something has > become overly fragile or things have become overly coupled. > > I'm not "hacking universal-argument this way" or in any way - > I don't redefine it. I just use a different binding for `C-u' > and a different keymap from `universal-argument-map'. (In the > bug report I show that even an exact copy of that map > demonstrates the bug, but in my real code I do use a slightly > different map.) > > All my code does is change the behavior of `C-u' during > completion very slightly, so that the prefix arg is echoed in > the minibuffer using `minibuffer-message'. IOW, instead of > echoing "FOO" as in the bug report, it shows the prefix arg. > In Icicles, you can perform lots of operations during > completion, and you can use `C-u' with those operations. > > That's true for vanilla Emacs too, but it's not as often that > users use `C-u' when editing minibuffer text. Because `C-u' > is used more during completion, Icicles shows the prefix value. > > > 2. As I mentioned, the code for `sit-for' has not changed a > bit between Emacs 22 and 23 (and my code works in Emacs > 22-21-20). Something else must have changed. There should be > no need to replace any of the `sit-for' code. This should not > be happening. There should be no need for such jumping > through hoops and redefining multiple things. > > I appreciate the workaround advice, and I'll look into it as > a temporary Emacs 23 workaround. But how about fixing this > regression? Interrupting `sit-for' with user input should > never cause the full `sit-for' delay to be waited out - > something is amiss. `sit-for' is not `sleep-for'. In case it helps, below is what my code really does, so you can see that I am in no way changing the code of `universal-argument' etc. In each case, I write and use my own function and my own keymap. The code is nearly the same as the original, with the only real change (and the purpose) being to add a minibuffer message that echoes the prefix arg. I hope this regression will be fixed. Thanks. Here you have my complete use of this, so you can better understand. Each function is identical to the original, except in the minor ways indicated: ;; Use my map for overriding terminal local. ;; Same as the definition of `ensure-overriding-map-is-bound', ;; except for using the different map. (defun icicle-ensure-overriding-map-is-bound () (unless overriding-map-is-bound (setq saved-overriding-map overriding-terminal-local-map overriding-terminal-local-map icicle-universal-argument-map overriding-map-is-bound t))) ;; Bound to `C-<0-9>', `M-<0-9>', `C-M-<0-9>' in minibuffer. (defun icicle-digit-argument (arg) "`digit-argument', but also echo the prefix arg." (interactive "P") (let* ((char (if (integerp last-command-char) last-command-char (get last-command-char 'ascii-character))) (digit (- (logand char ?\177) ?0))) (cond ((integerp arg) (setq prefix-arg (+ (* arg 10) (if (< arg 0) (- digit) digit)))) ((eq arg '-) ;; Treat -0 as just -, so that -01 will work. (setq prefix-arg (if (zerop digit) '- (- digit)))) (t (setq prefix-arg digit)))) (setq universal-argument-num-events (length (this-command-keys))) (icicle-ensure-overriding-map-is-bound) (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg)) ;; Bound to `M--', `C-M--' in minibuffer. (defun icicle-negative-argument (arg) "`negative-argument', but also echo the prefix arg." (interactive "P") (cond ((integerp arg) (setq prefix-arg (- arg))) ((eq arg '-) (setq prefix-arg nil)) (t (setq prefix-arg '-))) (setq universal-argument-num-events (length (this-command-keys))) (icicle-ensure-overriding-map-is-bound) (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg)) ; Bound to `C-u' in minibuffer. (defun icicle-universal-argument () "`universal-argument', but also echo the prefix arg." (interactive) (setq prefix-arg (list 4) universal-argument-num-events (length (this-command-keys))) (icicle-ensure-overriding-map-is-bound) (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg)) (defun icicle-universal-argument-more (arg) "`universal-argument-more', but also echo the prefix arg." (interactive "P") (universal-argument-more arg) (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg)) (defun icicle-universal-argument-other-key (arg) "`universal-argument-other-key', but also echo the prefix." (interactive "P") (universal-argument-other-key arg) (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg)) (defun icicle-universal-argument-minus (arg) "`universal-argument-minus', but also echo the prefix arg." (interactive "P") (universal-argument-minus arg) (icicle-msg-maybe-in-minibuffer "prefix %S" prefix-arg)) (defun icicle-msg-maybe-in-minibuffer (format-string &rest args) "Display FORMAT-STRING as a message. If called with the minibuffer inactive, use `message'. Otherwise, use `minibuffer-message'." (if (active-minibuffer-window) (save-selected-window (select-window (minibuffer-window)) (minibuffer-message (apply #'format (concat " [" format-string "]") args))) (apply #'message format-string args))) ;; Same code as that defining `universal-argument-map', ;; but with the above corresponding functions substituted. (defvar icicle-universal-argument-map (let ((map (make-sparse-keymap))) (define-key map [t] 'icicle-universal-argument-other-key) (define-key map (vector meta-prefix-char t) 'icicle-universal-argument-other-key) (define-key map [switch-frame] nil) (define-key map [?\C-u] 'icicle-universal-argument-more) (define-key map [?-] 'icicle-universal-argument-minus) (define-key map [?0] 'icicle-digit-argument) (define-key map [?1] 'icicle-digit-argument) (define-key map [?2] 'icicle-digit-argument) (define-key map [?3] 'icicle-digit-argument) (define-key map [?4] 'icicle-digit-argument) (define-key map [?5] 'icicle-digit-argument) (define-key map [?6] 'icicle-digit-argument) (define-key map [?7] 'icicle-digit-argument) (define-key map [?8] 'icicle-digit-argument) (define-key map [?9] 'icicle-digit-argument) (define-key map [kp-0] 'icicle-digit-argument) (define-key map [kp-1] 'icicle-digit-argument) (define-key map [kp-2] 'icicle-digit-argument) (define-key map [kp-3] 'icicle-digit-argument) (define-key map [kp-4] 'icicle-digit-argument) (define-key map [kp-5] 'icicle-digit-argument) (define-key map [kp-6] 'icicle-digit-argument) (define-key map [kp-7] 'icicle-digit-argument) (define-key map [kp-8] 'icicle-digit-argument) (define-key map [kp-9] 'icicle-digit-argument) (define-key map [kp-subtract] 'icicle-universal-argument-minus) map) "Keymap used while processing `C-u' during Icicles completion.") ;; Use my `C-u' during completion (only). (define-key minibuffer-local-completion-map (vector 'remap 'universal-argument) 'icicle-universal-argument) Besides this, I think that your suggested workaround has no chance of solving the problem. The problem cannot be in `sit-for', since that code has not changed between Emacs 22 and 23. And this bug is a regression wrt Emacs 22 (and 21, 20...). Thanks for taking another look.