mu4e.texi: add diary example action

This commit is contained in:
Dirk-Jan C. Binnema
2024-04-12 19:59:34 +03:00
parent adb560d960
commit 32d73260d3
2 changed files with 12 additions and 6 deletions

View File

@ -361,7 +361,7 @@ Each of the actions is a plist with keys
;; - index: the index number of the mime part (default) ;; - index: the index number of the mime part (default)
;; - temp: the full path to the mime part in a ;; - temp: the full path to the mime part in a
;; temporary file, which is deleted immediately ;; temporary file, which is deleted immediately
;; after invoking handler ;; after the handler returns
;; - pipe: the attachment is piped to some shell command ;; - pipe: the attachment is piped to some shell command
;; or as a string parameter to a function ;; or as a string parameter to a function
).") ).")

View File

@ -2984,14 +2984,12 @@ have more that one address.
@node MIME-part actions @node MIME-part actions
@section MIME-part actions @section MIME-part actions
Finally, let's define a MIME-part action. As mentioned, MIME-part Finally, let's define a MIME-part action.
functions receive @emph{2} arguments, the message and the attachment
number to use.
The following example action counts the number of lines in an attachment, and The following example action counts the number of lines in an attachment, and
defines @key{n} as its shortcut key (the @key{n} is prefixed to the defines @key{n} as its shortcut key (the @key{n} is prefixed to the
description). See the the @code{mu4e-view-mime-part-actions} for the details description). See the the @code{mu4e-view-mime-part-actions} for the details of
of the format. the format.
@lisp @lisp
(add-to-list 'mu4e-view-mime-part-actions (add-to-list 'mu4e-view-mime-part-actions
@ -2999,6 +2997,14 @@ of the format.
'(:name "line-count" :handler "wc -l" :receives pipe)) '(:name "line-count" :handler "wc -l" :receives pipe))
@end lisp @end lisp
Or another one, to import a calendar invitation into the venerable emacs diary:
@lisp
(add-to-list 'mu4e-view-mime-part-actions
;; import into calendar;
'(:name "dimport-in-diary" :handler (lambda(file) (icalendar-import-file file diary-file))
:receives temp))
@end lisp
@node Example actions @node Example actions
@section Example actions @section Example actions