Subject: bug#13841: 24.3.50; Regression - unreadable `C-h k' help

From: Lars Ingebrigtsen <[email-masked]>
Date: Sun, 09 Feb 2014 23:31:46 -0800

"Drew Adams" <[email-masked]> writes:

> C-h k
>
> Then choose menu item Options > Line Wrapping in This Buffer > Truncate
> Long Lines.
>
> You see binary output instead of useful help:
>
> <menu-bar> <options> <line-wrapping> <truncate> runs the command #[nil
> "ILLEGIBLE, INCOMPREHENSIBLE BINARY INCANTATIONS" [visual-line-mode
> word-wrap 0 nil toggle-truncate-lines 1] 2 nil nil], which is an
> interactive compiled Lisp function.
>
> It is bound to <menu-bar> <options> <line-wrapping> <truncate>.
>
> (anonymous)
>
> Not documented.
>
> For reference wrt this regression, this is what Emacs 23.4 shows
> instead - much more readable and helpful:
>
> <menu-bar> <options> <line-wrapping> <truncate> runs the command
> (lambda nil (interactive) (if visual-line-mode (visual-line-mode 0))
> (setq word-wrap nil) (toggle-truncate-lines 1)), which is an
> interactive Lisp function.
>
> It is bound to <menu-bar> <options> <line-wrapping> <truncate>.

Perhaps that's just because it didn't byte-compile the function?  So
we're making progress.

Anyway, if we put lambdas into menus, `C-h k' isn't very helpful:

    (bindings--define-key menu [truncate]
      `(menu-item "Truncate Long Lines"
                  ,(lambda ()
                     (interactive)
                     (if visual-line-mode (visual-line-mode 0))
                     (setq word-wrap nil)
                     (toggle-truncate-lines 1))
                  :help "Truncate long lines at window edge"
                  :button (:radio . (or truncate-lines
                                        (truncated-partial-width-window-p)))
                  :visible (menu-bar-menu-frame-live-and-visible-p)
                  :enable (not (truncated-partial-width-window-p))))

I think the right solution here would be for `C-h k' just to say that
it's an anonymous function and leave it at that.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/