all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lennart Borgman <lennart.borgman.073@student.lu.se>
Subject: read-file-name predicate problem
Date: Thu, 30 Mar 2006 00:02:42 +0200	[thread overview]
Message-ID: <442B0402.6040606@student.lu.se> (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.

                 reply	other threads:[~2006-03-29 22:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=442B0402.6040606@student.lu.se \
    --to=lennart.borgman.073@student.lu.se \
    /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.