help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Using keymap argument of define-minor-mode


From: Stefan Monnier
Subject: Re: Using keymap argument of define-minor-mode
Date: Mon, 18 Apr 2016 12:32:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

Thanks, installed in trunk.


        Stefan


>>>>> "Philipp" == Philipp Stephani <p.stephani2@gmail.com> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> schrieb am Fr., 15. Apr. 2016 um
> 23:18 Uhr:

>> > Fair enough, but that doesn't really answer the question. Is the
>> docstring
>> > wrong, or the implementation of define-minor-mode, or my example?
>> 
>> Good question.  The code passes the list as first (and sole) arg to
>> easy-mmode-define-keymap, and given the lack of interest to support this
>> in the future, I guess the code should take precedence over
>> the docstring.
>> 
>> 
>> 
> OK, I've attached a patch to fix the docstring.
> From e84c7f70b4b9394b06944bea3f8e7eed6a1ce6ba Mon Sep 17 00:00:00 2001
> From: Philipp Stephani <phst@google.com>
> Date: Sat, 16 Apr 2016 15:13:44 +0200
> Subject: [PATCH] =?UTF-8?q?Fix=20docstring=20of=20=E2=80=98define-minor-mo?=
>  =?UTF-8?q?de=E2=80=99.?=
> MIME-Version: 1.0
> Content-Type: text/plain; charset=UTF-8
> Content-Transfer-Encoding: 8bit

> Discussed in
> https://lists.gnu.org/archive/html/help-gnu-emacs/2016-04/msg00071.html.

> * emacs-lisp/easy-mmode.el (define-minor-mode): Fix docstring so that it
> matches the actual implementation.
> ---
>  lisp/emacs-lisp/easy-mmode.el | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

> diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
> index 6a4d835..46d5d0d 100644
> --- a/lisp/emacs-lisp/easy-mmode.el
> +++ b/lisp/emacs-lisp/easy-mmode.el
> @@ -108,9 +108,10 @@ define-minor-mode
>  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 you supply a KEYMAP
> -  argument that is not a symbol, this macro defines the variable
> -  MODE-map and gives it the value that KEYMAP specifies.
> +  (KEY . BINDING) pairs where KEY and BINDING are suitable for
> +  `define-key'.  If you supply a KEYMAP argument that is not a
> +  symbol, this macro defines the variable MODE-map and gives it
> +  the value that KEYMAP specifies.
 
>  BODY contains code to execute each time the mode is enabled or disabled.
>    It is executed after toggling the mode, and before running MODE-hook.
> -- 
> 2.7.4





reply via email to

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