From b87e91f984f45615b6459ff3829baa9130b8ef75 Mon Sep 17 00:00:00 2001
From: Tino Calancha <tino.calancha@gmail.com>
Date: Thu, 29 Aug 2019 12:54:23 +0200
Subject: emacs: Check that auth-source-pass-filename is bound before use it

For auth-source-pass versions < 5.0.0, auth-source-pass-filename
is not defined; thus, we must check that this variable exists before
use it.

* contrib/emacs/password-store.el (password-store-dir): Call
bound-and-true-p on auth-source-pass-filename.
---
 contrib/emacs/CHANGELOG.md      | 4 ++++
 contrib/emacs/password-store.el | 4 ++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/contrib/emacs/CHANGELOG.md b/contrib/emacs/CHANGELOG.md
index d4c865f..1d475c8 100644
--- a/contrib/emacs/CHANGELOG.md
+++ b/contrib/emacs/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 2.1.1
+
+* (bugfix) Check that auth-source-pass-filename is bound before use it.
+
 # 2.1.0
 
 * (feature) Support extraction of any secret fields stored in the files.
diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
index 22c5444..44c52b4 100644
--- a/contrib/emacs/password-store.el
+++ b/contrib/emacs/password-store.el
@@ -4,7 +4,7 @@
 
 ;; Author: Svend Sorensen <svend@svends.net>
 ;; Maintainer: Tino Calancha <tino.calancha@gmail.com>
-;; Version: 2.1.0
+;; Version: 2.1.1
 ;; URL: https://www.passwordstore.org/
 ;; Package-Requires: ((emacs "25") (f "0.11.0") (s "1.9.0") (with-editor "2.5.11") (auth-source-pass "5.0.0"))
 ;; Keywords: tools pass password password-store
@@ -181,7 +181,7 @@ Nil arguments are ignored.  Output is discarded."
 
 (defun password-store-dir ()
   "Return password store directory."
-  (or auth-source-pass-filename
+  (or (bound-and-true-p auth-source-pass-filename)
       (getenv "PASSWORD_STORE_DIR")
       "~/.password-store"))
 
-- 
cgit v1.2.3