At Wed, 09 Jul 2003 15:02:03 +0900,
Stephen J. Turnbull wrote:
>>>>> "Yoichi" == Yoichi NAKAYAMA <yoichi(a)geiin.org>
writes:
Yoichi> I've sent a report and a patch for this about 1 month ago,
Yoichi> but it seems to be ignored. I thought you don't like
Yoichi> previous patch, possibly. So I'm trying to send another
Yoichi> patch. Would you accept this one?
What exactly does this patch do, besides suppress an error? It looks
to me like it changes the name of the mode from what the user chose.
If so, this needs to be documented (and if interactive, there should
be a warning displayed).
Yes, exactly. In fact I don't like that patch. I think the patch
I've sent in the past (the following one) is more better.
NOTE: Original docstring of easy-mmode-define-toggle is also inconsistent.
;; if MODE=foo-mode, MODE-mode is foo-mode-mode
Problem was:
(define-minor-mode foo "test minor mode" t " :-)")
cause (wrong-type-argument commandp foo) error.
This is because define-minor-mode defines function
foo-mode and try to register toggle-function foo
by calling add-minor-mode.
The attached patch does:
Don't touch given argument "mode" to avoid the error.
Make document consistent.
Best Regards,
--
Yoichi NAKAYAMA
--- easy-mmode.el.orig 2002-09-12 05:39:13.000000000 +0900
+++ easy-mmode.el 2003-07-09 19:50:43.000000000 +0900
@@ -56,10 +56,10 @@
(defmacro easy-mmode-define-toggle (mode &optional doc)
"Define a one arg toggle mode MODE function and associated hooks.
-MODE-mode is the so defined function that toggle the mode.
+MODE is the so defined function that toggle the mode.
optional DOC is its associated documentation.
-Hooks are checked for run, each time MODE-mode is called.
+Hooks are checked for run, each time the function MODE is called.
They run under the followings conditions:
MODE-hook: if the mode is toggled.
MODE-on-hook: if the mode is on.
@@ -69,15 +69,11 @@
If so MODE-hook is guaranteed to be the first.
\(defmacro easy-mmode-define-toggle (MODE &optional DOC)"
- (let* ((mode-name
- (if (string-match "-mode\\'" (symbol-name mode))
- (symbol-name mode)
- (concat (symbol-name mode) "-mode")))
+ (let* ((mode-name (symbol-name mode))
(hook (intern (concat mode-name "-hook")))
(hook-on (intern (concat mode-name "-on-hook")))
(hook-off (intern (concat mode-name "-off-hook")))
- (toggle (intern mode-name))
- (mode toggle)
+ (toggle mode)
(toggle-doc (or doc
(format "With no argument, toggle %s mode.
With arg turn mode on.