diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-08-21 16:43:39 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2024-08-21 16:43:39 +0100 |
commit | f9d2fdb92805d36bfbf7e59616eca22263677894 (patch) | |
tree | 2f5ef0dd6af317d484f0d214b57090b99243765a /Emacs/.config/emacs | |
parent | 3bbfab5e4f75d2ea1ff5e85cb11405267593910f (diff) | |
download | dotfiles-f9d2fdb92805d36bfbf7e59616eca22263677894.tar.gz dotfiles-f9d2fdb92805d36bfbf7e59616eca22263677894.tar.bz2 dotfiles-f9d2fdb92805d36bfbf7e59616eca22263677894.zip |
(Emacs/elisp/org-bookmark)+org-bookmark/copy-bookmark-url
Just a nice helper function.
Diffstat (limited to 'Emacs/.config/emacs')
-rw-r--r-- | Emacs/.config/emacs/elisp/org-bookmark.el | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/elisp/org-bookmark.el b/Emacs/.config/emacs/elisp/org-bookmark.el index 795e969..aa2a377 100644 --- a/Emacs/.config/emacs/elisp/org-bookmark.el +++ b/Emacs/.config/emacs/elisp/org-bookmark.el @@ -110,6 +110,17 @@ the URL. FUNC is a callable or function which takes one parameter (the URL as a string) and produces some action of opening it.") +(defun org-bookmark/copy-bookmark-url () + "Copy a bookmark's URL." + (interactive) + (let* ((bookmarks (org-bookmark/bookmarks)) + (choice (completing-read "Choose bookmark: " (mapcar #'car bookmarks) nil t)) + (pair (assoc choice bookmarks #'string=))) + (if (null pair) + (error (format "`%s' is not a valid bookmark" choice)) + (message "[bookmark]: Copying bookmark `%s` (`%s`)" (car pair) (cdr pair)) + (kill-new (cdr pair))))) + (defun org-bookmark/open-bookmark () "Open a bookmark. Uses ORG-BOOKMARK/DISPATCH-LIST to dispatch opening the url to some handler function." |