By calling `dispass-label' with it's brand spankin' new `--add' and
`--remove' switches the `dispass-add-label' and `dispass-remove-label'
functions can be greatly simplified. This also removes the need for
the `dispass-file', which assumed the file was in `~/', though that is
not the default case with DisPass anymore.
When looking at dispass.el through ELPA it was not clear that
dispass.el is only a wrapper around DisPass and does not actually do
any of the work itself.
The way `shell-command' was being used would open a new window every
time `dispass-get-labels' would get called, so now use
`shell-command-to-string' in combination with `insert' in order to
prevent that from happening.
* 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 (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 (dispass-default-length): Add default length to pass
along to DisPass setting.
(dispass-create): Use `dispass-default-length' when LENGTH is
empty.
By using `defgroup' and `defcustom' the variable (and possible later
variables) can be changed through Emacs' extensive customization
interface.
M-x customize-group <RET> dispass <RET>
Will show you the variables that can be changed for dispass.el.
Using a numeric prefix argument when calling either `dispass' or
`dispass-create' will invoke dispass with the -l switch to cut
passwords down to a certain size.