From unknown Tue Aug 19 05:28:45 2025 X-Loop: help-debbugs@gnu.org Subject: bug#19685: [PATCH] define-minor-mode docstring generation bug Resent-From: Kelly Dean Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Jan 2015 08:54:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 19685 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 19685@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.142217603815822 (code B ref -1); Sun, 25 Jan 2015 08:54:02 +0000 Received: (at submit) by debbugs.gnu.org; 25 Jan 2015 08:53:58 +0000 Received: from localhost ([127.0.0.1]:55590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YFIxC-000478-6B for submit@debbugs.gnu.org; Sun, 25 Jan 2015 03:53:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34654) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YFIxA-00046v-W4 for submit@debbugs.gnu.org; Sun, 25 Jan 2015 03:53:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFIx4-0004gW-VA for submit@debbugs.gnu.org; Sun, 25 Jan 2015 03:53:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFIx4-0004gR-TE for submit@debbugs.gnu.org; Sun, 25 Jan 2015 03:53:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFIx3-0000bb-V2 for bug-gnu-emacs@gnu.org; Sun, 25 Jan 2015 03:53:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFIx0-0004fd-Pd for bug-gnu-emacs@gnu.org; Sun, 25 Jan 2015 03:53:49 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:52379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFIx0-0004fN-JL for bug-gnu-emacs@gnu.org; Sun, 25 Jan 2015 03:53:46 -0500 Received: from mfilter27-d.gandi.net (mfilter27-d.gandi.net [217.70.178.155]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id A72A1A80B6 for ; Sun, 25 Jan 2015 09:53:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter27-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter27-d.gandi.net (mfilter27-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id KnDhtn3KgLyt for ; Sun, 25 Jan 2015 09:53:44 +0100 (CET) X-Originating-IP: 66.220.3.179 Received: from localhost (gm179.geneticmail.com [66.220.3.179]) (Authenticated sender: kelly@prtime.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id AA38AA80B1 for ; Sun, 25 Jan 2015 09:53:42 +0100 (CET) From: Kelly Dean Date: Sun, 25 Jan 2015 08:52:42 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Try this: (define-minor-mode foo "foo" :global t) The variable it creates includes a docstring with =E2=8C=9CSetting this variable directly does not take effect=E2=8C=9D. That's a bug. The attached dmm-docstring-gen-bug.patch fixes it. Also attached is dmm-docstring-clarification.patch. (Not a bug, but might= as well include it here.) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dmm-docstring-gen-bug.patch --- emacs-24.4/lisp/emacs-lisp/easy-mmode.el +++ emacs-24.4/lisp/emacs-lisp/easy-mmode.el @@ -158,7 +158,8 @@ ;; Allow skipping the first three args. (cond ((keywordp init-value) - (setq body `(,init-value ,lighter ,keymap ,@body) + (setq body (if keymap `(,init-value ,lighter ,keymap ,@body) + `(,init-value ,lighter)) init-value nil lighter nil keymap nil)) ((keywordp lighter) (setq body `(,lighter ,keymap ,@body) lighter nil keymap nil)) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dmm-docstring-clarification.patch --- emacs-24.4/lisp/emacs-lisp/easy-mmode.el +++ emacs-24.4/lisp/emacs-lisp/easy-mmode.el @@ -114,9 +114,11 @@ 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. Before the actual body code, you can write keyword arguments, i.e. - alternating keywords and values. These following special keywords - are supported (other keywords are passed to `defcustom' if the minor - mode is global): + alternating keywords and values. If you provide BODY, then you must + provide INIT-VALUE, LIGHTER, and KEYMAP, or provide at least one + keyword argument, or both; otherwise, BODY would be misinterpreted. + The following special keywords are supported (other keywords are passed + to `defcustom' if the minor mode is global): :group GROUP Custom group name to use in all generated `defcustom' forms. Defaults to MODE without the possible trailing \"-mode\". --=-=-=-- From unknown Tue Aug 19 05:28:45 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Kelly Dean Subject: bug#19685: closed (Re: define-minor-mode docstring generation bug) Message-ID: References: X-Gnu-PR-Message: they-closed 19685 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 19685@debbugs.gnu.org Date: Wed, 18 Feb 2015 01:06:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1424221562-27597-1" This is a multi-part message in MIME format... ------------=_1424221562-27597-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #19685: [PATCH] define-minor-mode docstring generation bug which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 19685@debbugs.gnu.org. --=20 19685: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D19685 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1424221562-27597-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 19685-done) by debbugs.gnu.org; 18 Feb 2015 01:05:40 +0000 Received: from localhost ([127.0.0.1]:46758 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNt5A-0007AX-5B for submit@debbugs.gnu.org; Tue, 17 Feb 2015 20:05:40 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:40698) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YNt57-0007AO-4I for 19685-done@debbugs.gnu.org; Tue, 17 Feb 2015 20:05:38 -0500 Received: from mfilter1-d.gandi.net (mfilter1-d.gandi.net [217.70.178.130]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id 93043A80CA for <19685-done@debbugs.gnu.org>; Wed, 18 Feb 2015 02:05:36 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter1-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter1-d.gandi.net (mfilter1-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id fzhVWDCP+EN4 for <19685-done@debbugs.gnu.org>; Wed, 18 Feb 2015 02:05:35 +0100 (CET) X-Originating-IP: 66.220.3.179 Received: from localhost (gm179.geneticmail.com [66.220.3.179]) (Authenticated sender: kelly@prtime.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 57AE1A80BC for <19685-done@debbugs.gnu.org>; Wed, 18 Feb 2015 02:05:34 +0100 (CET) From: Kelly Dean To: 19685-done@debbugs.gnu.org Subject: Re: define-minor-mode docstring generation bug Date: Wed, 18 Feb 2015 01:04:16 +0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 19685-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.7 (/) Fixed in trunk. ------------=_1424221562-27597-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 25 Jan 2015 08:53:58 +0000 Received: from localhost ([127.0.0.1]:55590 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YFIxC-000478-6B for submit@debbugs.gnu.org; Sun, 25 Jan 2015 03:53:58 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34654) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YFIxA-00046v-W4 for submit@debbugs.gnu.org; Sun, 25 Jan 2015 03:53:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFIx4-0004gW-VA for submit@debbugs.gnu.org; Sun, 25 Jan 2015 03:53:51 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:39906) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFIx4-0004gR-TE for submit@debbugs.gnu.org; Sun, 25 Jan 2015 03:53:50 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFIx3-0000bb-V2 for bug-gnu-emacs@gnu.org; Sun, 25 Jan 2015 03:53:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YFIx0-0004fd-Pd for bug-gnu-emacs@gnu.org; Sun, 25 Jan 2015 03:53:49 -0500 Received: from relay3-d.mail.gandi.net ([2001:4b98:c:538::195]:52379) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YFIx0-0004fN-JL for bug-gnu-emacs@gnu.org; Sun, 25 Jan 2015 03:53:46 -0500 Received: from mfilter27-d.gandi.net (mfilter27-d.gandi.net [217.70.178.155]) by relay3-d.mail.gandi.net (Postfix) with ESMTP id A72A1A80B6 for ; Sun, 25 Jan 2015 09:53:45 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at mfilter27-d.gandi.net Received: from relay3-d.mail.gandi.net ([217.70.183.195]) by mfilter27-d.gandi.net (mfilter27-d.gandi.net [10.0.15.180]) (amavisd-new, port 10024) with ESMTP id KnDhtn3KgLyt for ; Sun, 25 Jan 2015 09:53:44 +0100 (CET) X-Originating-IP: 66.220.3.179 Received: from localhost (gm179.geneticmail.com [66.220.3.179]) (Authenticated sender: kelly@prtime.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id AA38AA80B1 for ; Sun, 25 Jan 2015 09:53:42 +0100 (CET) From: Kelly Dean To: bug-gnu-emacs@gnu.org Subject: [PATCH] define-minor-mode docstring generation bug Date: Sun, 25 Jan 2015 08:52:42 +0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Try this: (define-minor-mode foo "foo" :global t) The variable it creates includes a docstring with =E2=8C=9CSetting this variable directly does not take effect=E2=8C=9D. That's a bug. The attached dmm-docstring-gen-bug.patch fixes it. Also attached is dmm-docstring-clarification.patch. (Not a bug, but might= as well include it here.) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dmm-docstring-gen-bug.patch --- emacs-24.4/lisp/emacs-lisp/easy-mmode.el +++ emacs-24.4/lisp/emacs-lisp/easy-mmode.el @@ -158,7 +158,8 @@ ;; Allow skipping the first three args. (cond ((keywordp init-value) - (setq body `(,init-value ,lighter ,keymap ,@body) + (setq body (if keymap `(,init-value ,lighter ,keymap ,@body) + `(,init-value ,lighter)) init-value nil lighter nil keymap nil)) ((keywordp lighter) (setq body `(,lighter ,keymap ,@body) lighter nil keymap nil)) --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=dmm-docstring-clarification.patch --- emacs-24.4/lisp/emacs-lisp/easy-mmode.el +++ emacs-24.4/lisp/emacs-lisp/easy-mmode.el @@ -114,9 +114,11 @@ 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. Before the actual body code, you can write keyword arguments, i.e. - alternating keywords and values. These following special keywords - are supported (other keywords are passed to `defcustom' if the minor - mode is global): + alternating keywords and values. If you provide BODY, then you must + provide INIT-VALUE, LIGHTER, and KEYMAP, or provide at least one + keyword argument, or both; otherwise, BODY would be misinterpreted. + The following special keywords are supported (other keywords are passed + to `defcustom' if the minor mode is global): :group GROUP Custom group name to use in all generated `defcustom' forms. Defaults to MODE without the possible trailing \"-mode\". --=-=-=-- ------------=_1424221562-27597-1--