diff options
author | Carl Worth <cworth@cworth.org> | 2009-11-04 16:54:09 -0800 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2009-11-04 16:54:09 -0800 |
commit | 19993ea33b618b054398244114d6e1181a34cb84 (patch) | |
tree | 9149344b3eee61400f7a06af18d8164cd49a07bd /notmuch.el | |
parent | 3a330cb84a4f42d0013a772609fd10330a8413b0 (diff) |
notmuch.el: Add a simple command to pipe a message to a process.
With the obvious keybinding.
Diffstat (limited to 'notmuch.el')
-rw-r--r-- | notmuch.el | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -44,6 +44,7 @@ (define-key map "-" 'notmuch-show-remove-tag) (define-key map (kbd "DEL") 'notmuch-show-rewind) (define-key map " " 'notmuch-show-advance-marking-read-and-archiving) + (define-key map "|" 'notmuch-show-pipe-message) map) "Keymap for \"notmuch show\" buffers.") (fset 'notmuch-show-mode-map notmuch-show-mode-map) @@ -187,6 +188,15 @@ buffer." (interactive) (view-file (notmuch-show-get-filename))) +(defun notmuch-show-pipe-message (command) + "Pipe the contents of the current message to the given command. + +The given command will be executed with the raw contents of the +current email message as stdin. Anything printed by the command +to stdout or stderr will appear in the *Messages* buffer." + (interactive "sPipe message to command: ") + (apply 'start-process-shell-command "notmuch-pipe-command" "*notmuch-pipe*" (split-string (concat command " < " (notmuch-show-get-filename))))) + (defun notmuch-show-move-to-current-message-summary-line () "Move to the beginning of the one-line summary of the current message. |