From 8cc49120fa669f9ae1335b58b2e5f31a20827209 Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Fri, 3 Apr 2009 20:41:36 +0200 Subject: [PATCH] Tags scan: Also find the first line in a buffer. 2nd attempt. --- lisp/ChangeLog | 3 +++ lisp/org.el | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2907e2690..ddbb7ed88 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2009-04-03 Carsten Dominik + * org.el (org-scan-tags): Make tag scan find headline in first + line, 2nd attempt. + * org-agenda.el (org-agenda-get-progress): Fix regexp bug. * org.el (org-block-todo-from-children-or-siblings-or-parent): diff --git a/lisp/org.el b/lisp/org.el index 32f699110..e0be410f3 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -9967,7 +9967,7 @@ MATCHER is a Lisp form to be evaluated, testing if a given set of tags qualifies a headline for inclusion. When TODO-ONLY is non-nil, only lines with a TODO keyword are included in the output." (require 'org-agenda) - (let* ((re (concat "[\n\r]" outline-regexp " *\\(\\<\\(" + (let* ((re (concat "^" outline-regexp " *\\(\\<\\(" (mapconcat 'regexp-quote org-todo-keywords-1 "\\|") (org-re "\\>\\)\\)? *\\(.*?\\)\\(:[[:alnum:]_@:]+:\\)?[ \t]*$"))) @@ -10078,7 +10078,8 @@ only lines with a TODO keyword are included in the output." (t (error "Invalid action"))) ;; if we are to skip sublevels, jump to end of subtree - (or org-tags-match-list-sublevels (org-end-of-subtree t)))))) + (or org-tags-match-list-sublevels (org-end-of-subtree t)))) + (and (= (point) lspos) (forward-char 1)))) (when (and (eq action 'sparse-tree) (not org-sparse-tree-open-archived-trees)) (org-hide-archived-subtrees (point-min) (point-max))) -- 2.11.4.GIT