m-chrzan.xyz
aboutsummaryrefslogtreecommitdiff
path: root/contrib/emacs
diff options
context:
space:
mode:
authorTino Calancha <tino.calancha@gmail.com>2019-08-27 11:20:02 +0200
committerTino Calancha <tino.calancha@gmail.com>2019-08-27 11:23:06 +0200
commitb760f374c48ca1f98ab289e202af5306da79dc70 (patch)
tree21f4b4deea043481c672c3d535f52b6a534c2f6c /contrib/emacs
parent7c1b7e5fea36e656a95267fe3e256573504f3ada (diff)
emacs: Improve password-store-insert message on success/failure
Before, the following message was shown: "Enter contents of ENTRY and press Ctrl+D when finished:\n\n" Since the command is not interactive, it is better to show users specific messages on success/failure. * contrib/emacs/password-store.el (password-store-insert): Improve message shown on success/failure.
Diffstat (limited to 'contrib/emacs')
-rw-r--r--contrib/emacs/CHANGELOG.md4
-rw-r--r--contrib/emacs/password-store.el16
2 files changed, 14 insertions, 6 deletions
diff --git a/contrib/emacs/CHANGELOG.md b/contrib/emacs/CHANGELOG.md
index a22659c..7149ef6 100644
--- a/contrib/emacs/CHANGELOG.md
+++ b/contrib/emacs/CHANGELOG.md
@@ -1,3 +1,7 @@
+# 2.0.5
+
+Improve password-store-insert message on success/failure
+
# 2.0.4
* Re add password-store-timeout function to preserve backward
diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
index 7b20462..c4484d8 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.0.4
+;; Version: 2.0.5
;; URL: https://www.passwordstore.org/
;; Package-Requires: ((emacs "25") (f "0.11.0") (s "1.9.0") (with-editor "2.5.11"))
;; Keywords: tools pass password password-store
@@ -266,11 +266,15 @@ Separate multiple IDs with spaces."
"Insert a new ENTRY containing PASSWORD."
(interactive (list (read-string "Password entry: ")
(read-passwd "Password: " t)))
- (message "%s" (shell-command-to-string
- (format "echo %s | %s insert -m -f %s"
- (shell-quote-argument password)
- password-store-executable
- (shell-quote-argument entry)))))
+ (let* ((command (format "echo %s | %s insert -m -f %s"
+ (shell-quote-argument password)
+ password-store-executable
+ (shell-quote-argument entry)))
+ (ret (process-file-shell-command command)))
+ (if (zerop ret)
+ (message "Successfully inserted entry for %s" entry)
+ (message "Cannot insert entry for %s" entry))
+ nil))
;;;###autoload
(defun password-store-generate (entry &optional password-length)