forked from mirrors/org-mode
org-paste-subtree: Do not use `insert-before-markers'
* lisp/org.el (org-paste-subtree): Use `insert' instead of `insert-before-markers'. The former is what people usually expect and doing otherwise is surprising. * lisp/org-archive.el (org-archive-to-archive-sibling): Do not expect `org-paste-subtree' to insert before markers.
This commit is contained in:
parent
24d2826f04
commit
2861d9cad8
|
@ -453,6 +453,8 @@ Archiving time is retained in the ARCHIVE_TIME node property."
|
||||||
(setq leader (match-string 0)
|
(setq leader (match-string 0)
|
||||||
level (funcall outline-level))
|
level (funcall outline-level))
|
||||||
(setq pos (point-marker))
|
(setq pos (point-marker))
|
||||||
|
;; Advance POS upon insertion in front of it.
|
||||||
|
(set-marker-insertion-type pos t)
|
||||||
(condition-case nil
|
(condition-case nil
|
||||||
(outline-up-heading 1 t)
|
(outline-up-heading 1 t)
|
||||||
(error (setq e (point-max)) (goto-char (point-min))))
|
(error (setq e (point-max)) (goto-char (point-min))))
|
||||||
|
|
|
@ -7054,7 +7054,7 @@ When REMOVE is non-nil, remove the subtree from the clipboard."
|
||||||
;; is inserted and then promoted.
|
;; is inserted and then promoted.
|
||||||
(combine-change-calls beg beg
|
(combine-change-calls beg beg
|
||||||
(when (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt))
|
(when (fboundp 'org-id-paste-tracker) (org-id-paste-tracker txt))
|
||||||
(insert-before-markers txt)
|
(insert txt)
|
||||||
(unless (string-suffix-p "\n" txt) (insert "\n"))
|
(unless (string-suffix-p "\n" txt) (insert "\n"))
|
||||||
(setq newend (point))
|
(setq newend (point))
|
||||||
(org-reinstall-markers-in-region beg)
|
(org-reinstall-markers-in-region beg)
|
||||||
|
|
Loading…
Reference in a new issue