Commit 7b5836c7 authored by Jan Djärv's avatar Jan Djärv
Browse files

* 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.
parent 90f2e16b
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.
......
......@@ -178,6 +178,17 @@ A large number or nil slows down menu responsiveness."
(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 @@ A large number or nil slows down menu responsiveness."
: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]
......
......@@ -233,7 +233,7 @@ holds a keymap."
;; 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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment