unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: Glenn Morris <rgm@gnu.org>, emacs-devel@gnu.org
Subject: RE: with-output-to-temp-buffer and help-mode
Date: Fri, 25 Jul 2014 08:13:47 -0700 (PDT)	[thread overview]
Message-ID: <a1ce51dd-9d78-4468-a249-8dc82d72bc7b@default> (raw)
In-Reply-To: <1yppgtua5n.fsf@fencepost.gnu.org>

> with-output-to-temp-buffer was changed to no longer put the buffer in
> help-mode. This change makes no sense to me

+1

> - can someone explain the logic? Otherwise I'm thinking the change
> should just be reverted.
> 
> I did ask in http://debbugs.gnu.org/16038#104, but I haven't seen a
> proper explanation.

+1

> The elisp manual documents the use of help-mode (since at least 1999):
> 
>    This function executes the forms in BODY while arranging to insert
>    any output they print into the buffer named BUFFER-NAME, which is
>    first created if necessary, and put into Help mode.
>    [...]
>    If the forms in BODY do not change the major mode in the output
>    buffer, so that it is still Help mode at the end of their
>    execution, then `with-output-to-temp-buffer' makes this buffer
>    read-only at the end, and also scans it for function and variable
>    names to make them into clickable cross-references.
> 
> I agree that:
> 1) the fact there is no "help" in the name is unfortunate.
> 2) the fact that help-mode is not mentioned in the doc-string is
>    unfortunate.
> 3) the way this was implemented (via hooks) was unfortunate.

3 x (+1)

> However:
> 
> Many (most?) uses of the thing rely on the output being in help mode.
> See eg http://debbugs.gnu.org/17966 .
> There are ~ 223 uses of with-output-to-temp-buffer in lisp/.
> As a first simple test, the string "help" appears on the same line as 76
> of them.

Yes.  And what is true of the Emacs source code is also true of
3rd-party code.

`with-output-to-temp-buffer' is used a lot, and its uses expect and
depend on it using help-mode.  This help behavior is longstanding -
many, many moon.  It should not just be removed willy nilly overnight.

The name (with "temp" and without "help") is unfortunate, but the way
to fix a faulty name is not to change the code to fit the name but to
change the name to fit the code (AND to keep the old name as an alias,
and deprecate it).

> Nobody shows any signs of fixing all those uses, or even documenting
> this (incompatible) change in NEWS.
> 
> So I think this should just be reverted.

+1

(Even though it will mean undoing workaround code I added in lots of
places to accommodate this change.)



      parent reply	other threads:[~2014-07-25 15:13 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
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 [this message]

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=a1ce51dd-9d78-4468-a249-8dc82d72bc7b@default \
    --to=drew.adams@oracle.com \
    --cc=emacs-devel@gnu.org \
    --cc=rgm@gnu.org \
    /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).