6

I'm tired of emacs clobbering my windows with its output, and unpredictably at that. I'd like to have several windows in emacs frame and have each window dedicated for a certain purpose only. For example,

ECB panels |  Editor 1 | Editor 2 |  Bookmarks+
------------------------------------------------
"Messages" (output buffer)

So, when I run M-x compile, I want the output to always go into Messages. Similarily, when I run M-x magit-status, I want results in Messages, as well. Clicking on a bookmark or pressing C-x r b should open the file and position the cursor in Editor 1.

I've tried some lisp snippets to "lock" the windows to prevent the changes but the emacs goes nuts when all windows are "locked", cause it can't find an available window to put new output into. This nasty buffer-swap feature that emacs has must be going back to the 80x25 character terminal days.

I've never seen ECB windows get clobbered, so it must be doable somehow.

Drew
  • 29,895
  • 7
  • 74
  • 104
Kiska
  • 61
  • 2

2 Answers2

2

You are explicitly asking for dedicated windows. Well, Emacs has exactly that feature: dedicated windows. C-h r g dedicated windows tells you pretty much everything you need to know.

But see also special-display-buffer-names and special-display-regexps --- or if you are a masochist, fiddle with display-buffer-alist to do the same thing.

With display-buffer-alist you can in principle do anything you might imagine, including tie your underwear in knots and set it on fire.

(Me, I just set special-display-regexps to ("[ ]?[*][^*]+[*]").)

Drew
  • 29,895
  • 7
  • 74
  • 104
  • It looks like `display-buffer-alist` is the way of the future since `special-display-buffer-names` and `special-display-regexps` are both marked as "obsolete" in Emacs 24.3. – Carl Groner Oct 18 '13 at 22:38
  • Yes, I know, believe me. That doesn't mean it's the only way or the best way, especially for something as simple as this. But feel free to use `display-buffer-alist` -- that's why I mentioned it. ;-) At least in 24.3 you still have doc for special-display -- lots of it, in both manuals. All that's gone for Emacs 24. "On n'arrete pas le progres..." – Drew Oct 18 '13 at 22:47
  • 1
    A dedicated window will indeed work for his bookmark window, but not for his output window, since he wants to dedicate that window to various buffers, whereas Emacs's "dedicated windows" are limited to a single buffer. – Stefan Oct 19 '13 at 01:47
  • @Stefan: Agreed; good point. For that he doesn't want a "dedicated window" in the Emacs sense. – Drew Oct 19 '13 at 02:32
0

Call lockon-window before you open a thing. Call again to undedicate all windows. It is easy to setup sending everything to window:Message; however, to show a buffer to window:Editor-1 from window:Bookmarks+ without calling lockon-window, is too hard with my power. I hope slide-window helps.

Community
  • 1
  • 1