首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何使用How message客户端发送带有'format=flowed‘的消息?

如何使用How message客户端发送带有'format=flowed‘的消息?
EN

Stack Overflow用户
提问于 2016-12-23 18:10:30
回答 2查看 701关注 0票数 3

我使用最新的use emacs客户端来撰写和阅读我的电子邮件。(它们通过msmtp发送,并使用mbsync拉取。)

我希望所有新创建的邮件都使用format=flowed进行格式化。我在互联网上找到的这个问题的所有答案都与Gnus有关。

有没有办法在没有太多消息的情况下激活这个功能,或者如何通过elisp添加它?

EN

回答 2

Stack Overflow用户

发布于 2017-02-22 04:39:04

以下是工作原理:

代码语言:javascript
复制
 (require 'messages-are-flowing)
 (add-hook 'message-mode-hook #'messages-are-flowing-use-and-mark-hard-newlines)

不需要使用Gnus来发送邮件。

票数 1
EN

Stack Overflow用户

发布于 2017-10-04 20:14:12

为此,我编写了一些自定义的elisp:

代码语言:javascript
复制
(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作为一个中心门户,以便尝试在一个地方收集关于这个主题的信息。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/41299350

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档