Add org-board for bookmark management

This commit is contained in:
Jeremy Dormitzer 2020-02-04 11:14:04 -05:00
parent f478237e37
commit de348156e0

View File

@ -1412,8 +1412,41 @@ Always open directory links in Emacs instead of Finder:
:general
(org-brain-visualize-mode-map "SPC" leader-map))
#+end_src
** Capture templates
#+BEGIN_SRC emacs-lisp
(defvar org-capture-bookmark-last-url nil)
(defun org-capture-bookmark-link ()
"Returns an org-mode link. If it finds
a valid URL on the clipboard it uses that;
otherwise, it prompts for a URL."
(let* ((clip (org-cliplink-clipboard-content))
(parsed (url-generic-parse-url clip))
(url (if (url-type parsed)
clip
(read-string "Bookmark URL: ")))
(title (or (org-cliplink-retrieve-title-synchronously url)
(read-string "Bookmark title: "))))
(setq org-capture-bookmark-last-url url)
(format "[[%s][%s]]" url title)))
(defun org-capture-bookmark-after-finalize ()
"Runs `org-board-new' on the captured entry."
(let ((success (not org-note-abort))
(key (plist-get org-capture-plist :key))
(desc (plist-get org-capture-plist :description)))
(when (and success
(equal key "b")
(equal desc "Bookmark")
org-capture-bookmark-last-url)
(org-board-new org-capture-bookmark-last-url)
(setq org-capture-bookmark-last-url nil))))
(with-eval-after-load 'org
(add-hook 'org-capture-prepare-finalize-hook
#'org-capture-bookmark-after-finalize))
(setq org-capture-templates
`(("L" "Lola task" entry
(file+headline ,(agenda-files "todo.org") "Lola")
@ -1430,11 +1463,16 @@ Always open directory links in Emacs instead of Finder:
("p" "Project" entry
(file ,(agenda-files "notes.org"))
"* %^{Project name}\n\n** What's it supposed to do?\n%?\n** How can I test that it works?\n\n** How can I test that it didn't break anything?\n\n** What alternative approaches are there - what trade-offs can be made?\n\n** What assumptions have I made?\n\n** What deployables will I need to deploy?\n")
("b" "Brain" plain (function org-brain-goto-end)
("B" "Brain" plain (function org-brain-goto-end)
"* %i%?" :empty-lines 1)
("l" "Log" entry
(file ,(agenda-files "log.org"))
"* %<%Y-%m-%d %H:%M:%S>%?")))
"* %<%Y-%m-%d %H:%M:%S>%?")
("b" "Bookmark" entry
(file ,(concat (get-dropbox-directory)
"/org/deft/bookmarks.org"))
"* %(org-capture-bookmark-link)"
:empty-lines 1)))
#+END_SRC
** Refile targets
@ -1726,7 +1764,6 @@ Filter out the "u" from unicode results in org tabels returned from Python sourc
res))))
#+END_SRC
** Images
#+BEGIN_SRC emacs-lisp
(setq org-image-actual-width nil)
@ -1818,6 +1855,38 @@ Intelligently inserts an org-mode link from the clipboard.
(org-mode-map "C-c C-S-l" #'org-cliplink))
#+END_SRC
* org-board
[[https://github.com/scallywag/org-board][Org-board]] is a bookmarking/archiving system built on Org mode:
#+BEGIN_SRC emacs-lisp
(use-package org-board
:defer t
:general
(org-mode-map "C-c b" org-board-keymap))
#+END_SRC
* org-rifle
Quickly find stuff in Org files:
#+BEGIN_SRC emacs-lisp
(use-package helm-org-rifle
:defer t
:init
(defvar helm-org-rifle-commands-map (make-sparse-keymap))
(general-def helm-org-rifle-commands-map
"r" #'helm-org-rifle
"a" #'helm-org-rifle-agenda-files
"b" #'helm-org-rifle-current-buffer
"d" #'helm-org-rifle-directories
"f" #'helm-org-rifle-files
"o" #'helm-org-rifle-org-directory
"R" #'helm-org-rifle-occur
"A" #'helm-org-rifle-occur-agenda-files
"B" #'helm-org-rifle-occur-current-buffer
"D" #'helm-org-rifle-occur-directories
"F" #'helm-org-rifle-occur-files
"O" #'helm-org-rifle-occur-org-directory)
(leader-def-key "or" helm-org-rifle-commands-map))
#+END_SRC
* Projectile
#+BEGIN_SRC emacs-lisp
(use-package projectile