summaryrefslogtreecommitdiff
path: root/lisp/ffap.el
diff options
context:
space:
mode:
authorJuanma Barranquero <lekktu@gmail.com>2003-03-06 20:30:05 +0000
committerJuanma Barranquero <lekktu@gmail.com>2003-03-06 20:30:05 +0000
commit3fa86f26fe49998c027aeabedcbab2d778358938 (patch)
treeb1528686a3b3162b3844045c76cc834ca1b2fe23 /lisp/ffap.el
parentc9029fe54be0f7b0a6ecfee0528b171d7392b5fe (diff)
downloademacs-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.el5
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)))))