diff options
-rw-r--r-- | custom/jao-custom-gnus.el | 24 | ||||
-rw-r--r-- | lib/doc/jao-org-notes.el | 11 |
2 files changed, 18 insertions, 17 deletions
diff --git a/custom/jao-custom-gnus.el b/custom/jao-custom-gnus.el index 32571c0..a7059c6 100644 --- a/custom/jao-custom-gnus.el +++ b/custom/jao-custom-gnus.el @@ -448,7 +448,8 @@ :config (add-to-list 'org-capture-templates '("x" "arXiv" entry (file "notes/physics/arxiv.org") - "* %(jao-gnus-subject)\n\n %i" :immediate-finish t) + "* %(jao-gnus-subject)\n\n %i\n %(jao-gnus-org-url)" + :immediate-finish t) t) (add-to-list 'org-capture-templates '("X" "arXiv" entry (file "notes/physics/arxiv.org") @@ -458,6 +459,7 @@ (org-capture-upgrade-templates org-capture-templates)) (defvar jao-gnus-org-url nil) +(defun jao-gnus-org-url () jao-gnus-org-url) (defun jao-gnus-org-paragraph (x) (with-temp-buffer (insert " " (string-trim (or x "")) "\n ") @@ -478,17 +480,15 @@ (setq-local transient-mark-mode 'lambda) (set-mark (point)) (forward-paragraph) - (unless (save-excursion - (when (re-search-forward "^Link" nil t) - (beginning-of-line) - (setq jao-gnus-org-url (org-eww-url-below-point)) - (org-capture nil "X") - t)) - (next-line) - (set-mark (point)) - (end-of-buffer) - (org-capture nil "x")) - (set-mark (point)) + (or (and (save-excursion + (when (re-search-forward "^Link" nil t) + (beginning-of-line) + (setq jao-gnus-org-url (org-eww-url-below-point)))) + (org-capture nil "X")) + (and (save-excursion + (when (re-search-forward "^URL: " nil t) + (setq jao-gnus-org-url (thing-at-point-url-at-point)))) + (org-capture nil "x"))) (gnus-article-show-summary)) ;;; article diff --git a/lib/doc/jao-org-notes.el b/lib/doc/jao-org-notes.el index 43b8c09..d3f18b8 100644 --- a/lib/doc/jao-org-notes.el +++ b/lib/doc/jao-org-notes.el @@ -1,6 +1,6 @@ ;;; jao-org-notes.el --- A simple system for org note taking -*- lexical-binding: t; -*- -;; Copyright (C) 2020, 2021, 2022, 2024 jao +;; Copyright (C) 2020, 2021, 2022, 2024, 2025 jao ;; Author: jao <mail@jao.io> ;; Keywords: tools @@ -74,11 +74,12 @@ (defun jao-org-notes--consult-rg (prompt &optional cat no-req cmd initial) (let ((default-directory (expand-file-name (or cat "") jao-org-notes-dir))) (consult--read - (consult--async-command #'jao-org-notes--rg-title-or-tags - (consult--async-transform jao-org-notes--matches)) + (consult--async-pipeline + (consult--process-collection #'jao-org-notes--rg-title-or-tags) + (consult--async-transform #'jao-org-notes--matches)) :prompt prompt - :initial (consult--async-split-initial (or initial "")) - :add-history (concat (consult--async-split-initial (thing-at-point 'symbol))) + :initial (or initial "") + :add-history (thing-at-point 'symbol) :require-match (not no-req) :category 'jao-org-notes-lookup :group 'jao-org-notes--consult-group |