Commit Diff


commit - 71c456de0f7d25a1a8337960fdcd8ebd5602f12d
commit + d0ff72001b6c2471a6e6c14fb62a62fbbdbf9e49
blob - 8a4dba51e67af762040716dad2f5fc89370c4307
blob + 3a3d70e9392ae20abd0ce16510a755a30f8e1891
--- emacs/simple-pass.el
+++ emacs/simple-pass.el
@@ -46,7 +46,8 @@
                  collect (buffer-substring-no-properties
                           ;; skip ./
                           (+ 2 (line-beginning-position))
-                          (line-end-position))
+                          ;; skip .gpg
+                          (- (line-end-position) 4))
                  do (forward-line +1))))))
 
 (defun simple-pass--copy-cr ()
@@ -55,8 +56,12 @@
 
 ;;;###autoload
 (defun simple-pass-copy (pass)
+  "Copy the password for PASS in the `kill-ring'."
   (interactive (list (simple-pass--copy-cr)))
-  (shell-command (concat simple-pass-cmd " show -c " pass)))
+  (with-temp-buffer
+    (when (zerop (process-file simple-pass-cmd nil nil nil
+                               "show" "-c" pass))
+      (message "copied password for %s" pass))))
 
 (provide 'simple-pass)
 ;;; simple-pass.el ends here