GNU bug report logs - #17007
24.3.50; describe-key/function evaluates documentation function in the wrong buffer

Previous Next

Package: emacs;

Reported by: joaotavora <at> gmail.com (João Távora)

Date: Thu, 13 Mar 2014 11:23:02 UTC

Severity: normal

Found in version 24.3.50

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: joaotavora <at> gmail.com (João Távora)
Subject: bug#17007: closed (Re: bug#17007: 24.3.50; describe-key/function
 evaluates documentation function in the wrong buffer)
Date: Wed, 19 Mar 2014 10:51:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

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

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 17007 <at> debbugs.gnu.org.

-- 
17007: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17007
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Juanma Barranquero <lekktu <at> gmail.com>
To: João Távora <joaotavora <at> gmail.com>
Cc: martin rudalics <rudalics <at> gmx.at>, 17007-done <at> debbugs.gnu.org,
 Nicolas Richard <theonewiththeevillook <at> yahoo.fr>
Subject: Re: bug#17007: 24.3.50; describe-key/function evaluates documentation
 function in the wrong buffer
Date: Wed, 19 Mar 2014 11:50:08 +0100
Closing, presumably fixed in

2014-03-16  Martin Rudalics  <rudalics <at> gmx.at>

        Fix behavior of with-temp-buffer-window (Bug#16816, Bug#17007).

[Message part 3 (message/rfc822, inline)]
From: joaotavora <at> gmail.com (João Távora)
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50;
 describe-key/function evaluates documentation function in the wrong
 buffer
Date: Thu, 13 Mar 2014 11:22:32 +0000
Hi

So yasnippet has this bit of code (simplified for this report)

    (put 'yas-expand  'function-documentation
         '(yas--expand-from-trigger-key-doc t))
    (defun yas--expand-from-trigger-key-doc (context)
      "A doc synthesizer for `yas-expand'."
      (concat "Expand a snippet before point. If no snippet
    expansion is possible, "
              (let* ((fallback (yas--keybinding-beyond-yasnippet)))
                (or (and fallback
                         (format "call command `%s'"
                                 (pp-to-string fallback)))
                    "do nothing (`yas-expand' doesn't shadow\nanything)."))))

This used to work fine and output something like

    <tab> runs the command yas-expand, which is an alias for
    `yas-expand-from-trigger-key' in `yasnippet.el'.
     
    (yas-expand &optional FIELD)
     
    Expand a snippet before point. If no snippet
    expansion is possible, call command `indent-for-tab-command'

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.

Thanks,
João
    

In GNU Emacs 24.3.50.1 (i686-pc-mingw32)
 of 2014-01-04 on LEG570




This bug report was last modified 11 years and 69 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.