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

Bookmarks created by burly.el, can not read by emacs 28.0.90 after emacs restarted, but those bookmarks can be found when run command `list-bookmarks` #46

Closed zw963 closed 11 months ago

zw963 commented 2 years ago

I create some bookmarks use burly. it works, i can saw those bookmarks saved on my ~/.emacs.d/bookmarks.

sure i can restore those bookmarks if i am not restart emacs.

but, when i reboot my emacs, then run burly-bookmark-windows, i get nothing.

Following is a ivy screenshot.

image

Then, when i run list-bookmarks, i can see bookmarks there.

image

I can restore bookmarks pressing enter on it.

In fact, when i try to rerun burly-bookmark-window, i saw those bookmarks again.

image

I can try fix it with add following code into (bury-bookmark-names) method.

image

But, there maybe a better solution.

Thank you.

alphapapa commented 2 years ago

Hi,

Thanks, maybe something changed in Emacs 28 about the way bookmarks are loaded, and calling list-bookmarks happens to fix it. Could you check the emacs.git log and see if there is a commit that seems to be related?

ParetoOptimalDev commented 2 years ago

I checked emacs.git's log and didn't see anything obvious, but will post it shortly.

I also noticed that having a scratch buffer in org-mode seems to make burly fail for some reason, but perhaps that should be it's own issue.

Going to see the diff between the values in emacs27/emacs28 where the error is happening and post that as well.

ParetoOptimalDev commented 2 years ago

I can reproduce this in emacs 27.2 with emacs -Q and burly-20211005.1159.

It's because bookmark-alist is null and list-bookmarks calls (bookmark-maybe-load-default-file) and populates it when you execute list-bookmarks.

Should burly also call bookmarks-maybe-load-default-file? I'm guessing many users are using desktop-save-mode and wouldn't have noticed this.

alphapapa commented 2 years ago

but, when i reboot my emacs, then run burly-bookmark-windows, i get nothing.

IIUC, the bug here, to the extent that there is one, is that, if burly-bookmark-windows is executed before list-bookmarks is executed (or any other command that causes the bookmarks file to be loaded), there are no Burly bookmarks listed as completion candidates for the bookmark-creating command.

However, this does not mean that already-created bookmarks are unreadable, as the issue title describes.

Do I understand correctly?

zw963 commented 2 years ago

However, this does not mean that already-created bookmarks are unreadable, as the issue title describes.

Yes, you can consider it as unvisible by burly.el only before run list-bookmarks.

tfree87 commented 2 years ago

I am seeing this behavior in my Emacs 28 as well as I have recently removed desktop-save-mode from my configuration.

It does appear that Burly cannot access the bookmarks and it is not just a lack of completion candidates. If I manually type a bookmark that I know exists (e.g. Burly: test), it will give the error message Invalid bookmark Burly: test.

tfree87 commented 2 years ago

I am a user of Consult and I found looking through the code for that project that, as @ParetoOptimalDev mentioned, the function (bookmark-maybe-load-default-file) is utilized to intialize the bookmarks and get a list of completion candidates for consult-bookmarks.

I have added this function to the definition of burly-bookmark-names and tested it and it works in populating the list of bookmarks for Burly. I will add this to my fork and create a pull request.

alphapapa commented 11 months ago

Thanks to all.