diff --git a/.gitignore b/.gitignore index a71da58..a87c2c4 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ /speed-type /layouts /workspace +/bookmarks \ No newline at end of file diff --git a/config.org b/config.org index 7ffc5df..3e38163 100644 --- a/config.org +++ b/config.org @@ -2658,6 +2658,28 @@ (apply output-func (list (format "%d: %s\n" val key)))) h))) #+end_src +** Custom bookmarks location + #+begin_src emacs-lisp + (bookmark-load "~/.emacs.d/my-bookmarks") + + (defun my/bookmark-set (&optional name no-overwrite) + (interactive (list nil current-prefix-arg)) + (bookmark-set name no-overwrite) + (let* ((buffer (find-file-noselect "~/.emacs.d/my-bookmarks")) + (bookmark (car bookmark-alist)) + (bookmark-name (car bookmark)) + (bookmark-file (file-name-nondirectory (buffer-file-name)))) + (with-current-buffer buffer + (goto-char (point-min)) + (when (not (or (save-excursion (re-search-forward bookmark-name)) + (save-excursion (re-search-forward bookmark-file)))) + (re-search-forward "(") + (insert (pp bookmark)) + (save-buffer) + (kill-buffer))))) + + (global-set-key (kbd "C-x r m") #'my/bookmark-set) + #+end_src * Broken ** mu4e *** General config