diff options
| author | Jan Djärv | 2004-11-02 07:57:53 +0000 |
|---|---|---|
| committer | Jan Djärv | 2004-11-02 07:57:53 +0000 |
| commit | 46bfc73bed2e2b6b3cdfff43f82c6705fb89355c (patch) | |
| tree | fb8175d3c78aecf36b01e4749de6728af0411b84 | |
| parent | 95ec60bcbf3f89bd6c72c989a3510da8c0b96f9a (diff) | |
| download | emacs-46bfc73bed2e2b6b3cdfff43f82c6705fb89355c.tar.gz emacs-46bfc73bed2e2b6b3cdfff43f82c6705fb89355c.zip | |
* files.el (find-file-existing): New function.
* menu-bar.el (menu-bar-files-menu): Make "Open File..." call
find-file-existing. Add "New File..." that calls find-file.
* dired.el (dired-read-dir-and-switches): Call read-driectory-name
instead of read-file-name.
| -rw-r--r-- | lisp/ChangeLog | 15 | ||||
| -rw-r--r-- | lisp/dired.el | 2 | ||||
| -rw-r--r-- | lisp/files.el | 8 | ||||
| -rw-r--r-- | lisp/menu-bar.el | 9 |
4 files changed, 31 insertions, 3 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 7b9b92ee6ce..853daf41a26 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,18 @@ | |||
| 1 | 2004-11-02 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * files.el (find-file-existing): New function. | ||
| 4 | |||
| 5 | * menu-bar.el (menu-bar-files-menu): Make "Open File..." call | ||
| 6 | find-file-existing. Add "New File..." that calls find-file. | ||
| 7 | |||
| 8 | * diropen.pbm diropen.xpm: New files. | ||
| 9 | |||
| 10 | * toolbar/tool-bar.el (tool-bar-setup): Tool bar item dired uses | ||
| 11 | icon diropen. New tool bar item find-file-existing uses icon open. | ||
| 12 | |||
| 13 | * dired.el (dired-read-dir-and-switches): Call read-driectory-name | ||
| 14 | instead of read-file-name. | ||
| 15 | |||
| 1 | 2004-11-02 Ulf Jasper <ulf.jasper@web.de> | 16 | 2004-11-02 Ulf Jasper <ulf.jasper@web.de> |
| 2 | 17 | ||
| 3 | * calendar/icalendar.el (icalendar-version): Increase to 0.08. | 18 | * calendar/icalendar.el (icalendar-version): Increase to 0.08. |
diff --git a/lisp/dired.el b/lisp/dired.el index 96b2905337e..c0fc33729c2 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -546,7 +546,7 @@ Optional third argument FILTER, if non-nil, is a function to select | |||
| 546 | (if current-prefix-arg | 546 | (if current-prefix-arg |
| 547 | (read-string "Dired listing switches: " | 547 | (read-string "Dired listing switches: " |
| 548 | dired-listing-switches)) | 548 | dired-listing-switches)) |
| 549 | (read-file-name (format "Dired %s(directory): " str) | 549 | (read-directory-name (format "Dired %s(directory): " str) |
| 550 | nil default-directory nil)))) | 550 | nil default-directory nil)))) |
| 551 | 551 | ||
| 552 | ;;;###autoload (define-key ctl-x-map "d" 'dired) | 552 | ;;;###autoload (define-key ctl-x-map "d" 'dired) |
diff --git a/lisp/files.el b/lisp/files.el index f10281a0d10..888f9dc81e9 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -977,6 +977,14 @@ expand wildcards (if any) and visit multiple files." | |||
| 977 | (mapcar 'switch-to-buffer (cdr value))) | 977 | (mapcar 'switch-to-buffer (cdr value))) |
| 978 | (switch-to-buffer-other-frame value)))) | 978 | (switch-to-buffer-other-frame value)))) |
| 979 | 979 | ||
| 980 | (defun find-file-existing (filename &optional wildcards) | ||
| 981 | "Edit the existing file FILENAME. | ||
| 982 | Like \\[find-file] but only allow files that exists." | ||
| 983 | (interactive (find-file-read-args "Find existing file: " t)) | ||
| 984 | (unless (file-exists-p filename) (error "%s does not exist" filename)) | ||
| 985 | (find-file filename wildcards) | ||
| 986 | (current-buffer)) | ||
| 987 | |||
| 980 | (defun find-file-read-only (filename &optional wildcards) | 988 | (defun find-file-read-only (filename &optional wildcards) |
| 981 | "Edit file FILENAME but don't allow changes. | 989 | "Edit file FILENAME but don't allow changes. |
| 982 | Like \\[find-file] but marks buffer as read-only. | 990 | Like \\[find-file] but marks buffer as read-only. |
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 22840896c17..2c1d37c80e2 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el | |||
| @@ -186,10 +186,15 @@ A large number or nil slows down menu responsiveness." | |||
| 186 | '(menu-item "Open Directory..." dired | 186 | '(menu-item "Open Directory..." dired |
| 187 | :help "Read a directory, operate on its files")) | 187 | :help "Read a directory, operate on its files")) |
| 188 | (define-key menu-bar-files-menu [open-file] | 188 | (define-key menu-bar-files-menu [open-file] |
| 189 | '(menu-item "Open File..." find-file | 189 | '(menu-item "Open File..." find-file-existing |
| 190 | :enable (not (window-minibuffer-p | 190 | :enable (not (window-minibuffer-p |
| 191 | (frame-selected-window menu-updating-frame))) | 191 | (frame-selected-window menu-updating-frame))) |
| 192 | :help "Read a file into an Emacs buffer")) | 192 | :help "Read an existing file into an Emacs buffer")) |
| 193 | (define-key menu-bar-files-menu [new-file] | ||
| 194 | '(menu-item "New File..." find-file | ||
| 195 | :enable (not (window-minibuffer-p | ||
| 196 | (frame-selected-window menu-updating-frame))) | ||
| 197 | :help "Read or create a file and edit it")) | ||
| 193 | 198 | ||
| 194 | 199 | ||
| 195 | ;; The "Edit" menu items | 200 | ;; The "Edit" menu items |