abo-abo / hydra

make Emacs bindings that stick around

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lv window prevents `display-buffer-in-side-window` from working

Alexander-Miller opened this issue · comments

When an lv message is visible it is no longer possible to display a buffer in a side window with a left or right position.

Can be reproduced in emacs -q like this:

(progn
  (lv-message "TEST")
  (display-buffer-in-side-window (get-buffer-create "TEST") `((side . left))))

The test buffer is not shown, the display-buffer-in-side-window returns nil.

This is due to window-size-fixed, which was introduced to fix #64.

Here is a possible work-around:

(let ((lv-wnd
         (cl-find-if
          (lambda (w) (equal " *LV*" (buffer-name (window-buffer w))))
          (window-list))))
    (if lv-wnd
        (progn
          (with-current-buffer (window-buffer lv-wnd)
            (setq window-size-fixed nil))
          (display-buffer-in-side-window (get-buffer-create "TEST") `((side . left)))
          (with-current-buffer (window-buffer lv-wnd)
            (setq window-size-fixed t)))
      (display-buffer-in-side-window (get-buffer-create "TEST") `((side . left)))))

That does it, thanks.