mirror of https://github.com/djcb/mu.git
* cosmetics
This commit is contained in:
parent
ae1deb4b10
commit
0623973ce0
|
@ -187,7 +187,7 @@ store your org-contacts."
|
|||
Make sure it is one of the headers mu recognizes for storing
|
||||
tags: X-Keywords, X-Label, Keywords. Also note that changing
|
||||
this setting on already tagged messages can lead to messages
|
||||
with multiple tags headers")
|
||||
with multiple tags headers.")
|
||||
|
||||
(defun mu4e~contains-line-matching (regexp path)
|
||||
"Determine whether the file at path contains a line matching
|
||||
|
@ -201,7 +201,7 @@ store your org-contacts."
|
|||
|
||||
(defun mu4e~replace-first-line-matching (regexp to-string path)
|
||||
"Replace the first line in the file at path that matches regexp
|
||||
with the string replace"
|
||||
with the string replace."
|
||||
(with-temp-file path
|
||||
(insert-file-contents path)
|
||||
(save-excursion (beginning-of-buffer)
|
||||
|
@ -222,7 +222,6 @@ store your org-contacts."
|
|||
(t ", ")))
|
||||
(taglist (if oldtags (copy-sequence oldtags) '()))
|
||||
tagstr)
|
||||
|
||||
(dolist (tag (split-string-and-unquote retag) taglist)
|
||||
(cond
|
||||
((string-match "^\\+\\(.+\\)" tag)
|
||||
|
@ -240,7 +239,8 @@ store your org-contacts."
|
|||
|
||||
(if (not (mu4e~contains-line-matching (concat header ":.*") path))
|
||||
;; Add tags header just before the content
|
||||
(mu4e~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
|
||||
(mu4e~replace-first-line-matching
|
||||
|
|
Loading…
Reference in New Issue