From 2427dc31384c4f619c4ed6550c2adcfafc0ca927 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 5 Jul 2012 01:11:07 +0200 Subject: Add a simple list of labels --- dispass.el | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 10 deletions(-) diff --git a/dispass.el b/dispass.el index db7255b..5098a2d 100644 --- a/dispass.el +++ b/dispass.el @@ -4,7 +4,7 @@ ;; Author: Tom Willemsen ;; Created: Jun 8, 2012 -;; Version: 0.1a7.3 +;; Version: 1 ;; Keywords: encryption, security ;; Permission to use, copy, modify, and distribute this software for any @@ -44,22 +44,22 @@ ;;; Customization: ;; dispass.el only offers customization of the `dispass-executable' -;; variable for the moment. This is the location where the dispass -;; executable is located. +;; and `dispass-file' variables for the moment. This is the location +;; where the dispass executable is located. ;;; Usage: -;; Using dispass.el is simple, once installed. Either call `dispass' +;; Using dispass.el is simple, once installed. Either call `dispass' ;; to recall a priviously generated password or call `dispass-create' ;; to generate a new password. ;; The only real difference between the two is that `dispass-create' -;; asks to confirm the password. Both will ask for a label. +;; asks to confirm the password. Both will ask for a label. ;; When a numeric argument is used when calling either ;; `dispass-create' or `dispass', that argument is sent to the dispass -;; program along with the -l switch. This cuts the length of the -;; password to that many characters. For example: +;; program along with the -l switch. This cuts the length of the +;; password to that many characters. For example: ;; C-5 M-x dispass @@ -83,12 +83,15 @@ ;; numeric prefix argument. ;; - Add `dispass-executable' which holds the location of the -;; dispass executable script. It can be changed through the +;; dispass executable script. It can be changed through the ;; emacs customization interface. ;; - Add a customization group named dispass, it is found ;; under the "External" group. +;; 1 - Add `dispass-list-labels' which shows a list of all the labels +;; in `dispass-file'. + ;;; Code: (defgroup dispass nil "Customization options for the DisPass wrapper." @@ -101,6 +104,12 @@ :type '(string) :risky t) +(defcustom dispass-file "~/.dispass" + "The location of your dispass file." + :package-version '(dispass . "1") + :group 'dispass + :type '(file)) + (defun dispass-process-sentinel (proc status) "Report PROC's status change to STATUS." (let ((status (substring status 0 -1)) @@ -139,8 +148,8 @@ an eye out for LABEL." (kill-buffer buffer)))))))) (defun dispass-start-process (label create length) - "Start dispass process. When CREATE is non-nil send along the - -c switch to make it ask for a password twice. When LENGTH is + "Start dispass process. When CREATE is non-nil send along the + -c switch to make it ask for a password twice. When LENGTH is an integer and greater than 0, send along the -l switch with LENGTH." (let ((args `("-o" ,label)) @@ -168,6 +177,43 @@ an eye out for LABEL." "Recreate a password previously used." (dispass-start-process label nil length)) +;; Labels management +(defun dispass-labels--refresh () + "Reload labels from dispass." + (setq tabulated-list-entries nil) + + (let ((tmp-list '())) + (with-temp-buffer + (insert-file-contents dispass-file) + (while (re-search-forward + "\\(\\w+\\) .*length=\\([0-9]+\\) .*hash=\\(\\w+\\)$" + nil t) + (add-to-list 'tmp-list `(,(match-string 1) + [,(match-string 1) + ,(match-string 2) + ,(match-string 3)])))) + (setq tabulated-list-entries tmp-list))) + +(define-derived-mode dispass-labels-mode tabulated-list-mode "DisPass" + "Major mode for listing dispass labels." + (setq tabulated-list-format [("Label" 30 t) + ("Length" 6 nil) + ("Hash" 0 t)] + tabulated-list-sort-key '("Label" . nil)) + (add-hook 'tabulated-list-revert-hook 'dispass-labels--refresh) + (tabulated-list-init-header)) + +(defun dispass-list-labels () + "Display a list of labels for dispass." + (interactive) + (let ((buffer (get-buffer-create "*DisPass Labels*"))) + (with-current-buffer buffer + (dispass-labels-mode) + (dispass-labels--refresh) + (tabulated-list-print)) + (display-buffer buffer)) + nil) + (provide 'dispass) ;;; dispass.el ends here -- cgit v1.2.3-54-g00ecf From 36948506134e675ac54ce47e7e70d256fd7f6e2e Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 5 Jul 2012 01:41:41 +0200 Subject: Make labels in list clickable When a label is clicked on, or is pressed while the cursor is on it, the `dispass' function is called with the appropriate label and length. --- dispass.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dispass.el b/dispass.el index 5098a2d..1f054d3 100644 --- a/dispass.el +++ b/dispass.el @@ -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))) -- cgit v1.2.3-54-g00ecf From f0a31cb1f63db326722b191cde76a457bbdb4381 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 5 Jul 2012 01:45:55 +0200 Subject: Add autoload cookie to dispass-list-labels --- dispass.el | 1 + 1 file changed, 1 insertion(+) diff --git a/dispass.el b/dispass.el index 1f054d3..40f4604 100644 --- a/dispass.el +++ b/dispass.el @@ -214,6 +214,7 @@ an eye out for LABEL." (add-hook 'tabulated-list-revert-hook 'dispass-labels--refresh) (tabulated-list-init-header)) +;;;###autoload (defun dispass-list-labels () "Display a list of labels for dispass." (interactive) -- cgit v1.2.3-54-g00ecf From c72616deeb3e6baf4d24cd9f4bda3438a6a6a652 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 5 Jul 2012 02:07:38 +0200 Subject: Fix -c flag for dispass Since the prompt for dispass has changed in v0.1a8 the process filter didn't recognize the second prompt anymore. --- dispass.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dispass.el b/dispass.el index 40f4604..bed46ef 100644 --- a/dispass.el +++ b/dispass.el @@ -132,7 +132,7 @@ an eye out for LABEL." `(lambda (proc string) "Process STRING coming from PROC." - (cond ((string-match "^\\(Password\\|Again\\): ?$" string) + (cond ((string-match "^\\(Password[^:]*\\|Again\\): ?$" string) (process-send-string proc (concat (read-passwd string nil) "\n"))) -- cgit v1.2.3-54-g00ecf From cb33ce7048ab482feb863302373964bc2645061e Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 5 Jul 2012 02:14:58 +0200 Subject: Add and show keybinding for dispass-labels-mode --- dispass.el | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dispass.el b/dispass.el index bed46ef..1081b83 100644 --- a/dispass.el +++ b/dispass.el @@ -110,6 +110,11 @@ :group 'dispass :type '(file)) +(defvar dispass-labels-mode-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map tabulated-list-mode-map) + (define-key map "c" 'dispass-create))) + (defun dispass-process-sentinel (proc status) "Report PROC's status change to STATUS." (let ((status (substring status 0 -1)) @@ -206,7 +211,10 @@ an eye out for LABEL." (setq tabulated-list-entries tmp-list))) (define-derived-mode dispass-labels-mode tabulated-list-mode "DisPass" - "Major mode for listing dispass labels." + "Major mode for listing dispass labels. + +\\{dispass-labels-mode-map}" + (define-key dispass-labels-mode-map "c" 'dispass-create) (setq tabulated-list-format [("Label" 30 t) ("Length" 6 nil) ("Hash" 0 t)] -- cgit v1.2.3-54-g00ecf From 507be16558c1ab0ba0120bd94fdc4b51d0d86df4 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Thu, 5 Jul 2012 02:20:39 +0200 Subject: Select the new buffer When calling `dispass-list-labels' the new buffer should be selected, not _just_ shown. --- dispass.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dispass.el b/dispass.el index 1081b83..1ac4069 100644 --- a/dispass.el +++ b/dispass.el @@ -231,7 +231,7 @@ an eye out for LABEL." (dispass-labels-mode) (dispass-labels--refresh) (tabulated-list-print)) - (display-buffer buffer)) + (switch-to-buffer-other-window buffer)) nil) (provide 'dispass) -- cgit v1.2.3-54-g00ecf From 4ba77945680e6d3861ba80eae869ac72778e9c4d Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 6 Jul 2012 00:22:06 +0200 Subject: Return keymap If the keymap isn't returned, it doesn't work. --- dispass.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dispass.el b/dispass.el index 1ac4069..e30cb21 100644 --- a/dispass.el +++ b/dispass.el @@ -113,7 +113,8 @@ (defvar dispass-labels-mode-map (let ((map (make-sparse-keymap))) (set-keymap-parent map tabulated-list-mode-map) - (define-key map "c" 'dispass-create))) + (define-key map "c" 'dispass-create) + map)) (defun dispass-process-sentinel (proc status) "Report PROC's status change to STATUS." -- cgit v1.2.3-54-g00ecf From b1e4dfbaab7fb3975716871f8cddd76d495d83ca Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 6 Jul 2012 00:26:27 +0200 Subject: Add dispass-default-length setting * dispass.el (dispass-default-length): Add default length to pass along to DisPass setting. (dispass-create): Use `dispass-default-length' when LENGTH is empty. --- dispass.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/dispass.el b/dispass.el index e30cb21..32f96a3 100644 --- a/dispass.el +++ b/dispass.el @@ -97,6 +97,12 @@ "Customization options for the DisPass wrapper." :group 'external) +(defcustom dispass-default-length 30 + "The default length to use when generating passphrases." + :package-version '(dispass . "1") + :group 'dispass + :type '(integer)) + (defcustom dispass-executable "dispass" "The location of the dispass executable." :package-version '(dispass . "0.1a7.3") @@ -175,13 +181,15 @@ an eye out for LABEL." (defun dispass-create (label &optional length) (interactive "MLabel: \nP") "Create a new password for LABEL." - (dispass-start-process label t length)) + (let ((length (or length dispass-default-length))) + (dispass-start-process label t length))) ;;;###autoload (defun dispass (label &optional length) (interactive "MLabel: \nP") "Recreate a password previously used." - (dispass-start-process label nil length)) + (let ((length (or length dispass-default-length))) + (dispass-start-process label nil length))) ;; Labels management (defun dispass-from-button (button) -- cgit v1.2.3-54-g00ecf From 198a920f7b2ec22f77aeb8259a01d75b47edd3e0 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 6 Jul 2012 00:30:15 +0200 Subject: Add ability to add label to file * dispass.el (dispass-labels-mode-map): Add direct keybinding for `dispass-add-label' so it is not required to always call `dispass-create'. (dispass-create): Call `dispass-add-label' in order to automatically insert newly created labels. (dispass-add-label): Adds a new label definition at the end of `dispass-file' and when `major-mode' is `dispass-labels-mode' reverts the buffer to show the changes. --- dispass.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dispass.el b/dispass.el index 32f96a3..b02f354 100644 --- a/dispass.el +++ b/dispass.el @@ -120,6 +120,7 @@ (let ((map (make-sparse-keymap))) (set-keymap-parent map tabulated-list-mode-map) (define-key map "c" 'dispass-create) + (define-key map "a" 'dispass-add-label) map)) (defun dispass-process-sentinel (proc status) @@ -182,7 +183,8 @@ an eye out for LABEL." (interactive "MLabel: \nP") "Create a new password for LABEL." (let ((length (or length dispass-default-length))) - (dispass-start-process label t length))) + (dispass-start-process label t length) + (dispass-add-label label length "dispass1"))) ;;;###autoload (defun dispass (label &optional length) @@ -192,6 +194,15 @@ an eye out for LABEL." (dispass-start-process label nil length))) ;; Labels management +;;;###autoload +(defun dispass-add-label (label length hashtype) + (interactive "MLabel: \nnLength: \nMHash: ") + (with-temp-buffer + (insert (format "%s length=%d hash=%s\n" label length hashtype)) + (append-to-file (point-min) (point-max) dispass-file)) + (when (eq major-mode 'dispass-labels-mode) + (revert-buffer))) + (defun dispass-from-button (button) "Call dispass with information from BUTTON." (dispass (button-get button 'dispass-label) -- cgit v1.2.3-54-g00ecf From e1a25a2078dc62ef28c1420fc938022a5acd3b35 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Fri, 6 Jul 2012 00:31:02 +0200 Subject: Add for side effects --- dispass.el | 1 + 1 file changed, 1 insertion(+) diff --git a/dispass.el b/dispass.el index b02f354..3a68482 100644 --- a/dispass.el +++ b/dispass.el @@ -233,6 +233,7 @@ an eye out for LABEL." (define-derived-mode dispass-labels-mode tabulated-list-mode "DisPass" "Major mode for listing dispass labels. +\\ \\{dispass-labels-mode-map}" (define-key dispass-labels-mode-map "c" 'dispass-create) (setq tabulated-list-format [("Label" 30 t) -- cgit v1.2.3-54-g00ecf From d7d34799d4f347d45445fba75ad91b503b728bc9 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 8 Jul 2012 16:02:14 +0200 Subject: Improve label repexp * dispass.el (dispass-labels--refresh): Change the regular expression used to allow `-' and `_' in the label names. --- dispass.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dispass.el b/dispass.el index 3a68482..66588f2 100644 --- a/dispass.el +++ b/dispass.el @@ -216,7 +216,7 @@ an eye out for LABEL." (with-temp-buffer (insert-file-contents dispass-file) (while (re-search-forward - "\\(\\w+\\) .*length=\\([0-9]+\\) .*hash=\\(\\w+\\)$" + "\\(\\(?:\\sw\\|\\s_\\)+\\) .*length=\\([0-9]+\\) .*hash=\\(\\sw+\\)$" nil t) (add-to-list 'tmp-list `(,(match-string 1) [(,(match-string 1) -- cgit v1.2.3-54-g00ecf From 9bd8cdaaa503ca821488aea9cd16ff6601b9c8a3 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 8 Jul 2012 16:05:07 +0200 Subject: Add function to remove label from labels file * dispass.el (dispass-remove-label): Removes the given or pointed-at label from `dispass-file'. When no label is found it will throw an error. (dispass-labels-mode-map): Add binding for `dispass-remove-label'. --- dispass.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/dispass.el b/dispass.el index 66588f2..b93654f 100644 --- a/dispass.el +++ b/dispass.el @@ -121,6 +121,7 @@ (set-keymap-parent map tabulated-list-mode-map) (define-key map "c" 'dispass-create) (define-key map "a" 'dispass-add-label) + (define-key map "d" 'dispass-remove-label) map)) (defun dispass-process-sentinel (proc status) @@ -203,6 +204,23 @@ an eye out for LABEL." (when (eq major-mode 'dispass-labels-mode) (revert-buffer))) +(defun dispass-remove-label (&optional label) + (interactive) + (let* ((labels-mode-p (eq major-mode 'dispass-labels-mode)) + (label (or label (when labels-mode-p (tabulated-list-get-id))))) + (unless label + (error + "LABEL required or must be called from `dispass-labels-mode'.")) + + (with-temp-buffer + (insert-file-contents dispass-file) + (re-search-forward (concat "^" label)) + (kill-whole-line) + (write-file dispass-file)) + + (when labels-mode-p + (revert-buffer)))) + (defun dispass-from-button (button) "Call dispass with information from BUTTON." (dispass (button-get button 'dispass-label) -- cgit v1.2.3-54-g00ecf From c7a86ac858a22abb131df64e8523f12b57e942cb Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 8 Jul 2012 17:44:29 +0200 Subject: Only remove when a match has been found * dispass.el (dispass-remove-label): Only remove a label if it has been found and don't throw an error when it hasn't. --- dispass.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dispass.el b/dispass.el index b93654f..3808f43 100644 --- a/dispass.el +++ b/dispass.el @@ -214,9 +214,9 @@ an eye out for LABEL." (with-temp-buffer (insert-file-contents dispass-file) - (re-search-forward (concat "^" label)) - (kill-whole-line) - (write-file dispass-file)) + (when (re-search-forward (concat "^" label) nil t) + (kill-whole-line) + (write-file dispass-file))) (when labels-mode-p (revert-buffer)))) -- cgit v1.2.3-54-g00ecf From 8d80a61ff46cde79eae3b447031a23190e1cfc62 Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 8 Jul 2012 18:22:41 +0200 Subject: Update change log --- dispass.el | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dispass.el b/dispass.el index 3808f43..14b48a9 100644 --- a/dispass.el +++ b/dispass.el @@ -90,7 +90,18 @@ ;; under the "External" group. ;; 1 - Add `dispass-list-labels' which shows a list of all the labels -;; in `dispass-file'. +;; in `dispass-file'. Some management of labels is possible in +;; this list, namely adding and deleting labels. + +;; - `dispass-create' will automatically add "created" labels to +;; `dispass-file'. + +;; - Store a default length in `dispass-default-length'. When no +;; length is given or found in the labels file, this length will +;; be passed on to DisPass. + +;; - Fix the regular expression used in `dispass-process-filter-for' +;; to support DisPass v0.1a8. ;;; Code: (defgroup dispass nil -- cgit v1.2.3-54-g00ecf From 116dc63f4948d88e67470d226e84b49a4dc9c7ae Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 8 Jul 2012 18:29:45 +0200 Subject: Add/fix docstrings --- dispass.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/dispass.el b/dispass.el index 14b48a9..32a2e53 100644 --- a/dispass.el +++ b/dispass.el @@ -133,7 +133,9 @@ (define-key map "c" 'dispass-create) (define-key map "a" 'dispass-add-label) (define-key map "d" 'dispass-remove-label) - map)) + map) + "Keymap for `dispass-labels-mode', uses + `tabulated-list-mode-map' as its parent.") (defun dispass-process-sentinel (proc status) "Report PROC's status change to STATUS." @@ -192,22 +194,23 @@ an eye out for LABEL." ;;;###autoload (defun dispass-create (label &optional length) - (interactive "MLabel: \nP") "Create a new password for LABEL." + (interactive "MLabel: \nP") (let ((length (or length dispass-default-length))) (dispass-start-process label t length) (dispass-add-label label length "dispass1"))) ;;;###autoload (defun dispass (label &optional length) - (interactive "MLabel: \nP") "Recreate a password previously used." + (interactive "MLabel: \nP") (let ((length (or length dispass-default-length))) (dispass-start-process label nil length))) ;; Labels management ;;;###autoload (defun dispass-add-label (label length hashtype) + "Add LABEL with length LENGTH and hashtype HASHTYPE to `dispass-file'." (interactive "MLabel: \nnLength: \nMHash: ") (with-temp-buffer (insert (format "%s length=%d hash=%s\n" label length hashtype)) @@ -216,6 +219,10 @@ an eye out for LABEL." (revert-buffer))) (defun dispass-remove-label (&optional label) + "Remove LABEL from `dispass-file', if LABEL is not given +`tabulated-list-get-id' will be used to get the currently +pointed-at label. If neither LABEL is not found an error is +thrown." (interactive) (let* ((labels-mode-p (eq major-mode 'dispass-labels-mode)) (label (or label (when labels-mode-p (tabulated-list-get-id))))) -- cgit v1.2.3-54-g00ecf From 30bfd28fcba8d3df8b845edaf2c9706496ee194f Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 8 Jul 2012 18:30:52 +0200 Subject: Remove unnecessary key definition * dispass.el (dispass-labels-mode): Remove the key definition for `dispass-create', it is already defined in `dispass-labels-mode-map'. --- dispass.el | 1 - 1 file changed, 1 deletion(-) diff --git a/dispass.el b/dispass.el index 32a2e53..7adb36f 100644 --- a/dispass.el +++ b/dispass.el @@ -271,7 +271,6 @@ thrown." \\ \\{dispass-labels-mode-map}" - (define-key dispass-labels-mode-map "c" 'dispass-create) (setq tabulated-list-format [("Label" 30 t) ("Length" 6 nil) ("Hash" 0 t)] -- cgit v1.2.3-54-g00ecf From 41e2eb2b805c017fff4660c4b9e724a3fb8ab98c Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 8 Jul 2012 22:45:53 +0200 Subject: Change keywords `encryption' and `security' don't seem to be acceptable keywords. --- dispass.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dispass.el b/dispass.el index 7adb36f..efbdc09 100644 --- a/dispass.el +++ b/dispass.el @@ -5,7 +5,7 @@ ;; Author: Tom Willemsen ;; Created: Jun 8, 2012 ;; Version: 1 -;; Keywords: encryption, security +;; Keywords: processes ;; Permission to use, copy, modify, and distribute this software for any ;; purpose with or without fee is hereby granted, provided that the -- cgit v1.2.3-54-g00ecf From 688bee7ca1f2c889643e299025a8deb944b705de Mon Sep 17 00:00:00 2001 From: Tom Willemsen Date: Sun, 8 Jul 2012 22:46:55 +0200 Subject: Clean up dispass-labels--refresh * dispass.el (dispass-labels--refresh): Store information once and reuse. --- dispass.el | 25 +++++++++++++++---------- 1 file 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" -- cgit v1.2.3-54-g00ecf