GNU bug report logs - #17330
files.el cd-absolute overcome false negative from file-executable-p

Previous Next

Package: emacs;

Reported by: Philip Hodges <philip.hodges <at> bluewin.ch>

Date: Wed, 23 Apr 2014 20:57:03 UTC

Severity: minor

Done: Stefan Kangas <stefan <at> marxist.se>

Bug is archived. No further changes may be made.

Full log


Message #62 received at 17330 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Philip Hodges <philip.hodges <at> bluewin.ch>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 17330 <at> debbugs.gnu.org
Subject: Re: bug#17330: files.el cd-absolute overcome false negative
 from	file-executable-p
Date: Tue, 06 May 2014 08:46:27 -0400
> After discovering that even C functions can be redefined, today I "activated
> an advice" so that all file-executable-p C code calls from Lisp return t.
> No unexpected refusals, no noticeable downsides, no waiting months for
> C code changes to appear in a new official release.

The changes being discussed are to `cd-absolute' which is an Elisp
function, so no need for recompilation.

E.g. if you add

   (defun cd-absolute (dir)
     "Change current directory to given absolute file name DIR."
     ;; Put the name into directory syntax now,
     ;; because otherwise expand-file-name may give some bad results.
     (setq dir (file-name-as-directory dir))
     ;; We used to additionally call abbreviate-file-name here, for an
     ;; unknown reason.  Problem is that most buffers are setup
     ;; without going through cd-absolute and don't call
     ;; abbreviate-file-name on their default-directory, so the few that
     ;; do end up using a superficially different directory.
     (setq dir (expand-file-name dir))
     (if (not (file-directory-p dir))
         (if (file-exists-p dir)
   	  (error "%s is not a directory" dir)
   	(error "%s: no such directory" dir))
       (unless (file-accessible-directory-p dir)
         (error "Cannot cd to %s:  Permission denied" dir))
       (setq default-directory dir)
       (setq list-buffers-directory dir)))

to your .emacs, does it fix the problem for you?


        Stefan




This bug report was last modified 3 years and 210 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.