summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoni Rabkin <yrk@gnu.org>2015-10-23 16:02:24 -0400
committerYoni Rabkin <yrk@gnu.org>2015-10-23 16:02:24 -0400
commit09f7ac05aaa7ebd3fdbc96f0f697fd3e54b77870 (patch)
treea6059a81bef1d0bbb54748b4776b33aa9925d56c
parent0cfaa45ca4545904c44184e20c49c368e12d48b3 (diff)
* rt-liberation.el: new function rt-liber-print-queryreport
-rw-r--r--rt-liberation.el23
1 files changed, 23 insertions, 0 deletions
diff --git a/rt-liberation.el b/rt-liberation.el
index e172b42..90b7929 100644
--- a/rt-liberation.el
+++ b/rt-liberation.el
@@ -1084,6 +1084,29 @@ string then that will be the name of the new buffer."
(rt-liber-browser-with-message "no results from query"
query new))))
+(defun rt-liber-print-query (query &optional ticket-redraw-f)
+ "Run QUERY against the server and return a string.
+
+The optional function TICKET-REDRAW-F will be bound to
+`rt-liber-custom-ticket-redraw-function' for the duration of the
+query output. Note that unlike the browser output, the string
+returned as no associated text properties."
+ (let ((rt-liber-custom-ticket-redraw-function
+ (or ticket-redraw-f
+ rt-liber-custom-ticket-redraw-function))
+ (out ""))
+ (condition-case excep
+ (with-temp-buffer
+ (rt-liber-ticketlist-browser-redraw
+ (rt-liber-rest-run-show-base-query
+ (rt-liber-rest-run-ls-query query))
+ query)
+ (setq out (buffer-substring-no-properties 1 (- (point-max) 1))))
+ (rt-liber-no-result-from-query-error
+ (rt-liber-browser-with-message "no results from query"
+ query)))
+ out))
+
;;; --------------------------------------------------------
;;; Major mode definitions