summaryrefslogtreecommitdiff
path: root/contrib/emacs/password-store.el
diff options
context:
space:
mode:
authoribizaman <ibizapeanut@gmail.com>2019-06-28 10:35:28 -0700
committerSvend Sorensen <svend@svends.net>2019-08-04 13:04:46 -0700
commite93e03705fb5b81f3af85f04c07ad0ee2190b6aa (patch)
treee2fd35beac49e104b65662214ce859d0ff27a0c1 /contrib/emacs/password-store.el
parentc22cdbd4674a25dec71fe42ec1ef0b4829b6c7f3 (diff)
downloadpass-e93e03705fb5b81f3af85f04c07ad0ee2190b6aa.tar.gz
pass-e93e03705fb5b81f3af85f04c07ad0ee2190b6aa.tar.bz2
pass-e93e03705fb5b81f3af85f04c07ad0ee2190b6aa.zip
emacs: require matching password for completion
Diffstat (limited to '')
-rw-r--r--contrib/emacs/password-store.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
index fe9271d..a08fec9 100644
--- a/contrib/emacs/password-store.el
+++ b/contrib/emacs/password-store.el
@@ -177,9 +177,11 @@ Nil arguments are ignored. Output is discarded."
"Return entry name corresponding to FILE."
(f-no-ext (f-relative file (password-store-dir))))
-(defun password-store--completing-read ()
- "Read a password entry in the minibuffer, with completion."
- (completing-read "Password entry: " (password-store-list)))
+(defun password-store--completing-read (&optional require-match)
+ "Read a password entry in the minibuffer, with completion.
+
+Require a matching password if `REQUIRE-MATCH' is 't'."
+ (completing-read "Password entry: " (password-store-list) nil require-match))
(defun password-store-list (&optional subdir)
"List password entries under SUBDIR."
@@ -193,7 +195,7 @@ Nil arguments are ignored. Output is discarded."
;;;###autoload
(defun password-store-edit (entry)
"Edit password for ENTRY."
- (interactive (list (password-store--completing-read)))
+ (interactive (list (password-store--completing-read t)))
(password-store--run-edit entry))
;;;###autoload
@@ -228,7 +230,7 @@ When CALLBACK is non-`NIL', call CALLBACK with the first line instead."
Clear previous password from kill ring. Pointer to kill ring is
stored in `password-store-kill-ring-pointer'. Password is cleared
after `password-store-timeout' seconds."
- (interactive (list (password-store--completing-read)))
+ (interactive (list (password-store--completing-read t)))
(password-store-get
entry
(lambda (password)
@@ -275,13 +277,13 @@ Default PASSWORD-LENGTH is `password-store-password-length'."
;;;###autoload
(defun password-store-remove (entry)
"Remove existing password for ENTRY."
- (interactive (list (password-store--completing-read)))
+ (interactive (list (password-store--completing-read t)))
(message "%s" (password-store--run-remove entry t)))
;;;###autoload
(defun password-store-rename (entry new-entry)
"Rename ENTRY to NEW-ENTRY."
- (interactive (list (password-store--completing-read)
+ (interactive (list (password-store--completing-read t)
(read-string "Rename entry to: ")))
(message "%s" (password-store--run-rename entry new-entry t)))
@@ -297,7 +299,7 @@ Default PASSWORD-LENGTH is `password-store-password-length'."
This will only browse URLs that start with http:// or https:// to
avoid sending a password to the browser."
- (interactive (list (password-store--completing-read)))
+ (interactive (list (password-store--completing-read t)))
(let ((url (password-store-get entry)))
(if (or (string-prefix-p "http://" url)
(string-prefix-p "https://" url))
etions'>-2/+15 2013-11-06Colorscheme for virtual console.René 'Necoro' Neumann1-1/+5 2013-11-01Do not try to set window title and stuff in linux consoleRené 'Necoro' Neumann1-0/+3 2013-10-30Set terminal title not only on path change, but for each new prompt.René 'Necoro' Neumann1-2/+2 2013-10-22cwd-spawn: Use M-Return instead of M-o for consistency.René 'Necoro' Neumann1-2/+2 2013-10-22Add cwd-spawn to urxvt to allow spawning a new terminal from the currentRené 'Necoro' Neumann3-2/+199 2013-10-22Use chpwd_functions and precmd_functions instead of putting everything inRené 'Necoro' Neumann1-19/+23 2013-09-30urxvt: execute the wgetpaste check each timeRené 'Necoro' Neumann1-2/+5 2013-09-30urxvt: wgetpaste fixRené 'Necoro' Neumann1-4/+4 2013-09-30Allow HOME variable in .Xresources.René 'Necoro' Neumann2-3/+3 2013-09-30wgetpaste support for urxvt.René 'Necoro' Neumann2-1/+28 2013-09-30Urxvt autotransform for <filename>:<line>.René 'Necoro' Neumann1-1/+4 2013-09-30Remove tabbed(x) from urxvt. We use i3 -- no need for it.René 'Necoro' Neumann1-9/+0 2013-09-30Do not display icon in urxvt. It's not supported by i3 anyway.René 'Necoro' Neumann1-1/+1 2013-09-29Remove wrong monitors lineRené 'Necoro' Neumann1-1/+0 2013-09-29Delete vimperator paste plugin -- seems not to work anymore with new FFRené 'Necoro' Neumann1-266/+0 2013-09-29Use $HOST instead of Cauchiy in titleRené 'Necoro' Neumann1-1/+1 2013-09-24Remove herbstluftwmRené 'Necoro' Neumann1-1/+0 2013-09-24Conky changesRené 'Necoro' Neumann2-5/+13 2013-09-15Remove trailing slash from \~ulpRené 'Necoro' Neumann1-1/+1 2013-09-15Make cci explicitly use python2René 'Necoro' Neumann1-1/+1 2013-09-10Node/NPM preparationRené 'Necoro' Neumann3-1/+13