From: "Stefan Monnier" <monnier+gnu/emacs@cs-www.cs.yale.edu>
Cc: Stefan Monnier <monnier+gnu/emacs@rum.cs.yale.edu>
Subject: Re: cua: quiet warning messages
Date: Mon, 23 Jun 2003 13:00:23 -0400 [thread overview]
Message-ID: <200306231700.h5NH0NXr019258@rum.cs.yale.edu> (raw)
In-Reply-To: E19Tv6W-0000TC-KG@fencepost.gnu.org
> > 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
next prev parent reply other threads:[~2003-06-23 17:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-16 17:04 cua: quiet warning messages Michael Mauger
2003-06-16 18:47 ` Luc Teirlinck
2003-06-16 19:12 ` Stefan Monnier
2003-06-16 19:41 ` Luc Teirlinck
2003-06-22 3:01 ` Richard Stallman
2003-06-23 17:00 ` Stefan Monnier [this message]
2003-07-01 15:17 ` Richard Stallman
2003-07-04 0:47 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200306231700.h5NH0NXr019258@rum.cs.yale.edu \
--to=monnier+gnu/emacs@cs-www.cs.yale.edu \
--cc=monnier+gnu/emacs@rum.cs.yale.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).