fix: clear bookmark-alist before first project save
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user