comparison lisp/progmodes/compile.el @ 98661:cfea943367ab

(compilation-mode-tool-bar-map): Check if tool-bar-map has been initialized before setting it up.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 12 Oct 2008 13:46:28 +0000
parents a4dc0840f5dd
children d7ac626296a1
comparison
equal deleted inserted replaced
98660:90b078ed2dc4 98661:cfea943367ab
1469 map) 1469 map)
1470 "Keymap for compilation log buffers. 1470 "Keymap for compilation log buffers.
1471 `compilation-minor-mode-map' is a parent of this.") 1471 `compilation-minor-mode-map' is a parent of this.")
1472 1472
1473 (defvar compilation-mode-tool-bar-map 1473 (defvar compilation-mode-tool-bar-map
1474 (let ((map (butlast (copy-keymap tool-bar-map))) 1474 ;; When bootstrapping, tool-bar-map is not properly initialized yet,
1475 (help (last tool-bar-map))) ;; Keep Help last in tool bar 1475 ;; so don't do anything.
1476 (tool-bar-local-item 1476 (when (keymapp (butlast tool-bar-map))
1477 "left-arrow" 'previous-error-no-select 'previous-error-no-select map 1477 (let ((map (butlast (copy-keymap tool-bar-map)))
1478 :rtl "right-arrow" 1478 (help (last tool-bar-map))) ;; Keep Help last in tool bar
1479 :help "Goto previous error") 1479 (tool-bar-local-item
1480 (tool-bar-local-item 1480 "left-arrow" 'previous-error-no-select 'previous-error-no-select map
1481 "right-arrow" 'next-error-no-select 'next-error-no-select map 1481 :rtl "right-arrow"
1482 :rtl "left-arrow" 1482 :help "Goto previous error")
1483 :help "Goto next error") 1483 (tool-bar-local-item
1484 (tool-bar-local-item 1484 "right-arrow" 'next-error-no-select 'next-error-no-select map
1485 "cancel" 'kill-compilation 'kill-compilation map 1485 :rtl "left-arrow"
1486 :enable '(let ((buffer (compilation-find-buffer))) 1486 :help "Goto next error")
1487 (get-buffer-process buffer)) 1487 (tool-bar-local-item
1488 :help "Stop compilation") 1488 "cancel" 'kill-compilation 'kill-compilation map
1489 (tool-bar-local-item 1489 :enable '(let ((buffer (compilation-find-buffer)))
1490 "refresh" 'recompile 'recompile map 1490 (get-buffer-process buffer))
1491 :help "Restart compilation") 1491 :help "Stop compilation")
1492 (append map help))) 1492 (tool-bar-local-item
1493 "refresh" 'recompile 'recompile map
1494 :help "Restart compilation")
1495 (append map help))))
1493 1496
1494 (put 'compilation-mode 'mode-class 'special) 1497 (put 'compilation-mode 'mode-class 'special)
1495 1498
1496 ;;;###autoload 1499 ;;;###autoload
1497 (defun compilation-mode (&optional name-of-mode) 1500 (defun compilation-mode (&optional name-of-mode)