wasamasa / eyebrowse

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

(wrong-type-argument listp 79) #74

Closed manuel-uberti closed 6 years ago

manuel-uberti commented 6 years ago

Hi,

I just upgraded eyebrowse from MELPA, taking in the change discussed here.

Now when I am in workspace 1 and hit C-c C-w 2, I get this error:

Debugger entered--Lisp error: (wrong-type-argument listp 79)
  eyebrowse--walk-window-config((nil . 79) #f(compiled-function (item) #<bytecode 0x12ea5b1>))
  eyebrowse--walk-window-config(("project.clj" (selected . t) (hscroll . 0) (fringes 8 8 t) (margins nil . 79) (scroll-bars nil 0 t nil 0 t) (vscroll . 0) (dedicated) (point . 1295) (start . 486)) #f(compiled-function (item) #<bytecode 0x12ea5b1>))
  eyebrowse--walk-window-config((((min-height . 4) (min-width . 82) (min-height-ignore . 3) (min-width-ignore . 82) (min-height-safe . 1) (min-width-safe . 2) (min-pixel-height . 188) (min-pixel-width . 1640) (min-pixel-height-ignore . 141) (min-pixel-width-ignore . 1640) (min-pixel-height-safe . 47) (min-pixel-width-safe . 40)) leaf (pixel-width . 3200) (pixel-height . 1705) (total-width . 160) (total-height . 36) (normal-height . 1.0) (normal-width . 1.0) (buffer "project.clj" (selected . t) (hscroll . 0) (fringes 8 8 t) (margins nil . 79) (scroll-bars nil 0 t nil 0 t) (vscroll . 0) (dedicated) (point . 1295) (start . 486))) #f(compiled-function (item) #<bytecode 0x12ea5b1>))
  eyebrowse--fixup-window-config((((min-height . 4) (min-width . 82) (min-height-ignore . 3) (min-width-ignore . 82) (min-height-safe . 1) (min-width-safe . 2) (min-pixel-height . 188) (min-pixel-width . 1640) (min-pixel-height-ignore . 141) (min-pixel-width-ignore . 1640) (min-pixel-height-safe . 47) (min-pixel-width-safe . 40)) leaf (pixel-width . 3200) (pixel-height . 1705) (total-width . 160) (total-height . 36) (normal-height . 1.0) (normal-width . 1.0) (buffer "project.clj" (selected . t) (hscroll . 0) (fringes 8 8 t) (margins nil . 79) (scroll-bars nil 0 t nil 0 t) (vscroll . 0) (dedicated) (point . 1295) (start . 486))))
  eyebrowse--load-window-config(2)
  eyebrowse-switch-to-window-config(2)
  eyebrowse-switch-to-window-config-2()
  funcall-interactively(eyebrowse-switch-to-window-config-2)
  call-interactively(eyebrowse-switch-to-window-config-2 nil nil)
  #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x24d5ab>)(eyebrowse-switch-to-window-config-2 nil nil nil)
  ad-Advice-command-execute(#f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x24d5ab>) eyebrowse-switch-to-window-config-2)
  apply(ad-Advice-command-execute #f(compiled-function (cmd &optional record-flag keys special) "Execute CMD as an editor command.\nCMD must be a symbol that satisfies the `commandp' predicate.\nOptional second arg RECORD-FLAG non-nil\nmeans unconditionally put this command in the variable `command-history'.\nOtherwise, that is done only if an arg is read using the minibuffer.\nThe argument KEYS specifies the value to use instead of (this-command-keys)\nwhen reading the arguments; if it is nil, (this-command-keys) is used.\nThe argument SPECIAL, if non-nil, means that this command is executing\na special event, so ignore the prefix argument and don't clear it." #<bytecode 0x24d5ab>) eyebrowse-switch-to-window-config-2)
  command-execute(eyebrowse-switch-to-window-config-2)

This my Emacs version: GNU Emacs 27.0.50 (build 1, x86_64-debian-linux-gnu, GTK+ Version 3.18.9) of 2017-11-23.

And this is how I set up eyebrowse:

(use-package eyebrowse                  ; Easy workspaces creation and switching
  :ensure t
  :init (eyebrowse-mode t)
  :config
  (validate-setq
   eyebrowse-mode-line-separator " "
   eyebrowse-mode-line-style 'always
   eyebrowse-new-workspace t
   eyebrowse-wrap-around t))
manuel-uberti commented 6 years ago

FWIW, it is not happening with emacs -Q, so it should be just a problem in my configuration.

wasamasa commented 6 years ago

Ouch, your serialized window config has an improper list there. I didn't notice because I never tested with margins on and can reproduce it this way.

manuel-uberti commented 6 years ago

Any hint on how I can fix it?

wasamasa commented 6 years ago

Fixed in 0.7.7.

manuel-uberti commented 6 years ago

Just for the sake of debugging this: does it have something to do with display-buffer-alist?

wasamasa commented 6 years ago

No, it has to do with whatever (window-state-get) returns for you. My code foolishly assumes that every list in that tree can be traversed with dolist which is not the case, you have a margin specification there that isn't nil-terminated, so dolist blows up. I've added a check for improperly terminated lists which is a rather yucky bandaid, but will do it in the face of less than clearly specified trees.

manuel-uberti commented 6 years ago

Thanks for the support and the quick fix. Sorry to bring out such a corner case. :)

manuel-uberti commented 6 years ago

I can confirm your fix works. Thanks again.