1
0
mirror of https://github.com/djcb/mu.git synced 2024-06-30 08:01:07 +02:00

* mu4e: uses correct helper function naming conventions.

This commit is contained in:
D. LoBraico 2013-03-16 12:40:12 -05:00
parent 8fe98f3853
commit 0d4d7b4ff1

View File

@ -189,7 +189,7 @@ store your org-contacts."
this setting on already tagged messages can lead to messages this setting on already tagged messages can lead to messages
with multiple tags headers") with multiple tags headers")
(defun contains-line-matching (regexp path) (defun mu4e-contains-line-matching (regexp path)
"Determine whether the file at path contains a line matching "Determine whether the file at path contains a line matching
the given regexp." the given regexp."
(with-temp-buffer (with-temp-buffer
@ -199,7 +199,7 @@ store your org-contacts."
t t
nil)))) nil))))
(defun replace-first-line-matching (regexp to-string path) (defun mu4e-replace-first-line-matching (regexp to-string path)
"Replace the first line in the file at path that matches regexp "Replace the first line in the file at path that matches regexp
with the string replace" with the string replace"
(with-temp-file path (with-temp-file path
@ -237,12 +237,12 @@ store your org-contacts."
(setq tagstr (replace-regexp-in-string "[\\&]" "\\\\\\&" tagstr)) (setq tagstr (replace-regexp-in-string "[\\&]" "\\\\\\&" tagstr))
(setq tagstr (replace-regexp-in-string "[/]" "\\&" tagstr)) (setq tagstr (replace-regexp-in-string "[/]" "\\&" tagstr))
(if (not (contains-line-matching (concat header ":.*") path)) (if (not (mu4e-contains-line-matching (concat header ":.*") path))
;; Add tags header just before the content ;; Add tags header just before the content
(replace-first-line-matching "^$" (concat header ": " tagstr "\n") path) (mu4e-replace-first-line-matching "^$" (concat header ": " tagstr "\n") path)
;; replaces keywords, restricted to the header ;; replaces keywords, restricted to the header
(replace-first-line-matching (mu4e-replace-first-line-matching
(concat header ":.*") (concat header ":.*")
(concat header ": " tagstr) (concat header ": " tagstr)
path)) path))