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

Re: mysterious file-error



>>>>> In [emacs-w3m : No.08221] Guido Van Hoecke wrote:

> Just did a C-h f for file-executable-p:
> `file-executable-p' is a built-in function
> (file-executable-p FILENAME)

> Documentation:
> Return t if FILENAME can be executed by you.
> For a directory, this means you can access files in that directory.

> This means that as far as XEmacs is concerned, the behaviour is
> correct and should report t.

> So this is really a bug inside emacs-w3m.

Ouch!  I confirmed it is the same in Emacs as well.  Thank you
for pointing it out.  I've fixed the w3m-which-command function
in the CVS repository.  The following patch is for v1.4.4 (you
need to rebuild emacs-w3m after applying it).
--- w3m-util.el~	2005-03-22 08:05:20 +0000
+++ w3m-util.el	2005-07-01 07:49:36 +0000
@@ -778,10 +778,11 @@
       (catch 'found-command
 	(let (bin)
 	  (dolist (dir exec-path)
-	    (when (or (file-executable-p
-		       (setq bin (expand-file-name command dir)))
-		      (file-executable-p
-		       (setq bin (expand-file-name (concat command ".exe") dir))))
+	    (setq bin (expand-file-name command dir))
+	    (when (or (and (file-executable-p bin)
+			   (not (file-directory-p bin)))
+		      (and (file-executable-p (setq bin (concat bin ".exe")))
+			   (not (file-directory-p bin))))
 	      (throw 'found-command bin))))))))
 
 (defun w3m-cancel-refresh-timer (&optional buffer)