summaryrefslogtreecommitdiff
path: root/contrib/emacs
diff options
context:
space:
mode:
authorSvend Sorensen <svend@ciffer.net>2014-05-16 13:37:43 -0700
committerSvend Sorensen <svend@ciffer.net>2014-06-16 11:41:58 -0700
commit2817aeb73ad5086e92fb1bf5e3ba8bb6a4040cb6 (patch)
treedc7402d59b2329a2ef12c601149b16ef43869377 /contrib/emacs
parent6a2dc51b5d84c4bf76664cab5afed066cb9b48db (diff)
downloadpass-2817aeb73ad5086e92fb1bf5e3ba8bb6a4040cb6.tar.gz
pass-2817aeb73ad5086e92fb1bf5e3ba8bb6a4040cb6.tar.bz2
pass-2817aeb73ad5086e92fb1bf5e3ba8bb6a4040cb6.zip
emacs: Use PASSWORD_STORE_CLIP_TIME env variable
Timeout password after PASSWORD_STORE_CLIP_TIME seconds, if set. Otherwise timeout after 45 seconds. These are the setting used by pass.
Diffstat (limited to '')
-rw-r--r--contrib/emacs/password-store.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/contrib/emacs/password-store.el b/contrib/emacs/password-store.el
index 4bfa290..cdecad4 100644
--- a/contrib/emacs/password-store.el
+++ b/contrib/emacs/password-store.el
@@ -42,8 +42,11 @@
(defconst password-store-password-length 8
"Default password length.")
-(defconst password-store-timeout 45
- "Number of seconds to wait before clearing the password.")
+(defun password-store-timeout ()
+ "Number of seconds to wait before clearing the password."
+ (if (getenv "PASSWORD_STORE_CLIP_TIME")
+ (string-to-number (getenv "PASSWORD_STORE_CLIP_TIME"))
+ 45))
(defun password-store--run (&rest args)
"Run pass with ARGS.
@@ -181,8 +184,8 @@ after `password-store-timeout' seconds."
(password-store-clear)
(kill-new password)
(setq password-store-kill-ring-pointer kill-ring-yank-pointer)
- (message "Copied %s to the kill ring. Will clear in %s seconds." entry password-store-timeout)
- (run-at-time password-store-timeout nil 'password-store-clear)))
+ (message "Copied %s to the kill ring. Will clear in %s seconds." entry (password-store-timeout))
+ (run-at-time (password-store-timeout) nil 'password-store-clear)))
;;;###autoload
(defun password-store-init (gpg-id)
27feec&follow=1'>Improved HTML creationRené 'Necoro' Neumann4-3/+22 2020-04-21Upload mails to imapRené 'Necoro' Neumann3-35/+80 2020-04-21Move HTML template to stringRené 'Necoro' Neumann3-12/+13 2020-04-21HTML Template part of the mailRené 'Necoro' Neumann7-18/+199 2020-04-20Fixes and validationRené 'Necoro' Neumann6-28/+25 2020-04-20Fix vettingRené 'Necoro' Neumann1-1/+1 2020-04-20Started with mail creationRené 'Necoro' Neumann4-3/+126 2020-04-20FeeditemsRené 'Necoro' Neumann2-2/+14 2020-04-20GlobalOptionsRené 'Necoro' Neumann3-25/+79 2020-04-19RestructureRené 'Necoro' Neumann6-152/+177 2020-04-19Rename package 'parse' to 'feed'René 'Necoro' Neumann2-3/+3 2020-04-19SELECT is not necessary for most operations -- skip itRené 'Necoro' Neumann2-12/+1 2020-04-19Store path as array -- the delimiter is not always '.'René 'Necoro' Neumann3-36/+44 2020-04-19Split client part to client.goRené 'Necoro' Neumann2-125/+137 2020-04-19IMAP: Create foldersRené 'Necoro' Neumann1-4/+38 2020-04-19Improved IMAPRené 'Necoro' Neumann1-3/+88 2020-04-19Started IMAP connectionRené 'Necoro' Neumann4-0/+152 2020-04-19Use our own logger for debug for convenience sakeRené 'Necoro' Neumann1-2/+3 2020-04-19Fix debug logging m(René 'Necoro' Neumann1-2/+2 2020-04-19Rename util.go to log.go. Add verbose modeRené 'Necoro' Neumann4-24/+54 2020-04-19Clean go.modRené 'Necoro' Neumann2-3/+0 2020-04-19Do not print the parsedCfg anymoreRené 'Necoro' Neumann1-1/+1 2020-04-19Increase go-version to 1.14René 'Necoro' Neumann1-2/+2 2020-04-19CI: go vetRené 'Necoro' Neumann1-0/+3 2020-04-19Fetching and parsing the feedsRené 'Necoro' Neumann5-4/+113 2020-04-19Ignore all config*.ymlRené 'Necoro' Neumann1-1/+1