As the ‘elpher-bookmarks-file’ is customizable, one can set it to a
non-existent dir (like ‘~/.emacs.d/etc/elpher/bookrmarks’). This commit just
check that the directory part of ‘elpher-bookrmarks-file’ exists before trying
to save it.
(defun elpher-save-bookmarks (bookmarks)
"Record the bookmark list BOOKMARKS to the user's bookmark file.
Beware that this completely replaces the existing contents of the file."
+ (let ((bookmark-dir (file-name-directory elpher-bookmarks-file)))
+ (unless (file-directory-p bookmark-dir)
+ (make-directory bookmark-dir)))
(with-temp-file elpher-bookmarks-file
(erase-buffer)
(insert "; Elpher bookmarks file\n\n"