Mercurial > emacs
changeset 67762:31f77129bc92
* menu-bar.el (menu-find-file-existing): New function.
(menu-bar-file-menu): Use menu-find-file-existing for Open.
* tool-bar.el (tool-bar-setup): open changed to menu-find-file-existing.
author | Jan Djärv <jan.h.d@swipnet.se> |
---|---|
date | Fri, 23 Dec 2005 11:36:08 +0000 |
parents | 5b8799d65159 |
children | 880ba311db53 |
files | lisp/ChangeLog lisp/menu-bar.el lisp/tool-bar.el |
diffstat | 3 files changed, 20 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/ChangeLog Fri Dec 23 11:34:13 2005 +0000 +++ b/lisp/ChangeLog Fri Dec 23 11:36:08 2005 +0000 @@ -1,3 +1,10 @@ +2005-12-23 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> + + * menu-bar.el (menu-find-file-existing): New function. + (menu-bar-file-menu): Use menu-find-file-existing for Open. + + * tool-bar.el (tool-bar-setup): open changed to menu-find-file-existing. + 2005-12-22 Stefan Monnier <monnier@iro.umontreal.ca> * vc.el: Remove unnecessary leading * in docstrings.
--- a/lisp/menu-bar.el Fri Dec 23 11:34:13 2005 +0000 +++ b/lisp/menu-bar.el Fri Dec 23 11:36:08 2005 +0000 @@ -178,6 +178,17 @@ (define-key menu-bar-file-menu [separator-save] '(menu-item "--")) +(defun menu-find-file-existing () + "Edit the existing file FILENAME." + (interactive) + (let* ((mustmatch (not (and (fboundp 'x-uses-old-gtk-dialog) + (x-uses-old-gtk-dialog)))) + (filename (car (find-file-read-args "Find file: " mustmatch)))) + (if mustmatch + (find-file-existing filename) + (find-file filename)))) + + (define-key menu-bar-file-menu [kill-buffer] '(menu-item "Close" kill-this-buffer :enable (kill-this-buffer-enabled-p) @@ -191,7 +202,7 @@ :enable (menu-bar-non-minibuffer-window-p) :help "Read a directory, to operate on its files")) (define-key menu-bar-file-menu [open-file] - '(menu-item "Open File..." find-file-existing + '(menu-item "Open File..." menu-find-file-existing :enable (menu-bar-non-minibuffer-window-p) :help "Read an existing file into an Emacs buffer")) (define-key menu-bar-file-menu [new-file]
--- a/lisp/tool-bar.el Fri Dec 23 11:34:13 2005 +0000 +++ b/lisp/tool-bar.el Fri Dec 23 11:36:08 2005 +0000 @@ -233,7 +233,7 @@ ;; might inadvertently click that button. ;;(tool-bar-add-item-from-menu 'save-buffers-kill-emacs "exit") (tool-bar-add-item-from-menu 'find-file "new") - (tool-bar-add-item-from-menu 'find-file-existing "open") + (tool-bar-add-item-from-menu 'menu-find-file-existing "open") (tool-bar-add-item-from-menu 'dired "diropen") (tool-bar-add-item-from-menu 'kill-this-buffer "close") (tool-bar-add-item-from-menu 'save-buffer "save" nil