mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2025-01-29 20:35:02 +00:00
org-agenda.el (org-agenda-write): Don't copy headlines' subtrees when writing to an .org file
* org-agenda.el (org-agenda-write): Don't copy headlines' subtrees when writing to an .org file. * org.el (org-copy-subtree): New parameter `nosubtrees'.
This commit is contained in:
parent
1af91246cf
commit
6bcd7c44ec
@ -3334,7 +3334,7 @@ If AGENDA-BUFFER-NAME, use this as the buffer name for the agenda to write."
|
||||
(push (save-excursion
|
||||
(set-buffer (marker-buffer m))
|
||||
(goto-char m)
|
||||
(org-copy-subtree)
|
||||
(org-copy-subtree 1 nil t t)
|
||||
org-subtree-clip)
|
||||
content)))
|
||||
(find-file file)
|
||||
|
16
lisp/org.el
16
lisp/org.el
@ -7880,7 +7880,7 @@ This is a short-hand for marking the subtree and then cutting it."
|
||||
(interactive "p")
|
||||
(org-copy-subtree n 'cut))
|
||||
|
||||
(defun org-copy-subtree (&optional n cut force-store-markers)
|
||||
(defun org-copy-subtree (&optional n cut force-store-markers nosubtrees)
|
||||
"Cut the current subtree into the clipboard.
|
||||
With prefix arg N, cut this many sequential subtrees.
|
||||
This is a short-hand for marking the subtree and then copying it.
|
||||
@ -7896,12 +7896,14 @@ useful if the caller implements cut-and-paste as copy-then-paste-then-cut."
|
||||
(setq beg (point))
|
||||
(skip-chars-forward " \t\r\n")
|
||||
(save-match-data
|
||||
(save-excursion (outline-end-of-heading)
|
||||
(setq folded (outline-invisible-p)))
|
||||
(condition-case nil
|
||||
(org-forward-heading-same-level (1- n) t)
|
||||
(error nil))
|
||||
(org-end-of-subtree t t))
|
||||
(if nosubtrees
|
||||
(outline-next-heading)
|
||||
(save-excursion (outline-end-of-heading)
|
||||
(setq folded (outline-invisible-p)))
|
||||
(condition-case nil
|
||||
(org-forward-heading-same-level (1- n) t)
|
||||
(error nil))
|
||||
(org-end-of-subtree t t)))
|
||||
(setq end (point))
|
||||
(goto-char beg0)
|
||||
(when (> end beg)
|
||||
|
Loading…
Reference in New Issue
Block a user