Fix org-mu4e
This commit is contained in:
+27
-10
@@ -131,16 +131,33 @@ The affected area is START to END in the current buffer."
|
|||||||
after-change-functions)))
|
after-change-functions)))
|
||||||
(insert content))))))
|
(insert content))))))
|
||||||
|
|
||||||
(defun org-mu4e--textify-org-part ()
|
(defun org-mu4e--textify-make-original-message-verbatim ()
|
||||||
"Replace the org part of the current buffer with plain text."
|
"Make the original message of a reply message verbatim."
|
||||||
(when-let* ((bounds (org-mu4e--bounds-of-mime-part "text/plain")))
|
(goto-char (point-max))
|
||||||
(with-restriction (car bounds) (cdr bounds)
|
(forward-line 0)
|
||||||
(let ((ascii-content (org-export-as 'ascii nil nil t))
|
(while (looking-at (rx bol eol))
|
||||||
(after-change-functions (remq 'jit-lock-after-change
|
(forward-line -1))
|
||||||
after-change-functions)))
|
(when (looking-at (rx bol "> "))
|
||||||
(delete-region (point-min) (point-max))
|
(end-of-line)
|
||||||
(insert ascii-content)
|
(insert "\n#+END_VERSE")
|
||||||
(put-text-property (point-min) (point-max) 'font-lock-face 'default)))))
|
(forward-line -1)
|
||||||
|
(while (looking-at (rx bol ">" (or " " eol)))
|
||||||
|
(forward-line -1))
|
||||||
|
(end-of-line)
|
||||||
|
(insert "\n#+BEGIN_VERSE"))
|
||||||
|
|
||||||
|
(defun org-mu4e--textify-org-part ()
|
||||||
|
"Replace the org part of the current buffer with plain text."
|
||||||
|
(when-let* ((bounds (org-mu4e--bounds-of-mime-part "text/plain")))
|
||||||
|
(with-restriction (car bounds) (cdr bounds)
|
||||||
|
(org-mu4e--textify-make-original-message-verbatim)
|
||||||
|
(let* ((org-ascii-quote-margin 0)
|
||||||
|
(ascii-content (org-export-as 'ascii nil nil t))
|
||||||
|
(after-change-functions (remq 'jit-lock-after-change
|
||||||
|
after-change-functions)))
|
||||||
|
(delete-region (point-min) (point-max))
|
||||||
|
(insert ascii-content)
|
||||||
|
(put-text-property (point-min) (point-max) 'font-lock-face 'default))))))
|
||||||
|
|
||||||
(defun org-mu4e--htmlize-and-cleanup ()
|
(defun org-mu4e--htmlize-and-cleanup ()
|
||||||
"HTMLize and cleanup the visible portion of the buffer.
|
"HTMLize and cleanup the visible portion of the buffer.
|
||||||
|
|||||||
Reference in New Issue
Block a user