Permalink
Browse files

Clean up dispass-labels--refresh

* dispass.el (dispass-labels--refresh): Store information once and
  reuse.
  • Loading branch information...
1 parent 41e2eb2 commit 688bee7ca1f2c889643e299025a8deb944b705de @ryuslash committed Jul 8, 2012
Showing with 15 additions and 10 deletions.
  1. +15 −10 dispass.el
View
@@ -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"

0 comments on commit 688bee7

Please sign in to comment.