emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

read-file-name predicate problem


From: Lennart Borgman
Subject: read-file-name predicate problem
Date: Thu, 30 Mar 2006 00:02:42 +0200
User-agent: Thunderbird 1.5 (Windows/20051201)

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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]