Subject: bug#18349: 24.3.92; define-minor-mode: generated doc of hook: mode vs. modefun

From: Michael Heerdegen <[email-masked]>
Date: Fri, 29 Aug 2014 00:26:41 +0200

Hello,

in emacs -Q, eval

(define-minor-mode my-minor-mode
  "Doc"
  :variable foo
  ...)

Then, C-h v my-minor-mode-hook:

[...]
Documentation:
Hook run after entering or leaving `foo'.
[...]                              ^^^^^

This makes no sense, the doc of the hook should include the name of the
mode function, not that of the variable.

That happens e.g. for `read-only-mode-hook'.

Is this the right thing?

*** /tmp/ediff9150_DV	2014-08-29 00:18:07.582868434 +0200
--- /home/micha/software/emacs/lisp/emacs-lisp/easy-mmode.el	2014-08-29 00:17:46.634718136 +0200
***************
*** 300,306 ****
           ,(format "Hook run after entering or leaving `%s'.
  No problems result if this variable is not bound.
  `add-hook' automatically binds it.  (This is true for all hook variables.)"
!                   mode))
  
         ;; Define the minor-mode keymap.
         ,(unless (symbolp keymap)	;nil is also a symbol.
--- 300,306 ----
           ,(format "Hook run after entering or leaving `%s'.
  No problems result if this variable is not bound.
  `add-hook' automatically binds it.  (This is true for all hook variables.)"
!                   modefun))
  
         ;; Define the minor-mode keymap.
         ,(unless (symbolp keymap)	;nil is also a symbol.

Thanks,

Michael.

In GNU Emacs 24.3.92.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2)
 of 2014-08-11 on drachen
Windowing system distributor `The X.Org Foundation', version 11.0.11600000
System Description:	Debian GNU/Linux testing (jessie)

Important settings:
  value of $LC_ALL: de_DE.utf8
  value of $LC_COLLATE: C
  value of $LC_TIME: C
  value of $LANG: de_DE.utf8
  locale-coding-system: utf-8-unix