Browse Source

Fix expansion of archived trees

* lisp/org.el (org-hide-archived-subtrees): Do not assume BEG is at
  beginning of line.  This matters when function is called with point in
  the middle of an archived headline.

Reported-by: Hymie! <hymie@lactose.homelinux.net>
<http://permalink.gmane.org/gmane.emacs.orgmode/100291>
Nicolas Goaziou 9 years ago
parent
commit
daa8e23175
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lisp/org.el

+ 2 - 0
lisp/org.el

@@ -4755,6 +4755,8 @@ Otherwise, these types are allowed:
    (let ((case-fold-search nil)
 	 (re (concat org-outline-regexp-bol ".*:" org-archive-tag ":")))
      (goto-char beg)
+     ;; Include headline point is currently on.
+     (beginning-of-line)
      (while (and (< (point) end) (re-search-forward re end t))
        (when (member org-archive-tag (org-get-tags))
 	 (org-flag-subtree t)