emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/gnus-mock 0ec119f 2/2: Add a gnus-mock-resume command;


From: Eric Abrahamsen
Subject: [elpa] externals/gnus-mock 0ec119f 2/2: Add a gnus-mock-resume command; bump version to 0.5
Date: Fri, 1 Jan 2021 16:48:12 -0500 (EST)

branch: externals/gnus-mock
commit 0ec119ff8ddca61fc0f3e05ac4e895d57cb2ca21
Author: Eric Abrahamsen <eric@ericabrahamsen.net>
Commit: Eric Abrahamsen <eric@ericabrahamsen.net>

    Add a gnus-mock-resume command; bump version to 0.5
    
    * gnus-mock.el (gnus-mock-resume): Resume a previous session by
    restarting the Gnus mock Emacs from that session's files.
---
 gnus-mock.el | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/gnus-mock.el b/gnus-mock.el
index 97ff891..3ebe6b3 100644
--- a/gnus-mock.el
+++ b/gnus-mock.el
@@ -5,7 +5,7 @@
 ;; Author: Eric Abrahamsen <eric@ericabrahamsen.net>
 ;; Maintainer: Eric Abrahamsen <eric@ericabrahamsen.net>
 ;; Package-Type: multi
-;; Version: 0.4.5
+;; Version: 0.5
 
 ;; This program is free software; you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -307,5 +307,24 @@ will start a mock Gnus session."
               (delete-directory mock-tmp-dir t))
             (signal (car err) (cdr err))))))
 
+;;;###autoload
+(defun gnus-mock-resume (init-file)
+  "Resume a previous Gnus mock session.
+If your testing involves shutting Emacs down completely and
+restarting it, this command can be used to do that.  INIT-FILE
+should be the init file saved into the temporary directory
+created by the previous session.
+
+In order for this to work you'll have to prevent the previous
+Gnus mock session from deleting its temporary directory, either
+by setting `gnus-mock-cleanup-p' to nil before starting that
+session, or removing the cleanup lambda form from
+`kill-emacs-hook'."
+  (interactive "fInit file to resume from: ")
+  (make-process :name "gnus-mock" :buffer nil
+               :command (list gnus-mock-emacs-program
+                              "-Q" "--load" init-file)
+               :stderr "*gnus mock errors*"))
+
 (provide 'gnus-mock)
 ;;; gnus-mock.el ends here



reply via email to

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