emacs-devel
[Top][All Lists]
Advanced

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

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


From: Glenn Morris
Subject: Re: with-output-to-temp-buffer and help-mode
Date: Fri, 25 Jul 2014 21:39:39 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Leo Liu wrote:

> See Martin's comment in
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16038#14, there seems to be
> problems either way.

His comments relate to with-temp-buffer-window, which was a new thing he
introduced. This is normally how it works. If you don't like existing
long-standing behaviour, you introduce a new thing that behaves as you
want, and deprecate the old thing. You don't just silently change the
old thing to do something else.

As he said in the very message you cite:
    
    I'd rather get rid of `with-output-to-temp-buffer' ;-)
    
    If you look into our mail archives, you should find a couple of
    complaints about `with-output-to-temp-buffer' putting the buffer in
    `help-mode' (via `temp-buffer-setup-hook') and the like.  I tried to
    avoid these when I wrote `with-temp-buffer-window'.
    
    Assume two applications A and B: A expects `with-output-to-temp-buffer'
    to put the buffer in `help-mode'.  B wants to avoid that the buffer is
    put in `help-mode'.  I can offer B to use `with-temp-buffer-window'
    instead while A can continue to work as usual.  Eventually I'd like A to
    use `with-temp-buffer-window' too and put the buffer in `help-mode'
    itself.  But there were too many `with-output-to-temp-buffer' calls in
    the code base and I was not able to look into them.

That would be fine by me:
Deprecate with-output-to-temp-buffer and its ugly implementation,
and use with-temp-buffer-window + an explicit help call.
But leave the old with-output-to-temp-buffer alone.

> Note also temp-buffer-setup-hook is part of the public hooks of
> with-output-to-temp-buffer so the macro makes no guarantee it will be in
> Help mode. I.e. it is permissible for a user to have (add-hook
> 'temp-buffer-setup-hook 'fancy-help-mode t)

As I said, I agree the way this was implemented was unfortunate.
So deprecate it and introduce something better.

> The more important reason is we have variants of those macros and it is
> time to consolidate them.

I am just completely failing to understand your logic here.

But no-one else seems to care (can't say I blame them from being put
off this discussion).



reply via email to

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