有没有一种方法可以在elisp代码中从区域或缓冲区构建电子邮件消息,设置收件人,然后发送消息?
我已经配置了emacs通过我的gmail帐户发送邮件,我想能够从elisp程序向自己发送电子邮件。使用的命令是message-mail。
(defun my-message-mail-region (b e to subject)
"Send the current region in an email"
(interactive "r\nsRecipient: \nsSubject: ")
(let ((orig-buffer (current-buffer)))
(message-mail to subject)
(message-goto-body)
(insert (save-excursion (set-buffer orig-buffer)
(buffer-substring-no-properties b e)))
(message-send-and-exit)))
`在mail-region:init.el:48:3:警告:使用'with-current-buffer'而不是save-excursion+set-buffer`
- incandescentman