comparison lisp/startup.el @ 7371:099233e3a3be

(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.
author Karl Heuer <kwzh@gnu.org>
date Sat, 07 May 1994 00:21:24 +0000
parents 5635564a3064
children dd0db01bc9f4
comparison
equal deleted inserted replaced
7370:ecb09a00d330 7371:099233e3a3be
161 "."))) 161 ".")))
162 (setq process-environment 162 (setq process-environment
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)
185 200
186 ;; See if we should import version-control from the environment variable. 201 ;; See if we should import version-control from the environment variable.
420 435
421 GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details. 436 GNU Emacs comes with ABSOLUTELY NO WARRANTY; type \\[describe-no-warranty] for full details.
422 You may give out copies of Emacs; type \\[describe-copying] to see the conditions. 437 You may give out copies of Emacs; type \\[describe-copying] to see the conditions.
423 Type \\[describe-distribution] for information on getting the latest version."))) 438 Type \\[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
428 ;; another buffer, erase the one our message is in. 448 ;; another buffer, erase the one our message is in.
429 (set-buffer (get-buffer "*scratch*")) 449 (set-buffer (get-buffer "*scratch*"))