unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#41836: 26.3; Could we stop `help-buffer' from ever signalling errors?
@ 2020-06-13 13:29 Phil Sainty
  2021-01-21 16:04 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Phil Sainty @ 2020-06-13 13:29 UTC (permalink / raw)
  To: 41836

At present (current master branch included), `help-buffer'
returns the following:

  (buffer-name
   (if (not help-xref-following)
       (get-buffer-create "*Help*")
     (unless (derived-mode-p 'help-mode)
       (error "Current buffer is not in Help mode"))
     (current-buffer)))


Is there any reason not to change it to this?

  (buffer-name
   (if (and help-xref-following (derived-mode-p 'help-mode))
       (current-buffer)
     (get-buffer-create "*Help*")))


That way, even in unexpected situations, we can still show the
user some help.

My motivation is from wondering whether it was simple to
display all of the function and variable symbols displayed by
`so-long-commentary' as help buttons.  I found that calling
`help-make-xrefs' does exactly that, but then trying to use any
of the buttons causes the "Current buffer is not in Help mode"
error.

With the suggested change I get the desirable behaviour of those
help buttons popping up a help window with the relevant help.
It seems to work beautifully for my use-case, and would surely
be equally useful in other similar situations.

Is there any good reason to maintain that error?


-Phil





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-06 14:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-13 13:29 bug#41836: 26.3; Could we stop `help-buffer' from ever signalling errors? Phil Sainty
2021-01-21 16:04 ` Lars Ingebrigtsen
2022-06-06 14:12   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).