From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: Using keymap argument of define-minor-mode Date: Mon, 18 Apr 2016 12:32:55 -0400 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1460997299 10213 80.91.229.3 (18 Apr 2016 16:34:59 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 Apr 2016 16:34:59 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Philipp Stephani Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 18 18:34:50 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1asC8O-0000cD-K4 for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Apr 2016 18:34:48 +0200 Original-Received: from localhost ([::1]:41382 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asC8N-0002iV-Vd for geh-help-gnu-emacs@m.gmane.org; Mon, 18 Apr 2016 12:34:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42643) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asC75-00012X-Ud for help-gnu-emacs@gnu.org; Mon, 18 Apr 2016 12:34:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1asC6b-0006T6-Jk for help-gnu-emacs@gnu.org; Mon, 18 Apr 2016 12:33:27 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181]:38166) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1asC6b-0006So-Dz for help-gnu-emacs@gnu.org; Mon, 18 Apr 2016 12:32:57 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CrCAA731xV/ySNSC1cgxBUXoJQhVW7QIExHwqFdwKBPToSAQEBAQEBAYEKhCIBAQEBAgEBAnYFCwsNAQMDAQIdEhQNBwQjDgoJiBcDCggNyhINhHcBAQEBAQEBAwEBAQEBGQSLOoJNgjgHhC0Fi0SLXYQaXgGJW4VEgk+GfCOEFCIxAYJGAQEB X-IPAS-Result: A0CrCAA731xV/ySNSC1cgxBUXoJQhVW7QIExHwqFdwKBPToSAQEBAQEBAYEKhCIBAQEBAgEBAnYFCwsNAQMDAQIdEhQNBwQjDgoJiBcDCggNyhINhHcBAQEBAQEBAwEBAQEBGQSLOoJNgjgHhC0Fi0SLXYQaXgGJW4VEgk+GfCOEFCIxAYJGAQEB X-IronPort-AV: E=Sophos;i="5.13,465,1427774400"; d="scan'208";a="209220881" Original-Received: from unknown (HELO pastel.home) ([45.72.141.36]) by ironport2-out.teksavvy.com with ESMTP; 18 Apr 2016 12:32:57 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id A6E23640C7; Mon, 18 Apr 2016 12:32:55 -0400 (EDT) In-Reply-To: (Philipp Stephani's message of "Sat, 16 Apr 2016 13:16:13 +0000") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.181 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:109788 Archived-At: Thanks, installed in trunk. Stefan >>>>> "Philipp" == Philipp Stephani writes: > Stefan Monnier 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 > 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