alphapapa / burly.el

Save and restore frames and windows with their buffers in Emacs
GNU General Public License v3.0
301 stars 14 forks source link

Process buffers are not restorable #30

Closed tumashu closed 1 month ago

tumashu commented 3 years ago
Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  get-buffer(nil)
  window--state-put-2(nil 818)
  window-state-put((((min-height . 20) (min-width . 60) (min-height-ignore . 4) (min-width-ignore . 4) (min-height-safe . 2) (min-width-safe . 2) (min-pixel-height . 440) (min-pixel-width . 600) (min-pixel-height-ignore . 88) (min-pixel-width-ignore . 40) (min-pixel-height-safe . 44) (min-pixel-width-safe . 20)) vc (pixel-width . 1600) (pixel-height . 818) (total-width . 160) (total-height . 37) (normal-height . 1.0) (normal-width . 1.0) (combination-limit) (leaf (pixel-width . 1600) (pixel-height . 400) (total-width . 160) (total-height . 18) (normal-height . 0.5) (normal-width . 1.0) (parameters (burly-url . "emacs+burly+bookmark://gywjw-einvoice.py?filename=...")) (buffer #<buffer gywjw-einvoice.py> (selected . t) (hscroll . 0) (fringes 8 8 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 1) (start . 1)) (prev-buffers ("*Org Agenda*" 1 19) ("winner.el.gz" 11098 11650) ("*scratch*" 1 1))) (leaf (last . t) (pixel-width . 1600) (pixel-height . 418) (total-width . 160) (total-height . 19) (normal-height . 0.5) (normal-width . 1.0) (parameters (burly-url . "emacs+burly+name://?*Python*")) (buffer nil (selected) (hscroll . 0) (fringes 8 8 nil nil) (margins nil) (scroll-bars nil 0 t nil 0 t nil) (vscroll . 0) (dedicated) (point . 190) (start . 1)) (prev-buffers ("*Org Agenda*" 1 19)))) #<window 37 on  *temp*>)
  burly--windows-set(#s(url :type "emacs+burly+windows" :user nil :password nil :host nil :portspec nil :filename "?%28%28%28min-height%20.%2020%29%20%28min-width%20..." :target nil :attributes nil :fullness nil :silent nil :use-cookies t :asynchronous t))
  burly-open-url("emacs+burly+windows:?%28%28%28min-height%20.%2020%...")
  burly-bookmark-handler(("burly:python" (url . "emacs+burly+windows:?%28%28%28min-height%20.%2020%...") (handler . burly-bookmark-handler)))
  bookmark-handle-bookmark("burly:python")
  bookmark--jump-via("burly:python" pop-to-buffer-same-window)
  bookmark-jump("burly:python")
  burly-open-bookmark("burly:python")
  (let* ((n (- (length bookmarks) 1)) (pos (or eh-burly-bookmark-position 0)) (bookmark (nth pos bookmarks))) (burly-open-bookmark bookmark) (message "Revert to bookmark: %S" bookmark) (setq eh-burly-bookmark-position (if (>= pos n) 0 (1+ pos))))
  (if bookmarks (let* ((n (- (length bookmarks) 1)) (pos (or eh-burly-bookmark-position 0)) (bookmark (nth pos bookmarks))) (burly-open-bookmark bookmark) (message "Revert to bookmark: %S" bookmark) (setq eh-burly-bookmark-position (if (>= pos n) 0 (1+ pos)))) (burly-bookmark-windows "burly:0") (message "Create bookmark: burly:0") (setq eh-burly-bookmark-position nil))
  (let ((bookmarks (burly-bookmark-names))) (if bookmarks (let* ((n (- (length bookmarks) 1)) (pos (or eh-burly-bookmark-position 0)) (bookmark (nth pos bookmarks))) (burly-open-bookmark bookmark) (message "Revert to bookmark: %S" bookmark) (setq eh-burly-bookmark-position (if (>= pos n) 0 (1+ pos)))) (burly-bookmark-windows "burly:0") (message "Create bookmark: burly:0") (setq eh-burly-bookmark-position nil)))
  eh-burly-open-bookmark()
  funcall-interactively(eh-burly-open-bookmark)
  command-execute(eh-burly-open-bookmark)
alphapapa commented 3 years ago

Thanks for the backtrace. Can you figure out why the error occurs? What about that buffer makes it seem to be unrestoreable? Can you reproduce the problem in a clean Emacs config with only Burly installed?

tumashu commented 3 years ago
  1. open a python file.
  2. C-c C-p open python buffer
  3. burly bookmark window as burly:test
  4. kill python buffer
  5. burly open bookmark burly:test will error.
tumashu commented 3 years ago
Can you reproduce the problem in a clean Emacs config with only Burly installed?

emacs -Q can reproduce this problem

alphapapa commented 3 years ago

So by "Python buffer" you mean a Python process buffer, not a buffer containing Python code.

And rather than fix the problem of Python process buffers being unrestorable, you'd rather that the scratch buffer be restored in its place.

I would rather attempt to make process buffers properly restorable.

tumashu commented 3 years ago

Python process buffer is an example, we can add support to it, but we can not add support to all special mode...

alphapapa commented 1 year ago

AFAIK Burly should now restore such a window configuration with a warning rather than an error.

@tumashu What do you think? Thanks.