diff options
| author | Juanma Barranquero | 2003-03-06 20:30:05 +0000 |
|---|---|---|
| committer | Juanma Barranquero | 2003-03-06 20:30:05 +0000 |
| commit | 3fa86f26fe49998c027aeabedcbab2d778358938 (patch) | |
| tree | b1528686a3b3162b3844045c76cc834ca1b2fe23 | |
| parent | c9029fe54be0f7b0a6ecfee0528b171d7392b5fe (diff) | |
| download | emacs-3fa86f26fe49998c027aeabedcbab2d778358938.tar.gz emacs-3fa86f26fe49998c027aeabedcbab2d778358938.zip | |
(dired-at-point): Check whether the user can create a directory before asking
about creating it.
| -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 @@ | |||
| 1 | ;;; ffap.el --- find file (or url) at point | 1 | ;; ffap.el --- find file (or url) at point |
| 2 | ;; | 2 | ;; |
| 3 | ;; Copyright (C) 1995, 96, 97, 2000 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1995, 96, 97, 2000 Free Software Foundation, Inc. |
| 4 | ;; | 4 | ;; |
| @@ -1658,7 +1658,8 @@ ffap most of the time." | |||
| 1658 | (if (file-directory-p filename) | 1658 | (if (file-directory-p filename) |
| 1659 | (dired (expand-file-name filename)) | 1659 | (dired (expand-file-name filename)) |
| 1660 | (dired (concat (expand-file-name filename) "*")))) | 1660 | (dired (concat (expand-file-name filename) "*")))) |
| 1661 | ((y-or-n-p "Directory does not exist, create it? ") | 1661 | ((and (file-writable-p (file-name-directory filename)) |
| 1662 | (y-or-n-p "Directory does not exist, create it? ")) | ||
| 1662 | (make-directory filename) | 1663 | (make-directory filename) |
| 1663 | (dired filename)) | 1664 | (dired filename)) |
| 1664 | ((error "No such file or directory `%s'" filename))))) | 1665 | ((error "No such file or directory `%s'" filename))))) |