branch: elpa/org-mime
commit 0b32455a18365b29c91189a16ce00ed94e948e9f
Author: Kristoffer Balintona <[email protected]>
Commit: Kristoffer Balintona <[email protected]>
fix: Saving in the org-mime org buffer no longer duplicates text
Currently, in `org-mime-edit-src-save`, the region between
`org-mime-src--beg-marker` and `org-mime-src--end-marker` would be
deleted followed by a replacement of the text in the org-mime org
buffer.
However, the deletion of that text would not move
`org-mime-src--end-marker` as desired: to the end of the new email
body. Consequently, subsequent saves in the org-mime org buffer could
duplicate text.
The problem arose because the TYPE argument of the `copy-marker` used
to create `org-mime-src--end-marker` was left nil. Instead, a value
of t moves the marker to the end of text inserted at its
location.:(For an explanation of why, see (elisp) Marker Insertion
Types.) Therefore, pass t to the TYPE argument of the `copy-marker`
used to create `org-mime-src--end-marker.
---
org-mime.el | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/org-mime.el b/org-mime.el
index 5f3c828301b..32257a3b265 100644
--- a/org-mime.el
+++ b/org-mime.el
@@ -878,7 +878,7 @@ Following headline properties can determine the mail
headers.
(t
(setq org-mime--saved-temp-window-config (current-window-configuration))
(let* ((beg (copy-marker (org-mime-mail-body-begin)))
- (end (copy-marker (or (org-mime-mail-signature-begin) (point-max))))
+ (end (copy-marker (or (org-mime-mail-signature-begin) (point-max))
t))
(bufname "OrgMimeMailBody")
(buffer (generate-new-buffer bufname))
(overlay (org-mime-src--make-source-overlay beg end))