wasamasa / eyebrowse

A simple-minded way of managing window configs in emacs
GNU General Public License v3.0
437 stars 24 forks source link

delete-other-windows: Cannot make side window the only window #63

Closed manuel-uberti closed 7 years ago

manuel-uberti commented 7 years ago

Hi,

first of all thanks for this package, it's become a great add to my workflow. I have this setup in my config:

(use-package eyebrowse                  ; Easy workspaces creation and switching
  :ensure t
  :config
  (validate-setq eyebrowse-mode-line-separator " "
                 eyebrowse-new-workspace t)

  (eyebrowse-mode t))

And this is my configuration for display-buffer-alist:

(validate-setq
 display-buffer-alist
 `(
   ;; Messages, errors, Calendar and REPLs in the bottom side window
   (,(rx bos (or "*Help"             ; Help buffers
                 "*Warnings*"        ; Emacs warnings
                 "*Compile-Log*"     ; Emacs byte compiler log
                 "*compilation"      ; Compilation buffers
                 "*Flycheck errors*" ; Flycheck error list
                 "*shell"            ; Shell window
                 "*Calendar"         ; Calendar window
                 "*cider-repl"       ; CIDER REPL
                 "*sly-mrepl"        ; Sly REPL
                 "*scheme"           ; Inferior Scheme REPL
                 "*ielm"             ; IELM REPL
                 "*SQL"              ; SQL REPL
                 "*Cargo"            ; Cargo process buffers
                 "*idris-repl"       ; Idris REPL
                 ;; AUCTeX command output
                 (and (1+ nonl) " output*")
                 ))
    (display-buffer-reuse-window display-buffer-in-side-window)
    (side . bottom)
    (reusable-frames . visible)
    (window-height . 0.4))
   ("\\.pdf$*"
    (display-buffer-reuse-window display-buffer-in-side-window)
    (side . right)
    (reusable-frames . visible)
    (window-width . 0.5))
   ;; Let `display-buffer' reuse visible frames for all buffers.  This must
   ;; be the last entry in `display-buffer-alist', because it overrides any
   ;; later entry with more specific actions.
   ("." nil (reusable-frames . visible))))

If I try to open a new workspace (i.e. C-c C-w 3) from a bottom side window (i.e. a REPL), I get this message:

delete-other-windows: Cannot make side window the only window

The new workspace is open, but instead of seeing the *scratch* buffer as I was expecting by setting eyebrowse-new-workspace t, I see the previous window configuration (the one with the REPL in it).

Emacs version: GNU Emacs 26.0.50 (build 1, x86_64-debian-linux-gnu, GTK+ Version 3.18.9) of 2017-07-26.

If you need more details or further tests, feel free to ask.

wasamasa commented 7 years ago

What kind of REPL? Do you have a minimal repro?

manuel-uberti commented 7 years ago

For instance, CIDER REPL, but it happens with ielm as well. Basically everything I listed here:

(or             "*Help"             ; Help buffers
                 "*Warnings*"        ; Emacs warnings
                 "*Compile-Log*"     ; Emacs byte compiler log
                 "*compilation"      ; Compilation buffers
                 "*Flycheck errors*" ; Flycheck error list
                 "*shell"            ; Shell window
                 "*Calendar"         ; Calendar window
                 "*cider-repl"       ; CIDER REPL
                 "*sly-mrepl"        ; Sly REPL
                 "*scheme"           ; Inferior Scheme REPL
                 "*ielm"             ; IELM REPL
                 "*SQL"              ; SQL REPL
                 "*Cargo"            ; Cargo process buffers
                 "*idris-repl"       ; Idris REPL
                 ;; AUCTeX command output
                 (and (1+ nonl) " output*")
                 )

You can try setting display-buffer-alist for ielm like I did above and try C-c C-w 2 with point active in ielm.

It happens with emacs -Q too:

manuel-uberti commented 7 years ago

I updated the instructions a bit, they were messy and incomplete before, sorry.

Also, another thing to consider: if you place point in the other window (in the aforementioned case: the window "above" ielm), C-c C-w 2 works just fine.

wasamasa commented 7 years ago

What you've described happens because window-state-put deletes all other windows before doing its job, something you can't do if a side window is the active one. If you've selected another window however, the side window gets deleted and everything is fine.

That being said, I cannot reproduce this. Have you made sure you're on the latest version? I've added code for ignoring window parameters last year, that should have taken care of this bug...

manuel-uberti commented 7 years ago

Latest from MELPA: eyebrowse-20170318.1418

manuel-uberti commented 7 years ago

Since you're not able to reproduce it, I guess we can close the issue.