all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: A Soare <alinsoar@voila.fr>
To: "Emacs   Dev  [emacs-devel]" <emacs-devel@gnu.org>
Cc: rms@gnu.org
Subject: TAB in find-file with PARTIAL-COMPLETION-MODE on
Date: Sun, 18 Feb 2007 01:00:00 +0100 (CET)	[thread overview]
Message-ID: <7157014.255021171756800287.JavaMail.www@wwinf4001> (raw)


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

             reply	other threads:[~2007-02-18  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-18  0:00 A Soare [this message]
2007-02-18 18:58 ` TAB in find-file with PARTIAL-COMPLETION-MODE on Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7157014.255021171756800287.JavaMail.www@wwinf4001 \
    --to=alinsoar@voila.fr \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.