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: Eric S Fraga
Subject: Re: display-buffer-alist actions
Date: Thu, 25 Feb 2021 16:34:08 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On Wednesday, 24 Feb 2021 at 16:15, Stefan Monnier wrote:
> So the middle entry is only used when `my-current-monitor-is-tall`
> returns non-nil.

Ah, interesting.  I took the more simple approach (for me):

#+begin_src emacs-lisp
  (defun esf/display-buffer-in-side-window (buffer alist)
    ;; (message "here we are with alist=%s" alist)
    ;; (message "frame width=%d height=%d" (frame-width) (frame-height))
    (if (> (frame-width) 100)
        (display-buffer-in-side-window buffer '((window-width . 0.28)
                                                (side . left)
                                                (slot . 0)))
      (display-buffer-in-side-window buffer '((window-height . 0.25)
                                              (side . bottom)
                                              (slot . 0)))))
  (setq display-buffer-alist
        '(("^\\*Async Shell Command*" . (display-buffer-no-window))
          ("\\*[Hh]elp\\*" . (esf/display-buffer-in-side-window))))
#+end_src 

(elided for clarity)

Thank you all that pointed me in the right direction!
-- 
Eric S Fraga via Emacs 28.0.50 & org 9.4.4 on Debian bullseye/sid




reply via email to

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