diff options
author | Tom Willemsen | 2012-07-08 17:44:29 +0200 |
---|---|---|
committer | Tom Willemsen | 2012-07-08 17:44:29 +0200 |
commit | c7a86ac858a22abb131df64e8523f12b57e942cb (patch) | |
tree | ae90952820c4ae5429a9d3168449f717cc83902c | |
parent | 9bd8cdaaa503ca821488aea9cd16ff6601b9c8a3 (diff) | |
download | dispass.el-c7a86ac858a22abb131df64e8523f12b57e942cb.tar.gz dispass.el-c7a86ac858a22abb131df64e8523f12b57e942cb.zip |
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.
-rw-r--r-- | dispass.el | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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)))) |