unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#9819: 24.0.50; Docstring of `define-minor-mode' and KEYMAP
@ 2011-10-20 22:57 Deniz Dogan
  2011-10-21  7:13 ` Glenn Morris
  0 siblings, 1 reply; 4+ messages in thread
From: Deniz Dogan @ 2011-10-20 22:57 UTC (permalink / raw)
  To: 9819

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#9819: 24.0.50; Docstring of `define-minor-mode' and KEYMAP
  2011-10-20 22:57 bug#9819: 24.0.50; Docstring of `define-minor-mode' and KEYMAP Deniz Dogan
@ 2011-10-21  7:13 ` Glenn Morris
  2011-10-21 13:58   ` Drew Adams
  2011-10-24 17:37   ` Glenn Morris
  0 siblings, 2 replies; 4+ messages in thread
From: Glenn Morris @ 2011-10-21  7:13 UTC (permalink / raw)
  To: Deniz Dogan; +Cc: 9819

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.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#9819: 24.0.50; Docstring of `define-minor-mode' and KEYMAP
  2011-10-21  7:13 ` Glenn Morris
@ 2011-10-21 13:58   ` Drew Adams
  2011-10-24 17:37   ` Glenn Morris
  1 sibling, 0 replies; 4+ messages in thread
From: Drew Adams @ 2011-10-21 13:58 UTC (permalink / raw)
  To: 'Glenn Morris', 'Deniz Dogan'; +Cc: 9819

> >      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..."






^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug#9819: 24.0.50; Docstring of `define-minor-mode' and KEYMAP
  2011-10-21  7:13 ` Glenn Morris
  2011-10-21 13:58   ` Drew Adams
@ 2011-10-24 17:37   ` Glenn Morris
  1 sibling, 0 replies; 4+ messages in thread
From: Glenn Morris @ 2011-10-24 17:37 UTC (permalink / raw)
  To: 9819-done

Version: 24.0.91

I have tried to clarify the doc-string.





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-10-24 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20 22:57 bug#9819: 24.0.50; Docstring of `define-minor-mode' and KEYMAP Deniz Dogan
2011-10-21  7:13 ` Glenn Morris
2011-10-21 13:58   ` Drew Adams
2011-10-24 17:37   ` Glenn Morris

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).