Mercurial > emacs
changeset 50042:5e493709a8ef
(dired-at-point): Check whether the user can create a directory before asking
about creating it.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Thu, 06 Mar 2003 20:30:05 +0000 |
parents | 8a0260337471 |
children | 90beb357e9f5 |
files | lisp/ffap.el |
diffstat | 1 files changed, 3 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ffap.el Thu Mar 06 13:07:24 2003 +0000 +++ b/lisp/ffap.el Thu Mar 06 20:30:05 2003 +0000 @@ -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 @@ (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)))))