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

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Wed, 25 Feb 2009 18:05:05 UTC

Severity: minor

Tags: fixed

Fixed in version 24.1

Done: Lars Magne Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juanma Barranquero <lekktu <at> gmail.com>
To: Drew Adams <drew.adams <at> oracle.com>
Cc: 2470 <at> debbugs.gnu.org
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 <at> 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




This bug report was last modified 13 years and 313 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.