aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tom Willemsen2012-07-08 17:44:29 +0200
committerGravatar Tom Willemsen2012-07-08 17:44:29 +0200
commitc7a86ac858a22abb131df64e8523f12b57e942cb (patch)
treeae90952820c4ae5429a9d3168449f717cc83902c
parent9bd8cdaaa503ca821488aea9cd16ff6601b9c8a3 (diff)
downloaddispass.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.el6
1 files 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))))