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

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

Re: display-buffer-alist actions


From: Joost Kremers
Subject: Re: display-buffer-alist actions
Date: Wed, 24 Feb 2021 20:52:03 +0100
User-agent: mu4e 1.5.8; emacs 27.1.91

On Wed, Feb 24 2021, Eric S Fraga wrote:
> Hello all,
>
> I've read and re-read the documentation for display-buffer-alist and I
> cannot quite understand it.

Yes, it's the easiest thing to grok. I've found Protesilaos Stavrou's comments
and Youtube video on the topic helpful:

https://protesilaos.com/dotemacs/#h:12591f89-eeea-4b12-93e8-9293504e5a12

>  I have the following, which works:
>
> #+begin_src emacs-lisp
>   (setq display-buffer-alist
>         '(("^\\*Async Shell Command*" . (display-buffer-no-window))
>           ("some regexp that works fine"
>            (display-buffer-in-side-window)
>            (window-width . 0.28)
>            (side . left)
>            (slot . 0))))
> #+end_src 
>
> I have two monitors, one in landscape for which the above is ideal,
> although I do not quite understand it.  I got it from somewhere on the
> Interweb...

Watch Protesilaos' video and I think you'll understand better.

> In any case, my other monitor is portrait and I would rather set the
> width and the side to be bottom for windows on that monitor.  Is it
> possible to have a conditional of some sort in the list of conses, one
> where I would look at the frame width and height?

IIUC no, the actions (the conses you mention) don't have conditionals. What you
could do, however, is write your own display-buffer function, which checks the
frame dimensions and calls `display-buffer-side-window` with either `(side .
left)` or `(side . bottom)`.



-- 
Joost Kremers
Life has its moments



reply via email to

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