fix: clear bookmark-alist before first project save

This commit is contained in:
2026-07-17 15:24:18 -04:00
parent 453bda34b7
commit 40f8d57609
2 changed files with 14 additions and 10 deletions

View File

@@ -3579,8 +3579,9 @@ Saves only project bookmarks without contaminating global list."
(saved-alist (copy-tree bookmark-alist)))
;; Save globals first, then load project bookmarks
(bookmark-save)
(when (file-exists-p proj-file)
(bookmark-load proj-file t))
(if (file-exists-p proj-file)
(bookmark-load proj-file t)
(setq bookmark-alist nil))
(bookmark-store name `((filename . ,url)) nil)
(bookmark-save nil proj-file)
;; Restore globals
@@ -3620,9 +3621,10 @@ Project bookmarks go to .bookmarks file in project root."
(record (bookmark-make-record)))
;; Save current globals to disk first
(bookmark-save)
;; Load existing .bookmarks (if any)
(when (file-exists-p proj-file)
(bookmark-load proj-file t))
;; Load or init project bookmark alist
(if (file-exists-p proj-file)
(bookmark-load proj-file t)
(setq bookmark-alist nil))
;; Add new bookmark to alist
(bookmark-store name (cdr record) nil)
;; Write ONLY project bookmarks to .bookmarks

View File

@@ -2649,8 +2649,9 @@ Saves only project bookmarks without contaminating global list."
(saved-alist (copy-tree bookmark-alist)))
;; Save globals first, then load project bookmarks
(bookmark-save)
(when (file-exists-p proj-file)
(bookmark-load proj-file t))
(if (file-exists-p proj-file)
(bookmark-load proj-file t)
(setq bookmark-alist nil))
(bookmark-store name `((filename . ,url)) nil)
(bookmark-save nil proj-file)
;; Restore globals
@@ -2690,9 +2691,10 @@ Project bookmarks go to .bookmarks file in project root."
(record (bookmark-make-record)))
;; Save current globals to disk first
(bookmark-save)
;; Load existing .bookmarks (if any)
(when (file-exists-p proj-file)
(bookmark-load proj-file t))
;; Load or init project bookmark alist
(if (file-exists-p proj-file)
(bookmark-load proj-file t)
(setq bookmark-alist nil))
;; Add new bookmark to alist
(bookmark-store name (cdr record) nil)
;; Write ONLY project bookmarks to .bookmarks