mirror of https://github.com/djcb/mu.git
mu4e.texi: add hint about getting fields from raw messages
from a mailing-list reply, a quick & dirty way to get arbitrary headers from a message.
This commit is contained in:
parent
08bd686903
commit
068e459cc4
|
@ -2345,19 +2345,21 @@ kinds of assumptions, and they are subject to change, and should therefore
|
||||||
@end verbatim
|
@end verbatim
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
In addition, you should use functions in the right context; functions that
|
In addition, you should use functions in the right context; functions
|
||||||
start with @t{mu4e-view-} are only applicable to the message view, while
|
that start with @t{mu4e-view-} are only applicable to the message view,
|
||||||
functions starting with @t{mu4e-headers-} are only applicable to the headers
|
while functions starting with @t{mu4e-headers-} are only applicable to
|
||||||
view. Functions without such prefixes are applicable everywhere.
|
the headers view. Functions without such prefixes are applicable
|
||||||
|
everywhere.
|
||||||
|
|
||||||
@node Message functions
|
@node Message functions
|
||||||
@section Message functions
|
@section Message functions
|
||||||
|
|
||||||
Many functions in @t{mu4e} deal with message plist (property lists). They
|
Many functions in @t{mu4e} deal with message plist (property
|
||||||
contain information about messages, such as sender and recipient, subject,
|
lists). They contain information about messages, such as sender and
|
||||||
date and so on. To deal with these plists, there are a number of
|
recipient, subject, date and so on. To deal with these plists, there are
|
||||||
@code{mu4e-message-} functions (in @file{mu4e-message.el}), such as
|
a number of @code{mu4e-message-} functions (in @file{mu4e-message.el}),
|
||||||
@code{mu4e-message-field} and @code{mu4e-message-at-point}
|
such as @code{mu4e-message-field} and @code{mu4e-message-at-point}, and
|
||||||
|
a shortcut to combine the two, @code{mu4e-message-field-at-point}.
|
||||||
|
|
||||||
For example, to get the subject of the message at point, in either the headers
|
For example, to get the subject of the message at point, in either the headers
|
||||||
view or the message view, you could write:
|
view or the message view, you could write:
|
||||||
|
@ -2380,6 +2382,24 @@ recipients of the message?''), there is a convenience function
|
||||||
headers view.
|
headers view.
|
||||||
@end itemize
|
@end itemize
|
||||||
|
|
||||||
|
Note that the message-functions work available to @t{mu4e} -- the
|
||||||
|
headers that are stored in the database and, in
|
||||||
|
@code{mu4e-message-view}-context, the message body.
|
||||||
|
|
||||||
|
If you need access to other parts of the message, it is possible to do
|
||||||
|
so by hand, using the raw-message and some third-party tool like
|
||||||
|
@t{procmail}'s @t{formail}:
|
||||||
|
@lisp
|
||||||
|
(defun my-mu4e-any-message-field-at-point (hdr)
|
||||||
|
"Quick & dirty way to get an arbitrary header HDR at
|
||||||
|
point. Requires the 'formail' tool from procmail."
|
||||||
|
(replace-regexp-in-string "\n$" ""
|
||||||
|
(shell-command-to-string
|
||||||
|
(concat "formail -x " hdr " -c < "
|
||||||
|
(shell-quote-argument (mu4e-message-field-at-point :path))))))
|
||||||
|
@end lisp
|
||||||
|
|
||||||
|
|
||||||
@node Utility functions
|
@node Utility functions
|
||||||
@section Utility functions
|
@section Utility functions
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue