forked from mirrors/org-mode
org: Fix: keep archived subtrees hidden after C-c C-k
* lisp/org.el (org-kill-note-or-show-branches): Hide archived subtrees. Report by Allen Li https://lists.gnu.org/archive/html/emacs-orgmode/2019-12/msg00396.html
This commit is contained in:
parent
c0c790eb9b
commit
524ccf3adb
12
lisp/org.el
12
lisp/org.el
|
@ -18012,9 +18012,15 @@ Move point to the beginning of first heading or end of buffer."
|
||||||
(let ((org-note-abort t))
|
(let ((org-note-abort t))
|
||||||
(funcall org-finish-function))
|
(funcall org-finish-function))
|
||||||
(if (org-before-first-heading-p)
|
(if (org-before-first-heading-p)
|
||||||
(org-show-branches-buffer)
|
(progn
|
||||||
(outline-hide-subtree)
|
(org-show-branches-buffer)
|
||||||
(outline-show-branches))))
|
(org-hide-archived-subtrees (point-min) (point-max)))
|
||||||
|
(let ((beg (progn (outline-back-to-heading) (point)))
|
||||||
|
(end (progn (outline-end-of-subtree) (point))))
|
||||||
|
(goto-char beg)
|
||||||
|
(outline-hide-subtree)
|
||||||
|
(outline-show-branches)
|
||||||
|
(org-hide-archived-subtrees beg end)))))
|
||||||
|
|
||||||
(defun org-delete-indentation (&optional arg)
|
(defun org-delete-indentation (&optional arg)
|
||||||
"Join current line to previous and fix whitespace at join.
|
"Join current line to previous and fix whitespace at join.
|
||||||
|
|
|
@ -7257,6 +7257,16 @@ Contents
|
||||||
(org-set-visibility-according-to-property)
|
(org-set-visibility-according-to-property)
|
||||||
(invisible-p (point)))))
|
(invisible-p (point)))))
|
||||||
|
|
||||||
|
(ert-deftest test-org/visibility-show-branches ()
|
||||||
|
"Test visibility of inline archived subtrees."
|
||||||
|
(org-test-with-temp-text
|
||||||
|
"* Foo<point>
|
||||||
|
** Bar :ARCHIVE:
|
||||||
|
*** Baz
|
||||||
|
"
|
||||||
|
(org-kill-note-or-show-branches)
|
||||||
|
(should (org-invisible-p (- (point-max) 2)))))
|
||||||
|
|
||||||
|
|
||||||
;;; Yank and Kill
|
;;; Yank and Kill
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue