Changeset 3988 for vendor/emacs-CVS_HEAD/lisp/emacs-lisp/easy-mmode.el
- Timestamp:
- 11/26/05 08:33:26 (3 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
vendor/emacs-CVS_HEAD/lisp/emacs-lisp/easy-mmode.el
r3823 r3988 273 273 TURN-ON is a function that will be called with no args in every buffer 274 274 and that should try to turn MODE on if applicable for that buffer. 275 KEYS is a list of CL-style keyword arguments: 276 :group to specify the custom group. 275 KEYS is a list of CL-style keyword arguments. As the minor mode 276 defined by this function is always global, any :global keyword is 277 ignored. Other keywords have the same meaning as in `define-minor-mode', 278 which see. In particular, :group specifies the custom group. 279 The most useful keywords are those that are passed on to the 280 `defcustom'. It normally makes no sense to pass the :lighter 281 or :keymap keywords to `define-global-minor-mode', since these 282 are usually passed to the buffer-local version of the minor mode. 277 283 278 284 If MODE's set-up depends on the major mode in effect when it was … … 286 292 (pretty-global-name (easy-mmode-pretty-mode-name global-mode)) 287 293 (group nil) 288 (extra- args nil)294 (extra-keywords nil) 289 295 (MODE-buffers (intern (concat global-mode-name "-buffers"))) 290 296 (MODE-enable-in-buffers … … 293 299 (intern (concat global-mode-name "-check-buffers"))) 294 300 (MODE-cmhh (intern (concat global-mode-name "-cmhh"))) 295 (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode")))) 301 (MODE-major-mode (intern (concat (symbol-name mode) "-major-mode"))) 302 keyw) 296 303 297 304 ;; Check keys. 298 (while (keywordp ( car keys))299 ( case (pop keys)300 (:extra-args (setq extra-args (pop keys))) 305 (while (keywordp (setq keyw (car keys))) 306 (setq keys (cdr keys)) 307 (case keyw 301 308 (:group (setq group (nconc group (list :group (pop keys))))) 302 (t (setq keys (cdr keys))))) 309 (:global (setq keys (cdr keys))) 310 (t (push keyw extra-keywords) (push (pop keys) extra-keywords)))) 303 311 304 312 (unless group … … 318 326 in which `%s' turns it on." 319 327 pretty-name pretty-global-name pretty-name turn-on) 320 :global t :extra-args ,extra-args ,@group328 :global t ,@group ,@(nreverse extra-keywords) 321 329 322 330 ;; Setup hook to handle future mode changes and new buffers.
