From matthew@dempsky.org Mon Nov 23 22:09:27 2009 Received: (at submit) by emacsbugs.donarmstrong.com; 24 Nov 2009 06:09:27 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=FOURLA autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 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 nAO69Qdm005389 for ; Mon, 23 Nov 2009 22:09:27 -0800 Received: from mx10.gnu.org ([199.232.76.166]:59686) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1NCoab-00048p-CS for emacs-pretest-bug@gnu.org; Tue, 24 Nov 2009 01:09:25 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1NCoaY-0002gU-Vv for emacs-pretest-bug@gnu.org; Tue, 24 Nov 2009 01:09:24 -0500 Received: from mail-pw0-f47.google.com ([209.85.160.47]:44686) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NCoaY-0002gO-Ln for emacs-pretest-bug@gnu.org; Tue, 24 Nov 2009 01:09:22 -0500 Received: by pwi9 with SMTP id 9so4452815pwi.26 for ; Mon, 23 Nov 2009 22:09:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.188.38 with SMTP id l38mr11120410waf.179.1259042961465; Mon, 23 Nov 2009 22:09:21 -0800 (PST) Date: Mon, 23 Nov 2009 22:09:21 -0800 Message-ID: Subject: 23.1.50; Unexpected minibuffer tab completion behavior From: Matthew Dempsky To: emacs-pretest-bug@gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Please write in English if possible, because the Emacs maintainers usually do not have translators to read other languages for them. Your bug report will be posted to the emacs-pretest-bug@gnu.org mailing list. Please describe exactly what actions triggered the bug and the precise symptoms of the bug. If you can, give a recipe starting from `emacs -Q': On my computer, I have only two files in my home directory beginning with the letter 'a': ~/aaa and ~/aab. After starting Emacs with "Emacs -Q" and pressing "C-x C-k C-a C-k ~ / ", a new window appears to display the *Completion* buffer with all of the files in my home directory. I expect this. After additionally pressing "a ", the minibuffer completes to "~/aa", and the window that previously displayed the *Completion* buffer now switches to displaying the *Messages* buffer instead. I don't expect this. Instead, I expect either for that window to continue showing the *Completion* buffer (refreshed to display just the "aaa" and "aab" entries) or for that window to be deleted. (I'd prefer the former behavior.) If Emacs crashed, and you have the Emacs process in the gdb debugger, please include the output from the following gdb commands: `bt full' and `xbacktrace'. For information about debugging Emacs, please read the file /Volumes/Disk Image/emacs-build/obj/nextstep/Emacs.app/Contents/Resources/etc/DEBUG. In GNU Emacs 23.1.50.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54) of 2009-11-23 on admins-macbook-pro-2.local Windowing system distributor `Apple', version 10.3.949 configured using `configure '--with-ns' '--without-x'' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: en_US.UTF-8 value of $XMODIFIERS: nil locale-coding-system: utf-8-unix default enable-multibyte-characters: t Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t transient-mark-mode: t Recent input: C-x C-f C-a C-k ~ / a C-g M-x r e p o r t - e m a c s - b u g Recent messages: For information about GNU Emacs and the GNU system, type C-h C-a. Making completion list... Quit Load-path shadows: None found. Features: (shadow mail-extr message ecomplete rfc822 mml mml-sec password-cache mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 qp ietf-drums mailabbrev nnheader gnus-util netrc time-date mm-util mail-prsvr gmm-utils wid-edit mailheader canlock sha1 hex-util hashcash mail-utils emacsbug sendmail regexp-opt help-mode view tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win easymenu tool-bar dnd fontset image fringe lisp-mode register page menu-bar rfn-eshadow timer select scroll-bar mldrag mouse jit-lock font-lock syntax facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev loaddefs button minibuffer faces cus-face text-properties overlay md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote make-network-process ns multi-tty emacs) From matthew@dempsky.org Tue Nov 24 17:09:57 2009 Received: (at 5030) by emacsbugs.donarmstrong.com; 25 Nov 2009 01:09:57 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=AWL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-qy0-f197.google.com (mail-qy0-f197.google.com [209.85.221.197]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAP19uwS017057 for <5030@emacsbugs.donarmstrong.com>; Tue, 24 Nov 2009 17:09:57 -0800 Received: by qyk35 with SMTP id 35so3326637qyk.19 for <5030@emacsbugs.donarmstrong.com>; Tue, 24 Nov 2009 17:09:50 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.66.29 with SMTP id l29mr3620192qai.210.1259111390631; Tue, 24 Nov 2009 17:09:50 -0800 (PST) Date: Tue, 24 Nov 2009 17:09:50 -0800 Message-ID: Subject: Re: 23.1.50; Unexpected minibuffer tab completion behavior From: Matthew Dempsky To: 5030@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 It seems like the unexpected buffer switching is because the 'dedicated' flag on the temporary window created for *Completions* is getting cleared by set-window-buffer. My understanding of the situation so far is: - The `(with-output-to-temp-buffer "*Completions*" ...)' form in minibuffer-completion-help results in `display-buffer' being called with `display-buffer-mark-dedicated' bound to `soft'. - The `(and pop-up-windows ...)' clause of `display-buffer' is evaluated*, and calls `(set-window-dedicated-p window-to-use 'soft)'. - However, the `window--display-buffer-2' call then calls `set-window-buffer', which sets `w->dedicated = Qnil'. - Later, when `(bury-buffer)' is called to hide the minibuffer help, it sees the window is not dedicated, so it switches to a new buffer instead of killing the window. (* I haven't bothered yet to look into why that particular clause is evaluated, but I don't think it matters; it's just the one that stepping through the code took me to.) From matthew@dempsky.org Tue Nov 24 17:23:07 2009 Received: (at 5030) by emacsbugs.donarmstrong.com; 25 Nov 2009 01:23:07 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.1 required=4.0 tests=AWL,FOURLA,MURPHY_DRUGS_REL8 autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.27]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAP1N50v018199 for <5030@emacsbugs.donarmstrong.com>; Tue, 24 Nov 2009 17:23:07 -0800 Received: by qw-out-2122.google.com with SMTP id 9so1496394qwb.13 for <5030@emacsbugs.donarmstrong.com>; Tue, 24 Nov 2009 17:23:05 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.86.211 with SMTP id t19mr3626986qal.146.1259112185449; Tue, 24 Nov 2009 17:23:05 -0800 (PST) In-Reply-To: References: Date: Tue, 24 Nov 2009 17:23:05 -0800 Message-ID: Subject: Re: 23.1.50; Unexpected minibuffer tab completion behavior From: Matthew Dempsky To: 5030@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Nov 24, 2009 at 5:09 PM, Matthew Dempsky wrote: > =A0- The `(and pop-up-windows ...)' clause of `display-buffer' is > evaluated*, and calls `(set-window-dedicated-p window-to-use 'soft)'. > =A0- However, the `window--display-buffer-2' call then calls > `set-window-buffer', which sets `w->dedicated =3D Qnil'. Not sure if this is the best fix, but the patch below at least corrects this issue. It changes `display-buffer' so that `set-window-dedicated-p' is called after `window--display-buffer-2' in both clauses that use `display-buffer-mark-dedicated'. --- a/lisp/window.el +++ b/lisp/window.el @@ -1139,9 +1139,9 @@ consider all visible or iconified frames." ((or use-pop-up-frames (not frame-to-use)) ;; We want or need a new frame. (let ((win (frame-selected-window (funcall pop-up-frame-function)))) - (when display-buffer-mark-dedicated - (set-window-dedicated-p win display-buffer-mark-dedicated)) - (window--display-buffer-2 buffer win))) + (prog1 (window--display-buffer-2 buffer win) + (when display-buffer-mark-dedicated + (set-window-dedicated-p win display-buffer-mark-dedicated))))) ((and pop-up-windows ;; Make a new window. (or (not (frame-parameter frame-to-use 'unsplittable)) @@ -1157,9 +1157,9 @@ consider all visible or iconified frames." (get-largest-window frame-to-use t)) (window--try-to-split-window (get-lru-window frame-to-use t))))) - (when display-buffer-mark-dedicated - (set-window-dedicated-p window-to-use display-buffer-mark-dedicate= d)) - (window--display-buffer-2 buffer window-to-use)) + (prog1 (window--display-buffer-2 buffer window-to-use) + (when display-buffer-mark-dedicated + (set-window-dedicated-p window-to-use display-buffer-mark-dedicated)))) ((let ((window-to-undedicate ;; When NOT-THIS-WINDOW is non-nil, temporarily dedicate ;; the selected window to its buffer, to avoid that some of From matthew@dempsky.org Tue Nov 24 18:24:41 2009 Received: (at 5030) by emacsbugs.donarmstrong.com; 25 Nov 2009 02:24:41 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-qy0-f197.google.com (mail-qy0-f197.google.com [209.85.221.197]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAP2Od8X023514 for <5030@emacsbugs.donarmstrong.com>; Tue, 24 Nov 2009 18:24:41 -0800 Received: by qyk35 with SMTP id 35so3349881qyk.19 for <5030@emacsbugs.donarmstrong.com>; Tue, 24 Nov 2009 18:24:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.112.5 with SMTP id u5mr3636438qap.362.1259115874537; Tue, 24 Nov 2009 18:24:34 -0800 (PST) In-Reply-To: References: Date: Tue, 24 Nov 2009 18:24:34 -0800 Message-ID: Subject: Re: 23.1.50; Unexpected minibuffer tab completion behavior From: Matthew Dempsky To: 5030@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Mon, Nov 23, 2009 at 10:09 PM, Matthew Dempsky wrote: > Instead, I expect either for that window to continue showing the > *Completion* buffer (refreshed to display just the "aaa" and "aab" > entries) or for that window to be deleted. =A0(I'd prefer the former > behavior.) The last patch I posted achieves the latter behavior. Combining with the (proof-of-concept) patch below, I seem to achieve the former (personally more desirable) behavior. --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -489,10 +489,11 @@ E =3D after completion we now have an Exact match. minibuffer-completion-table minibuffer-completion-predicate))) (if completed - ;; We could also decide to refresh the completions, - ;; if they're displayed (and assuming there are - ;; completions left). - (minibuffer-hide-completions) + (cond + (exact (minibuffer-hide-completions)) + ((get-buffer-window "*Completions*" 0) + (minibuffer-completion-help)) + (t t)) ;; Show the completion table, if requested. (cond ((not exact) From matthew@dempsky.org Wed Nov 25 00:42:42 2009 Received: (at 5030) by emacsbugs.donarmstrong.com; 25 Nov 2009 08:42:42 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=0.0 required=4.0 tests=AWL,MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail-pw0-f42.google.com (mail-pw0-f42.google.com [209.85.160.42]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAP8gfBo024632 for <5030@emacsbugs.donarmstrong.com>; Wed, 25 Nov 2009 00:42:42 -0800 Received: by pwi3 with SMTP id 3so5164178pwi.1 for <5030@emacsbugs.donarmstrong.com>; Wed, 25 Nov 2009 00:42:35 -0800 (PST) MIME-Version: 1.0 Received: by 10.114.189.8 with SMTP id m8mr8582231waf.180.1259138555870; Wed, 25 Nov 2009 00:42:35 -0800 (PST) In-Reply-To: References: Date: Wed, 25 Nov 2009 00:42:35 -0800 Message-ID: Subject: Re: 23.1.50; Unexpected minibuffer tab completion behavior From: Matthew Dempsky To: 5030@debbugs.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Nov 24, 2009 at 6:24 PM, Matthew Dempsky wrote: > The last patch I posted achieves the latter behavior. =A0Combining with > the (proof-of-concept) patch below, I seem to achieve the former > (personally more desirable) behavior. I think the patch below is better yet. The second hunk fixes a bug where `minibuffer-completion-help' assumes that it can directly compare the input string against the list of candidate completion strings (e.g., for `find-file', `string' will be bound to something like `/path/to/a' while `completions' will be a list of file names like ("aaa" "aab" . 10)). The first hunk then improves on my last patch's behavior by if you complete "x" to "xy" when there's also "xyz" available and the *Completions* buffer is visible, it leaves it visible rather than hiding it just because "xy" is now an exact match. (I'm still playing around with this to see how it actually feels.) --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -489,10 +489,8 @@ E =3D after completion we now have an Exact match. minibuffer-completion-table minibuffer-completion-predicate))) (if completed - ;; We could also decide to refresh the completions, - ;; if they're displayed (and assuming there are - ;; completions left). - (minibuffer-hide-completions) + (when (get-buffer-window "*Completions*" 0) + (minibuffer-completion-help)) ;; Show the completion table, if requested. (cond ((not exact) @@ -1003,7 +1001,9 @@ variables.") (message nil) (if (and completions (or (consp (cdr completions)) - (not (equal (car completions) string)))) + (not (test-completion completion + minibuffer-completion-table + minibuffer-completion-predicate)))) (let* ((last (last completions)) (base-size (cdr last)) ;; If the *Completions* buffer is shown in a new From monnier@iro.umontreal.ca Wed Nov 25 08:36:50 2009 Received: (at 5030) by emacsbugs.donarmstrong.com; 25 Nov 2009 16:36:50 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.8 required=4.0 tests=AWL,HAS_BUG_NUMBER, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.pppoe.ca (ironport2-out.teksavvy.com [206.248.154.183]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id nAPGam8b004530 for <5030@emacsbugs.donarmstrong.com>; Wed, 25 Nov 2009 08:36:50 -0800 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvYEADfsDEtFpYc//2dsb2JhbACBTdRbhDIEihY X-IronPort-AV: E=Sophos;i="4.47,286,1257138000"; d="scan'208";a="50000838" Received: from 69-165-135-63.dsl.teksavvy.com (HELO pastel.home) ([69.165.135.63]) by ironport2-out.pppoe.ca with ESMTP; 25 Nov 2009 11:36:43 -0500 Received: by pastel.home (Postfix, from userid 20848) id 2912280E3; Wed, 25 Nov 2009 11:36:43 -0500 (EST) From: Stefan Monnier To: Matthew Dempsky Cc: 5030@debbugs.gnu.org Subject: Re: bug#5030: 23.1.50; Unexpected minibuffer tab completion behavior Message-ID: References: Date: Wed, 25 Nov 2009 11:36:42 -0500 In-Reply-To: (Matthew Dempsky's message of "Tue, 24 Nov 2009 17:23:05 -0800") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable >> =A0- The `(and pop-up-windows ...)' clause of `display-buffer' is >> evaluated*, and calls `(set-window-dedicated-p window-to-use 'soft)'. >> =A0- However, the `window--display-buffer-2' call then calls >> `set-window-buffer', which sets `w->dedicated =3D Qnil'. > Not sure if this is the best fix, but the patch below at least > corrects this issue. It changes `display-buffer' so that > `set-window-dedicated-p' is called after `window--display-buffer-2' in > both clauses that use `display-buffer-mark-dedicated'. Thanks for tracking that down. I've installed a slightly different patch which seems to fix it, Stefan From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 01 12:17:51 2010 Received: (at control) by debbugs.gnu.org; 1 Jan 2010 17:17:51 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NQl8J-0005x7-MQ for submit@debbugs.gnu.org; Fri, 01 Jan 2010 12:17:51 -0500 Received: from pantheon-po39.its.yale.edu ([130.132.50.100]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NQl8H-0005x0-LE for control@debbugs.gnu.org; Fri, 01 Jan 2010 12:17:49 -0500 Received: from furry (dhcp128036014103.central.yale.edu [128.36.14.103]) (authenticated bits=0) by pantheon-po39.its.yale.edu (8.12.11.20060308/8.12.11) with ESMTP id o01HHjHn022303 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Fri, 1 Jan 2010 12:17:45 -0500 Received: by furry (Postfix, from userid 1000) id 20095C05D; Fri, 1 Jan 2010 12:17:45 -0500 (EST) From: Chong Yidong To: control@debbugs.gnu.org Subject: close 5030 Date: Fri, 01 Jan 2010 12:17:45 -0500 Message-ID: <87iqblg2x2.fsf@stupidchicken.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-YaleITSMailFilter: Version 1.2c (attachment(s) not renamed) X-Spam-Score: 3.1 (+++) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: 3.1 (+++) close 5030 thanks From unknown Mon Aug 18 04:43:18 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 30 Jan 2010 12:24:04 +0000 User-Agent: Fakemail v42.6.9 # A New Hope # A long time ago, in a galaxy far, far away # something happened. # # Magically this resulted in the following # action being taken, but this fake control # message doesn't tell you why it happened # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator