all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#25505: 24.5; doc of `define-minor-mode': incorrect for :keymap
@ 2017-01-21 18:24 Drew Adams
  2017-01-23 17:12 ` Drew Adams
  2017-02-10 23:28 ` npostavs
  0 siblings, 2 replies; 7+ messages in thread
From: Drew Adams @ 2017-01-21 18:24 UTC (permalink / raw)
  To: 25505

For :keymap, the doc string says "Same as the KEYMAP argument."
Similarly the doc in (elisp) `Defining Minor Modes'.  This does not
appear to be correct.

For positional arg KEYMAP, the doc string says:

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

But the value of :keymap apparently cannot be a variable name whose
value is a keymap or an expression that evaluates to a keymap.  The
:keymap value you pass is apparently not evaluated - unlike other
keyword values such as :group.

So, for example, the `define-minor-mode' fr `follow-mode' uses this:

  :keymap follow-mode-map

and not this:

  :keymap 'follow-mode-map

and not this:

  (let ((mainmap (make-sparse-keymap))
        (map (make-sparse-keymap)))
    (define-key map "\C-v"	'follow-scroll-up)
    ...
    (define-key mainmap follow-mode-prefix map)
    (define-key mainmap [remap end-of-buffer] 'follow-end-of-buffer)
    ...
    mainmap)

In fact, it is not clear from the doc whether and which keyword values
are evaluated.  And shouldn't they all be evaluated or else none be so?


In GNU Emacs 24.5.1 (i686-pc-mingw32)
 of 2015-04-11 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr --host=i686-pc-mingw32'





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

end of thread, other threads:[~2021-09-25 16:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-21 18:24 bug#25505: 24.5; doc of `define-minor-mode': incorrect for :keymap Drew Adams
2017-01-23 17:12 ` Drew Adams
2017-02-10 23:28 ` npostavs
2017-02-10 23:43   ` Drew Adams
2017-02-15 14:49   ` Michael Heerdegen
2017-02-15 16:55     ` Noam Postavsky
2021-09-25 16:12   ` Stefan Kangas

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.