Subject: Re: bug#17007: 24.3.50; describe-key/function evaluates documentation function in the wrong buffer

From: martin rudalics <[email-masked]>
Date: Fri, 14 Mar 2014 12:32:16 +0100

> This has stopped working in 24.3.5 since `with-help-window' started
 > replaced `with-output-to-temp-buffer' with
 > `with-temp-buffer-window'. The former just binds `standard-output' while
 > the latter also sets the current buffer to the *Help* buffer.
 >
 > The result is that the fallback keybinding reported is always
 > "forward-button", which is almost always wrong.
 >
 > One could either
 >
 > 1. revert that change (was it just a cleanup?)
 > 2. fix/parametrize that particular behaviour of
 > `with-temp-buffer-window'
 > 3. pass an extra original-buffer arg to `describe-function-1'
 > 4. dynamically bind some new `help-original-buffer' var.
 >
 > Even though a better mechanism for "fallback keybindings" is being
 > discussed (and by then yasnippet can get rid of its own technique, which
 > is half-baked but working since emacs 22), it'd be nice if the current
 > function-documentation trick is kept working for upcoming emacs 24.4.
 >
 > This originated in https://github.com/capitaomorte/yasnippet/issues/468
 >
 > http://github.com/capitaomorte/autopair does something similar and is
 > probably also affected, but I plan to deprecate autopair in favor of
 > 24.4's electric-pair-mode anyway.

Sorry, I messed this up too often already.  Hopefully, it's sufficient
to add one `with-current-buffer' binding at some particular level.
Could you please send me the calling sequence used by yasnippet, so I
can identify the location where this is necessary?

martin