]> code.delx.au - gnu-emacs-elpa/commitdiff
Add a command to save the bugs list
authorLars Ingebrigtsen <larsi@gnus.org>
Fri, 4 Mar 2016 11:46:59 +0000 (11:46 +0000)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 4 Mar 2016 11:47:16 +0000 (11:47 +0000)
* debbugs-gnu.el (debbugs-gnu-save-cache): New function to save
the bugs list for offline debugging.

packages/debbugs/debbugs-gnu.el

index d22dd81705bded41a9278267fe8214e63c4afc86..08c8425485d6b46cdc77342f270bce83d15ea970 100644 (file)
@@ -1666,6 +1666,17 @@ If given a prefix, patch in the branch directory instead."
    (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: