Bläddra i källkod

Merge branch 'maint'

Bastien 4 år sedan
förälder
incheckning
8538654591
2 ändrade filer med 10 tillägg och 7 borttagningar
  1. 3 4
      doc/org-manual.org
  2. 7 3
      lisp/org.el

+ 3 - 4
doc/org-manual.org

@@ -6600,10 +6600,9 @@ into the buffer by ~org-clock-report~:
 #+end_example
 
 #+vindex: org-clocktable-defaults
-The =#+BEGIN= line and specify a number of options to define the
-scope, structure, and formatting of the report.  Defaults for all
-these options can be configured in the variable
-~org-clocktable-defaults~.
+The =#+BEGIN= line contains options to define the scope, structure,
+and formatting of the report.  Defaults for all these options can be
+configured in the variable ~org-clocktable-defaults~.
 
 First there are options that determine which clock entries are to
 be selected:

+ 7 - 3
lisp/org.el

@@ -11488,7 +11488,7 @@ are also TODO tasks."
   (interactive "P")
   (org-agenda-prepare-buffers (list (current-buffer)))
   (let ((org--matcher-tags-todo-only todo-only))
-    (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match))
+    (org-scan-tags 'sparse-tree (cdr (org-make-tags-matcher match t))
 		   org--matcher-tags-todo-only)))
 
 (defalias 'org-tags-sparse-tree 'org-match-sparse-tree)
@@ -11529,7 +11529,7 @@ instead of the agenda files."
 		   (if (car-safe files) files
 		     (org-agenda-files))))))))
 
-(defun org-make-tags-matcher (match)
+(defun org-make-tags-matcher (match &optional only-local-tags)
   "Create the TAGS/TODO matcher form for the selection string MATCH.
 
 Returns a cons of the selection string MATCH and a function
@@ -11547,6 +11547,9 @@ This function sets the variable `org--matcher-tags-todo-only' to
 a non-nil value if the matcher restricts matching to TODO
 entries, otherwise it is not touched.
 
+When ONLY-LOCAL-TAGS is non-nil, ignore the global tag completion
+table, only get buffer tags.
+
 See also `org-scan-tags'."
   (unless match
     ;; Get a new match request, with completion against the global
@@ -11554,7 +11557,8 @@ See also `org-scan-tags'."
     (let ((org-last-tags-completion-table
 	   (org--tag-add-to-alist
 	    (org-get-buffer-tags)
-	    (org-global-tags-completion-table))))
+	    (unless only-local-tags
+	      (org-global-tags-completion-table)))))
       (setq match
 	    (completing-read
 	     "Match: "