From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Sean O'Rourke" Newsgroups: gmane.emacs.devel Subject: Re: For after-the-release: enhanced partial completion Date: Mon, 04 Jun 2007 09:19:05 -0700 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1180983953 31801 80.91.229.12 (4 Jun 2007 19:05:53 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Jun 2007 19:05:53 +0000 (UTC) Cc: emacs-devel@gnu.org To: Leo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jun 04 21:05:50 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 1HvHrU-0003SO-MJ for ged-emacs-devel@m.gmane.org; Mon, 04 Jun 2007 21:05:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvHrU-0005AU-BW for ged-emacs-devel@m.gmane.org; Mon, 04 Jun 2007 15:05:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HvFHG-0002Sx-25 for emacs-devel@gnu.org; Mon, 04 Jun 2007 12:19:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HvFHD-0002Rh-0X for emacs-devel@gnu.org; Mon, 04 Jun 2007 12:19:29 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HvFHC-0002Re-UZ for emacs-devel@gnu.org; Mon, 04 Jun 2007 12:19:26 -0400 Original-Received: from outbound1.ucsd.edu ([132.239.1.205]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1HvFHC-0006EI-Fg for emacs-devel@gnu.org; Mon, 04 Jun 2007 12:19:26 -0400 Original-Received: from smtp.ucsd.edu (smtp.ucsd.edu [132.239.1.49]) by outbound1.ucsd.edu (8.13.6/8.13.6) with ESMTP id l54GJLgx060406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 4 Jun 2007 09:19:21 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; s=2007001; d=ucsd.edu; c=simple; q=dns; b=vHPwqc9sNBf2poX7w0m62ls0TN9s0F11pDCWeyE35uGO0imq8WZ0rowrVo+Y4SUBG brEY3EWIkWgQ94m1hP+Kw== Original-Received: from mister-foo.local ([128.54.220.221]) by smtp.ucsd.edu (8.13.6/8.13.4) with ESMTP id l54GJH21028477; Mon, 4 Jun 2007 09:19:18 -0700 (PDT) In-Reply-To: (Leo's message of "Mon\, 04 Jun 2007 17\:09\:54 +0100") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (darwin) X-detected-kernel: FreeBSD 6.x (1) X-Mailman-Approved-At: Mon, 04 Jun 2007 15:05:01 -0400 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:72220 Archived-At: --=-=-= Leo writes: > I have applied this patch. Wow, I'm impressed someone revisited this almost 4 months later! > I try an example to expand to "emacs-lisp-mode" by: > > M-x e l m TAB > > The minibuffer shows "M-x e-l-m (no matches)" while the *completions* is > showing: > > Click on a completion to select it. > In this buffer, type RET to select the completion near point. > > Possible completions are: > emacs-lisp-mode emms-lyrics-mode > erc-log-mode ess-listing-minor-mode > > Do you think this is a bug? It sounds like one, but I don't see it currently with emacs -Q in CVS-HEAD Emacs. Specifically, *Completions* contains: ------------------------------------------------------------ Click on a completion to select it. In this buffer, type RET to select the completion near point. Possible completions are: emacs-lisp-mode erc-log-mode ------------------------------------------------------------ and there's no '(no matches)' message in *Messages*. I've attached my current diff of complete.el, in case I changed something since my last message. /s --=-=-= Content-Disposition: attachment Index: complete.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/complete.el,v retrieving revision 1.72 diff -u -r1.72 complete.el --- complete.el 14 Apr 2007 20:23:31 -0000 1.72 +++ complete.el 4 Jun 2007 16:14:39 -0000 @@ -590,17 +590,32 @@ pred nil)) ;; Find an initial list of possible completions - (if (not (setq p (string-match (concat PC-delim-regex - (if filename "\\|\\*" "")) - str - (+ (length dirname) offset)))) - - ;; Minibuffer contains no hyphens -- simple case! - (setq poss (all-completions (if env-on - basestr str) - table - pred)) - + (unless (setq p (string-match (concat PC-delim-regex + (if filename "\\|\\*" "")) + str + (+ (length dirname) offset))) + + ;; Minibuffer contains no hyphens -- simple case! + (setq poss (all-completions (if env-on basestr str) + table + pred)) + (unless (or filename poss) + (setq + ;; unexploded str + ;; str (mapconcat #'list str "-") + regex (concat "\\`" + (mapconcat #'list str + (if filename "[^/.]*[/.]" "[^-]*-")) + ;; (replace-regexp-in-string + ;; "-" "[^-]*-" + ;; (mapconcat #'list str "-")) + ) + p 1) + (goto-char beg) + (delete-region beg end) + (setq end (+ beg (length str))) + (insert str))) + (when p ;; Use all-completions to do an initial cull. This is a big win, ;; since all-completions is written in C! (let ((compl (all-completions (if env-on @@ -609,6 +624,9 @@ table pred))) (setq p compl) + (when (and str (not compl)) + (setq ;; str unexploded + p nil)) (while p (and (string-match regex (car p)) (progn --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --=-=-=--