aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-07-08 22:46:55 +0200
committerGravatar Tom Willemsen2012-07-08 22:46:55 +0200
commit688bee7ca1f2c889643e299025a8deb944b705de (patch)
tree8c9cac3e98a8717f37477f5eafb961cb7ffe0096
parent41e2eb2b805c017fff4660c4b9e724a3fb8ab98c (diff)
downloaddispass.el-688bee7ca1f2c889643e299025a8deb944b705de.tar.gz
dispass.el-688bee7ca1f2c889643e299025a8deb944b705de.zip
Clean up dispass-labels--refresh
* dispass.el (dispass-labels--refresh): Store information once and reuse.
-rw-r--r--dispass.el25
1 files changed, 15 insertions, 10 deletions
diff --git a/dispass.el b/dispass.el
index efbdc09..09a359a 100644
--- a/dispass.el
+++ b/dispass.el
@@ -254,16 +254,21 @@ thrown."
(while (re-search-forward
"\\(\\(?:\\sw\\|\\s_\\)+\\) .*length=\\([0-9]+\\) .*hash=\\(\\sw+\\)$"
nil t)
- (add-to-list 'tmp-list `(,(match-string 1)
- [(,(match-string 1)
- face link
- help-echo ,(concat "Generate passphrase for " (match-string 1))
- follow-link t
- dispass-label ,(match-string 1)
- dispass-length ,(match-string 2)
- action dispass-from-button)
- ,(match-string 2)
- ,(match-string 3)]))))
+ (let ((label (match-string 1))
+ (length (match-string 2))
+ (hashmethod (match-string 3)))
+ (add-to-list 'tmp-list
+ `(,label
+ [(,label
+ face link
+ help-echo ,(concat "Generate passphrase for "
+ label)
+ follow-link t
+ dispass-label ,label
+ dispass-length ,length
+ action dispass-from-button)
+ ,length
+ ,hashmethod])))))
(setq tabulated-list-entries tmp-list)))
(define-derived-mode dispass-labels-mode tabulated-list-mode "DisPass"