diff options
author | Yuchen Pei <me@ypei.me> | 2021-07-27 14:10:50 +1000 |
---|---|---|
committer | Yuchen Pei <me@ypei.me> | 2021-07-27 14:10:50 +1000 |
commit | 19cadf0137cfaefb5012fd62611397129752761a (patch) | |
tree | c86f090e732794599d17247992623cdc3e90c2ea | |
parent | f6a29a2031c566699e1693efe324785d7cdda56d (diff) |
bugfix: moved side effects of add props to only when ticket non-nil
-rw-r--r-- | rt-liberation-org.el | 23 |
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 |