update packages
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
;;; org-interactive-query.el --- Interactive modification of agenda query
|
||||
;;; org-interactive-query.el --- Interactive modification of agenda query -*- lexical-binding: t; -*-
|
||||
;;
|
||||
;; Copyright 2007-2021 Free Software Foundation, Inc.
|
||||
;;
|
||||
@@ -36,6 +36,7 @@
|
||||
;; ;
|
||||
|
||||
(require 'org)
|
||||
(require 'org-agenda)
|
||||
|
||||
(org-defkey org-agenda-mode-map "=" 'org-agenda-query-clear-cmd)
|
||||
(org-defkey org-agenda-mode-map "/" 'org-agenda-query-and-cmd)
|
||||
@@ -82,7 +83,7 @@ not change the current one."
|
||||
(set-buffer (get-buffer-create " *Org tags*"))
|
||||
(delete-other-windows)
|
||||
(split-window-vertically)
|
||||
(org-switch-to-buffer-other-window (get-buffer-create " *Org tags*")))
|
||||
(switch-to-buffer-other-window (get-buffer-create " *Org tags*")))
|
||||
(erase-buffer)
|
||||
(setq-local org-done-keywords done-keywords)
|
||||
(insert "Query: " current "\n")
|
||||
@@ -153,7 +154,7 @@ not change the current one."
|
||||
(setq expert nil)
|
||||
(delete-other-windows)
|
||||
(split-window-vertically)
|
||||
(org-switch-to-buffer-other-window " *Org tags*")
|
||||
(switch-to-buffer-other-window " *Org tags*")
|
||||
(and (fboundp 'fit-window-to-buffer)
|
||||
(fit-window-to-buffer))))
|
||||
((or (= c ?\C-g)
|
||||
@@ -193,10 +194,10 @@ not change the current one."
|
||||
(if (eq exit-after-next 'now) (throw 'exit t))
|
||||
(goto-char (point-min))
|
||||
(beginning-of-line 1)
|
||||
(delete-region (point) (point-at-eol))
|
||||
(delete-region (point) (line-end-position))
|
||||
(insert "Query: " current)
|
||||
(beginning-of-line 2)
|
||||
(delete-region (point) (point-at-eol))
|
||||
(delete-region (point) (line-end-position))
|
||||
(org-agenda-query-op-line op)
|
||||
(goto-char (point-min)))))
|
||||
(if rtn current nil))))
|
||||
@@ -225,20 +226,20 @@ not change the current one."
|
||||
(defun org-agenda-query-manip (current op groups kind tag)
|
||||
"Apply an operator to a query string and a tag.
|
||||
CURRENT is the current query string, OP is the operator, GROUPS is a
|
||||
list of lists of tags that are mutually exclusive. KIND is 'tag for a
|
||||
regular tag, or 'todo for a TODO keyword, and TAG is the tag or
|
||||
list of lists of tags that are mutually exclusive. KIND is \\='tag for a
|
||||
regular tag, or \\='todo for a TODO keyword, and TAG is the tag or
|
||||
keyword string."
|
||||
;; If this tag is already in query string, remove it.
|
||||
(setq current (org-agenda-query-clear current "[-\\+&|]?" tag))
|
||||
(if (equal op "=") current
|
||||
;; When using AND, also remove mutually exclusive tags.
|
||||
(if (equal op "+")
|
||||
(loop for g in groups do
|
||||
(if (member tag g)
|
||||
(mapc (lambda (x)
|
||||
(setq current
|
||||
(org-agenda-query-clear current "\\+" x)))
|
||||
g))))
|
||||
(cl-loop for g in groups do
|
||||
(if (member tag g)
|
||||
(mapc (lambda (x)
|
||||
(setq current
|
||||
(org-agenda-query-clear current "\\+" x)))
|
||||
g))))
|
||||
;; Decompose current query into q1 (tags) and q2 (TODOs).
|
||||
(org-agenda-query-decompose current)
|
||||
(let* ((q1 (match-string 1 current))
|
||||
@@ -258,11 +259,11 @@ keyword string."
|
||||
(unless (and files (car files))
|
||||
(setq files (org-agenda-files)))
|
||||
(save-excursion
|
||||
(loop for f in files do
|
||||
(set-buffer (find-file-noselect f))
|
||||
(loop for k in org-todo-key-alist do
|
||||
(setq alist (org-agenda-query-merge-todo-key
|
||||
alist k)))))
|
||||
(cl-loop for f in files do
|
||||
(set-buffer (find-file-noselect f))
|
||||
(cl-loop for k in org-todo-key-alist do
|
||||
(setq alist (org-agenda-query-merge-todo-key
|
||||
alist k)))))
|
||||
alist))
|
||||
|
||||
(defun org-agenda-query-merge-todo-key (alist entry)
|
||||
|
||||
Reference in New Issue
Block a user