diff options
author | Tom Willemsen | 2012-07-05 01:41:41 +0200 |
---|---|---|
committer | Tom Willemsen | 2012-07-05 01:41:41 +0200 |
commit | 36948506134e675ac54ce47e7e70d256fd7f6e2e (patch) | |
tree | 57b2816172ea84f97f0d85a5719fb2b8c2a0a3e1 | |
parent | 2427dc31384c4f619c4ed6550c2adcfafc0ca927 (diff) | |
download | dispass.el-36948506134e675ac54ce47e7e70d256fd7f6e2e.tar.gz dispass.el-36948506134e675ac54ce47e7e70d256fd7f6e2e.zip |
Make labels in list clickable
When a label is clicked on, or <RET> is pressed while the cursor is on
it, the `dispass' function is called with the appropriate label and
length.
-rw-r--r-- | dispass.el | 13 |
1 files changed, 12 insertions, 1 deletions
@@ -178,6 +178,11 @@ an eye out for LABEL." (dispass-start-process label nil length)) ;; Labels management +(defun dispass-from-button (button) + "Call dispass with information from BUTTON." + (dispass (button-get button 'dispass-label) + (button-get button 'dispass-length))) + (defun dispass-labels--refresh () "Reload labels from dispass." (setq tabulated-list-entries nil) @@ -189,7 +194,13 @@ an eye out for LABEL." "\\(\\w+\\) .*length=\\([0-9]+\\) .*hash=\\(\\w+\\)$" nil t) (add-to-list 'tmp-list `(,(match-string 1) - [,(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)])))) (setq tabulated-list-entries tmp-list))) |