mirror of https://github.com/djcb/mu.git
parent
2dca07612c
commit
b8861cdbfe
|
@ -161,14 +161,16 @@ Does a local-exit and does not return."
|
||||||
"Get PROP from plist LST and raise an error if not present."
|
"Get PROP from plist LST and raise an error if not present."
|
||||||
(or (plist-get lst prop)
|
(or (plist-get lst prop)
|
||||||
(if (plist-member lst prop)
|
(if (plist-member lst prop)
|
||||||
nil
|
nil
|
||||||
(mu4e-error "Missing property %s in %s" prop lst))))
|
(mu4e-error "Missing property %s in %s" prop lst))))
|
||||||
|
|
||||||
(defun mu4e--read-char-choice (prompt choices)
|
(defun mu4e--read-char-choice (prompt choices &optional key)
|
||||||
"Read and return one of CHOICES, prompting for PROMPT.
|
"Read and return one of CHOICES, prompting for PROMPT.
|
||||||
Any input that is not one of CHOICES is ignored. This is mu4e's
|
Any input that is not one of CHOICES is ignored. This is mu4e's
|
||||||
version of `read-char-choice' which becomes case-insentive after
|
version of `read-char-choice' which becomes case-insentive after
|
||||||
trying an exact match."
|
trying an exact match.
|
||||||
|
|
||||||
|
If optional KEY is provided, use that instead of asking user."
|
||||||
(let ((choice) (chosen) (inhibit-quit nil))
|
(let ((choice) (chosen) (inhibit-quit nil))
|
||||||
(while (not chosen)
|
(while (not chosen)
|
||||||
(message nil);; this seems needed...
|
(message nil);; this seems needed...
|
||||||
|
@ -369,18 +371,18 @@ http://cr.yp.to/proto/maildir.html."
|
||||||
(seq-mapcat
|
(seq-mapcat
|
||||||
(lambda (flag)
|
(lambda (flag)
|
||||||
(pcase flag
|
(pcase flag
|
||||||
(`draft "D")
|
(`draft "D")
|
||||||
(`flagged "F")
|
(`flagged "F")
|
||||||
(`new "N")
|
(`new "N")
|
||||||
(`passed "P")
|
(`passed "P")
|
||||||
(`replied "R")
|
(`replied "R")
|
||||||
(`seen "S")
|
(`seen "S")
|
||||||
(`trashed "T")
|
(`trashed "T")
|
||||||
(`attach "a")
|
(`attach "a")
|
||||||
(`encrypted "x")
|
(`encrypted "x")
|
||||||
(`signed "s")
|
(`signed "s")
|
||||||
(`unread "u")
|
(`unread "u")
|
||||||
(_ "")))
|
(_ "")))
|
||||||
(seq-uniq flags) 'string)))
|
(seq-uniq flags) 'string)))
|
||||||
|
|
||||||
(defun mu4e-string-to-flags (str)
|
(defun mu4e-string-to-flags (str)
|
||||||
|
@ -394,14 +396,14 @@ http://cr.yp.to/proto/maildir.html."
|
||||||
(seq-mapcat
|
(seq-mapcat
|
||||||
(lambda (kar)
|
(lambda (kar)
|
||||||
(list
|
(list
|
||||||
(pcase kar
|
(pcase kar
|
||||||
('?D 'draft)
|
('?D 'draft)
|
||||||
('?F 'flagged)
|
('?F 'flagged)
|
||||||
('?P 'passed)
|
('?P 'passed)
|
||||||
('?R 'replied)
|
('?R 'replied)
|
||||||
('?S 'seen)
|
('?S 'seen)
|
||||||
('?T 'trashed)
|
('?T 'trashed)
|
||||||
(_ nil))))
|
(_ nil))))
|
||||||
str))))
|
str))))
|
||||||
|
|
||||||
|
|
||||||
|
@ -470,7 +472,7 @@ The file will self-destruct in a short while, enough to open it
|
||||||
in an external program."
|
in an external program."
|
||||||
(let ((tmpfile (make-temp-file "mu4e-" nil (concat "." ext))))
|
(let ((tmpfile (make-temp-file "mu4e-" nil (concat "." ext))))
|
||||||
(run-at-time "30 sec" nil
|
(run-at-time "30 sec" nil
|
||||||
(lambda () (ignore-errors (delete-file tmpfile))))
|
(lambda () (ignore-errors (delete-file tmpfile))))
|
||||||
tmpfile))
|
tmpfile))
|
||||||
|
|
||||||
(defsubst mu4e-is-mode-or-derived-p (mode)
|
(defsubst mu4e-is-mode-or-derived-p (mode)
|
||||||
|
@ -492,12 +494,12 @@ Or go to the top level if there is none."
|
||||||
(defun mu4e--make-bookmark-record ()
|
(defun mu4e--make-bookmark-record ()
|
||||||
"Create a bookmark for the message at point."
|
"Create a bookmark for the message at point."
|
||||||
(let* ((msg (mu4e-message-at-point))
|
(let* ((msg (mu4e-message-at-point))
|
||||||
(subject (or (plist-get msg :subject) "No subject"))
|
(subject (or (plist-get msg :subject) "No subject"))
|
||||||
(date (plist-get msg :date))
|
(date (plist-get msg :date))
|
||||||
(date (if date (format-time-string "%F: " date) ""))
|
(date (if date (format-time-string "%F: " date) ""))
|
||||||
(title (format "%s%s" date subject))
|
(title (format "%s%s" date subject))
|
||||||
(msgid (or (plist-get msg :message-id)
|
(msgid (or (plist-get msg :message-id)
|
||||||
(mu4e-error "Cannot bookmark message without message-id"))))
|
(mu4e-error "Cannot bookmark message without message-id"))))
|
||||||
`(,title
|
`(,title
|
||||||
,@(bookmark-make-record-default 'no-file 'no-context)
|
,@(bookmark-make-record-default 'no-file 'no-context)
|
||||||
(message-id . ,msgid)
|
(message-id . ,msgid)
|
||||||
|
|
Loading…
Reference in New Issue