[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Add hook to end of `custom-create-buffer-internal'
From: |
Stefan Monnier |
Subject: |
Re: Add hook to end of `custom-create-buffer-internal' |
Date: |
Fri, 28 Jan 2005 09:58:16 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux) |
> *** cus-edit.el 08 Jan 2005 21:43:12 -0500 1.206
> --- cus-edit.el 28 Jan 2005 08:59:52 -0500
> ***************
> *** 1249,1257 ****
> (special-display-buffer-names nil)
> (special-display-regexps nil)
> (same-window-buffer-names nil)
> ! (same-window-regexps nil))
> ! (pop-to-buffer (custom-get-fresh-buffer name))
> ! (custom-buffer-create-internal options description)))
> (defcustom custom-reset-button-menu nil
> "If non-nil, only show a single reset button in customize buffers.
> --- 1240,1250 ----
> (special-display-buffer-names nil)
> (special-display-regexps nil)
> (same-window-buffer-names nil)
> ! (same-window-regexps nil)
> ! (buffer (custom-get-fresh-buffer name)))
> ! (with-current-buffer buffer
> ! (custom-buffer-create-internal options description))
> ! (pop-to-buffer buffer)))
> (defcustom custom-reset-button-menu nil
> "If non-nil, only show a single reset button in customize buffers.
Those kinds of changes typically have the negative side effect that the
buffer-setup code (i.e. custom-buffer-create-internal in this case) can't
know the width of the window any more, so it can't fill text properly.
I general, we want to do the following:
- display the buffer in a window, so we know the properties of the window.
- fill the buffer with whatever text needs to be there, potentially using
info about the window such as its width.
- re-adjust the window to the content of the buffer.
We could get away with a 2-step setup if we could do a "pop-to-buffer
dry-run" which would return some kind of "window prediction", i.e.:
- fill the buffer with whatever text needs to be there, potentially using
things like (window-width (pop-to-buffer-dry-run (current-buffer))).
- call pop-to-buffer.
But note that pop-to-buffer-dry-run will sometimes have to return
a non-existent window because pop-to-buffer would create a new window.
That sounds nasty.
Stefan
- Add hook to end of `custom-create-buffer-internal', Drew Adams, 2005/01/24
- Re: Add hook to end of `custom-create-buffer-internal', Richard Stallman, 2005/01/25
- RE: Add hook to end of `custom-create-buffer-internal', Drew Adams, 2005/01/25
- Re: Add hook to end of `custom-create-buffer-internal', Richard Stallman, 2005/01/26
- RE: Add hook to end of `custom-create-buffer-internal', Drew Adams, 2005/01/26
- Re: Add hook to end of `custom-create-buffer-internal', Richard Stallman, 2005/01/27
- RE: Add hook to end of `custom-create-buffer-internal', Drew Adams, 2005/01/27
- Re: Add hook to end of `custom-create-buffer-internal', Richard Stallman, 2005/01/28
- Re: Add hook to end of `custom-create-buffer-internal',
Stefan Monnier <=
- RE: Add hook to end of `custom-create-buffer-internal', Drew Adams, 2005/01/28
- Re: Add hook to end of `custom-create-buffer-internal', Richard Stallman, 2005/01/28
- Re: Add hook to end of `custom-create-buffer-internal', Stefan Monnier, 2005/01/29
- RE: Add hook to end of `custom-create-buffer-internal', Drew Adams, 2005/01/28
- Re: Add hook to end of `custom-create-buffer-internal', Richard Stallman, 2005/01/28
- RE: Add hook to end of `custom-create-buffer-internal', Drew Adams, 2005/01/29
- Re: Add hook to end of `custom-create-buffer-internal', Richard Stallman, 2005/01/30