unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Leo Liu <sdl.web@gmail.com>, emacs-devel@gnu.org
Subject: RE: with-output-to-temp-buffer and help-mode
Date: Fri, 25 Jul 2014 12:06:33 -0700 (PDT)	[thread overview]
Message-ID: <61a1087c-3e21-46df-a12c-22dce14e82b1@default> (raw)
In-Reply-To: <m3a97x5muf.fsf@gmail.com>

> > 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: 

1.
>> 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:

2.
>> 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	other threads:[~2014-07-25 19:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25  8:15 with-output-to-temp-buffer and help-mode Glenn Morris
2014-07-25  9:06 ` Leo Liu
2014-07-25 15:34   ` Drew Adams
2014-07-25 18:12     ` Leo Liu
2014-07-25 19:06       ` Drew Adams [this message]
2014-07-26  1:10         ` Stephen J. Turnbull
2014-07-26  9:00           ` martin rudalics
2014-07-26  1:30       ` Glenn Morris
2014-07-26  1:39   ` Glenn Morris
2014-07-26  3:33     ` Thien-Thi Nguyen
2014-08-05  8:35     ` Glenn Morris
2014-08-06 16:54       ` Stefan Monnier
2014-08-07  3:30         ` Leo Liu
2014-07-25 15:13 ` Drew Adams

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61a1087c-3e21-46df-a12c-22dce14e82b1@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=sdl.web@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).