all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* TAB in find-file with PARTIAL-COMPLETION-MODE on
@ 2007-02-18  0:00 A Soare
  2007-02-18 18:58 ` Stefan Monnier
  0 siblings, 1 reply; 2+ messages in thread
From: A Soare @ 2007-02-18  0:00 UTC (permalink / raw)
  To: Emacs   Dev  [emacs-devel]; +Cc: rms


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: TAB in find-file with PARTIAL-COMPLETION-MODE on
  2007-02-18  0:00 TAB in find-file with PARTIAL-COMPLETION-MODE on A Soare
@ 2007-02-18 18:58 ` Stefan Monnier
  0 siblings, 0 replies; 2+ messages in thread
From: Stefan Monnier @ 2007-02-18 18:58 UTC (permalink / raw)
  To: alinsoar; +Cc: rms, Emacs Dev [emacs-devel]

> TAB does not complete in in find-file when PARTIAL-COMPLETION-MODE is active.

I believe this was fixed recently (the problem was that
minibuffer-completing-file-name was incorrectly reset to nil by some change
that tried to fix some other bug).
Can you try again with the latest code from the CVS repository?


        Stefan

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-18 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-18  0:00 TAB in find-file with PARTIAL-COMPLETION-MODE on A Soare
2007-02-18 18:58 ` Stefan Monnier

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.