bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#2470: 23.0.90; auto-fill-mode, :minor-mode-function


From: Juanma Barranquero
Subject: bug#2470: 23.0.90; auto-fill-mode, :minor-mode-function
Date: Sun, 10 Jul 2011 00:16:10 +0200

On Wed, Feb 25, 2009 at 18:59, Drew Adams <drew.adams@oracle.com> wrote:

> I said to check the mode variable.  The reply was that
> auto-fill-mode has no mode variable.

As you point out below, the "mode variable" for auto-fill-mode is
auto-fill-function. Is what gets set in minor-mode-alist, and its a
reliable way to know whether the mode is active or not.

> ;; FIXME: turn into a proper minor mode.
> ;; Add a global minor mode version of it.
> (defun auto-fill-mode (&optional arg)
> ...
>
> So it seems to be in need of a fix, but I see no bug filed against it.

It now says:

;; FIXME: turn into a proper minor mode.
;; Add a global minor mode version of it.
(define-minor-mode auto-fill-mode

The comment (from 2002) is still there, but the mode was converted to
define-minor-mode in 2010.

> Is this mechanism still needed if `define-minor-mode' is used? Is it
> just for compatibility with XEmacs code and legacy code?

define-minor-mode has an equivalent :variable keyword, used, as in
this case, when it is preferable to get/set the mode variable
differently, or use another variable. It is not, AFAIK, because of
XEmacs compatibility, but cases where the variable is not just a
toggle; for example, overwrite-mode uses it too, and also the new
emacs-lock-mode that I committed a few days ago.

> How about documenting it - at least with a comment in the code
> somewhere: what is for, how and when to use it.

About :minor-mode-function, Stefan already answered you that should
not be used in new code, so nothing to document.

Is anything more to be done about this bug?

    Juanma





reply via email to

[Prev in Thread] Current Thread [Next in Thread]