]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/debbugs/debbugs-gnu.el
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs/elpa
[gnu-emacs-elpa] / packages / debbugs / debbugs-gnu.el
index 8634ccc0800f7a7ee960c6c0020bcb6a2a4a0934..d22dd81705bded41a9278267fe8214e63c4afc86 100644 (file)
@@ -579,7 +579,9 @@ marked as \"client-side filter\"."
      (t (apply 'debbugs-get-bugs args)))))
 
 (defun debbugs-gnu-show-reports (&optional offline)
-  "Show bug reports."
+  "Show bug reports.
+If OFFLINE is non-nil, the query is not sent to the server.  Bugs
+are taken from the cache instead."
   (let ((inhibit-read-only t)
        (buffer-name "*Emacs Bugs*"))
     ;; The tabulated mode sets several local variables.  We must get
@@ -591,14 +593,16 @@ marked as \"client-side filter\"."
 
     ;; Print bug reports.
     (dolist (status
-            (apply 'debbugs-get-status
-                   (if offline
-                       (let ((ids nil))
-                         (maphash (lambda (key elem)
-                                    (push (cdr (assq 'id elem)) ids))
-                                  debbugs-cache-data)
-                         (sort ids '<))
-                     (debbugs-gnu-get-bugs debbugs-gnu-local-query))))
+            (let ((debbugs-cache-expiry (if offline nil debbugs-cache-expiry))
+                  ids)
+              (apply 'debbugs-get-status
+                     (if offline
+                         (progn
+                           (maphash (lambda (key _elem)
+                                      (push key ids))
+                                    debbugs-cache-data)
+                           (sort ids '<))
+                       (debbugs-gnu-get-bugs debbugs-gnu-local-query)))))
       (let* ((id (cdr (assq 'id status)))
             (words
              (mapconcat
@@ -1230,6 +1234,9 @@ MERGED is the list of bugs merged with this one."
           (re-search-forward "#\\([0-9]+\\)" nil t)))
      (string-to-number (match-string 1)))))
 
+(defvar debbugs-gnu-send-mail-function nil
+  "A function to send control messages from debbugs.")
+
 (defun debbugs-gnu-send-control-message (message &optional reverse)
   "Send a control message for the current bug report.
 You can set the severity or add a tag, or close the report.  If
@@ -1332,7 +1339,7 @@ removed instead."
                (format "tags %d%s %s\n"
                        id (if reverse " -" "")
                        message))))
-      (funcall send-mail-function)
+      (funcall (or debbugs-gnu-send-mail-function send-mail-function))
       (remhash id debbugs-cache-data)
       (message-goto-body)
       (message "Control message sent:\n%s"