comparison lisp/prim/modeline.el @ 197:acd284d43ca1 r20-3b25

Import from CVS: tag r20-3b25
author cvs
date Mon, 13 Aug 2007 10:00:02 +0200
parents 2d532a89d707
children eb5470882647
comparison
equal deleted inserted replaced
196:58e0786448ca 197:acd284d43ca1
214 ;; button2 selects the window without setting point 214 ;; button2 selects the window without setting point
215 (define-key modeline-map 'button2 (lambda () (interactive "@"))) 215 (define-key modeline-map 'button2 (lambda () (interactive "@")))
216 (define-key modeline-map 'button3 'modeline-menu) 216 (define-key modeline-map 'button3 'modeline-menu)
217 217
218 (make-face 'modeline-mousable "Face for mousable portions of the modeline.") 218 (make-face 'modeline-mousable "Face for mousable portions of the modeline.")
219 (set-face-parent 'modeline-mousable 'modeline)
220 (when (featurep 'x)
221 (set-face-foreground 'modeline-mousable "firebrick" 'global '(color x))
222 (set-face-font 'modeline-mousable [bold] nil '(mono x))
223 (set-face-font 'modeline-mousable [bold] nil '(grayscale x)))
219 224
220 (defmacro make-modeline-command-wrapper (command) 225 (defmacro make-modeline-command-wrapper (command)
221 `#'(lambda (event) 226 `#'(lambda (event)
222 (interactive "e") 227 (interactive "e")
223 (save-selected-window 228 (save-selected-window
244 If two active keymaps bind the same key, the keymap appearing earlier 249 If two active keymaps bind the same key, the keymap appearing earlier
245 in the list takes precedence.") 250 in the list takes precedence.")
246 251
247 (make-face 'modeline-mousable-minor-mode 252 (make-face 'modeline-mousable-minor-mode
248 "Face for mousable minor-mode strings in the modeline.") 253 "Face for mousable minor-mode strings in the modeline.")
254 (set-face-parent 'modeline-mousable-minor-mode 'modeline-mousable)
255 (when (featurep 'x)
256 (set-face-foreground 'modeline-mousable-minor-mode
257 '(((color x) . "green4")
258 ((color x) . "forestgreen")) 'global))
249 259
250 (defvar modeline-mousable-minor-mode-extent (make-extent nil nil) 260 (defvar modeline-mousable-minor-mode-extent (make-extent nil nil)
251 ;; alliteration at its finest. 261 ;; alliteration at its finest.
252 "Extent managing the mousable minor mode modeline strings.") 262 "Extent managing the mousable minor mode modeline strings.")
253 (set-extent-face modeline-mousable-minor-mode-extent 263 (set-extent-face modeline-mousable-minor-mode-extent
259 ;; (setq minor-mode-alist 269 ;; (setq minor-mode-alist
260 ;; (purecopy 270 ;; (purecopy
261 ;; (append minor-mode-alist 271 ;; (append minor-mode-alist
262 ;; '((isearch-mode isearch-mode)))))) 272 ;; '((isearch-mode isearch-mode))))))
263 273
274 (defvar place)
264 (defun add-minor-mode (toggle name &optional keymap after toggle-fun) 275 (defun add-minor-mode (toggle name &optional keymap after toggle-fun)
265 "Add a minor mode to `minor-mode-alist' and `minor-mode-map-alist'. 276 "Add a minor mode to `minor-mode-alist' and `minor-mode-map-alist'.
266 TOGGLE is a symbol whose value as a variable specifies whether the 277 TOGGLE is a symbol whose value as a variable specifies whether the
267 minor mode is active. NAME is the name that should appear in the 278 minor mode is active. NAME is the name that should appear in the
268 modeline (it should either be a string beginning with a space or a 279 modeline (it should either be a string beginning with a space or a
410 (define-key modeline-buffer-id-left-map 'button3 'modeline-buffers-menu) 421 (define-key modeline-buffer-id-left-map 'button3 'modeline-buffers-menu)
411 (define-key modeline-buffer-id-right-map 'button3 'modeline-buffers-menu) 422 (define-key modeline-buffer-id-right-map 'button3 'modeline-buffers-menu)
412 423
413 (make-face 'modeline-buffer-id 424 (make-face 'modeline-buffer-id
414 "Face for the buffer ID string in the modeline.") 425 "Face for the buffer ID string in the modeline.")
426 (set-face-parent 'modeline-buffer-id 'modeline)
427 (when (featurep 'x)
428 (set-face-foreground 'modeline-buffer-id "blue4" 'global '(color x)))
429 (when (featurep 'x)
430 (set-face-font 'modeline-buffer-id [bold-italic] nil '(mono x))
431 (set-face-font 'modeline-buffer-id [bold-italic] nil '(grayscale x)))
432 (when (featurep 'tty)
433 (set-face-font 'modeline-buffer-id [bold-italic] nil 'tty))
415 434
416 (defvar modeline-buffer-id-extent (make-extent nil nil) 435 (defvar modeline-buffer-id-extent (make-extent nil nil)
417 "Extent covering the whole of the buffer-id string.") 436 "Extent covering the whole of the buffer-id string.")
418 (set-extent-face modeline-buffer-id-extent 'modeline-buffer-id) 437 (set-extent-face modeline-buffer-id-extent 'modeline-buffer-id)
419 438