XEmacs's define-minor-mode cause error when the specified MODE does
not end with -mode. (GNU Emacs has no problem for the same situation)
This is because easy-mmode-define-toggle defines function named
"foo-mode" and define-minor-mode try to register non-existing
toggle-function named "foo".
I've sent a report and a patch for this about 1 month ago, but it seems
to be ignored. I thought you don't like previous patch, possibly.
So I'm trying to send another patch. Would you accept this one?
Regards,
--
Yoichi Nakayama
--- easy-mmode.el.orig 2002-09-12 05:39:13.000000000 +0900
+++ easy-mmode.el 2003-07-08 20:48:12.000000000 +0900
@@ -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.
@@ -130,7 +126,11 @@
\(defmacro easy-mmode-define-minor-mode
(MODE DOC &optional INIT-VALUE LIGHTER KEYMAP)...\)"
- (let* ((mode-name (symbol-name mode))
+ (let* ((mode-name
+ (if (string-match "-mode\\'" (symbol-name mode))
+ (symbol-name mode)
+ (concat (symbol-name mode) "-mode")))
+ (mode (intern mode-name))
(mode-doc (format "Non-nil if %s mode is enabled." mode-name))
(keymap-name (concat mode-name "-map"))
(keymap-doc (format "Keymap for %s mode." mode-name)))