From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong Newsgroups: gmane.emacs.devel Subject: Re: [bojohan+mail@dd.chalmers.se: Partial completion] Date: Thu, 08 Mar 2007 15:44:33 -0500 Message-ID: <87abynsbwu.fsf@stupidchicken.com> References: <17888.10288.446902.230637@kahikatea.snap.net.nz> <45E0979B.2020006@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1173388735 32624 80.91.229.12 (8 Mar 2007 21:18:55 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 8 Mar 2007 21:18:55 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 08 22:18:40 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HPQ0W-0007Pg-8m for ged-emacs-devel@m.gmane.org; Thu, 08 Mar 2007 22:18:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPQ0k-0007v6-V2 for ged-emacs-devel@m.gmane.org; Thu, 08 Mar 2007 16:18:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HPQ0a-0007uo-26 for emacs-devel@gnu.org; Thu, 08 Mar 2007 16:18:44 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HPQ0Z-0007uY-NE for emacs-devel@gnu.org; Thu, 08 Mar 2007 16:18:43 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HPQ0Z-0007uV-E5 for emacs-devel@gnu.org; Thu, 08 Mar 2007 16:18:43 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HPQ0J-0005yg-Ha for emacs-devel@gnu.org; Thu, 08 Mar 2007 16:18:27 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1HPPtW-0003mt-1p for emacs-devel@gnu.org; Thu, 08 Mar 2007 22:11:26 +0100 Original-Received: from main-twelve-two-fifty-six.mit.edu ([18.19.6.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 22:11:26 +0100 Original-Received: from cyd by main-twelve-two-fifty-six.mit.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 08 Mar 2007 22:11:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 93 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: main-twelve-two-fifty-six.mit.edu User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.95 (gnu/linux) Cancel-Lock: sha1:FtzBy79rUP+/6Q9Gmqhl9l70Alg= X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67581 Archived-At: martin rudalics writes: > Please try the attached patch instead. It's simpler and should take > care of the remaining problems. I think it's time to check this patch in. > *** complete.el Tue Jan 23 07:40:00 2007 > --- complete.el Sat Feb 24 20:46:14 2007 > *************** > *** 383,388 **** > --- 383,393 ---- > (let ((completion-ignore-case nil)) > (test-completion str table pred)))) > > + (defun try-completion-old (string alist &optional predicate) > + "Like `try-completion' but return empty string instead of t." > + (let ((result (try-completion string alist predicate))) > + (if (eq result t) "" result))) > + > (defun PC-do-completion (&optional mode beg end) > (or beg (setq beg (minibuffer-prompt-end))) > (or end (setq end (point-max))) > *************** > *** 390,396 **** > (pred minibuffer-completion-predicate) > (filename (funcall PC-completion-as-file-name-predicate)) > (dirname nil) ; non-nil only if a filename is being completed > ! (dirlength 0) > (str (buffer-substring beg end)) > (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str))) > (ambig nil) > --- 395,401 ---- > (pred minibuffer-completion-predicate) > (filename (funcall PC-completion-as-file-name-predicate)) > (dirname nil) ; non-nil only if a filename is being completed > ! dirlength > (str (buffer-substring beg end)) > (incname (and filename (string-match "<\\([^\"<>]*\\)>?$" str))) > (ambig nil) > *************** > *** 623,630 **** > > ;; Check if next few letters are the same in all cases > (if (and (not (eq mode 'help)) > ! (setq prefix (try-completion (PC-chunk-after basestr skip) > ! poss))) > (let ((first t) i) > ;; Retain capitalization of user input even if > ;; completion-ignore-case is set. > --- 628,635 ---- > > ;; Check if next few letters are the same in all cases > (if (and (not (eq mode 'help)) > ! (setq prefix (try-completion-old > ! (PC-chunk-after basestr skip) poss))) > (let ((first t) i) > ;; Retain capitalization of user input even if > ;; completion-ignore-case is set. > *************** > *** 662,668 **** > (setq skip (concat skip > (regexp-quote prefix) > PC-ndelims-regex) > ! prefix (try-completion > (PC-chunk-after > ;; not basestr, because that does > ;; not reflect insertions > --- 667,673 ---- > (setq skip (concat skip > (regexp-quote prefix) > PC-ndelims-regex) > ! prefix (try-completion-old > (PC-chunk-after > ;; not basestr, because that does > ;; not reflect insertions > *************** > *** 996,1002 **** > (cond > ((not completion-table) nil) > ((eq action 'lambda) (test-completion str2 completion-table nil)) > ! ((eq action nil) (try-completion str2 completion-table nil)) > ((eq action t) (all-completions str2 completion-table nil))))) > ad-do-it)) > > --- 1001,1007 ---- > (cond > ((not completion-table) nil) > ((eq action 'lambda) (test-completion str2 completion-table nil)) > ! ((eq action nil) (try-completion-old str2 completion-table nil)) > ((eq action t) (all-completions str2 completion-table nil))))) > ad-do-it)) >