diff options
author | Chong Yidong <[email protected]> | 2008-10-12 13:46:28 +0000 |
---|---|---|
committer | Chong Yidong <[email protected]> | 2008-10-12 13:46:28 +0000 |
commit | b4bd2cbe6de8fc09917bafd3af56f6537db1e10d (patch) | |
tree | 4052f6f435a2089074d0760fa285b5ed98cf893b /lisp/progmodes/compile.el | |
parent | 30b724916f83b13ff1cd02652255680e3e80d943 (diff) |
(compilation-mode-tool-bar-map): Check if tool-bar-map has been
initialized before setting it up.
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r-- | lisp/progmodes/compile.el | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index f6e15d0ba4..2405efb2ba 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1471,25 +1471,28 @@ Returns the compilation buffer created." `compilation-minor-mode-map' is a parent of this.") (defvar compilation-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 error") - (tool-bar-local-item - "right-arrow" 'next-error-no-select 'next-error-no-select map - :rtl "left-arrow" - :help "Goto next error") - (tool-bar-local-item - "cancel" 'kill-compilation 'kill-compilation map - :enable '(let ((buffer (compilation-find-buffer))) - (get-buffer-process buffer)) - :help "Stop compilation") - (tool-bar-local-item - "refresh" 'recompile 'recompile map - :help "Restart compilation") - (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 error") + (tool-bar-local-item + "right-arrow" 'next-error-no-select 'next-error-no-select map + :rtl "left-arrow" + :help "Goto next error") + (tool-bar-local-item + "cancel" 'kill-compilation 'kill-compilation map + :enable '(let ((buffer (compilation-find-buffer))) + (get-buffer-process buffer)) + :help "Stop compilation") + (tool-bar-local-item + "refresh" 'recompile 'recompile map + :help "Restart compilation") + (append map help)))) (put 'compilation-mode 'mode-class 'special) |