summaryrefslogtreecommitdiff
path: root/mu4e
diff options
context:
space:
mode:
authordjcb <djcb@djcbsoftware.nl>2014-09-02 05:15:25 -0700
committerdjcb <djcb@djcbsoftware.nl>2014-09-02 05:15:25 -0700
commit068e459cc4f4f6acf9021fc0f3c277d811599907 (patch)
treee3ed46fdd032237140ef0ac904b06c8e3c87d00e /mu4e
parent08bd686903e71fcf419146a5a48a3a3845c09c16 (diff)
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.
Diffstat (limited to 'mu4e')
-rw-r--r--mu4e/mu4e.texi38
1 files changed, 29 insertions, 9 deletions
diff --git a/mu4e/mu4e.texi b/mu4e/mu4e.texi
index 1a472a0..c56e506 100644
--- a/mu4e/mu4e.texi
+++ b/mu4e/mu4e.texi
@@ -2345,19 +2345,21 @@ kinds of assumptions, and they are subject to change, and should therefore
@end verbatim
@noindent
-In addition, you should use functions in the right context; functions that
-start with @t{mu4e-view-} are only applicable to the message view, while
-functions starting with @t{mu4e-headers-} are only applicable to the headers
-view. Functions without such prefixes are applicable everywhere.
+In addition, you should use functions in the right context; functions
+that start with @t{mu4e-view-} are only applicable to the message view,
+while functions starting with @t{mu4e-headers-} are only applicable to
+the headers view. Functions without such prefixes are applicable
+everywhere.
@node Message functions
@section Message functions
-Many functions in @t{mu4e} deal with message plist (property lists). They
-contain information about messages, such as sender and recipient, subject,
-date and so on. To deal with these plists, there are a number of
-@code{mu4e-message-} functions (in @file{mu4e-message.el}), such as
-@code{mu4e-message-field} and @code{mu4e-message-at-point}
+Many functions in @t{mu4e} deal with message plist (property
+lists). They contain information about messages, such as sender and
+recipient, subject, date and so on. To deal with these plists, there are
+a number of @code{mu4e-message-} functions (in @file{mu4e-message.el}),
+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
view or the message view, you could write:
@@ -2380,6 +2382,24 @@ recipients of the message?''), there is a convenience function
headers view.
@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
@section Utility functions