1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-26 10:49:33 +00:00

(precompute-menubar-bindings): New function, formerly in loadup.el.

(normal-top-level): Call it here, after loading user files.
(command-line-1): Or here, if displaying startup message.
This commit is contained in:
Karl Heuer 1994-05-07 00:21:24 +00:00
parent 80056f3da6
commit 6f2c86fa80

View File

@ -163,6 +163,7 @@ this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.")
(delete (concat "PWD=" pwd)
process-environment)))))))
(setq default-directory (abbreviate-file-name default-directory))
(let ((menubar-bindings-done nil))
(unwind-protect
(command-line)
;; Do this again, in case .emacs defined more abbreviations.
@ -178,7 +179,21 @@ this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.")
(if (fboundp 'font-menu-add-default)
(font-menu-add-default))
(and window-setup-hook
(run-hooks 'window-setup-hook)))))
(run-hooks 'window-setup-hook))
(or menubar-bindings-done
(precompute-menubar-bindings))))))
;; Precompute the keyboard equivalents in the menu bar items.
(defun precompute-menubar-bindings ()
(if (fboundp 'x-popup-menu)
(let ((submap (lookup-key global-map [menu-bar])))
(while submap
(and (consp (car submap))
(symbolp (car (car submap)))
(stringp (car-safe (cdr (car submap))))
(keymapp (cdr (cdr (car submap))))
(x-popup-menu nil (cdr (cdr (car submap)))))
(setq submap (cdr submap))))))
(defun command-line ()
(setq command-line-default-directory default-directory)
@ -422,6 +437,11 @@ GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for f
You may give out copies of Emacs; type \\[describe-copying] to see the conditions.
Type \\[describe-distribution] for information on getting the latest version.")))
(set-buffer-modified-p nil)
;; Do this now to avoid an annoying delay if the user
;; clicks the menu bar during the sit-for.
(sit-for 0)
(precompute-menubar-bindings)
(setq menubar-bindings-done t)
(sit-for 120))
(save-excursion
;; In case the Emacs server has already selected