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

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

[elpa] master d80690d: [gnus-mock] Protect value of gnus-mock-data-dir,


From: Eric Abrahamsen
Subject: [elpa] master d80690d: [gnus-mock] Protect value of gnus-mock-data-dir, bump to 0.4.3
Date: Fri, 18 Oct 2019 15:36:55 -0400 (EDT)

branch: master
commit d80690dc01546634abd37647e96e299e6e272aba
Author: Eric Abrahamsen <address@hidden>
Commit: Eric Abrahamsen <address@hidden>

    [gnus-mock] Protect value of gnus-mock-data-dir, bump to 0.4.3
    
    * packages/gnus-mock/gnus-mock.el (gnus-mock-data-dir): This file
    might be loaded in such a way that load-file-name is nil. Avoid an
    error in that case, and ask the user to set it themselves.
---
 packages/gnus-mock/gnus-mock.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/packages/gnus-mock/gnus-mock.el b/packages/gnus-mock/gnus-mock.el
index dd4ed07..6119785 100644
--- a/packages/gnus-mock/gnus-mock.el
+++ b/packages/gnus-mock/gnus-mock.el
@@ -5,7 +5,7 @@
 ;; Author: Eric Abrahamsen <address@hidden>
 ;; Maintainer: Eric Abrahamsen <address@hidden>
 ;; Package-Type: multi
-;; Version: 0.4.2
+;; Version: 0.4.3
 
 ;; 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
@@ -119,9 +119,10 @@ installation."
   :type 'string)
 
 (defconst gnus-mock-data-dir
-  (file-name-as-directory (expand-file-name
-                          "data"
-                          (file-name-directory load-file-name)))
+  (when load-file-name
+    (file-name-as-directory (expand-file-name
+                            "data"
+                            (file-name-directory load-file-name))))
   "Source directory for Gnus mock data.")
 
 ;;;###autoload
@@ -131,6 +132,8 @@ The new Emacs process will be started as \"-Q\", with the 
mock
 Gnus settings pre-loaded.  Any of the normal Gnus entry points
 will start a mock Gnus session."
   (interactive)
+  (unless gnus-mock-data-dir
+    (error "Set `gnus-mock-data-dir' to the \"gnus-mock/data\" directory"))
   (let ((mock-tmp-dir (make-temp-file "emacs-gnus-mock-" t)))
     (condition-case-unless-debug err
        (let ((init-file (expand-file-name "init.el" mock-tmp-dir)))



reply via email to

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