Compare commits
4 Commits
73a8e3be4b
...
1ef654788a
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ef654788a | |||
| 54bcd4d6a0 | |||
| 4457921ca9 | |||
| db00b4f3c7 |
10
init.el
10
init.el
@ -572,7 +572,9 @@
|
|||||||
hydra-org-linking/body
|
hydra-org-linking/body
|
||||||
org-dblock-write:db/org-backlinks
|
org-dblock-write:db/org-backlinks
|
||||||
db/org-clock-goto-first-open-checkbox
|
db/org-clock-goto-first-open-checkbox
|
||||||
org-password-manager-get-password-by-id))
|
org-password-manager-get-password-by-id
|
||||||
|
db/org-bookmark-open
|
||||||
|
db/org-bookmark-store-link))
|
||||||
|
|
||||||
;; This is to make the byte-compiler happy about setting some variables later on
|
;; This is to make the byte-compiler happy about setting some variables later on
|
||||||
;; that are defined in those packages.
|
;; that are defined in those packages.
|
||||||
@ -759,6 +761,9 @@
|
|||||||
(browse-url
|
(browse-url
|
||||||
(format "https://www.cve.org/CVERecord?id=CVE-%s"
|
(format "https://www.cve.org/CVERecord?id=CVE-%s"
|
||||||
number))))
|
number))))
|
||||||
|
(org-link-set-parameters "bookmark"
|
||||||
|
:follow #'db/org-bookmark-open
|
||||||
|
:store #'db/org-bookmark-store-link)
|
||||||
(when (eq system-type 'windows-nt)
|
(when (eq system-type 'windows-nt)
|
||||||
(org-link-set-parameters "onenote" :follow #'db/org-onenote-open)
|
(org-link-set-parameters "onenote" :follow #'db/org-onenote-open)
|
||||||
(org-link-set-parameters "outlook" :follow #'db/org-outlook-open))
|
(org-link-set-parameters "outlook" :follow #'db/org-outlook-open))
|
||||||
@ -2353,7 +2358,8 @@ eventuelly be set to nil, however)."
|
|||||||
|
|
||||||
(use-package bookmark
|
(use-package bookmark
|
||||||
:init (setq bookmark-default-file (expand-file-name "bookmarks" emacs-d-userdata)
|
:init (setq bookmark-default-file (expand-file-name "bookmarks" emacs-d-userdata)
|
||||||
bookmark-menu-confirm-deletion t))
|
bookmark-menu-confirm-deletion t
|
||||||
|
bookmark-save-flag 1))
|
||||||
|
|
||||||
(use-package dumb-jump
|
(use-package dumb-jump
|
||||||
:commands (dumb-jump-xref-activate)
|
:commands (dumb-jump-xref-activate)
|
||||||
|
|||||||
@ -2228,20 +2228,20 @@ PARAMS may contain the following values:
|
|||||||
;; The code in this section is based version 1.0 of `ol-bookmark.el' by Tokuya Kameshima;
|
;; The code in this section is based version 1.0 of `ol-bookmark.el' by Tokuya Kameshima;
|
||||||
;; see https://github.com/emacsmirror/org-contrib/blob/bd39cca48b1c4a8a1cdfb1cdd6be2ce700acdd97/lisp/ol-bookmark.el.
|
;; see https://github.com/emacsmirror/org-contrib/blob/bd39cca48b1c4a8a1cdfb1cdd6be2ce700acdd97/lisp/ol-bookmark.el.
|
||||||
|
|
||||||
(org-link-set-parameters "bookmark"
|
(defun db/org-bookmark-open (bookmark _)
|
||||||
:follow #'org-bookmark-open
|
|
||||||
:store #'org-bookmark-store-link)
|
|
||||||
|
|
||||||
(defun org-bookmark-open (bookmark _)
|
|
||||||
"Visit the bookmark BOOKMARK."
|
"Visit the bookmark BOOKMARK."
|
||||||
(bookmark-jump bookmark))
|
(bookmark-jump bookmark))
|
||||||
|
|
||||||
(defun org-bookmark-store-link ()
|
(defun db/org-bookmark-store-link ()
|
||||||
"Store a link to the bookmark at point.
|
"Store a link to the bookmark at point.
|
||||||
|
|
||||||
When in Dired, try to find bookmark that points to the file at
|
When in Dired, try to find bookmark that points to the file at
|
||||||
point. When in a buffer associated with a file, try to find a
|
point. When in a buffer associated with a file, try to find a
|
||||||
bookmark that points to this file."
|
bookmark that points to this file. Note that in this case, for
|
||||||
|
performance reasons, equality checks between file names is not
|
||||||
|
done with `file-equal-p', which seems to be too slow on Windows;
|
||||||
|
a simple `string=' is used instead, which may not be completely
|
||||||
|
accurate in certain cases."
|
||||||
(let (file bookmark bmks)
|
(let (file bookmark bmks)
|
||||||
(cond ((eq major-mode 'dired-mode)
|
(cond ((eq major-mode 'dired-mode)
|
||||||
(setq file (abbreviate-file-name (dired-get-filename))))
|
(setq file (abbreviate-file-name (dired-get-filename))))
|
||||||
@ -2254,7 +2254,7 @@ bookmark that points to this file."
|
|||||||
(when (setq bmks
|
(when (setq bmks
|
||||||
(->> (bookmark-all-names)
|
(->> (bookmark-all-names)
|
||||||
(-map (lambda (name)
|
(-map (lambda (name)
|
||||||
(if (file-equal-p file
|
(if (string= file
|
||||||
(abbreviate-file-name
|
(abbreviate-file-name
|
||||||
(bookmark-location name)))
|
(bookmark-location name)))
|
||||||
name)))
|
name)))
|
||||||
|
|||||||
@ -847,13 +847,15 @@ it."
|
|||||||
(let ((new-record `((filename . ,location)
|
(let ((new-record `((filename . ,location)
|
||||||
(handler . ,handler))))
|
(handler . ,handler))))
|
||||||
(bookmark-update-last-modified new-record)
|
(bookmark-update-last-modified new-record)
|
||||||
(bookmark-store name new-record nil)
|
(bookmark-store name new-record nil)))
|
||||||
(bookmark-save)))
|
|
||||||
|
|
||||||
(defun db/bookmark-browse-url (bmk)
|
(defun db/bookmark-browse-url (bmk)
|
||||||
"Extract filename from bookmark BMK and apply `browse-url' to it."
|
"Extract filename from bookmark BMK and apply `browse-url' to it."
|
||||||
(browse-url (bookmark-get-filename bmk)))
|
(browse-url (bookmark-get-filename bmk)))
|
||||||
|
|
||||||
|
;; https://takeonrules.com/2024/12/17/extending-built-in-emacs-bookmark-package/
|
||||||
|
(put 'db/bookmark-browse-url 'bookmark-handler-type "URL")
|
||||||
|
|
||||||
(defun db/bookmark-system-open (bmk)
|
(defun db/bookmark-system-open (bmk)
|
||||||
"Extract filename from bookmark BMK and apply `db/system-open' to it."
|
"Extract filename from bookmark BMK and apply `db/system-open' to it."
|
||||||
(db/system-open (bookmark-get-filename bmk)))
|
(db/system-open (bookmark-get-filename bmk)))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user