فهرست منبع

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'.
Nicolas Goaziou 8 سال پیش
والد
کامیت
3553c0a524
3فایلهای تغییر یافته به همراه54 افزوده شده و 37 حذف شده
  1. 13 0
      etc/ORG-NEWS
  2. 0 37
      lisp/org-agenda.el
  3. 41 0
      lisp/org-compat.el

+ 13 - 0
etc/ORG-NEWS

@@ -161,8 +161,21 @@ This allow to use a different title than entry title.
 ** Removed functions
 ** Removed functions
 
 
 *** Org Timeline
 *** Org Timeline
+
 This feature has been removed.  Use a custom agenda view, possibly
 This feature has been removed.  Use a custom agenda view, possibly
 narrowed to current buffer to achieve a similar functionality.
 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
 ** Removed options
 
 
 *** ~org-agenda-repeating-timestamp-show-all~ is removed.
 *** ~org-agenda-repeating-timestamp-show-all~ is removed.

+ 0 - 37
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
 This variable should not be set directly, but custom commands can bind it
 in the options section.")
 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)
 (defun org-agenda-skip-entry-if (&rest conditions)
   "Skip entry if any of CONDITIONS is true.
   "Skip entry if any of CONDITIONS is true.
 See `org-agenda-skip-if' for details."
 See `org-agenda-skip-if' for details."

+ 41 - 0
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."
  "set `:sitemap-format-entry' in `org-publish-project-alist' instead."
  "Org 9.1")
  "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
 ;;;; Obsolete link types
 
 
 (eval-after-load 'org
 (eval-after-load 'org