我使用最新的use emacs客户端来撰写和阅读我的电子邮件。(它们通过msmtp发送,并使用mbsync拉取。)
我希望所有新创建的邮件都使用format=flowed进行格式化。我在互联网上找到的这个问题的所有答案都与Gnus有关。
有没有办法在没有太多消息的情况下激活这个功能,或者如何通过elisp添加它?
发布于 2017-02-22 04:39:04
以下是工作原理:
(require 'messages-are-flowing)
(add-hook 'message-mode-hook #'messages-are-flowing-use-and-mark-hard-newlines)不需要使用Gnus来发送邮件。
发布于 2017-10-04 20:14:12
为此,我编写了一些自定义的elisp:
(defun as-format-as-flowed-text ()
"Format the buffer as flowed text according to RFC 2646.
This ensures that appropriate lines should be terminated with a
single space, and that \"> \" quoting prefixes are replaced with
\">\". Operates on the current region if active, otherwise on
the whole buffer."
(interactive)
(let ((start (if (use-region-p) (region-beginning) (point-min)))
(end (if (use-region-p) (region-end) (point-max))))
(save-excursion
(goto-char start)
;; Ensure appropriate lines end with a space
(while (re-search-forward "^\\(>+ ?\\)?\\S-.*\\S-$" end t)
(replace-match "\\& " t))
;; Replace "> " quoting prefixes with ">"
(goto-char start)
(let ((eol)
(eolm (make-marker)))
(while (setq eol (re-search-forward "^>.*" end t))
(set-marker eolm eol)
(goto-char (match-beginning 0))
(while (looking-at ">")
(if (looking-at "> ")
(replace-match ">")
(forward-char)))
(goto-char (marker-position eolm)))))))
(bind-key "M-s M-m" 'as-format-as-flowed-text)(您可以找到the permanent home for this here。我非常肯定它可以写得更优雅;建议甚至拉请求都非常受欢迎。)
在写完它几分钟后,我发现在gnus中对format=flowed有一定的本机支持。不幸的是,在撰写本文时,该功能似乎还不能立即在gnus之外重用。
我刚刚创建了https://www.emacswiki.org/emacs/FormatFlowed作为一个中心门户,以便尝试在一个地方收集关于这个主题的信息。
https://stackoverflow.com/questions/41299350
复制相似问题