From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Matthew Dempsky Newsgroups: gmane.emacs.bugs Subject: bug#5030: 23.1.50; Unexpected minibuffer tab completion behavior Date: Wed, 25 Nov 2009 00:42:35 -0800 Message-ID: References: Reply-To: Matthew Dempsky , 5030@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1259157045 1291 80.91.229.12 (25 Nov 2009 13:50:45 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 25 Nov 2009 13:50:45 +0000 (UTC) To: 5030@emacsbugs.donarmstrong.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 25 14:50:38 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 1NDIGS-00081I-AA for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Nov 2009 14:50:36 +0100 Original-Received: from localhost ([127.0.0.1]:36115 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDIGR-0003tV-Qg for geb-bug-gnu-emacs@m.gmane.org; Wed, 25 Nov 2009 08:50:35 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NDDqS-0006NQ-JI for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2009 04:07:28 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NDDqO-0006MQ-S2 for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2009 04:07:28 -0500 Original-Received: from [199.232.76.173] (port=35573 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NDDqO-0006MJ-O1 for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2009 04:07:24 -0500 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:43421) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NDDqO-0003NH-5e for bug-gnu-emacs@gnu.org; Wed, 25 Nov 2009 04:07:24 -0500 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 nAP97M4o027277; Wed, 25 Nov 2009 01:07:22 -0800 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id nAP8o36E025127; Wed, 25 Nov 2009 00:50:03 -0800 Resent-Date: Wed, 25 Nov 2009 00:50:03 -0800 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Matthew Dempsky Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs 2Resent-Date: Wed, 25 Nov 2009 08:50:03 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 5030 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 5030-submit@emacsbugs.donarmstrong.com id=B5030.125913856224639 (code B ref 5030); Wed, 25 Nov 2009 08:50:03 +0000 Original-Received: (at 5030) by emacsbugs.donarmstrong.com; 25 Nov 2009 08:42:42 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-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 Original-Received: by pwi3 with SMTP id 3so5164178pwi.1 for <5030@emacsbugs.donarmstrong.com>; Wed, 25 Nov 2009 00:42:35 -0800 (PST) Original-Received: by 10.114.189.8 with SMTP id m8mr8582231waf.180.1259138555870; Wed, 25 Nov 2009 00:42:35 -0800 (PST) In-Reply-To: X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Wed, 25 Nov 2009 04:07:28 -0500 X-Mailman-Approved-At: Wed, 25 Nov 2009 08:42:58 -0500 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:32909 Archived-At: 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