org.el (org-refile): Fix refiling the active region within an list
* org.el (org-refile): Fix refiling the active region within an list. Thanks to Jeff Horn and Samuel Wales.
This commit is contained in:
parent
e3195550fc
commit
5381ebd910
10
lisp/org.el
10
lisp/org.el
|
@ -11471,7 +11471,6 @@ prefix argument (`C-u C-u C-u C-c C-w')."
|
||||||
(regionp (org-region-active-p))
|
(regionp (org-region-active-p))
|
||||||
(region-start (and regionp (region-beginning)))
|
(region-start (and regionp (region-beginning)))
|
||||||
(region-end (and regionp (region-end)))
|
(region-end (and regionp (region-end)))
|
||||||
(region-length (and regionp (- region-end region-start)))
|
|
||||||
(filename (buffer-file-name (buffer-base-buffer cbuf)))
|
(filename (buffer-file-name (buffer-base-buffer cbuf)))
|
||||||
pos it nbuf file re level reversed)
|
pos it nbuf file re level reversed)
|
||||||
(setq last-command nil)
|
(setq last-command nil)
|
||||||
|
@ -11482,7 +11481,9 @@ prefix argument (`C-u C-u C-u C-c C-w')."
|
||||||
(unless (or (org-kill-is-subtree-p
|
(unless (or (org-kill-is-subtree-p
|
||||||
(buffer-substring region-start region-end))
|
(buffer-substring region-start region-end))
|
||||||
(prog1 org-refile-active-region-within-subtree
|
(prog1 org-refile-active-region-within-subtree
|
||||||
(org-toggle-heading)))
|
(let ((s (point-at-eol)))
|
||||||
|
(org-toggle-heading)
|
||||||
|
(setq region-end (+ (- (point-at-eol) s) region-end)))))
|
||||||
(user-error "The region is not a (sequence of) subtree(s)")))
|
(user-error "The region is not a (sequence of) subtree(s)")))
|
||||||
(if (equal goto '(16))
|
(if (equal goto '(16))
|
||||||
(org-refile-goto-last-stored)
|
(org-refile-goto-last-stored)
|
||||||
|
@ -11564,8 +11565,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
|
||||||
(if (not (bolp)) (newline))
|
(if (not (bolp)) (newline))
|
||||||
(org-paste-subtree level)
|
(org-paste-subtree level)
|
||||||
(when org-log-refile
|
(when org-log-refile
|
||||||
(org-add-log-setup 'refile nil nil 'findpos
|
(org-add-log-setup 'refile nil nil 'findpos org-log-refile)
|
||||||
org-log-refile)
|
|
||||||
(unless (eq org-log-refile 'note)
|
(unless (eq org-log-refile 'note)
|
||||||
(save-excursion (org-add-log-note))))
|
(save-excursion (org-add-log-note))))
|
||||||
(and org-auto-align-tags
|
(and org-auto-align-tags
|
||||||
|
@ -11583,7 +11583,7 @@ prefix argument (`C-u C-u C-u C-c C-w')."
|
||||||
(run-hooks 'org-after-refile-insert-hook))))
|
(run-hooks 'org-after-refile-insert-hook))))
|
||||||
(unless org-refile-keep
|
(unless org-refile-keep
|
||||||
(if regionp
|
(if regionp
|
||||||
(delete-region (point) (+ (point) region-length))
|
(delete-region (point) (+ (point) (- region-end region-start)))
|
||||||
(delete-region
|
(delete-region
|
||||||
(point-at-bol)
|
(point-at-bol)
|
||||||
(min (buffer-size) (1+ (org-end-of-subtree t))))))
|
(min (buffer-size) (1+ (org-end-of-subtree t))))))
|
||||||
|
|
Loading…
Reference in New Issue