>>>> "Stephen" == Stephen J Turnbull
<stephen(a)xemacs.org> writes:
Stephen> If you know exactly what you're doing, none. However,
Stephen> there are a number of conventions that you're supposed to
Stephen> follow in initializing a minor mode, and define-minor-mode
Stephen> ensures that.
Stephen> The problem is probably that XEmacs's version is not fully
Stephen> synched to GNU Emacs's.
That is my impression as well. Let us see
this is the gnus definition
(define-minor-mode longlines-mode
nil " ll" nil
(if longlines-mode
;; Turn on longlines mode
(progn
(add-to-list 'buffer-file-format 'longlines)
CODE)
;; Turn off longlines mode
(setq buffer-file-format (delete 'longlines buffer-file-format))
MORE CODE))
I rewrote that as following
;;{{{ real minor mode
(defvar longlines-mode nil
"Determines if mylonglines minor mode is active.")
(make-variable-buffer-local 'longlines-mode)
(defun longlines-mode (&optional arg)
(interactive "P")
(setq longlines-mode (not (or (and (null arg) longlines-mode)
(<= (prefix-numeric-value arg) 0))))
(if longlines-mode
;;everthing when mode is turn on
(progn
SAME CODE AS ABOVE)
;; Turn off longlines mode
(setq buffer-file-format (delete 'longlines buffer-file-format))
SAME CODE AS ABOVE
))
(or (assoc 'longlines-mode minor-mode-alist)
(setq minor-mode-alist
(cons '(longlines-mode " ll") minor-mode-alist))))
Is this correct?
Would the following be useful (instead of a (or (assoc ):
;;from reftex:
(if (fboundp 'add-minor-mode)
(add-minor-mode 'longlines-mode " ll"))
(unless (assoc 'reftex-mode minor-mode-alist)
(push '(reftex-mode " ll") minor-mode-alist)))
Thanks
Uwe Brauer