all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Correct fallback from display-buffer-function
@ 2011-12-12  5:04 Tomohiro Matsuyama
  2011-12-12  9:23 ` martin rudalics
  0 siblings, 1 reply; 3+ messages in thread
From: Tomohiro Matsuyama @ 2011-12-12  5:04 UTC (permalink / raw
  To: emacs-devel

Hi all,

I have some problem about display-buffer-function. My poor extension,
popwin.el, uses display-buffer-function for handling all operations to
windows in order to pop up particular windows in popwin's way.

If one of pop up rules matches against the buffer being to be displayed,
popwin will be responsible about the window of the buffer, and there is
no problem in this case. However, if no rules match, popwin can't
fallback the operations to windows correctly.

Currently, popwin has the following ugly code for fallback in the entity
of display-buffer-function.

;; Assume display-buffer-function to be nil here
(if (and (>= emacs-major-version 24)
(boundp 'action)
(boundp 'frame))
;; Use variables ACTION and FRAME which are formal parameters
;; of DISPLAY-BUFFER.
(display-buffer buffer action frame)
;; handle it
)

You may notice that there is no proper way to get `action' and `frame'
variables for correct fallback.
So, could you tell me a good solution for this problem?

Regards,
Tomohiro




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Correct fallback from display-buffer-function
  2011-12-12  5:04 Correct fallback from display-buffer-function Tomohiro Matsuyama
@ 2011-12-12  9:23 ` martin rudalics
  2011-12-21 12:11   ` Tomohiro Matsuyama
  0 siblings, 1 reply; 3+ messages in thread
From: martin rudalics @ 2011-12-12  9:23 UTC (permalink / raw
  To: Tomohiro Matsuyama; +Cc: emacs-devel

> You may notice that there is no proper way to get `action' and `frame'
> variables for correct fallback.

This is by intention.  Applications that used `display-buffer-function'
before Emacs 24 wouldn't know how to handle these arguments.

> So, could you tell me a good solution for this problem?

Add to `display-buffer-alist' a regexp matching the names of the buffer
you want to handle via your `display-buffer-function' plus the function
of your choice.  Don't use `display-buffer-function', it's here for
compatibility with earlier Emacs versions only.  Check with the code of
`display-buffer' to know what will be passed to your function via the
ALIST argument.

martin



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Correct fallback from display-buffer-function
  2011-12-12  9:23 ` martin rudalics
@ 2011-12-21 12:11   ` Tomohiro Matsuyama
  0 siblings, 0 replies; 3+ messages in thread
From: Tomohiro Matsuyama @ 2011-12-21 12:11 UTC (permalink / raw
  To: martin rudalics; +Cc: emacs-devel


>> So, could you tell me a good solution for this problem?
> Add to `display-buffer-alist' a regexp matching the names of the buffer
> you want to handle via your `display-buffer-function' plus the function
> of your choice.  Don't use `display-buffer-function', it's here for
> compatibility with earlier Emacs versions only.  Check with the code of
> `display-buffer' to know what will be passed to your function via the
> ALIST argument.
>

OK. I will use `display-buffer-alist' for future release.
Thanks a lot!

Tomohiro




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-12-21 12:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-12  5:04 Correct fallback from display-buffer-function Tomohiro Matsuyama
2011-12-12  9:23 ` martin rudalics
2011-12-21 12:11   ` Tomohiro Matsuyama

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.