GNU bug report logs - #9819
24.0.50; Docstring of `define-minor-mode' and KEYMAP

Previous Next

Package: emacs;

Reported by: Deniz Dogan <deniz <at> dogan.se>

Date: Thu, 20 Oct 2011 23:00:01 UTC

Severity: minor

Found in version 24.0.50

Fixed in version 24.0.91

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9819 in the body.
You can then email your comments to 9819 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9819; Package emacs. (Thu, 20 Oct 2011 23:00:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Deniz Dogan <deniz <at> dogan.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 20 Oct 2011 23:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Deniz Dogan <deniz <at> dogan.se>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.50; Docstring of `define-minor-mode' and KEYMAP
Date: Fri, 21 Oct 2011 00:57:49 +0200
I read in the docstring of `define-minor-mode':

<quote>
Optional KEYMAP is the default keymap bound to the mode keymap.
  If non-nil, it should be a variable name (whose value is a keymap),
  or an expression that returns either a keymap or a list of
  arguments for `easy-mmode-define-keymap'.  If KEYMAP is not a symbol,
  this also defines the variable MODE-map.

  [...]

:keymap MAP	Same as the KEYMAP argument.
</quote>

The way I interpret that is: if I don't pass a KEYMAP argument, it will
define a variable named `MODE-map'.  However, this doesn't happen when I
use this code:

<quote>
(define-minor-mode helo-track-minor-mode
  "Global minor mode for tracking activity in helo buffers."
  :init-value nil
  :lighter ""
  :global t
  :group 'helo
  [...]
</quote>

Am I misunderstanding the docstring or is this a bug?

Deniz




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9819; Package emacs. (Fri, 21 Oct 2011 07:16:02 GMT) Full text and rfc822 format available.

Message #8 received at 9819 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Deniz Dogan <deniz <at> dogan.se>
Cc: 9819 <at> debbugs.gnu.org
Subject: Re: bug#9819: 24.0.50; Docstring of `define-minor-mode' and KEYMAP
Date: Fri, 21 Oct 2011 03:13:44 -0400
Deniz Dogan wrote:

>      If KEYMAP is not a symbol, this also defines the variable MODE-map.
[...]
> The way I interpret that is: if I don't pass a KEYMAP argument, it will
> define a variable named `MODE-map'.

nil is a symbol. :(
If you pass a keymap argument that is not a symbol, eg:

:keymap '(("\C-a" . foo-command)

then a `foo-mode-map' variable will be defined and given that map as its
value.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9819; Package emacs. (Fri, 21 Oct 2011 14:01:02 GMT) Full text and rfc822 format available.

Message #11 received at 9819 <at> debbugs.gnu.org (full text, mbox):

From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Glenn Morris'" <rgm <at> gnu.org>, "'Deniz Dogan'" <deniz <at> dogan.se>
Cc: 9819 <at> debbugs.gnu.org
Subject: RE: bug#9819: 24.0.50; Docstring of `define-minor-mode' and KEYMAP
Date: Fri, 21 Oct 2011 06:58:46 -0700
> >      If KEYMAP is not a symbol, this also defines the 
> >      variable MODE-map.
> 
> nil is a symbol. :(
> If you pass a keymap argument that is not a symbol, eg:
> :keymap '(("\C-a" . foo-command)
> then a `foo-mode-map' variable will be defined and given that 
> map as its value.

It might be clearer to say just what you said, i.e., something like "If you pass
a non-symbol KEYMAP argument..." or even more explicitly, "If KEYMAP is a cons
that is a keymap..."





Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Mon, 24 Oct 2011 17:40:02 GMT) Full text and rfc822 format available.

Notification sent to Deniz Dogan <deniz <at> dogan.se>:
bug acknowledged by developer. (Mon, 24 Oct 2011 17:40:02 GMT) Full text and rfc822 format available.

Message #16 received at 9819-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 9819-done <at> debbugs.gnu.org
Subject: Re: bug#9819: 24.0.50; Docstring of `define-minor-mode' and KEYMAP
Date: Mon, 24 Oct 2011 13:37:28 -0400
Version: 24.0.91

I have tried to clarify the doc-string.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 22 Nov 2011 12:24:03 GMT) Full text and rfc822 format available.

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

Previous Next


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