|
@@ -1677,6 +1677,18 @@ When non-nil, this must be the number of minutes, e.g. 60 for one hour."
|
|
|
:group 'org-agenda-line-format
|
|
|
:type 'boolean)
|
|
|
|
|
|
+(defcustom org-agenda-use-tag-inheritance '(todo search timeline agenda)
|
|
|
+ "List of agenda view types where to use tag inheritance.
|
|
|
+
|
|
|
+In tags/tags-todo/tags-tree agenda views, tag inheritance is
|
|
|
+controlled by `org-use-tag-inheritance'. In other agenda types,
|
|
|
+`org-use-tag-inheritance' is not used when selecting the agenda
|
|
|
+entries, but you may want the agenda to use the inherited tags
|
|
|
+anyway, e.g. for later tag filtering.
|
|
|
+
|
|
|
+Setting this to nil will speed up non-tags agenda view a lot."
|
|
|
+ :version "24.3")
|
|
|
+
|
|
|
(defcustom org-agenda-hide-tags-regexp nil
|
|
|
"Regular expression used to filter away specific tags in agenda views.
|
|
|
This means that these tags will be present, but not be shown in the agenda
|
|
@@ -3577,9 +3589,20 @@ generating a new one."
|
|
|
(if (and (functionp 'org-habit-insert-consistency-graphs)
|
|
|
(save-excursion (next-single-property-change (point-min) 'org-habit-p)))
|
|
|
(org-habit-insert-consistency-graphs))
|
|
|
+ (setq org-agenda-type (org-get-at-bol 'org-agenda-type))
|
|
|
+ (when (delq nil (mapcar (lambda (tp) (org-agenda-check-type nil tp))
|
|
|
+ org-agenda-use-tag-inheritance))
|
|
|
+ (let (mrk)
|
|
|
+ (save-excursion
|
|
|
+ (goto-char (point-min))
|
|
|
+ (while (equal (forward-line) 0)
|
|
|
+ (when (setq mrk (or (get-text-property (point) 'org-hd-marker)
|
|
|
+ (get-text-property (point) 'org-hd-marker)))
|
|
|
+ (put-text-property (point-at-bol) (point-at-eol)
|
|
|
+ 'tags (org-with-point-at mrk
|
|
|
+ (delete-dups (org-get-tags-at)))))))))
|
|
|
(let ((inhibit-read-only t))
|
|
|
(run-hooks 'org-agenda-finalize-hook))
|
|
|
- (setq org-agenda-type (org-get-at-bol 'org-agenda-type))
|
|
|
(when (or org-agenda-tag-filter (get 'org-agenda-tag-filter :preset-filter))
|
|
|
(org-agenda-filter-apply org-agenda-tag-filter 'tag))
|
|
|
(when (or org-agenda-category-filter (get 'org-agenda-category-filter :preset-filter))
|
|
@@ -4456,7 +4479,7 @@ in `org-agenda-text-search-extra-files'."
|
|
|
category (org-get-category)
|
|
|
level (make-string (org-reduced-level (org-outline-level)) ? )
|
|
|
category-pos (get-text-property (point) 'org-category-position)
|
|
|
- tags (org-get-tags-at (point))
|
|
|
+ tags (org-get-tags-at nil t)
|
|
|
txt (org-agenda-format-item
|
|
|
""
|
|
|
(buffer-substring-no-properties
|
|
@@ -5292,7 +5315,7 @@ the documentation of `org-diary'."
|
|
|
category-pos (get-text-property (point) 'org-category-position)
|
|
|
txt (org-trim
|
|
|
(buffer-substring (match-beginning 2) (match-end 0)))
|
|
|
- tags (org-get-tags-at (point))
|
|
|
+ tags (org-get-tags-at nil t)
|
|
|
level (make-string (org-reduced-level (org-outline-level)) ? )
|
|
|
txt (org-agenda-format-item "" txt level category tags t)
|
|
|
priority (1+ (org-get-priority txt))
|
|
@@ -5461,7 +5484,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp?
|
|
|
clockp (and org-agenda-include-inactive-timestamps
|
|
|
(or (string-match org-clock-string tmp)
|
|
|
(string-match "]-+\\'" tmp)))
|
|
|
- warntime (org-entry-get (point) "APPT_WARNTIME")
|
|
|
+ warntime (get-text-property (point) 'org-appt-warntime)
|
|
|
donep (member todo-state org-done-keywords))
|
|
|
(if (or scheduledp deadlinep closedp clockp
|
|
|
(and donep org-agenda-skip-timestamp-if-done))
|
|
@@ -5480,7 +5503,7 @@ Do we have a reason to ignore this TODO entry because it has a time stamp?
|
|
|
(assoc (point) deadline-position-alist))
|
|
|
(throw :skip nil))
|
|
|
(setq hdmarker (org-agenda-new-marker)
|
|
|
- tags (org-get-tags-at)
|
|
|
+ tags (org-get-tags-at nil t)
|
|
|
level (make-string (org-reduced-level (org-outline-level)) ? ))
|
|
|
(looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
|
|
|
(setq head (or (match-string 1) ""))
|
|
@@ -5532,10 +5555,9 @@ Do we have a reason to ignore this TODO entry because it has a time stamp?
|
|
|
level (make-string (org-reduced-level (org-outline-level)) ? )
|
|
|
category (org-get-category beg)
|
|
|
category-pos (get-text-property beg 'org-category-position)
|
|
|
- tags (save-excursion (org-backward-heading-same-level 0)
|
|
|
- (org-get-tags-at))
|
|
|
+ tags (save-excursion (org-back-to-heading t) (org-get-tags-at nil t))
|
|
|
todo-state (org-get-todo-state)
|
|
|
- warntime (org-entry-get (point) "APPT_WARNTIME")
|
|
|
+ warntime (get-text-property (point) 'org-appt-warntime)
|
|
|
extra nil)
|
|
|
|
|
|
(dolist (r (if (stringp result)
|
|
@@ -5582,7 +5604,6 @@ Do we have a reason to ignore this TODO entry because it has a time stamp?
|
|
|
(org-no-warnings
|
|
|
(let ((calendar-date-style 'european) (european-calendar-style t))
|
|
|
(diary-date day month year mark))))
|
|
|
-(defalias 'org-float 'diary-float)
|
|
|
|
|
|
;; Define the` org-class' function
|
|
|
(defun org-class (y1 m1 d1 y2 m2 d2 dayname &rest skip-weeks)
|
|
@@ -5703,7 +5724,7 @@ please use `org-class' instead."
|
|
|
(setq txt org-agenda-no-heading-message)
|
|
|
(goto-char (match-beginning 0))
|
|
|
(setq hdmarker (org-agenda-new-marker)
|
|
|
- tags (org-get-tags-at)
|
|
|
+ tags (org-get-tags-at nil t)
|
|
|
level (make-string (org-reduced-level (org-outline-level)) ? ))
|
|
|
(looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
|
|
|
(setq txt (match-string 1))
|
|
@@ -5922,14 +5943,14 @@ See also the user option `org-agenda-clock-consistency-checks'."
|
|
|
(not (= diff 0))))
|
|
|
(setq txt nil)
|
|
|
(setq category (org-get-category)
|
|
|
- warntime (org-entry-get (point) "APPT_WARNTIME")
|
|
|
+ warntime (get-text-property (point) 'org-appt-warntime)
|
|
|
category-pos (get-text-property (point) 'org-category-position))
|
|
|
(if (not (re-search-backward "^\\*+[ \t]+" nil t))
|
|
|
(setq txt org-agenda-no-heading-message)
|
|
|
(goto-char (match-end 0))
|
|
|
(setq pos1 (match-beginning 0))
|
|
|
(setq level (make-string (org-reduced-level (org-outline-level)) ? ))
|
|
|
- (setq tags (org-get-tags-at pos1))
|
|
|
+ (setq tags (org-get-tags-at pos1 t))
|
|
|
(setq head (buffer-substring-no-properties
|
|
|
(point)
|
|
|
(progn (skip-chars-forward "^\r\n")
|
|
@@ -6014,7 +6035,7 @@ FRACTION is what fraction of the head-warning time has passed."
|
|
|
(match-string 1) d1 'past show-all
|
|
|
(current-buffer) pos)
|
|
|
diff (- d2 d1)
|
|
|
- warntime (org-entry-get (point) "APPT_WARNTIME"))
|
|
|
+ warntime (get-text-property (point) 'org-appt-warntime))
|
|
|
(setq pastschedp (and todayp (< diff 0)))
|
|
|
(setq did-habit-check-p nil)
|
|
|
;; When to show a scheduled item in the calendar:
|
|
@@ -6060,7 +6081,7 @@ FRACTION is what fraction of the head-warning time has passed."
|
|
|
pastschedp))
|
|
|
(setq mm (assoc pos1 deadline-position-alist)))
|
|
|
(throw :skip nil)))
|
|
|
- (setq tags (org-get-tags-at))
|
|
|
+ (setq tags (org-get-tags-at nil t))
|
|
|
(setq level (make-string (org-reduced-level (org-outline-level)) ? ))
|
|
|
(setq head (buffer-substring-no-properties
|
|
|
(point)
|
|
@@ -6144,7 +6165,7 @@ FRACTION is what fraction of the head-warning time has passed."
|
|
|
(setq txt org-agenda-no-heading-message)
|
|
|
(goto-char (match-beginning 0))
|
|
|
(setq hdmarker (org-agenda-new-marker (point)))
|
|
|
- (setq tags (org-get-tags-at))
|
|
|
+ (setq tags (org-get-tags-at nil t))
|
|
|
(setq level (make-string (org-reduced-level (org-outline-level)) ? ))
|
|
|
(looking-at "\\*+[ \t]+\\([^\r\n]+\\)")
|
|
|
(setq head (match-string 1))
|
|
@@ -6311,12 +6332,7 @@ Any match of REMOVE-RE will be removed from TXT."
|
|
|
(match-string 2 txt))
|
|
|
t t txt))))
|
|
|
(when (derived-mode-p 'org-mode)
|
|
|
- (setq effort
|
|
|
- (condition-case nil
|
|
|
- (org-get-effort
|
|
|
- (or (get-text-property 0 'org-hd-marker txt)
|
|
|
- (get-text-property 0 'org-marker txt)))
|
|
|
- (error nil)))
|
|
|
+ (setq effort (ignore-errors (get-text-property 0 'org-effort txt)))
|
|
|
(when effort
|
|
|
(setq neffort (org-duration-string-to-minutes effort)
|
|
|
effort (setq effort (concat "[" effort "]")))))
|
|
@@ -6840,7 +6856,8 @@ in the file. Otherwise, restriction will be to the current subtree."
|
|
|
|
|
|
(defun org-agenda-check-type (error &rest types)
|
|
|
"Check if agenda buffer is of allowed type.
|
|
|
-If ERROR is non-nil, throw an error, otherwise just return nil."
|
|
|
+If ERROR is non-nil, throw an error, otherwise just return nil.
|
|
|
+Allowed types are 'agenda 'timeline 'todo 'tags 'search."
|
|
|
(if (not org-agenda-type)
|
|
|
(error "No Org agenda currently displayed")
|
|
|
(if (memq org-agenda-type types)
|