summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSvend Sorensen <svend@ciffer.net>2014-05-07 14:42:01 -0700
committerSvend Sorensen <svend@ciffer.net>2014-05-07 15:55:10 -0700
commitd8ff6bcc1c8bd4efa440c6d91cc10e94b6f8027c (patch)
tree4a46d1e3775589ab721f9b5c77d89b53b6ad47fc /contrib
parent4de018e3a0a2cb8463ad36ca110627571122dc53 (diff)
downloadpass-d8ff6bcc1c8bd4efa440c6d91cc10e94b6f8027c.tar.gz
pass-d8ff6bcc1c8bd4efa440c6d91cc10e94b6f8027c.tar.bz2
pass-d8ff6bcc1c8bd4efa440c6d91cc10e94b6f8027c.zip
Factor out password completing-read function
Diffstat (limited to 'contrib')
-rw-r--r--contrib/emacs/password-store.el12
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
index d0c5dcd..4b85995 100644
--- a/contrib/emacs/password-store.el
+++ b/contrib/emacs/password-store.el
@@ -132,6 +132,10 @@ outputs error message on failure."
"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-list (&optional subdir)
"List password entries under SUBDIR."
(unless subdir (setq subdir ""))
@@ -146,7 +150,7 @@ outputs error message on failure."
This edits the password file directly in Emacs, so changes will
need to be commited manually if git is being used."
- (interactive (list (completing-read "Password entry: " (password-store-list))))
+ (interactive (list (password-store--completing-read)))
(find-file (password-store--entry-to-file entry)))
;;;###autoload
@@ -173,7 +177,7 @@ Returns the first line of the password data."
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 (completing-read "Password entry: " (password-store-list))))
+ (interactive (list (password-store--completing-read)))
(let ((password (password-store-get entry)))
(password-store-clear)
(kill-new password)
@@ -205,7 +209,7 @@ Default PASSWORD-LENGTH is `password-store-password-length'."
;;;###autoload
(defun password-store-remove (entry)
"Remove existing password for ENTRY."
- (interactive (list (completing-read "Password entry: " (password-store-list))))
+ (interactive (list (password-store--completing-read)))
(message (password-store--run-remove entry t)))
;;;###autoload
@@ -214,7 +218,7 @@ Default PASSWORD-LENGTH is `password-store-password-length'."
This will only browse URLs that start with http:// or http:// to
avoid sending a password to the browser."
- (interactive (list (completing-read "Password entry: " (password-store-list))))
+ (interactive (list (password-store--completing-read)))
(let ((url (password-store-get entry)))
(if (or (string-prefix-p "http://" url)
(string-prefix-p "https://" url))
>1-1/+1 2008-03-24Removed the nasty 'expand' bugRené 'Necoro' Neumann1-98/+98 2008-03-24Removed button labels in the package notebookRené 'Necoro' Neumann1-102/+96 2008-03-19install dbus_init pluginRené 'Necoro' Neumann1-1/+1 2008-03-19Init dbus threads using a pluginRené 'Necoro' Neumann3-1/+20 2008-03-19Make logger thread-safeRené 'Necoro' Neumann1-3/+6 2008-03-18Fixed new_use_flag creation errorRené 'Necoro' Neumann1-3/+3 2008-03-18keep i18n up2dateRené 'Necoro' Neumann3-326/+366 2008-03-18corrected header commentRené 'Necoro' Neumann1-2/+2 2008-03-18Removed gtk subdirRené 'Necoro' Neumann21-134/+79 2008-03-18Removed wrapperRené 'Necoro' Neumann2-238/+184 2008-03-18Split and renamed gui_helperRené 'Necoro' Neumann4-249/+266 2008-03-18Splitted windows.pyRené 'Necoro' Neumann10-424/+549 2008-03-12Moved get_dependencies to top package classRené 'Necoro' Neumann4-50/+85 2008-03-11improved performance by caching the use_expand queriesRené 'Necoro' Neumann1-5/+14 2008-03-11use catapult varsRené 'Necoro' Neumann2-4/+6 2008-03-11Updated catapult stuffRené 'Necoro' Neumann5-56/+108 2008-03-10Generate correct KeyNotFoundExceptionRené 'Necoro' Neumann1-2/+2 2008-03-09Small changesRené 'Necoro' Neumann3-1/+4 2008-03-07Better session handlingRené 'Necoro' Neumann1-5/+54 2008-03-07Small changesRené 'Necoro' Neumann1-1/+4 2008-03-07Updated shm module to 1.2René 'Necoro' Neumann1-8/+21 2008-03-07Update TODORené 'Necoro' Neumann1-3/+1 2008-03-07hmm ... yesRené 'Necoro' Neumann1-1/+1 2008-03-06Used better exceptions for configuration parserRené 'Necoro' Neumann1-26/+114 2008-03-06Update translationRené 'Necoro' Neumann2-349/+393 2008-03-06Update createpot.shRené 'Necoro' Neumann1-3/+2 2008-03-06Use 'nofork' instead of 'nolistener'René 'Necoro' Neumann1-3/+3 2008-03-05Install glade files into template dir and not data dirRené 'Necoro' Neumann2-2/+1 2008-03-05Added dependency listRené 'Necoro' Neumann3-117/+237