[Top][All Lists]

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103854: Reimplement list-process

From: Juanma Barranquero
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r103854: Reimplement list-processes in Lisp.
Date: Thu, 7 Apr 2011 02:57:08 +0200

On Thu, Apr 7, 2011 at 02:38, Chong Yidong <address@hidden> wrote:

> The documentation for temp-buffer-show-hook is somewhat vacuous---

For generous values of "somewhat", yeah.

> it
> says that it's the hook run by with-output-to-temp-buffer.  Because the
> new implementation doesn't use with-output-to-temp-buffer, it doesn't
> run the hook.

Well, the problem is that with the current list-processes:

  (unless (bufferp buffer)
    (setq buffer (get-buffer-create "*Process List*")))
  (with-current-buffer buffer
    (process-menu-mode)   ;; <--- process-menu-mode-hook
    (setq process-menu-query-only query-only)
  (display-buffer buffer))  ;; <--- showing the contents

the point at which the available hook is run is way too early to make
adding `fit-window-to-buffer' or `resize-temp-buffer-window' useful.
And display-buffer does not run any hook. So the only fix is either a
defadvice, or a wrapper function.

> Should it?  Note that list-buffers does not either.

I hadn't noticed because I don't ever use it (I have bs-show bound to
a single key, <apps>); but I think resizing should work with
list-buffers too.

> Maybe temp-buffer-show-hook/temp-buffer-resize-mode needs a bit of a
> rethink.  IIUC, this hook was intended for "disposable" buffers that
> temporarily display information but do not provide any other useful
> interaction.  But that hasn't even been the case for the *Help* buffers
> for a long time, since those now contain clickable text buttons.

Certainly, `temp-buffer-resize-mode' is useful for non-"disposable"
buffers. Resizing is not related to the lifetime of the buffer


reply via email to

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