[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easy-mmode.el
From: |
Miles Bader |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easy-mmode.el |
Date: |
Fri, 04 Apr 2003 01:21:58 -0500 |
Index: emacs/lisp/emacs-lisp/easy-mmode.el
diff -c emacs/lisp/emacs-lisp/easy-mmode.el:1.46
emacs/lisp/emacs-lisp/easy-mmode.el:1.47
*** emacs/lisp/emacs-lisp/easy-mmode.el:1.46 Tue Feb 4 07:53:34 2003
--- emacs/lisp/emacs-lisp/easy-mmode.el Mon Mar 24 12:41:43 2003
***************
*** 90,96 ****
It will be executed after any toggling but before running the hooks.
Before the actual body code, you can write
keyword arguments (alternating keywords and values).
! These following keyword arguments are supported:
:group GROUP Custom group name to use in all generated `defcustom' forms.
:global GLOBAL If non-nil specifies that the minor mode is not meant
to be
buffer-local, so don't make the variable MODE
buffer-local.
--- 90,97 ----
It will be executed after any toggling but before running the hooks.
Before the actual body code, you can write
keyword arguments (alternating keywords and values).
! These following keyword arguments are supported (other keywords
! will be passed to `defcustom' if the minor mode is global):
:group GROUP Custom group name to use in all generated `defcustom' forms.
:global GLOBAL If non-nil specifies that the minor mode is not meant
to be
buffer-local, so don't make the variable MODE
buffer-local.
***************
*** 101,108 ****
For example, you could write
(define-minor-mode foo-mode \"If enabled, foo on you!\"
! nil \"Foo \" foo-keymap
! :require 'foo :global t :group 'inconvenience
...BODY CODE...)"
;; Allow skipping the first three args.
--- 102,108 ----
For example, you could write
(define-minor-mode foo-mode \"If enabled, foo on you!\"
! :lighter \" Foo\" :require 'foo :global t :group 'hassle :version \"27.5\"
...BODY CODE...)"
;; Allow skipping the first three args.
***************
*** 119,141 ****
(globalp nil)
(group nil)
(extra-args nil)
(require t)
(keymap-sym (if (and keymap (symbolp keymap)) keymap
(intern (concat mode-name "-map"))))
(hook (intern (concat mode-name "-hook")))
(hook-on (intern (concat mode-name "-on-hook")))
! (hook-off (intern (concat mode-name "-off-hook"))))
;; Check keys.
! (while (keywordp (car body))
! (case (pop body)
(:init-value (setq init-value (pop body)))
(:lighter (setq lighter (pop body)))
(:global (setq globalp (pop body)))
(:extra-args (setq extra-args (pop body)))
(:group (setq group (nconc group (list :group (pop body)))))
(:require (setq require (pop body)))
! (t (pop body))))
(unless group
;; We might as well provide a best-guess default group.
--- 119,144 ----
(globalp nil)
(group nil)
(extra-args nil)
+ (extra-keywords nil)
(require t)
(keymap-sym (if (and keymap (symbolp keymap)) keymap
(intern (concat mode-name "-map"))))
(hook (intern (concat mode-name "-hook")))
(hook-on (intern (concat mode-name "-on-hook")))
! (hook-off (intern (concat mode-name "-off-hook")))
! keyw)
;; Check keys.
! (while (keywordp (setq keyw (car body)))
! (setq body (cdr body))
! (case keyw
(:init-value (setq init-value (pop body)))
(:lighter (setq lighter (pop body)))
(:global (setq globalp (pop body)))
(:extra-args (setq extra-args (pop body)))
(:group (setq group (nconc group (list :group (pop body)))))
(:require (setq require (pop body)))
! (t (push keyw extra-keywords) (push (pop body) extra-keywords))))
(unless group
;; We might as well provide a best-guess default group.
***************
*** 161,167 ****
Setting this variable directly does not take effect;
use either \\[customize] or the function `%s'."
pretty-name mode mode)
! :set (lambda (symbol value) (funcall symbol (or value 0)))
:initialize 'custom-initialize-default
,@group
:type 'boolean
--- 164,170 ----
Setting this variable directly does not take effect;
use either \\[customize] or the function `%s'."
pretty-name mode mode)
! :set 'custom-set-minor-mode
:initialize 'custom-initialize-default
,@group
:type 'boolean
***************
*** 170,176 ****
((not (eq require t)) `(:require ,require))
(t `(:require
',(intern (file-name-nondirectory
! (file-name-sans-extension curfile)))))))))
;; The actual function.
(defun ,mode (&optional arg ,@extra-args)
--- 173,180 ----
((not (eq require t)) `(:require ,require))
(t `(:require
',(intern (file-name-nondirectory
! (file-name-sans-extension curfile))))))
! ,@(nreverse extra-keywords))))
;; The actual function.
(defun ,mode (&optional arg ,@extra-args)
- [Emacs-diffs] Changes to emacs/lisp/emacs-lisp/easy-mmode.el,
Miles Bader <=