karthink / project-x

Ehancements to Emacs' built in project library.
75 stars 5 forks source link

FYI: Burly does exactly this, but better #2

Closed alphapapa closed 3 years ago

alphapapa commented 3 years ago

Hi,

I just saw your blog post from a few months ago: https://karthinks.com/software/persistent-project-switching-in-emacs/ In it, you say:

Somehow there’s no clear way to bookmark and switch to (across Emacs sessions) a collection of files, buffers and windows together as a unit… or project. ... Between burly, bufler, persp-mode, projectile and various tab libraries I’m sure this hole is covered, but I’m happy with project.el and wanted something much simpler, so I whipped something up.

And in this readme, you say:

While Emacs has many built-in features to save and restore state (bookmarks, desktop, window-configurations and more) none of them allow you to bookmark and switch to, across Emacs sessions, a collection of files, buffers and windows together as a unit… or project.

But that is exactly what Burly does: save and restore buffers, windows, and frames using bookmarks, allowing you to restore them all at once, including previously unopened files. It does so using Emacs's built-in bookmarks system, which allows mode-specific restoration of buffers' position, e.g. scrolling to the right place, or the right heading in an Org buffer, even if it has since moved to another position (it even restores narrowing correctly in Org buffers). And since it uses Emacs bookmarks, any major mode that gains a bookmark-make-record function will gain the ability to have its buffers restored properly with Burly; the functionality is abstracted, so Burly needs no special support for any mode.

The code is actually very simple, and it's designed to be modular, so you could easily use it to implement functionality more specific to project projects if you want.

Please consider, at least, mentioning Burly in your readme in the comparison section. :)

karthink commented 3 years ago

I have a special admiration for packages that integrate into Emacs' built-in APIs and don't force me to learn a new set of metaphors. I'm glad to know Burly is one of them! I meant to check it out but hadn't gotten around to it.

I'll update the README with an alternatives section mentioning this information soon.

karthink commented 3 years ago

Added a note about Burly to the alternatives section.

BTW when I tried out burly-open-bookmark it failed with the following error:

window--state-put-2: Wrong type argument: stringp, nil

Here is the bookmark I was trying to open. It was the scratch buffer, an elisp file and ielm on a frame.

Also, do you have any thoughts about bookmark+?

alphapapa commented 3 years ago

It doesn't appear that ielm has a bookmark-make-record function, so its buffers don't restore with Burly.

Also, do you have any thoughts about bookmark+?

I've never used it. Can you be more specific with your question?