From: Kelly Dean <kelly@prtime.org>
To: 19685@debbugs.gnu.org
Subject: bug#19685: [PATCH] define-minor-mode docstring generation bug
Date: Sun, 25 Jan 2015 08:52:42 +0000 [thread overview]
Message-ID: <YoGpD6u8UrFl98ZTKM71BvqOtZk1QQEdxC6oPK1gwT2@local> (raw)
[-- Attachment #1: Type: text/plain, Size: 343 bytes --]
Try this:
(define-minor-mode foo "foo" :global t)
The variable it creates includes a docstring with
⌜Setting this variable directly does not take effect⌝.
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.)
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: dmm-docstring-gen-bug.patch --]
[-- Type: text/x-diff, Size: 475 bytes --]
--- 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))
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: dmm-docstring-clarification.patch --]
[-- Type: text/x-diff, Size: 962 bytes --]
--- 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\".
next reply other threads:[~2015-01-25 8:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-25 8:52 Kelly Dean [this message]
2015-02-18 1:04 ` bug#19685: define-minor-mode docstring generation bug Kelly Dean
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YoGpD6u8UrFl98ZTKM71BvqOtZk1QQEdxC6oPK1gwT2@local \
--to=kelly@prtime.org \
--cc=19685@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).