mu4e: document org-mu4e-store-and-capture in manual

Document org-mu4e-store-and-capture in the manual. Some cosmetics.
This commit is contained in:
djcb
2015-12-22 18:02:50 +02:00
parent 972678b6be
commit d6f8dd19df
2 changed files with 31 additions and 26 deletions

View File

@ -2841,7 +2841,6 @@ with other tools.
@menu @menu
* Setting the default emacs mail program:: * Setting the default emacs mail program::
* Creating org-mode links:: * Creating org-mode links::
* Rich-text messages with org-mode::
* Maintaining an address-book with org-contacts:: * Maintaining an address-book with org-contacts::
* Maintaining an address-book with BBDB:: * Maintaining an address-book with BBDB::
* Getting new mail notifications with Sauron:: * Getting new mail notifications with Sauron::
@ -2853,33 +2852,28 @@ with other tools.
@node Setting the default emacs mail program @node Setting the default emacs mail program
@section Setting the default @command{emacs} mail program @section Setting the default @command{emacs} mail program
@command{emacs} allows you to select an e-mail program as the default program @command{emacs} allows you to select an e-mail program as the default
it uses when you press @key{C-x m} (@code{compose-mail}), call program it uses when you press @key{C-x m} (@code{compose-mail}), call
@code{report-emacs-bug} and so on. If you want to use @t{mu4e} for this, you @code{report-emacs-bug} and so on. If you want to use @t{mu4e} for this,
do so by adding the following to your configuration: you can do so by adding the following to your configuration:
@lisp @lisp
(setq mail-user-agent 'mu4e-user-agent) (setq mail-user-agent 'mu4e-user-agent)
@end lisp @end lisp
@noindent
At the present time, support is @emph{experimental}.
@node Creating org-mode links @node Creating org-mode links
@section Creating @t{org-mode} links @section Creating @t{org-mode} links
It can be useful to include links to e-mail messages or even search queries in It can be useful to include links to e-mail messages or even search
your org-mode files. @t{mu4e} supports this with the @t{org-mu4e} module; you queries in your org-mode files. @t{mu4e} supports this with the
can set it up by adding it to your configuration: @t{org-mu4e} module; you can set it up by adding it to your
configuration:
@lisp @lisp
(require 'org-mu4e) (require 'org-mu4e)
@end lisp @end lisp
this expects org-mode 8.x. If you have an older version, you can try: this expects org-mode 8.x.@footnote{If you have an older version, you
can try @t{org-old-mu4e} instead}
@lisp
(require 'org-old-mu4e)
@end lisp
@noindent @noindent
After this, you can use the normal @t{org-mode} mechanisms to store After this, you can use the normal @t{org-mode} mechanisms to store
@ -2894,16 +2888,28 @@ You can insert this link later with @kbd{M-x org-insert-link}. From
either @kbd{M-x org-agenda-open-link} in agenda buffers, or @kbd{M-x either @kbd{M-x org-agenda-open-link} in agenda buffers, or @kbd{M-x
org-open-at-point} elsewhere - both typically bound to @kbd{C-c C-o}. org-open-at-point} elsewhere - both typically bound to @kbd{C-c C-o}.
@node Rich-text messages with org-mode You can also directly @emph{capture} such links - for example, to add
@section Rich-text messages with @t{org-mode} (deprecated) e-mail messages to your todo-list. For that, @t{org-mu4e} has a function
@code{org-mu4e-store-and-capture}. This captures the message-at-point
(or header - see the discussion on
@code{org-mu4e-link-query-in-headers-mode} above), then calls org-mode's
capture functionality.
It is possible to write rich-text messages using @t{org-mode}; see You can add some specific capture-template for this, for example, to add
@url{http://orgmode.org/worg/org-contrib/org-mime.html}. a message to your todo-list, and set a deadline for processing it within
two days, you could add this to @code{org-capture-templates}:
Note, some earlier versions of @t{mu4e} had more elaborate support for @lisp
editing e-mail messages using @t{org-mode}; since this never worked very ("S" "read-soon" entry (file+headline "todo.org" "Reading")
well, this has now been deprecated; it might be replaced with something "* TODO %a %?\nDEADLINE: %(org-insert-time-stamp (org-read-date nil t \"+2d\"))")
better in some future version. @end lisp
If you use the functionality a lot, you may want to define key-bindings
for that in headers and view mode:
@lisp
(define-key mu4e-headers-mode-map (kbd "C-c c") 'org-mu4e-store-and-capture)
(define-key mu4e-view-mode-map (kbd "C-c c") 'org-mu4e-store-and-capture)
@end lisp
@node Maintaining an address-book with org-contacts @node Maintaining an address-book with org-contacts
@section Maintaining an address-book with org-contacts @section Maintaining an address-book with org-contacts

View File

@ -123,7 +123,6 @@ Example usage:
(defun org-mu4e-open (path) (defun org-mu4e-open (path)
"Open the mu4e message (for paths starting with 'msgid:') or run "Open the mu4e message (for paths starting with 'msgid:') or run
the query (for paths starting with 'query:')." the query (for paths starting with 'query:')."
(require 'mu4e)
(cond (cond
((string-match "^msgid:\\(.+\\)" path) ((string-match "^msgid:\\(.+\\)" path)
(mu4e-view-message-with-msgid (match-string 1 path))) (mu4e-view-message-with-msgid (match-string 1 path)))
@ -131,7 +130,6 @@ the query (for paths starting with 'query:')."
(mu4e-headers-search (match-string 1 path) current-prefix-arg)) (mu4e-headers-search (match-string 1 path) current-prefix-arg))
(t (mu4e-error "mu4e: unrecognized link type '%s'" path)))) (t (mu4e-error "mu4e: unrecognized link type '%s'" path))))
(defun org-mu4e-store-and-capture () (defun org-mu4e-store-and-capture ()
"Store a link to the current message or query (depending on "Store a link to the current message or query (depending on
`org-mu4e-link-query-in-headers-mode', and capture it with `org-mu4e-link-query-in-headers-mode', and capture it with
@ -140,6 +138,7 @@ org-mode)."
(org-mu4e-store-link) (org-mu4e-store-link)
(org-capture)) (org-capture))
;;; editing with org-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; editing with org-mode ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;