enhancement to the emacs "query-pr" command
Mel Hatzis <[email protected]>
| Newsgroups | gmane.comp.bug-tracking.gnats.general |
|---|---|
| Message-ID | <[email protected]> |
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 _______________________________________________ Help-gnats mailing list [email protected] http://mail.gnu.org/mailman/listinfo/help-gnats
gnats.el.patch
(text/plain, 945 B)
Change Log: 2003-10-10 Mark D Baushke <[email protected]> * 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))