From 3553c0a5246a63bc5abceec7bce7c843b40dc947 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 22 Jan 2017 13:47:45 +0100 Subject: [PATCH] org-agenda: Make `org-agenda-skip-(entry|subtree)-when.*' obsolete * lisp/org-agenda.el (org-agenda-skip-entry-if): (org-agenda-skip-entry-if): (org-agenda-skip-entry-if): Move to... * lisp/org-compat.el (org-agenda-skip-entry-when-regexp-matches): (org-agenda-skip-subtree-when-regexp-matches): (org-agenda-skip-entry-when-regexp-matches-in-subtree): ... here and mark as obsolete. These functions are not used in code base anymore, and they are easily replaced with `org-agenda-skip-if'. --- etc/ORG-NEWS | 13 +++++++++++++ lisp/org-agenda.el | 37 ------------------------------------- lisp/org-compat.el | 41 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 37 deletions(-) diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS index bb3020cca..fdce28b1d 100644 --- a/etc/ORG-NEWS +++ b/etc/ORG-NEWS @@ -161,8 +161,21 @@ This allow to use a different title than entry title. ** Removed functions *** Org Timeline + This feature has been removed. Use a custom agenda view, possibly narrowed to current buffer to achieve a similar functionality. + +*** ~org-agenda-skip-entry-when-regexp-matches~ is obsolete + +Use ~org-agenda-skip-if~ instead. + +*** ~org-agenda-skip-subtree-when-regexp-matches~ is obsolete + +Use ~org-agenda-skip-if~ instead. + +*** ~org-agenda-skip-entry-when-regexp-matches-in-subtree~ is obsolete + +Use ~org-agenda-skip-if~ instead. ** Removed options *** ~org-agenda-repeating-timestamp-show-all~ is removed. diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el index 737e1841f..b95e17810 100644 --- a/lisp/org-agenda.el +++ b/lisp/org-agenda.el @@ -4775,43 +4775,6 @@ used by user-defined selections using `org-agenda-skip-function'.") This variable should not be set directly, but custom commands can bind it in the options section.") -(defun org-agenda-skip-entry-when-regexp-matches () - "Check if the current entry contains match for `org-agenda-skip-regexp'. -If yes, it returns the end position of this entry, causing agenda commands -to skip the entry but continuing the search in the subtree. This is a -function that can be put into `org-agenda-skip-function' for the duration -of a command." - (let ((end (save-excursion (org-end-of-subtree t))) - skip) - (save-excursion - (setq skip (re-search-forward org-agenda-skip-regexp end t))) - (and skip end))) - -(defun org-agenda-skip-subtree-when-regexp-matches () - "Check if the current subtree contains match for `org-agenda-skip-regexp'. -If yes, it returns the end position of this tree, causing agenda commands -to skip this subtree. This is a function that can be put into -`org-agenda-skip-function' for the duration of a command." - (let ((end (save-excursion (org-end-of-subtree t))) - skip) - (save-excursion - (setq skip (re-search-forward org-agenda-skip-regexp end t))) - (and skip end))) - -(defun org-agenda-skip-entry-when-regexp-matches-in-subtree () - "Check if the current subtree contains match for `org-agenda-skip-regexp'. -If yes, it returns the end position of the current entry (NOT the tree), -causing agenda commands to skip the entry but continuing the search in -the subtree. This is a function that can be put into -`org-agenda-skip-function' for the duration of a command. An important -use of this function is for the stuck project list." - (let ((end (save-excursion (org-end-of-subtree t))) - (entry-end (save-excursion (outline-next-heading) (1- (point)))) - skip) - (save-excursion - (setq skip (re-search-forward org-agenda-skip-regexp end t))) - (and skip entry-end))) - (defun org-agenda-skip-entry-if (&rest conditions) "Skip entry if any of CONDITIONS is true. See `org-agenda-skip-if' for details." diff --git a/lisp/org-compat.el b/lisp/org-compat.el index fc3b8d653..7e1412964 100644 --- a/lisp/org-compat.el +++ b/lisp/org-compat.el @@ -295,6 +295,47 @@ You could use brackets to delimit on what part the link will be. "set `:sitemap-format-entry' in `org-publish-project-alist' instead." "Org 9.1") +(defvar org-agenda-skip-regexp) +(defun org-agenda-skip-entry-when-regexp-matches () + "Check if the current entry contains match for `org-agenda-skip-regexp'. +If yes, it returns the end position of this entry, causing agenda commands +to skip the entry but continuing the search in the subtree. This is a +function that can be put into `org-agenda-skip-function' for the duration +of a command." + (declare (obsolete "use `org-agenda-skip-if' instead." "Org 9.1")) + (let ((end (save-excursion (org-end-of-subtree t))) + skip) + (save-excursion + (setq skip (re-search-forward org-agenda-skip-regexp end t))) + (and skip end))) + +(defun org-agenda-skip-subtree-when-regexp-matches () + "Check if the current subtree contains match for `org-agenda-skip-regexp'. +If yes, it returns the end position of this tree, causing agenda commands +to skip this subtree. This is a function that can be put into +`org-agenda-skip-function' for the duration of a command." + (declare (obsolete "use `org-agenda-skip-if' instead." "Org 9.1")) + (let ((end (save-excursion (org-end-of-subtree t))) + skip) + (save-excursion + (setq skip (re-search-forward org-agenda-skip-regexp end t))) + (and skip end))) + +(defun org-agenda-skip-entry-when-regexp-matches-in-subtree () + "Check if the current subtree contains match for `org-agenda-skip-regexp'. +If yes, it returns the end position of the current entry (NOT the tree), +causing agenda commands to skip the entry but continuing the search in +the subtree. This is a function that can be put into +`org-agenda-skip-function' for the duration of a command. An important +use of this function is for the stuck project list." + (declare (obsolete "use `org-agenda-skip-if' instead." "Org 9.1")) + (let ((end (save-excursion (org-end-of-subtree t))) + (entry-end (save-excursion (outline-next-heading) (1- (point)))) + skip) + (save-excursion + (setq skip (re-search-forward org-agenda-skip-regexp end t))) + (and skip entry-end))) + ;;;; Obsolete link types (eval-after-load 'org