(autoload 'diff-goto-source "diff-mode")
(autoload 'diff-hunk-file-names "diff-mode")
(autoload 'gnus-article-mime-handles "gnus-art")
+(autoload 'gnus-fetch-field "gnus-util")
(autoload 'gnus-read-ephemeral-emacs-bug-group "gnus-group")
(autoload 'gnus-summary-article-header "gnus-sum")
(autoload 'gnus-summary-select-article "gnus-sum")
(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
;; 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
(switch-to-buffer "*vc-diff*")
(other-window 1))
+(defun debbugs-gnu-save-cache ()
+ "Save the bugs cache to a file."
+ (interactive)
+ (unless debbugs-cache-data
+ (error "No data to cache"))
+ (unless (file-exists-p "~/.emacs.d/debbugs-cache")
+ (make-directory "~/.emacs.d/debbugs-cache" t))
+ (let ((coding-system-for-write 'utf-8))
+ (with-temp-file "~/.emacs.d/debbugs-cache/list"
+ (prin1 debbugs-cache-data (current-buffer)))))
+
(provide 'debbugs-gnu)
;;; TODO: