all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: Drew Adams <drew.adams@oracle.com>, 3366@emacsbugs.donarmstrong.com
Subject: bug#3366: 23.0.94; doc of split-window-preferred-function, display-buffer, etc.
Date: Mon, 25 May 2009 09:04:25 +0200	[thread overview]
Message-ID: <4A1A42F9.7050500@gmx.at> (raw)
In-Reply-To: <7BFD115BD21E4677AAB801DA5EBBFED1@us.oracle.com>

 > It seems (but I'm not sure this works for all cases) that what is
 > needed, to ensure that the same window as before is split, is to bind
 > `split-window-preferred-function' to something like this around calls
 > to `display-buffer':
 >
 > (lambda (w) (eq w (get-lru-window)))

The function you want might be

(defun split-window-22 (window)
   (let ((frame (window-frame window)))
     (or (and (setq window (get-largest-window frame t))
	     (window-full-width-p window)
	     (window-splittable-p window)
	     (split-window window))
	(and (setq window (get-lru-window frame t))
	     (window-splittable-p window)
	     (split-window window)))))

but I wouldn't rely on it.

 > Even if this function is not an exact recipe for all cases, something
 > like it should be mentioned, to help users get back the behavior that
 > existed before the new "smarter" behavior was introduced.  Preferably,
 > Emacs would itself provide a function that users could use here - a
 > function that would give precisely the pre-23 behavior in all cases.
 >
 > We should also make it clear that if you want the pre-23 behavior then
 > you will need to wrap not only explicit calls to `display-buffer' with
 > a `let' binding this way, but also calls to things such as
 > `with-output-to-temp-buffer'.

All people have to do is customize `split-window-preferred-function' to
that function.

martin






  reply	other threads:[~2009-05-25  7:04 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-24 17:01 bug#3366: 23.0.94; doc of split-window-preferred-function, display-buffer, etc Drew Adams
2009-05-25  7:04 ` martin rudalics [this message]
2009-05-25  8:42   ` Drew Adams
2009-05-25  9:40     ` martin rudalics
2009-05-25 15:27     ` Stefan Monnier
2009-05-26  9:28       ` martin rudalics
2009-05-26 13:47         ` Drew Adams
2009-05-26 17:12         ` Stefan Monnier
2009-05-27  6:53           ` martin rudalics
2009-05-27 14:39             ` Stefan Monnier
2009-05-27 14:47               ` Drew Adams
2009-05-27 17:03               ` martin rudalics
2009-05-27 17:54                 ` Stefan Monnier
2011-07-11 16:03                   ` Lars Magne Ingebrigtsen

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A1A42F9.7050500@gmx.at \
    --to=rudalics@gmx.at \
    --cc=3366@emacsbugs.donarmstrong.com \
    --cc=drew.adams@oracle.com \
    /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 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.