help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: launch a program in an arbitrary frame


From: Drew Adams
Subject: RE: launch a program in an arbitrary frame
Date: Fri, 17 Jul 2015 22:22:35 -0700 (PDT)

> I often run ERC to connect to IM services via a local Bitlbee daemon.
> It works best running in its own frame, so I know when people are
> talking to me without having to flip through all my buffers.  (A window
> doesn't seem to be sufficient, since Gnus keeps changing the window
> layout to its Summary/Article split, and the only way I've found to deal
> with that is to keep programs whose layout I care about in separate
> frames.)
> 
> Anyway, it's redundant to have to manually put ERC in its own frame
> every time I launch it.
> 
> I have somethink like this bound to a key:
> 
>   (erc :server "localhost")
> 
> Some programs have the ability to launch in a new frame built into them,
> but shouldn't you be able to do that with almost any program?  If I
> wanted to run the above in an 80x24 frame at a particular X coordinate,
> how would I say that in Elisp?

Here is one possibility perhaps (I don't use ERC).

Find out what the name of the buffer is that you want to have its own
frame.  Then just customize option `special-display-buffer-names' to
include that name.

(If there are multiple such buffers then either add each of their
names to that option value or, if the buffer names follow a simple
pattern, add a regexp that matches those names to the value of option
`special-display-regexps'.)

`C-h v' will tell you info about these user options.  It will also
tell you that Emacs considers them to be deprecated in favor of
(hyper-complex) option `display-buffer-alist'.  If you prefer to
wrestle with that option then go ahead.

To me, `special-display-buffer-names' is super simple, and it does
just what it says it does.  And of course "deprecated" does not
mean "unsupported" - it still works fine, thank goodness.  Anyway,
it's your choice.  If you need help with `display-buffer-alist',
hopefully someone else will have some advice.  My 2 cents is bet
on `special-display-buffer-names'.

By default, a "special-display" buffer is shown in its own frame.
Specifically, as `C-h v special-display-buffer-names' tells you, it:

 "displays the buffer in a way specified by `special-display-function'.
 `special-display-popup-frame' (the default for `special-display-function')
 usually displays the buffer in a separate frame made with the parameters
 specified by `special-display-frame-alist'.

So try customizing option `special-display-buffer-names'.  You can
also customize `special-display-frame-alist', if you want the frame
to have certain properties (e.g. different background color or whatever).



reply via email to

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