Subject: bug#17210: 24.3.50; help mode [back] link to a C-h b keybind listing fails with message "Current buffer is not in Help mode"

From: Ian Kelling <[email-masked]>
Date: Sun, 06 Apr 2014 16:47:36 -0700

Repro steps:
emacs -Q
C-h b
click function name link
click back

expected:
go back to the C-h b keymap listing

acutal
in echo area: "Current buffer is not in Help mode"
the help buffer does no change.

The problem does not always happen, but it seems consistent on the first try in a
fresh emacs. Toggling debug on error, gives this trace:

Debugger entered--Lisp error: (error "Current buffer is not in Help mode")
  signal(error ("Current buffer is not in Help mode"))
  error("Current buffer is not in Help mode")
  help-buffer()
  describe-bindings-internal(nil nil)
  describe-bindings(nil #<buffer *scratch*>)
  apply(describe-bindings (nil #<buffer *scratch*>))
  help-xref-go-back(#<buffer *Help*>)
  apply(help-xref-go-back #<buffer *Help*>)
  help-do-xref(63 help-xref-go-back (#<buffer *Help*>))
  help-button-action(#<marker (moves after insertion) at 66 in *Help*>)
  button-activate(#<marker (moves after insertion) at 66 in *Help*> nil)
  push-button(66)
  push-button((mouse-2 (#<window 6 on *Help*> 66 (34 . 106) 107906261 nil 66 (3 .
5) nil (7 . 11) (9 . 19))))
  call-interactively(push-button nil nil)
  command-execute(push-button)

In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2)
 of 2014-03-18 on treetowl
Repository revision: 116779 [email-masked]
Windowing system distributor `The X.Org Foundation', version 11.0.11204000
System Description:	Debian GNU/Linux 7.4 (wheezy)

Configured using:
 `configure --enable-link-time-optimization 'CFLAGS=-std=gnu99 -g3 -O2''

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
C-h b <help-echo> <help-echo> <down-mouse-2> <mouse-1>
<help-echo> <down-mouse-2> <mouse-1> <help-echo> M-x
r e C-g M-x b u g <kp-add> <backspace> <tab> <tab>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> <backspace>
<backspace> <backspace> <backspace> <backspace> r e
p o r t - b <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Type C-x 1 to delete the help window, C-M-v to scroll help.

help-buffer: Current buffer is not in Help mode
Quit
Making completion list...
call-interactively: End of buffer

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils help-fns kmacro two-column iso-transl help-mode
easymenu time-date tooltip electric uniquify ediff-hook vc-hooks
lisp-float-type mwheel x-win x-dnd tool-bar dnd fontset image regexp-opt
fringe tabulated-list newcomment lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cham georgian utf-8-lang misc-lang
vietnamese tibetan thai tai-viet lao korean japanese hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
case-table epa-hook jka-cmpr-hook help simple abbrev minibuffer nadvice
loaddefs button faces cus-face macroexp files text-properties overlay
sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote make-network-process dbusbind
gfilenotify dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)