From 41e09b617ed97f4e509e3c80ee0409b34a8334f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20A=2E=20Gomes?= Date: Thu, 7 Oct 2021 15:59:05 +0300 Subject: [PATCH 07/76] Deprecate org-agenda-filter-top-headline-apply. --- lisp/org-agenda.el | 18 +++++++++--------- lisp/org-compat.el | 2 ++ 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 28cde5378..48539f3e5 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -3992,7 +3992,7 @@ agenda display, configure `org-agenda-finalize-hook'." (setq org-agenda-represented-tags nil org-agenda-represented-categories nil) (when org-agenda-top-headline-filter - (org-agenda-filter-top-headline-apply + (org-agenda-filter-top-heading-apply org-agenda-top-headline-filter)) (when org-agenda-tag-filter (org-agenda-filter-apply org-agenda-tag-filter 'tag t)) @@ -7640,7 +7640,7 @@ in the agenda." (when cat (org-agenda-filter-apply cat 'category)) (when effort (org-agenda-filter-apply effort 'effort)) (when re (org-agenda-filter-apply re 'regexp))) - (and top-hl-filter (org-agenda-filter-top-headline-apply top-hl-filter)) + (and top-hl-filter (org-agenda-filter-top-heading-apply top-hl-filter)) (and cols (called-interactively-p 'any) (org-agenda-columns)) (org-goto-line line) (when (called-interactively-p 'any) (recenter window-line)))) @@ -7712,7 +7712,7 @@ all lines of the category at point." org-agenda-top-headline-filter nil) (org-agenda-filter-show-all-top-filter)) (let ((toph (org-find-top-headline (org-get-at-bol 'org-hd-marker)))) - (if toph (org-agenda-filter-top-headline-apply toph strip) + (if toph (org-agenda-filter-top-heading-apply toph strip) (error "No top-level heading at point"))))) (defvar org-agenda-regexp-filter nil) @@ -8230,21 +8230,21 @@ grouptags." (when (get-char-property (point) 'invisible) (ignore-errors (org-agenda-previous-line)))) -(defun org-agenda-filter-top-headline-apply (hl &optional negative) - "Filter by top heading HL." +(defun org-agenda-filter-top-heading-apply (heading &optional negative) + "Filter by top HEADING." (org-agenda-set-mode-name) (save-excursion (goto-char (point-min)) (while (not (eobp)) (let* ((pos (org-get-at-bol 'org-hd-marker)) - (tophl (and pos (org-find-top-headline pos)))) - (when (and tophl (funcall (if negative 'identity 'not) - (string= hl tophl))) + (top-heading (and pos (org-find-top-headline pos)))) + (when (and top-heading (funcall (if negative 'identity 'not) + (string= heading top-heading))) (org-agenda-filter-hide-line 'top-headline))) (beginning-of-line 2))) (when (get-char-property (point) 'invisible) (org-agenda-previous-line)) - (setq org-agenda-top-headline-filter hl + (setq org-agenda-top-headline-filter heading org-agenda-filtered-by-top-headline t)) (defun org-agenda-filter-hide-line (type) diff --git a/lisp/org-compat.el b/lisp/org-compat.el index 498d61344..8f078f8d5 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -322,6 +322,8 @@ Counting starts at 1." 'org-add-log-current-heading "9.5") (define-obsolete-function-alias 'org-agenda-filter-by-top-headline 'org-agenda-filter-by-top-heading "9.5") +(define-obsolete-function-alias 'org-agenda-filter-top-headline-apply + 'org-agenda-filter-top-heading-apply "9.5") (defun org-in-fixed-width-region-p () "Non-nil if point in a fixed-width region." -- 2.33.0