Add missing `save-restriction' to template copy function

This commit is contained in:
Daniel - 2020-05-24 16:46:24 +02:00
parent fba18ca527
commit a404f9a8c2
No known key found for this signature in database
GPG Key ID: 1C7071A75BB72D64
1 changed files with 17 additions and 16 deletions

View File

@ -414,7 +414,8 @@ headline of the periodic task, i.e., of the parent of the current
item at point. The body of the template item, without any
drawers, will be copied to point."
(interactive)
(let ((template (save-mark-and-excursion
(let ((template (save-restriction
(save-mark-and-excursion
(let ((template-element (progn
(outline-up-heading 1 'invisible-ok)
(outline-next-heading)
@ -429,7 +430,7 @@ drawers, will be copied to point."
(goto-char (org-element-property :contents-end template-element))
(org-mark-element)
(buffer-substring-no-properties (region-beginning)
(region-end))))))
(region-end)))))))
(insert template)
(org-update-statistics-cookies nil)))