Eval (progn (purpose-mode 1) (purpose-x-popwin-setup)) to turn on window-purpose and install its popwin-like emulation. popwin will make "popup windows", such as windows containing help buffers, automatically go away.
Bring up any help that contains a link, such as C-hfauto-fill-modeRET.
Select the "*Help*" buffer/window, e.g. C-xo.
M-xlink-hint-open-linkRET
link-hint does successfully follow the link, but you get an error such as internal--before-with-selected-window: Wrong type argument: window-valid-p, #<window 18>. Here's the backtrace:
I believe this happens because window-purpose's popwin emulation deletes the window containing "*Help*" in the middle of link-hint following the link.
Specifically, I am guessing that link-hint follows the link around line 993 in link-hint--action, which involves changing the window configuration, which in turn triggers window-purpose to close the popup "*Help*" window. But then link-hint tries to use the now-invalid link-win window at line 1006 in with-selected-window. (internal--before-with-selected-window is part of with-selected-window.)
I'm not sure what the appropriate fix is here. Change line 1006 to (with-selected-window (if (window-valid-p link-win) (current-window)) ...)? Or avoid this branch of the cond entirely if the link-win is no longer valid? There's also the comment right around here about using a "temporary window" that I don't fully understand.
Which is to say, I can't open a PR because I don't know how you would like to fix this! But please let me know if you have any problems understanding or reproducing the above.
I am using Emacs 27.0.50 (rebuilt from master earlier today) on macOS with the latest link-hint and window-purpose from MELPA.
Steps to reproduce:
(progn (purpose-mode 1) (purpose-x-popwin-setup))
to turn on window-purpose and install its popwin-like emulation. popwin will make "popup windows", such as windows containing help buffers, automatically go away.auto-fill-mode
RET.link-hint-open-link
RETlink-hint does successfully follow the link, but you get an error such as
internal--before-with-selected-window: Wrong type argument: window-valid-p, #<window 18>
. Here's the backtrace:I believe this happens because window-purpose's popwin emulation deletes the window containing "*Help*" in the middle of link-hint following the link.
Specifically, I am guessing that link-hint follows the link around line 993 in
link-hint--action
, which involves changing the window configuration, which in turn triggers window-purpose to close the popup "*Help*" window. But then link-hint tries to use the now-invalidlink-win
window at line 1006 inwith-selected-window
. (internal--before-with-selected-window
is part ofwith-selected-window
.)I'm not sure what the appropriate fix is here. Change line 1006 to
(with-selected-window (if (window-valid-p link-win) (current-window)) ...)
? Or avoid this branch of thecond
entirely if thelink-win
is no longer valid? There's also the comment right around here about using a "temporary window" that I don't fully understand.Which is to say, I can't open a PR because I don't know how you would like to fix this! But please let me know if you have any problems understanding or reproducing the above.
I am using Emacs 27.0.50 (rebuilt from master earlier today) on macOS with the latest link-hint and window-purpose from MELPA.