Skip to content

Commit

Permalink
mu4e.texi: add diary example action
Browse files Browse the repository at this point in the history
  • Loading branch information
djcb committed Apr 12, 2024
1 parent adb560d commit 32d7326
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion mu4e/mu4e-mime-parts.el
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ Each of the actions is a plist with keys
;; - index: the index number of the mime part (default)
;; - temp: the full path to the mime part in a
;; temporary file, which is deleted immediately
;; after invoking handler
;; after the handler returns
;; - pipe: the attachment is piped to some shell command
;; or as a string parameter to a function
).")
Expand Down
16 changes: 11 additions & 5 deletions mu4e/mu4e.texi
Original file line number Diff line number Diff line change
Expand Up @@ -2984,21 +2984,27 @@ have more that one address.
@node MIME-part actions
@section MIME-part actions

Finally, let's define a MIME-part action. As mentioned, MIME-part
functions receive @emph{2} arguments, the message and the attachment
number to use.
Finally, let's define a MIME-part action.

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
description). See the the @code{mu4e-view-mime-part-actions} for the details
of the format.
description). See the the @code{mu4e-view-mime-part-actions} for the details of
the format.

@lisp
(add-to-list 'mu4e-view-mime-part-actions
;; count the number of lines in a MIME-part
'(:name "line-count" :handler "wc -l" :receives pipe))
@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
@section Example actions

Expand Down

0 comments on commit 32d7326

Please sign in to comment.