all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* read-file-name predicate problem
@ 2006-03-29 22:02 Lennart Borgman
  0 siblings, 0 replies; only message in thread
From: Lennart Borgman @ 2006-03-29 22:02 UTC (permalink / raw)


I get a completion for a file name that does not match my predicate 
function with read-file-name. This problem seems to happen when there is 
just one file in the directory. Maybe this problem is w32 specific since 
the completion also returns "../" and "./". (Are these seen on other 
systems too?)

To try this put just one file in a directory. This file should NOT match 
predicate below (use for example temp.txt). Set default-directory to 
this directory. Then eval

    (defun image-predicate(url)
      (or (file-directory-p url)
          (string-match "\\.\\(?:png\\|jpg\\|jpeg\\|gif\\)$" url)))

    (read-file-name "File: " nil nil nil nil 'image-predicate)

Press M-Tab to complete and see what happens. I get a hit for that file 
(temp.txt) that does not match the predicate.

If I put another non-matching file there completion gives just "../".

w32. GNU Emacs 22.0.50.1 (i386-mingw-nt5.0.2195) of 2006-03-28.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-03-29 22:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-29 22:02 read-file-name predicate problem Lennart Borgman

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.