From 32066ae43347a9660e5913ebeed8c1de2dda1c2b Mon Sep 17 00:00:00 2001 From: Jonas Bernoulli Date: Thu, 13 Feb 2020 09:28:15 +0100 Subject: [PATCH] mu4e~contains-line-matching: Cosmetics --- mu4e/mu4e-actions.el | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mu4e/mu4e-actions.el b/mu4e/mu4e-actions.el index a80744a0..59e8e221 100644 --- a/mu4e/mu4e-actions.el +++ b/mu4e/mu4e-actions.el @@ -296,14 +296,13 @@ messages can lead to messages with multiple tags headers.") "List of tags for completion in `mu4e-action-retag-message'.") (defun mu4e~contains-line-matching (regexp path) - "Does file at PATH contain a line matching the given REGEXP?" + "Return non-nil if the file at PATH contain a line matching REGEXP. +Otherwise return nil." (with-temp-buffer (insert-file-contents path) (save-excursion (goto-char (point-min)) - (if (re-search-forward regexp nil t) - t - nil)))) + (re-search-forward regexp nil t)))) (defun mu4e~replace-first-line-matching (regexp to-string path) "Replace first line matching REGEXP in PATH with TO-STRING."