diff options
author | Chong Yidong <cyd@stupidchicken.com> | 2008-10-12 13:46:13 +0000 |
---|---|---|
committer | Chong Yidong <cyd@stupidchicken.com> | 2008-10-12 13:46:13 +0000 |
commit | 30b724916f83b13ff1cd02652255680e3e80d943 (patch) | |
tree | de2a0f82bed52fb95b0897b5e57ef4fd7bb7814c /lisp/progmodes/grep.el | |
parent | c1461986d175cced4c180752aaaa56d1b466da3e (diff) | |
download | emacs-30b724916f83b13ff1cd02652255680e3e80d943.tar.gz |
(grep-mode-tool-bar-map): Check if tool-bar-map has been initialized
before setting it up.
Diffstat (limited to 'lisp/progmodes/grep.el')
-rw-r--r-- | lisp/progmodes/grep.el | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 945c656e7d3..295e2b29fab 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -228,25 +228,28 @@ See `compilation-error-screen-columns'" `compilation-minor-mode-map' is a cdr of this.") (defvar grep-mode-tool-bar-map - (let ((map (butlast (copy-keymap tool-bar-map))) - (help (last tool-bar-map))) ;; Keep Help last in tool bar - (tool-bar-local-item - "left-arrow" 'previous-error-no-select 'previous-error-no-select map - :rtl "right-arrow" - :help "Goto previous match") - (tool-bar-local-item - "right-arrow" 'next-error-no-select 'next-error-no-select map - :rtl "left-arrow" - :help "Goto next match") - (tool-bar-local-item - "cancel" 'kill-compilation 'kill-compilation map - :enable '(let ((buffer (compilation-find-buffer))) - (get-buffer-process buffer)) - :help "Stop grep") - (tool-bar-local-item - "refresh" 'recompile 'recompile map - :help "Restart grep") - (append map help))) + ;; When bootstrapping, tool-bar-map is not properly initialized yet, + ;; so don't do anything. + (when (keymapp (butlast tool-bar-map)) + (let ((map (butlast (copy-keymap tool-bar-map))) + (help (last tool-bar-map))) ;; Keep Help last in tool bar + (tool-bar-local-item + "left-arrow" 'previous-error-no-select 'previous-error-no-select map + :rtl "right-arrow" + :help "Goto previous match") + (tool-bar-local-item + "right-arrow" 'next-error-no-select 'next-error-no-select map + :rtl "left-arrow" + :help "Goto next match") + (tool-bar-local-item + "cancel" 'kill-compilation 'kill-compilation map + :enable '(let ((buffer (compilation-find-buffer))) + (get-buffer-process buffer)) + :help "Stop grep") + (tool-bar-local-item + "refresh" 'recompile 'recompile map + :help "Restart grep") + (append map help)))) (defalias 'kill-grep 'kill-compilation) |