Mercurial > emacs
comparison lisp/cedet/semantic/idle.el @ 108211:73a1ddc06d0e
Use a mode-line spec rather than a static string in Semantic.
* cedet/semantic/util-modes.el:
(semantic-minor-modes-format): New var to replace...
(semantic-minor-modes-status): Remove.
(semantic-mode-line-update): Construct a mode-line spec rather than
a static string so that mouse buttons can be used on individual minor
modes and so that semantic-mode-line-update only needs to be called
when global settings are changed.
(semantic-add-minor-mode, semantic-toggle-minor-mode-globally):
Call semantic-mode-line-update.
(semantic-toggle-minor-mode-globally): Don't assume mode is on
minor-mode-alist, check semantic-minor-mode-alist as well.
(semantic-stickyfunc-mode, semantic-show-parser-state-auto-marker)
(semantic-show-parser-state-marker, semantic-show-parser-state-mode)
(semantic-show-unmatched-syntax-mode, semantic-highlight-edits-mode):
* cedet/semantic/mru-bookmark.el (semantic-mru-bookmark-mode):
* cedet/semantic/idle.el (semantic-idle-scheduler-mode)
(define-semantic-idle-service, semantic-idle-summary-mode):
* cedet/semantic/decorate/mode.el (semantic-decoration-mode):
Don't call semantic-mode-line-update any more.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Sun, 02 May 2010 01:06:53 -0400 |
parents | 5143700578d0 |
children | b799d38f522a |
comparison
equal
deleted
inserted
replaced
108210:5143700578d0 | 108211:73a1ddc06d0e |
---|---|
175 (progn | 175 (progn |
176 ;; Disable minor mode if semantic stuff not available | 176 ;; Disable minor mode if semantic stuff not available |
177 (setq semantic-idle-scheduler-mode nil) | 177 (setq semantic-idle-scheduler-mode nil) |
178 (error "Buffer %s was not set up idle time scheduling" | 178 (error "Buffer %s was not set up idle time scheduling" |
179 (buffer-name))) | 179 (buffer-name))) |
180 (semantic-idle-scheduler-setup-timers))) | 180 (semantic-idle-scheduler-setup-timers)))) |
181 (semantic-mode-line-update)) | |
182 | 181 |
183 (semantic-add-minor-mode 'semantic-idle-scheduler-mode | 182 (semantic-add-minor-mode 'semantic-idle-scheduler-mode |
184 "ARP") | 183 "ARP") |
185 | 184 |
186 ;;; SERVICES services | 185 ;;; SERVICES services |
587 (error "Buffer %s was not set up for parsing" | 586 (error "Buffer %s was not set up for parsing" |
588 (buffer-name))) | 587 (buffer-name))) |
589 ;; Enable the mode mode | 588 ;; Enable the mode mode |
590 (semantic-idle-scheduler-add #',func)) | 589 (semantic-idle-scheduler-add #',func)) |
591 ;; Disable the mode mode | 590 ;; Disable the mode mode |
592 (semantic-idle-scheduler-remove #',func)) | 591 (semantic-idle-scheduler-remove #',func))) |
593 (semantic-mode-line-update)) | |
594 | 592 |
595 (semantic-add-minor-mode ',mode | 593 (semantic-add-minor-mode ',mode |
596 "") ; idle schedulers are quiet? | 594 "") ; idle schedulers are quiet? |
597 | 595 |
598 (defun ,func () | 596 (defun ,func () |
756 (require 'eldoc) | 754 (require 'eldoc) |
757 (semantic-idle-scheduler-add 'semantic-idle-summary-idle-function) | 755 (semantic-idle-scheduler-add 'semantic-idle-summary-idle-function) |
758 (add-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t)) | 756 (add-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t)) |
759 ;; Disable the mode | 757 ;; Disable the mode |
760 (semantic-idle-scheduler-remove 'semantic-idle-summary-idle-function) | 758 (semantic-idle-scheduler-remove 'semantic-idle-summary-idle-function) |
761 (remove-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t)) | 759 (remove-hook 'pre-command-hook 'semantic-idle-summary-refresh-echo-area t))) |
762 (semantic-mode-line-update)) | |
763 | 760 |
764 (defun semantic-idle-summary-refresh-echo-area () | 761 (defun semantic-idle-summary-refresh-echo-area () |
765 (and semantic-idle-summary-mode | 762 (and semantic-idle-summary-mode |
766 eldoc-last-message | 763 eldoc-last-message |
767 (if (and (not executing-kbd-macro) | 764 (if (and (not executing-kbd-macro) |