diff options
author | Juanma Barranquero <lekktu@gmail.com> | 2003-03-06 20:30:05 +0000 |
---|---|---|
committer | Juanma Barranquero <lekktu@gmail.com> | 2003-03-06 20:30:05 +0000 |
commit | 3fa86f26fe49998c027aeabedcbab2d778358938 (patch) | |
tree | b1528686a3b3162b3844045c76cc834ca1b2fe23 /lisp/ffap.el | |
parent | c9029fe54be0f7b0a6ecfee0528b171d7392b5fe (diff) | |
download | emacs-3fa86f26fe49998c027aeabedcbab2d778358938.tar.gz |
(dired-at-point): Check whether the user can create a directory before asking
about creating it.
Diffstat (limited to 'lisp/ffap.el')
-rw-r--r-- | lisp/ffap.el | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/ffap.el b/lisp/ffap.el index 2ebb21e6bcf..5bea298f4df 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el @@ -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))))) |