Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
password-store
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Karl Fogel
password-store
Commits
d8ff6bcc
Commit
d8ff6bcc
authored
10 years ago
by
Svend Sorensen
Browse files
Options
Downloads
Patches
Plain Diff
Factor out password completing-read function
parent
4de018e3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
contrib/emacs/password-store.el
+8
-4
8 additions, 4 deletions
contrib/emacs/password-store.el
with
8 additions
and
4 deletions
contrib/emacs/password-store.el
+
8
−
4
View file @
d8ff6bcc
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment