emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: partial-completion-mode and deleting symlink problem


From: Dan Nicolaescu
Subject: Re: partial-completion-mode and deleting symlink problem
Date: Thu, 12 May 2005 13:56:27 -0700

Dan Nicolaescu <address@hidden> writes:

  > partial-completion-mode seems to cause a problem when one tries to
  > delete a symlink to a non-existent file. 
  > 
  > Try this:
  > 
  > ln -s BLAHBLAHBLAH /tmp/DELETEME 
  > (this assumes that neither BLAHBLAHBLAH nor /tmp/DELETEME exist before
  > running ln).
  > 
  > emacs -q
  > M-x partial-completion-mode RET
  > M-x delete-file RET /tmp/DELETEME RET
  > 
  > instead of deleting /tmp/DELETEME the minibuffer shows:
  > Delete file: /tmp/DELETEME [Confirm]
  > Pressing RET does not do anything... 
  > 
  > If the symlink target for /tmp/DELETEME exists, then /tmp/DELETEME is
  > deleted just fine...

A bit of debugging shows that the partial completion code calls: 

(test-completion "/tmp/DELETEME" 'read-file-name-internal "/tmp")
which returns nil because it calls 

(read-file-name-internal "/tmp/DELETEME" "/tmp" 'lambda)
which returns nil because it calls 

Ffile_exists_p ("/tmp/DELETEME")
which returns nil because it calls stat ("/tmp/DELETEME")

If "stat" was to be changed to "lstat" then the original problem would
be fixed.

But is that change desirable?  
What should (file-exists-p "/tmp/DELETEME") return when /tmp/DELETEME
is a symlink that points to a non-existent file? 





reply via email to

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