comparison lisp/emacs-lisp/easy-mmode.el @ 90751:52a7f3f50b89

Merge from emacs--devo--0 Patches applied: * emacs--devo--0 (patch 624-636) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 200-201) - Merge from emacs--devo--0 - Update from CVS: lisp/nnweb.el (nnweb-google-parse-1): Update parser. Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-171
author Miles Bader <miles@gnu.org>
date Tue, 13 Feb 2007 12:14:16 +0000
parents 95d0cdf160ea 39dd9f1dfbb0
children e6fdae9180d4
comparison
equal deleted inserted replaced
90750:f8cc067aba62 90751:52a7f3f50b89
269 ;;; 269 ;;;
270 ;;; make global minor mode 270 ;;; make global minor mode
271 ;;; 271 ;;;
272 272
273 ;;;###autoload 273 ;;;###autoload
274 (defalias 'easy-mmode-define-global-mode 'define-global-minor-mode) 274 (defalias 'easy-mmode-define-global-mode 'define-globalized-minor-mode)
275 ;;;###autoload 275 ;;;###autoload
276 (defmacro define-global-minor-mode (global-mode mode turn-on &rest keys) 276 (defalias 'define-global-minor-mode 'define-globalized-minor-mode)
277 ;;;###autoload
278 (defmacro define-globalized-minor-mode (global-mode mode turn-on &rest keys)
277 "Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE. 279 "Make a global mode GLOBAL-MODE corresponding to buffer-local minor MODE.
278 TURN-ON is a function that will be called with no args in every buffer 280 TURN-ON is a function that will be called with no args in every buffer
279 and that should try to turn MODE on if applicable for that buffer. 281 and that should try to turn MODE on if applicable for that buffer.
280 KEYS is a list of CL-style keyword arguments. As the minor mode 282 KEYS is a list of CL-style keyword arguments. As the minor mode
281 defined by this function is always global, any :global keyword is 283 defined by this function is always global, any :global keyword is
282 ignored. Other keywords have the same meaning as in `define-minor-mode', 284 ignored. Other keywords have the same meaning as in `define-minor-mode',
283 which see. In particular, :group specifies the custom group. 285 which see. In particular, :group specifies the custom group.
284 The most useful keywords are those that are passed on to the 286 The most useful keywords are those that are passed on to the
285 `defcustom'. It normally makes no sense to pass the :lighter 287 `defcustom'. It normally makes no sense to pass the :lighter
286 or :keymap keywords to `define-global-minor-mode', since these 288 or :keymap keywords to `define-globalized-minor-mode', since these
287 are usually passed to the buffer-local version of the minor mode. 289 are usually passed to the buffer-local version of the minor mode.
288 290
289 If MODE's set-up depends on the major mode in effect when it was 291 If MODE's set-up depends on the major mode in effect when it was
290 enabled, then disabling and reenabling MODE should make MODE work 292 enabled, then disabling and reenabling MODE should make MODE work
291 correctly with the current major mode. This is important to 293 correctly with the current major mode. This is important to
346 ;; Go through existing buffers. 348 ;; Go through existing buffers.
347 (dolist (buf (buffer-list)) 349 (dolist (buf (buffer-list))
348 (with-current-buffer buf 350 (with-current-buffer buf
349 (if ,global-mode (,turn-on) (when ,mode (,mode -1)))))) 351 (if ,global-mode (,turn-on) (when ,mode (,mode -1))))))
350 352
351 ;; Autoloading define-global-minor-mode autoloads everything 353 ;; Autoloading define-globalized-minor-mode autoloads everything
352 ;; up-to-here. 354 ;; up-to-here.
353 :autoload-end 355 :autoload-end
354 356
355 ;; List of buffers left to process. 357 ;; List of buffers left to process.
356 (defvar ,MODE-buffers nil) 358 (defvar ,MODE-buffers nil)