summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-09-03 01:06:28 -0500
committerCraig Jennings <c@cjennings.net>2025-09-03 01:06:28 -0500
commit1a8a28e997d28411aa01e92a8b1e69071e1e2d1b (patch)
tree533fee7184077c733fd14cffb622e541cd4f84af /modules
parent35b4fdcd3e94a19cc47d31974e37e5c87ff40c3f (diff)
downloaddotemacs-1a8a28e997d28411aa01e92a8b1e69071e1e2d1b.tar.gz
dotemacs-1a8a28e997d28411aa01e92a8b1e69071e1e2d1b.zip
restored original webclipper functionality
Diffstat (limited to 'modules')
-rw-r--r--modules/org-capture-config.el57
1 files changed, 18 insertions, 39 deletions
diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el
index 55a12e2f..e9a83d9d 100644
--- a/modules/org-capture-config.el
+++ b/modules/org-capture-config.el
@@ -28,19 +28,18 @@
and Returns the yanked content as a string."
(interactive)
(let* ((source-buffer (org-capture-get :original-buffer))
- (source-mode (with-current-buffer source-buffer major-mode)))
- (cond
- ((eq source-mode 'w3m-mode)
- (with-current-buffer source-buffer
- (org-w3m-copy-for-org-mode)))
- ((eq source-mode 'eww-mode)
- (with-current-buffer source-buffer
- (org-eww-copy-for-org-mode)))
- (t
- (error "Not valid -- must be in w3m or eww mode")))
- ;; extract the webpage content from the kill ring
- (car kill-ring)))
-
+ (source-mode (with-current-buffer source-buffer major-mode)))
+ (cond
+ ((eq source-mode 'w3m-mode)
+ (with-current-buffer source-buffer
+ (org-w3m-copy-for-org-mode)))
+ ((eq source-mode 'eww-mode)
+ (with-current-buffer source-buffer
+ (org-eww-copy-for-org-mode)))
+ (t
+ (error "Not valid -- must be in w3m or eww mode")))
+ ;; extract the webpage content from the kill ring
+ (car kill-ring)))
;; ----------------------- Org Capture PDF Active Region -----------------------
;; allows capturing the selected region from within a PDF file.
@@ -108,35 +107,15 @@ Captured On: %U"
("s" "Shopping List Entry" entry
(file+headline inbox-file "Shopping List") "* %?")
- ;; requires cj/org-web-clipper function defined above
- ("w" "Web Page Clipper" plain
- (function cj/org-roam-capture-webclip)
- "" :immediate-finish t)
+ ;; requires cj/org-web-clipper function defined above
+ ("w" "Web Page Clipper" entry
+ (file+headline inbox-file "To Read")
+ "* %a\nURL: %L\nCaptured On:%U\n%(cj/org-webpage-clipper)\n"
+ :prepend t :immediate-finish t)
+
)) ;; end setq
) ;; end use-package org-protocol
-;; -------------------------- Org-Roam-Capture-Webclip -------------------------
-
-(defun cj/org-roam-capture-webclip ()
- "Capture current webpage as an org-roam node with webclipped tag."
- (let* ((url (plist-get org-store-link-plist :link))
- (title (or (plist-get org-store-link-plist :description) ""))
- (body (cj/org-webpage-clipper)))
- (org-roam-capture- :node (org-roam-node-create :title title)
- :templates '(("w" "webclip" plain "%?"
- :if-new (file+head "%<%Y%m%d%H%M%S>-${slug}.org"
- "#+TITLE: ${title}
-#+FILETAGS: webclipped
-#+ROAM_KEY: ${url}
-URL: ${url}
-Captured On: %U
-
-${body}")
- :unnarrowed t
- :immediate-finish t))
- :props =(:url ,url
- :body ,body))))
-
;; ---------------------------- Simple Task Capture ----------------------------
;; the simplest way to capture a task. Also a simple way to write this function.