Bläddra i källkod

Tags scan: Also find the first line in a buffer. 2nd attempt.

Carsten Dominik 16 år sedan
förälder
incheckning
8cc49120fa
2 ändrade filer med 6 tillägg och 2 borttagningar
  1. 3 0
      lisp/ChangeLog
  2. 3 2
      lisp/org.el

+ 3 - 0
lisp/ChangeLog

@@ -1,5 +1,8 @@
 2009-04-03  Carsten Dominik  <carsten.dominik@gmail.com>
 
+	* 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):

+ 3 - 2
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)))