emacs-devel
[Top][All Lists]
Advanced

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

Re: cua: quiet warning messages


From: Stefan Monnier
Subject: Re: cua: quiet warning messages
Date: Mon, 23 Jun 2003 13:00:23 -0400

>     > Note that _any_ symbol other than `nil' or `-' should turn the mode
>     > _on_.  `toggle' is a symbol, it is not `nil' and not `-'.
> 
>     That's also how define-minor-mode behaves.
> 
> I don't think so.  This code
> 
>        ;; Use `toggle' rather than (if ,mode 0 1) so that using
>        ;; repeat-command still does the toggling correctly.
>        (interactive (list (or current-prefix-arg 'toggle)))
>        (setq ,mode
>              (cond
>               ((eq arg 'toggle) (not ,mode))
> 
> seems to handling `toggle' by toggling the mode,
> not by turning it off, which the spec says it should do.

Indeed.  Although I doubt anybody expects (minor-mode 'toggle) to turn
the mode off unconditionally.

> changes in such a general and basic spec should be thought about as
> such, and I don't think they have been.
> 
> Can I have your comments and proposals for what to do?

As far as I know, minor modes are only ever called with the
following arguments:

        - integers
        - nil
        - t
        - a one-element list containing an integer
        - toggle

This last one is new and only happens when the minor mode is
called interactively.  I think the doc should only describe
the behavior is the above cases and leave the others unspecified.
It could even not specify the behavior in the `toggle' case since
it's only used internally between the interactive spec and
the minor mode's body.

After all, why should (minor-mode (make-hash-table)) turn the mode off
rather than on and why should the doc specify it at all ?


        Stefan





reply via email to

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