From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: A Soare Newsgroups: gmane.emacs.devel Subject: TAB in find-file with PARTIAL-COMPLETION-MODE on Date: Sun, 18 Feb 2007 01:00:00 +0100 (CET) Message-ID: <7157014.255021171756800287.JavaMail.www@wwinf4001> Reply-To: alinsoar@voila.fr NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1171756826 12862 80.91.229.12 (18 Feb 2007 00:00:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 18 Feb 2007 00:00:26 +0000 (UTC) Cc: rms@gnu.org To: "Emacs Dev [emacs-devel]" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 18 01:00:20 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 1HIZTX-0002aA-Ex for ged-emacs-devel@m.gmane.org; Sun, 18 Feb 2007 01:00:19 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HIZTW-0005NO-Pw for ged-emacs-devel@m.gmane.org; Sat, 17 Feb 2007 19:00:18 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HIZTK-0005N2-0d for emacs-devel@gnu.org; Sat, 17 Feb 2007 19:00:06 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HIZTI-0005MI-4V for emacs-devel@gnu.org; Sat, 17 Feb 2007 19:00:05 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HIZTH-0005MA-ST for emacs-devel@gnu.org; Sat, 17 Feb 2007 19:00:03 -0500 Original-Received: from smtp1.voila.fr ([193.252.22.174]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HIZTG-0005iG-Cl; Sat, 17 Feb 2007 19:00:02 -0500 Original-Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf4009.voila.fr (SMTP Server) with ESMTP id 50DD6680018B; Sun, 18 Feb 2007 01:00:00 +0100 (CET) Original-Received: from wwinf4001 (wwinf4001 [172.22.157.28]) by mwinf4009.voila.fr (SMTP Server) with ESMTP id 49C1F680018A; Sun, 18 Feb 2007 01:00:00 +0100 (CET) X-ME-UUID: 20070218000000302.49C1F680018A@mwinf4009.voila.fr X-Originating-IP: [86.107.96.49] X-Wum-Nature: EMAIL-NATURE X-WUM-FROM: |~| X-WUM-TO: |~| X-WUM-CC: |~| X-WUM-REPLYTO: |~| X-detected-kernel: Linux 2.4-2.6 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:66495 Archived-At: TAB does not complete in in find-file when PARTIAL-COMPLETION-MODE is active. I do not write another description of this bug. Just I describe the solution from this patch: the output from cvs -d:pserver:anonymous@cvs.gnu.org:/sources/emacs diff -c emacs/lisp/files.el --------------------------------------------------------------------------------------- Index: emacs/lisp/files.el =================================================================== RCS file: /sources/emacs/emacs/lisp/files.el,v retrieving revision 1.884 diff -c -r1.884 files.el *** emacs/lisp/files.el 11 Feb 2007 02:28:57 -0000 1.884 --- emacs/lisp/files.el 17 Feb 2007 23:46:19 -0000 *************** *** 1056,1062 **** (and buffer-file-name (abbreviate-file-name buffer-file-name)))) (minibuffer-with-setup-hook ! (lambda () (setq minibuffer-default find-file-default)) (read-file-name prompt nil default-directory mustmatch))) t)) --- 1056,1063 ---- (and buffer-file-name (abbreviate-file-name buffer-file-name)))) (minibuffer-with-setup-hook ! (lambda () (setq minibuffer-default find-file-default ! minibuffer-completing-file-name partial-completion-mode)) (read-file-name prompt nil default-directory mustmatch))) t)) ---------------------------------------------------------------------------------- When partial-completion is active, the completion is made by the function (defun PC-do-completion (&optional mode beg end) from complete.el. Here is the backtrace when I press TAB in execute-extended-command (M-x) and find-file (C-x C-f): (edebug-backtrace) ------------------------------------------------- PC-do-completion(nil) PC-complete() call-interactively(PC-complete) execute-extended-command(nil) call-interactively(execute-extended-command) ------------------------------------------------- PC-do-completion(nil) PC-complete() call-interactively(PC-complete) read-file-name("Find file: " nil "/mnt/doc/emacs/lisp/" nil) find-file-read-args("Find file: " nil) call-interactively(find-file) ------------------------------------------------- PC-do-completion check that is called from find-file (so in this case it deals with a file) by the line: (filename (funcall PC-completion-as-file-name-predicate)) The definition of PC-completion-as-file-name-predicate is: (defvar PC-completion-as-file-name-predicate (lambda () minibuffer-completing-file-name) "A function testing whether a minibuffer completion now will work filename-style. The function takes no arguments, and typically looks at the value of `minibuffer-completion-table' and the minibuffer contents.") So PC-completion-as-file-name-predicate = minibuffer-completing-file-name; Here is the bug. Find-file should set this var to t (i.e. TRUE) when called by find-file. But it does not. So in my patch I set in the hook minibuffer-with-setup-hook this variable to true if partial-completion is enabled, and to false otherwise, i.e. minibuffer-completing-file-name = (eval partial-completion-mode) That is all. Alin Soare