mirror of
https://github.com/pestctrl/emacs-config.git
synced 2026-06-14 12:21:20 +00:00
Some elisp for my own bookmarks
This commit is contained in:
parent
3fe4572030
commit
f86743fc45
2 changed files with 23 additions and 0 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -31,3 +31,4 @@
|
||||||
/speed-type
|
/speed-type
|
||||||
/layouts
|
/layouts
|
||||||
/workspace
|
/workspace
|
||||||
|
/bookmarks
|
||||||
22
config.org
22
config.org
|
|
@ -2658,6 +2658,28 @@
|
||||||
(apply output-func (list (format "%d: %s\n" val key))))
|
(apply output-func (list (format "%d: %s\n" val key))))
|
||||||
h)))
|
h)))
|
||||||
#+end_src
|
#+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
|
* Broken
|
||||||
** mu4e
|
** mu4e
|
||||||
*** General config
|
*** General config
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue