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

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

Re: How to force display-buffer-in-side-window to open side window on ri


From: Jean Louis
Subject: Re: How to force display-buffer-in-side-window to open side window on right?
Date: Thu, 2 Feb 2023 22:38:01 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Bruno Barbier <brubar.cs@gmail.com> [2023-02-02 21:13]:
> 
> Jean Louis <bugs@gnu.support> writes:
> 
> >
> > What am I doing wrong?
> 
> At least the following line is wrong:
> 
>          (display-buffer-in-side-window buffer-right '(side right))
> 
> it should be:
> 
>        (display-buffer-in-side-window buffer-right '((side . right)))

Thank you, that is good to understand.

Though I can see tha windows are not equal. So I changed it to:
  (switch-to-buffer-other-window buffer-right)))

and now it works well, but I am not sure how would that be affected by
user options.

(defun rcd-two-windows (buffer-left buffer-right &optional window-register)
  "Display BUFFER-LEFT and BUFFER-RIGHT only.

Previous window configuration is saved register ?r or to optional
WINDOW-REGISTER.

Parent function may restore window configuration by using the
function `jump-to-register' with WINDOW-REGISTER as argument."
  (cond ((and (buffer-live-p buffer-left) (buffer-live-p buffer-right))
         (let ((register (or window-register ?r)))
           (window-configuration-to-register register)
           (switch-to-buffer buffer-left)
           (delete-other-windows)
           ;; (display-buffer-in-side-window buffer-right '((side . right)))))
           (switch-to-buffer-other-window buffer-right)))
        (t (user-error "Buffers `%s' and `%s' must be live" buffer-left 
buffer-right))))


(let ((buffer-left (get-buffer-create "*My Left*"))
      (buffer-right (get-buffer-create "*My Right*")))
  (rcd-two-windows buffer-left buffer-right))

-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



reply via email to

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