summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2021-08-20 16:22:53 +1000
committerYuchen Pei <hi@ypei.me>2021-08-20 16:22:53 +1000
commitd8793ce007f8104fd709fdfec1e15bec80341f27 (patch)
treee2b02a37e850649689fb21e3047aa10bdb65f99e
parent9659491fe20acdd597bdf7d5b8c9647e5fd916b9 (diff)
Improved rt-liber-viewer-visit-in-browser.
- With a prefix arg, it opens the ticket in secondary browser. This is particularly useful when the internal browser complains about REST access. - The browsing link pinpoints the section on top of the ticket id.
-rw-r--r--rt-liberation.el18
1 files changed, 12 insertions, 6 deletions
diff --git a/rt-liberation.el b/rt-liberation.el
index a50dcbb..8e6a226 100644
--- a/rt-liberation.el
+++ b/rt-liberation.el
@@ -740,13 +740,19 @@ returned as no associated text properties."
(rt-liber-next-section-in-viewer))
(message "no correspondence found"))))
-(defun rt-liber-viewer-visit-in-browser ()
- "Visit this ticket in the RT Web interface."
- (interactive)
- (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local)))
+(defun rt-liber-viewer-visit-in-browser (&optional external)
+ "Visit this ticket section in the RT Web interface.
+With a prefix arg, browse using secondary browser."
+ (interactive "P")
+ (let ((id (rt-liber-ticket-id-only rt-liber-ticket-local))
+ (browser-function
+ (if external browse-url-secondary-browser-function
+ browse-url)))
(if id
- (browse-url
- (concat rt-liber-base-url "Ticket/Display.html?id=" id))
+ (funcall browser-function
+ (concat rt-liber-base-url "Ticket/Display.html?id=" id
+ "#txn-"
+ (alist-get 'id (rt-liber-viewer2-get-section-data))))
(error "no ticket currently in view"))))
(defun rt-liber-viewer-mode-quit ()