[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: with-output-to-temp-buffer and help-mode

From: Drew Adams
Subject: RE: with-output-to-temp-buffer and help-mode
Date: Fri, 25 Jul 2014 12:06:33 -0700 (PDT)

> > What we got instead was a new macro for help (good) and a blind
> > removal of the help-mode stuff from the existing "temp" macro (bad!).
> You seem to believe with-output-to-temp-buffer is only about help mode.

No.  Please read what I wrote.  I explicitly said: 

>> That requires every existing use of `with-output-to-temp-buffer' to
>> be revisited and adjusted to use the new help macro (or not, rarely)
>> instead.

and even more explicitly:

>> Of course, wholesale replacement by such a macro would not deal
>> directly or correctly with existing occurrences of
>> `with-output-to-temp-buffer' where there was accompanying code that
>> removed/inhibited the help-mode stuff (i.e., that tried to treat it
>> as really just a temporary buffer).

>> Whatever the workaround, each occurrence of
>> `with-output-to-temp-buffer' really needs to be checked to see
>> what TRT to do is.

I made it clear that (a) regardless of its unfortunate name,
`with-output-to-temp-buffer' IS "about help mode" most of the time
(the vast majority of occurrences).  But (b) there are some (pretty
rare) occurrences where the code jumped through some extra hoops to
explicitly remove the imposition of help-mode.

I have some of the latter in my own code, so I'm well aware that not
all uses of `with-output-to-temp-buffer' used help mode.  The point
is that they needed to, in effect, prevent or undo the help-mode part
(which was the largest part) of what `with-output-to-temp-buffer' did.

> Now there are places in emacs that show otherwise, for example, check
> display-completion-list. The doc says the macro runs
> temp-buffer-setup-hook which normally sets up the buffer in help mode.
> So entering help mode is the default behaviour but not the only one,
> and the decision is up to the user.

Please read the bug threads, and reread my message that you are
replying to.

And please do not confuse things by referring to what
`with-output-to-temp-buffer' does now, as if the decision of whether
it imposed help-mode was always "up to the user".  Sure, it was up to
the user in the sense that someone using it could jump through some
extra hoops to remove the imposition of help-mode.  That was not done
often, as you surely know.

That was the point of the original bug report I filed: the macro name
says nothing about help mode but the behavior was to impose help mode,
unless you took extra measures.  To get just a temporary buffer
without help mode you had to work at it (remove hooks etc.).

The point of my original bug report was twofold: (a) we should have
a simple macro to use a temporary buffer, without it having anything
to do with help mode, and (b) we should have a macro to do what
`with-output-to-temp-buffer' does (did): use a buffer in help mode.

The first macro should have "temp" in its name and the second should
have "help" in its name.  The bad name `with-output-to-temp-buffer'
needs to be continued as a defalias for the new help-mode macro, but
it should be deprecated.

That is very different from what has been done.  Martin created
`with-help-window', which is (b).  Good.  But you simply changed the
behavior of `with-output-to-temp-buffer' to be (a).  You removed its
use of help mode without changing the name, breaking tons of existing
code that uses it expecting help mode.

All of this has been explained 8 zillion times now.  If you don't
get it then I don't know what more could help you understand.  And
if you do get it then I can only conclude that what you are saying
is motivated by bad faith, as it contradicts reality.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]