【发布时间】:2015-10-05 09:03:15
【问题描述】:
我想通过外部过滤器重写完全组合的 emacs-gnus 消息/帖子(标题和正文)
(外部程序/脚本,STDIN 到 STDOUT)。
怎么做?
【问题讨论】:
标签: email emacs elisp emacs24 gnus
我想通过外部过滤器重写完全组合的 emacs-gnus 消息/帖子(标题和正文)
(外部程序/脚本,STDIN 到 STDOUT)。
怎么做?
【问题讨论】:
标签: email emacs elisp emacs24 gnus
将你的函数添加到message-send-hook:
(add-hook 'message-send-hook 'my-message-rewrite)
(defun my-message-rewrite ()
"Pipe the current message buffer through the command and replace it with the output."
(shell-command-on-region (point-min) (point-max)
"my command line with args"
t t))
显然您不必求助于 shell 命令,您的 lisp 函数可以做的更多。
注意事项:
这个钩子“很早就”运行;您可能想改用 message-send-mail-hook - 它运行“非常晚”。
让我重申一下:你在这里逆流游泳。你确实不想要这样做。请在 emacs.SE 上提出一个单独的问题,描述您的 perl 脚本的作用,您将看到使用 Lisp 完成它是多么容易。
【讨论】: