alphapapa / ement.el

A Matrix client for GNU Emacs
GNU General Public License v3.0
476 stars 44 forks source link

Consider defining the ement-room-mode-hook docstring explicitly #184

Open phil-s opened 11 months ago

phil-s commented 11 months ago

I think this is an Emacs bug which could be resolved with a call to format-mode-line , but the auto-generated docstring for major mode hooks doesn't cope with the (entirely valid) use of mode line constructs in mode-name, so we end up with a *Help* buffer like this:

ement-room-mode-hook is a variable defined in ‘ement-room.el’.

Its value is (visual-line-mode)

Hook run after entering ‘(Ement-Room (:eval (unless (map-elt ement-syncs ement-session) (propertize :Not-syncing ’face ’font-lock-warning-face ’help-echo Automatic syncing was interrupted; press "g" to resume)))) mode.
No problems result if this variable is not bound.
‘add-hook’ automatically binds it.  (This is true for all hook variables.)

  This variable may be risky if used as a file-local variable.

[back]

I see that emacs-lisp-mode circumvents this with a defcustom for the hook, to declare a plainer-text docstring (although that might well have pre-dated the use of mode line constructs in its mode-name; I didn't check.)

It might be a sensible idea to do something similar in this case.

alphapapa commented 11 months ago

Thanks, I hadn't noticed that. Should we report an Emacs bug about this?