aboutsummaryrefslogtreecommitdiff
path: root/pearl.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-27 15:44:21 -0500
committerCraig Jennings <c@cjennings.net>2026-05-27 15:44:21 -0500
commit805e288178ce2b96dd4a0277b49904131853e8fe (patch)
tree69f282cac13dd5b0253b5b2b41129c321589f206 /pearl.el
parent6169288a7f3ad3a96a4cf07ed07a9ee81cee53c9 (diff)
downloadpearl-805e288178ce2b96dd4a0277b49904131853e8fe.tar.gz
pearl-805e288178ce2b96dd4a0277b49904131853e8fe.zip
feat(commands): add pearl-copy-issue-url, bound at u c
I added pearl-copy-issue-url. It copies the Linear URL of the issue at point to the kill ring and the system clipboard, reading the stored LINEAR-URL drawer property so there's no network call, and works from anywhere inside the issue subtree. kill-new carries it to the clipboard through interprogram-cut-function, so nothing shells out to a clipboard tool. Bound at u c in the url group, beside u o (open in browser).
Diffstat (limited to 'pearl.el')
-rw-r--r--pearl.el19
1 files changed, 17 insertions, 2 deletions
diff --git a/pearl.el b/pearl.el
index f5d0489..bc9319d 100644
--- a/pearl.el
+++ b/pearl.el
@@ -2575,6 +2575,22 @@ Reads the `LINEAR-URL' property of the enclosing issue heading and hands it to
(user-error "No LINEAR-URL on the issue at point"))
(browse-url url)))
+;;;###autoload
+(defun pearl-copy-issue-url ()
+ "Copy the Linear URL of the issue at point to the kill ring and clipboard.
+Reads the `LINEAR-URL' property of the enclosing issue heading. Works from
+anywhere inside the issue subtree and makes no network call. `kill-new' adds
+the URL to the kill ring and, through `interprogram-cut-function', the system
+clipboard."
+ (interactive)
+ (let ((url (save-excursion
+ (pearl--goto-issue-heading-or-error)
+ (org-entry-get nil "LINEAR-URL"))))
+ (unless (and url (not (string-empty-p url)))
+ (user-error "No LINEAR-URL on the issue at point"))
+ (kill-new url)
+ (message "Copied %s" url)))
+
(defun pearl--delete-issue-async (issue-id callback)
"Delete ISSUE-ID on Linear via issueDelete, calling CALLBACK with the outcome.
CALLBACK receives a plist (:success BOOL). Linear's `issueDelete' is a soft
@@ -4847,9 +4863,8 @@ body stay."
(defvar pearl-url-map
(let ((map (make-sparse-keymap)))
(define-key map "o" (cons "open issue in browser" #'pearl-open-current-issue))
+ (define-key map "c" (cons "copy issue URL" #'pearl-copy-issue-url))
(define-key map "v" (cons "open view in Linear" #'pearl-open-current-view-in-linear))
- ;; "c" (copy the issue URL to the clipboard) lands with
- ;; `pearl-copy-issue-url' -- see the todo.
map)
"Pearl URL commands; a sub-keymap of `pearl-prefix-map'.")