summaryrefslogtreecommitdiff
path: root/rt-liberation-org.el
diff options
context:
space:
mode:
authorYuchen Pei <me@ypei.me>2021-07-27 14:10:50 +1000
committerYuchen Pei <me@ypei.me>2021-07-27 14:10:50 +1000
commit19cadf0137cfaefb5012fd62611397129752761a (patch)
treec86f090e732794599d17247992623cdc3e90c2ea /rt-liberation-org.el
parentf6a29a2031c566699e1693efe324785d7cdda56d (diff)
bugfix: moved side effects of add props to only when ticket non-nil
Diffstat (limited to 'rt-liberation-org.el')
-rw-r--r--rt-liberation-org.el23
1 files changed, 11 insertions, 12 deletions
diff --git a/rt-liberation-org.el b/rt-liberation-org.el
index 8db9a81..0943774 100644
--- a/rt-liberation-org.el
+++ b/rt-liberation-org.el
@@ -49,19 +49,18 @@
(defun rt-org-store-link ()
"Stores an rt link in ticket-browser mode."
(require 'rt-liberation)
- (let* (
- (ticket (or (get-text-property (point) 'rt-ticket)
- rt-liber-ticket-local
- ))
- (link (concat "rt:id:" (rt-liber-ticket-id-only ticket)))
- (subject (cdr (assoc "Subject" ticket)))
+ (let ((ticket (or (get-text-property (point) 'rt-ticket)
+ rt-liber-ticket-local)))
+ (when ticket
+ (let (
+ (link (concat "rt:id:" (rt-liber-ticket-id-only ticket)))
+ (subject (cdr (assoc "Subject" ticket)))
+ )
+ (org-link-add-props
+ :link link
+ :description subject
)
- (org-link-add-props
- :link link
- :description subject
- )
- (when ticket link)
- ))
+ link))))
;; org-add-link-type is obsolete as of org-mode 9. Instead we will use the
;; org-link-set-parameters method