wasamasa / eyebrowse

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

Attempting to change window configs during hydra activation causes eyebrowse to not be able to change any more in the future #62

Closed dakrone closed 7 years ago

dakrone commented 7 years ago

I happened to have a single-line hydra open when I hit the keybinding to change to the next eyebrowse window config. It did change, however, now every time I try to go to a different config I get the following error:

Debugger entered--Lisp error: (error "Window #<window 6417 on  *temp*-934863> too small for splitting")
  signal(error ("Window #<window 6417 on  *temp*-934863> too small for splitting"))
  error("Window %s too small for splitting" #<window 6417 on  *temp*-934863>)
  split-window(#<window 6417 on  *temp*-934863> 1005 nil 1019)
  window--state-put-1((vc (pixel-width . 1920) (pixel-height . 1019) (total-width . 274) (total-height . 73) (normal-height . 1.0) (normal-width . 1.0) (combination-limit) (leaf (pixel-width . 1920) (pixel-height . 1005) (total-width . 274) (total-height . 72) (normal-height . 0.9862610402355251) (normal-width . 1.0) (buffer "*compilation*" (selected . t) (hscroll . 0) (fringes 4 4 t) (margins nil) (scroll-bars nil 0 t nil 0 t) (vscroll . 0) (dedicated) (point . 29106) (start . 25973))) (leaf (last . t) (pixel-width . 1920) (pixel-height . 14) (total-width . 274) (total-height . 1) (normal-height . 0.013738959764474975) (normal-width . 1.0) (buffer "*scratch*" (selected) (hscroll . 0) (fringes 4 4 t) (margins nil) (scroll-bars nil 0 t nil 0 t) (vscroll . 0) (dedicated . t) (point . 1) (start . 1)))) #<window 6417 on  *temp*-934863> nil t 1019)
  window-state-put((((min-height . 5) (min-width . 274) (min-height-ignore . 3) (min-width-ignore . 4) (min-height-safe . 2) (min-width-safe . 2) (min-pixel-height . 70) (min-pixel-width . 1920) (min-pixel-height-ignore . 42) (min-pixel-width-ignore . 28) (min-pixel-height-safe . 28) (min-pixel-width-safe . 14)) vc (pixel-width . 1920) (pixel-height . 1019) (total-width . 274) (total-height . 73) (normal-height . 1.0) (normal-width . 1.0) (combination-limit) (leaf (pixel-width . 1920) (pixel-height . 1005) (total-width . 274) (total-height . 72) (normal-height . 0.9862610402355251) (normal-width . 1.0) (buffer "*compilation*" (selected . t) (hscroll . 0) (fringes 4 4 t) (margins nil) (scroll-bars nil 0 t nil 0 t) (vscroll . 0) (dedicated) (point . 29106) (start . 25973))) (leaf (last . t) (pixel-width . 1920) (pixel-height . 14) (total-width . 274) (total-height . 1) (normal-height . 0.013738959764474975) (normal-width . 1.0) (buffer "*scratch*" (selected) (hscroll . 0) (fringes 4 4 t) (margins nil) (scroll-bars nil 0 t nil 0 t) (vscroll . 0) (dedicated . t) (point . 1) (start . 1)))) #<window 6417 on  *temp*-934863> safe)
  eyebrowse--load-window-config(1)
  eyebrowse-switch-to-window-config(1)
  eyebrowse-next-window-config(nil)
  funcall-interactively(eyebrowse-next-window-config nil)
  call-interactively(eyebrowse-next-window-config nil nil)
  command-execute(eyebrowse-next-window-config)
wasamasa commented 7 years ago

I cannot reproduce it with this alone, can you give a proper repro, including the hydra?

dakrone commented 7 years ago

Sure:

Here's by eyebrowse config:

(use-package eyebrowse
  :ensure t
  :init
  (progn
    (defun eos/create-eyebrowse-setup ()
      (interactive)
      "Create a default window config, if none is present"
      (when (not (eyebrowse--window-config-present-p 4))
        ;; there's probably a better way to do this, creating four workspaces
        (eyebrowse-switch-to-window-config-2)
        (eyebrowse-switch-to-window-config-3)
        (eyebrowse-switch-to-window-config-4)
        (eyebrowse-switch-to-window-config-1)))
    (setq eyebrowse-wrap-around t
          eyebrowse-new-workspace t)
    (eyebrowse-mode 1)
    (global-set-key (kbd "C-'") 'eyebrowse-next-window-config)
    (add-hook 'after-init-hook #'eos/create-eyebrowse-setup)))

And the hydra:

(defhydra eos/nav-mode (:foreign-keys run)
  "[NAV-MODE] q or i to exit"
  ("C-h" hl-line-mode)
  ("t" toggle-truncate-lines)
  ("a" beginning-of-line)
  ("l" forward-char)
  ("h" backward-char)
  ("n" next-line)
  ("j" next-line)
  ("p" previous-line)
  ("k" previous-line)
  ("e" View-scroll-half-page-forward)
  ("u" View-scroll-half-page-backward)
  ("SPC" scroll-up-command)
  ("S-SPC" scroll-down-command)
  ("<" beginning-of-buffer)
  (">" end-of-buffer)
  ("." end-of-buffer)
  ("d" (when (y-or-n-p "Kill buffer?")
         (kill-this-buffer))
   :exit t)
  ("/" isearch-forward-regexp :exit t)
  ("?" isearch-backward-regexp :exit t)
  ("i" nil :exit t)
  ("q" nil :exit t))

(global-set-key (kbd "M-V") 'eos/nav-mode/body)
  1. Start Emacs, 4 eyebrowse configs are created
  2. Hit M-V to start the hydra
  3. Hit C-', now on window config 2
  4. Hit C-', now on window config 3
  5. Hit C-', now on window config 4
  6. Hit C-' (to wrap around back to config 1), Emacs complains: split-window: Window #<window 3 on *temp*> too small for splitting
wasamasa commented 7 years ago

Hm, I've tried reproducing it by putting your config into a .emacs file, booting Emacs with it and following the steps, but no dice. Could it be that you're on an old version where the bug is still present? Please try upgrading to the latest version.

wasamasa commented 7 years ago

Closing as I cannot repro this.