[Top][All Lists]

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

bug#4748: 23.1; least recently used window - is it?

From: Drew Adams
Subject: bug#4748: 23.1; least recently used window - is it?
Date: Sun, 18 Oct 2009 23:28:43 -0700

> The window used by pop-to-buffer depends on so many different factors
> that it's illusory to think you can control it from the outside.

You didn't respond to the question, which was how to replace `switch-to-buffer',
to both (a) keep the same-window and `quit-window' behavior that people are used
to (and presumably want) and (b) respect `special-display-*' and
`pop-up-frames'. Those vars would take precedence, but if their values don't
require using another frame, then the behavior should be to do what
`switch-to-buffer' does now (use the same window).

I don't need this for myself (other than curiosity), but I understood that an
aim was to move away from using `switch-to-buffer' in Emacs code and encourage
the same for 3rd-party code. And I understood that one reason for that was that
`switch-to-buffer' does not respect those use-other-frame variables (that's what
bothers me about it, at least).

If that's not the case, then don't worry about the question. I use
`pop-to-buffer', myself.

FWIW, this came up because I was replacing some code in `bookmark-bmenu-list',
and I wanted to preserve the `switch-to-buffer' that users are used to (and
might prefer), while at the same time making it sane wrt
`special-display-regexps' (for users like me). So far, I'm just using this to
replace the `switch-to-buffer' call - it at least DTRT for one-window frames:

(let ((one-win-p  (one-window-p)))
  (pop-to-buffer (get-buffer-create "*Bookmark List*"))
  (when one-win-p (delete-other-windows)))

reply via email to

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