help-gnats
[Top][All Lists]
Advanced

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

enhancement to the emacs "query-pr" command


From: Mel Hatzis
Subject: enhancement to the emacs "query-pr" command
Date: Fri, 10 Oct 2003 18:49:47 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624

A colleague at work came up with an enhancement to gnats.el
so that query-pr will accept both space separated PR numbers
as well as GNATS query expressions as input.

Please review (and hopefully accept) the attached patch
which, IMO, makes the 'query-pr' command in emacs mode
more intuitive and easier to use.

--
Mel Hatzis
Change Log:

2003-10-10  Mark D Baushke <address@hidden>

        * gnats.el (gnats-do-query): Accept a list of PR numbers as an
                  alternative to just a gnats query expression.

--- gnats.el~   Fri Oct 10 13:55:33 2003
+++ gnats.el    Fri Oct 10 14:55:34 2003
@@ -1592,9 +1592,15 @@ The function works in the query buffers.
   ;; TODO: Handle gnatsd errors.
   (gnats-send-command "QFMT" "summary")
   (gnats-send-command "RSET")
-  (unless (string= query "")
-    (gnats-send-command "EXPR" query))
-  (let ((result (gnats-send-command "QUER")))
+  (let* ((quer-cmd
+         (cond
+          ((string-match "^\[0-9 \]\+$" query)
+           (concat "QUER " query))
+          (t
+           (unless (string= query "")
+             (gnats-send-command "EXPR" query))
+           "QUER")))
+         (result (gnats-send-command quer-cmd)))
     (unless (= (caar result) 300)
       (error "Query error (%d %s)" (car (car result)) (cadr (car result))))
     (setq result (cdr result))

reply via email to

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