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