branch: master commit d80690dc01546634abd37647e96e299e6e272aba Author: Eric Abrahamsen <e...@ericabrahamsen.net> Commit: Eric Abrahamsen <e...@ericabrahamsen.net>
[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 <e...@ericabrahamsen.net> ;; Maintainer: Eric Abrahamsen <e...@ericabrahamsen.net> ;; 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)))