aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-05-07 00:21:24 +0000
committerKarl Heuer1994-05-07 00:21:24 +0000
commit6f2c86fa800bd2f327600c6d32ffe0387b3c5b16 (patch)
tree5646b3094f5172ee8b4dacdb52346bd269f26ca4
parent80056f3da61bc4eae7bc6d899c5c6d38171b3d72 (diff)
downloademacs-6f2c86fa800bd2f327600c6d32ffe0387b3c5b16.tar.gz
emacs-6f2c86fa800bd2f327600c6d32ffe0387b3c5b16.zip
(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.
-rw-r--r--lisp/startup.el52
1 files changed, 36 insertions, 16 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index c5f131e0814..01a5101599f 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -163,22 +163,37 @@ this variable, if non-nil; 2. `~/.emacs'; 3. `default.el'.")
163 (delete (concat "PWD=" pwd) 163 (delete (concat "PWD=" pwd)
164 process-environment))))))) 164 process-environment)))))))
165 (setq default-directory (abbreviate-file-name default-directory)) 165 (setq default-directory (abbreviate-file-name default-directory))
166 (unwind-protect 166 (let ((menubar-bindings-done nil))
167 (command-line) 167 (unwind-protect
168 ;; Do this again, in case .emacs defined more abbreviations. 168 (command-line)
169 (setq default-directory (abbreviate-file-name default-directory)) 169 ;; Do this again, in case .emacs defined more abbreviations.
170 (run-hooks 'emacs-startup-hook) 170 (setq default-directory (abbreviate-file-name default-directory))
171 (and term-setup-hook 171 (run-hooks 'emacs-startup-hook)
172 (run-hooks 'term-setup-hook)) 172 (and term-setup-hook
173 ;; Modify the initial frame based on what .emacs puts into 173 (run-hooks 'term-setup-hook))
174 ;; ...-frame-alist. 174 ;; Modify the initial frame based on what .emacs puts into
175 (if (fboundp 'frame-notice-user-settings) 175 ;; ...-frame-alist.
176 (frame-notice-user-settings)) 176 (if (fboundp 'frame-notice-user-settings)
177 ;; Now we know the user's default font, so add it to the menu. 177 (frame-notice-user-settings))
178 (if (fboundp 'font-menu-add-default) 178 ;; Now we know the user's default font, so add it to the menu.
179 (font-menu-add-default)) 179 (if (fboundp 'font-menu-add-default)
180 (and window-setup-hook 180 (font-menu-add-default))
181 (run-hooks 'window-setup-hook))))) 181 (and window-setup-hook
182 (run-hooks 'window-setup-hook))
183 (or menubar-bindings-done
184 (precompute-menubar-bindings))))))
185
186;; Precompute the keyboard equivalents in the menu bar items.
187(defun precompute-menubar-bindings ()
188 (if (fboundp 'x-popup-menu)
189 (let ((submap (lookup-key global-map [menu-bar])))
190 (while submap
191 (and (consp (car submap))
192 (symbolp (car (car submap)))
193 (stringp (car-safe (cdr (car submap))))
194 (keymapp (cdr (cdr (car submap))))
195 (x-popup-menu nil (cdr (cdr (car submap)))))
196 (setq submap (cdr submap))))))
182 197
183(defun command-line () 198(defun command-line ()
184 (setq command-line-default-directory default-directory) 199 (setq command-line-default-directory default-directory)
@@ -422,6 +437,11 @@ GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for f
422You may give out copies of Emacs; type \\[describe-copying] to see the conditions. 437You may give out copies of Emacs; type \\[describe-copying] to see the conditions.
423Type \\[describe-distribution] for information on getting the latest version."))) 438Type \\[describe-distribution] for information on getting the latest version.")))
424 (set-buffer-modified-p nil) 439 (set-buffer-modified-p nil)
440 ;; Do this now to avoid an annoying delay if the user
441 ;; clicks the menu bar during the sit-for.
442 (sit-for 0)
443 (precompute-menubar-bindings)
444 (setq menubar-bindings-done t)
425 (sit-for 120)) 445 (sit-for 120))
426 (save-excursion 446 (save-excursion
427 ;; In case the Emacs server has already selected 447 ;; In case the Emacs server has already selected