From b760f374c48ca1f98ab289e202af5306da79dc70 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Tue, 27 Aug 2019 11:20:02 +0200 Subject: 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. --- contrib/emacs/CHANGELOG.md | 4 ++++ contrib/emacs/password-store.el | 16 ++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) (limited to 'contrib/emacs') 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 ;; Maintainer: Tino Calancha -;; 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) -- cgit v1.2.3