emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/rt-liberation 09f7ac0 60/72: * rt-liberation.el: new fu


From: Stefan Monnier
Subject: [elpa] externals/rt-liberation 09f7ac0 60/72: * rt-liberation.el: new function rt-liber-print-query
Date: Wed, 5 Aug 2020 11:57:44 -0400 (EDT)

branch: externals/rt-liberation
commit 09f7ac05aaa7ebd3fdbc96f0f697fd3e54b77870
Author: Yoni Rabkin <yrk@gnu.org>
Commit: Yoni Rabkin <yrk@gnu.org>

    * rt-liberation.el: new function rt-liber-print-query
---
 rt-liberation.el | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]