summaryrefslogtreecommitdiff
path: root/common.el
diff options
context:
space:
mode:
Diffstat (limited to 'common.el')
-rw-r--r--common.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/common.el b/common.el
index fd317ad..550f16c 100644
--- a/common.el
+++ b/common.el
@@ -426,6 +426,20 @@ mark at the end for the first yank."
(define-key ctl-x-r-map (vector ?p) #'point-to-register)
+;;; Save anonymous bookmark in a register
+
+(load-after-function bookmark-make-record "bookmark-conf.el"
+ "Fake function that loads bookmarks." nil)
+
+(defun durand-bookmark-to-register (register)
+ "Store an anonymous bookmark in register REGISTER.
+Use \\[jump-to-register] to jump to the bookmark."
+ (interactive
+ (list (register-read-with-preview "Bookmark to register: ")))
+ (set-register register (cons 'bookmark (bookmark-make-record))))
+
+(define-key ctl-x-r-map (vector ?B) #'durand-bookmark-to-register)
+
;;; Intentionally disable some key-bindings.
;; Using byte-code is fun.