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.
This commit is contained in:
Tom Willemsen 2012-07-06 00:26:27 +02:00
parent 4ba7794568
commit b1e4dfbaab

View file

@ -97,6 +97,12 @@
"Customization options for the DisPass wrapper." "Customization options for the DisPass wrapper."
:group 'external) :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" (defcustom dispass-executable "dispass"
"The location of the dispass executable." "The location of the dispass executable."
:package-version '(dispass . "0.1a7.3") :package-version '(dispass . "0.1a7.3")
@ -175,13 +181,15 @@ an eye out for LABEL."
(defun dispass-create (label &optional length) (defun dispass-create (label &optional length)
(interactive "MLabel: \nP") (interactive "MLabel: \nP")
"Create a new password for LABEL." "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 ;;;###autoload
(defun dispass (label &optional length) (defun dispass (label &optional length)
(interactive "MLabel: \nP") (interactive "MLabel: \nP")
"Recreate a password previously used." "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 ;; Labels management
(defun dispass-from-button (button) (defun dispass-from-button (button)