mmontone / emacs-inspector

Inspection tool for Emacs Lisp objects.
GNU General Public License v3.0
107 stars 9 forks source link

Better quit-window behavior #2

Closed casouri closed 2 years ago

casouri commented 3 years ago

Thanks for writing this package, it is immensely helpful when writing programs involving cl-structs! I think the quit-window behavior could be improved. For example, if the inspector buffer reused the window that was displaying another buffer, it should return to that previous buffer when quitting; and it the inspector created a new window, it should delete that window when quitting. Ie, something like this:

(defun inspector-quit ()
    "Quit the Emacs inspector."
    (interactive)
    (setq inspector-history nil)
    (if (window-prev-buffers)
        (quit-window)
      (delete-window))
    (kill-buffer "*inspector*"))

That's just my preference, of course.

Btw, I think such an essential feature should be included in Emacs, do you want to contribute this package to ELPA or perhaps even Emacs core?

mmontone commented 3 years ago

Hello.

I'll give your suggestion a try. Thanks.

About contributing to ELPA or Emacs, yes, I would like to. I think I'd need to go through all the listed Emacs Lisp data types to be sure I've implemented methods to inspect them. I perhaps should consider implementing units tests too.

I haven't added to ELPA or Emacs yet because they have requirements, and I haven't been putting lots of time on this project lately.

mmontone commented 2 years ago

@casouri I've implemented your suggestion for quit behaviour