]> git.eshelyaron.com Git - emacs.git/commitdiff
(dired-at-point): Check whether the user can create a directory before asking
authorJuanma Barranquero <lekktu@gmail.com>
Thu, 6 Mar 2003 20:30:05 +0000 (20:30 +0000)
committerJuanma Barranquero <lekktu@gmail.com>
Thu, 6 Mar 2003 20:30:05 +0000 (20:30 +0000)
about creating it.

lisp/ffap.el

index 2ebb21e6bcf8f697094d69cc5d99def69b5c19f8..5bea298f4df77aed30f490867f3f4a79ca6fedb4 100644 (file)
@@ -1,4 +1,4 @@
-;;; ffap.el --- find file (or url) at point
+;; ffap.el --- find file (or url) at point
 ;;
 ;; Copyright (C) 1995, 96, 97, 2000  Free Software Foundation, Inc.
 ;;
@@ -1658,7 +1658,8 @@ ffap most of the time."
       (if (file-directory-p filename)
          (dired (expand-file-name filename))
        (dired (concat (expand-file-name filename) "*"))))
-     ((y-or-n-p "Directory does not exist, create it? ")
+     ((and (file-writable-p (file-name-directory filename))
+           (y-or-n-p "Directory does not exist, create it? "))
       (make-directory filename)
       (dired filename))
      ((error "No such file or directory `%s'" filename)))))