[Top][All Lists]

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

bug#25505: 24.5; doc of `define-minor-mode': incorrect for :keymap

From: Drew Adams
Subject: bug#25505: 24.5; doc of `define-minor-mode': incorrect for :keymap
Date: Sat, 21 Jan 2017 10:24:11 -0800 (PST)

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)

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'

reply via email to

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