about summary refs log tree commit diff
path: root/users/glittershark/emacs.d/org-config.el
diff options
context:
space:
mode:
Diffstat (limited to 'users/glittershark/emacs.d/org-config.el')
-rw-r--r--users/glittershark/emacs.d/org-config.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/users/glittershark/emacs.d/org-config.el b/users/glittershark/emacs.d/org-config.el
index 9885a8e3c97a..c72a7c968710 100644
--- a/users/glittershark/emacs.d/org-config.el
+++ b/users/glittershark/emacs.d/org-config.el
@@ -144,3 +144,19 @@
 
 ;;; TODO: this doesn't work?
 (define-auto-insert "\\.org?$" #'grfn/insert-org-template t)
+
+(defun forge--post-submit-around---link-pr-to-org-item
+    (orig)
+  (let ((cb (funcall orig)))
+    (lambda (value headers status req)
+      (prog1 (funcall cb value headers status req)
+        (grfn/at-org-clocked-in-item
+         (let ((url (alist-get 'url value))
+               (number (alist-get 'number value)))
+           (org-set-property
+            "pull-request"
+            (org-make-link-string url (number-to-string number)))))))))
+
+(advice-add
+ #'forge--post-submit-callback
+ :around #'forge--post-submit-around---link-pr-to-org-item)