[Emacs] Simplification and optimisation of org-msg-signature

It’s faster to modify text while it is still in a buffer. The code is
also much simpler and nicer to look at.
This commit is contained in:
Lucien Cartier-Tilet 2022-07-03 12:24:28 +02:00
parent fa2e092f89
commit 1703b07d91
Signed by: phundrak
GPG Key ID: BD7789E705CB8DCA

View File

@ -2279,13 +2279,11 @@ the export part and write your emails directly in org-mode?
org-msg-convert-citation t org-msg-convert-citation t
org-msg-greeting-name-limit 3 org-msg-greeting-name-limit 3
org-msg-signature (format "\n--\n#+begin_signature\n%s\n#+end_signature" org-msg-signature (format "\n--\n#+begin_signature\n%s\n#+end_signature"
(string-trim (with-temp-buffer
(replace-regexp-in-string (insert-file-contents mail-signature-file)
(regexp-quote "\n") (while (re-search-forward "\n" nil t)
"\n\n" (replace-match "\n\n"))
(with-temp-buffer (buffer-string))))
(insert-file-contents mail-signature-file)
(buffer-string))))))
:general :general
(phundrak/major-leader-key (phundrak/major-leader-key
:keymaps 'org-msg-edit-mode-map :keymaps 'org-msg-edit-mode-map