[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org eb0a293a02 048/101: Remove 'org-category text prope
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org eb0a293a02 048/101: Remove 'org-category text property cache |
Date: |
Sat, 1 Jul 2023 09:59:08 -0400 (EDT) |
branch: externals/org
commit eb0a293a02f60b854bc631a5c10b0be74dc7c2c6
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
Remove 'org-category text property cache
* lisp/org.el (org-get-category): Update useing
`org-entry-get-with-inheritance'.
(org-agenda-ignore-properties): Update docstring.
(org-refresh-category-properties):
(org-check-agenda-file): Do not call
`org-refresh-category-properties'.
* lisp/org-compat.el (org-refresh-category-properties): Obsolete.
* doc/org-manual.org (Speeding Up Your Agendas): Update the manual.
* testing/lisp/test-org.el (test-org/get-category): Update tests, not
calling the obsolete function.
---
doc/org-manual.org | 6 +++---
lisp/org-agenda.el | 2 +-
lisp/org-compat.el | 2 ++
lisp/org.el | 28 +++++++++-------------------
testing/lisp/test-org.el | 44 ++++++++++++++++++--------------------------
5 files changed, 33 insertions(+), 49 deletions(-)
diff --git a/doc/org-manual.org b/doc/org-manual.org
index 00901ad130..33648769d9 100644
--- a/doc/org-manual.org
+++ b/doc/org-manual.org
@@ -21768,12 +21768,12 @@ number. Here are tips to speed up:
- Disable parsing of some drawer properties:
#+begin_src emacs-lisp
- (setq org-agenda-ignore-properties '(effort appt stats category))
+ (setq org-agenda-ignore-properties '(effort appt stats))
#+end_src
The drawer properties you can disable in the agenda are effort
- estimates (~effort~), appointments (~appt~), statistics (~stats~)
- and subtree-local categories (~category~).
+ estimates (~effort~), appointments (~appt~), and statistics
+ (~stats~).
These options can be applied to selected agenda views. For more
details about generation of agenda views, see the docstrings for the
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index eb02335b48..da74ed5381 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -5664,7 +5664,7 @@ and the timestamp type relevant for the sorting strategy
in
(throw :skip nil)))
(goto-char (match-beginning 2))
(setq marker (org-agenda-new-marker (match-beginning 0))
- category (org-get-category)
+ category (save-match-data (org-get-category))
effort (save-match-data (or (get-text-property (point) 'effort)
(org-entry-get (point)
org-effort-property)))
effort-minutes (when effort (save-match-data
(org-duration-to-minutes effort)))
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index a12400ed28..9316aefc56 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -582,6 +582,8 @@ Counting starts at 1."
(define-obsolete-function-alias 'org--math-always-on
'org--math-p "9.7")
+(make-obsolete 'org-refresh-category-properties "no longer used" "9.7")
+
(defun org-compatible-face (inherits specs)
"Make a compatible face specification.
If INHERITS is an existing face and if the Emacs version supports
diff --git a/lisp/org.el b/lisp/org.el
index 44a41f9f63..856a37a7c5 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7956,20 +7956,13 @@ call CMD."
(cl-progv vars vals
(call-interactively cmd))))
-(defun org-get-category (&optional pos force-refresh)
- "Get the category applying to position POS."
- (save-match-data
- (when force-refresh (org-refresh-category-properties))
- (let ((pos (or pos (point))))
- (if (org-element--cache-active-p)
- ;; Sync cache.
- (org-with-point-at (org-element-begin (org-element-at-point pos))
- (or (org-entry-get-with-inheritance "CATEGORY")
- "???"))
- (or (get-text-property pos 'org-category)
- (progn
- (org-refresh-category-properties)
- (get-text-property pos 'org-category)))))))
+(defun org-get-category (&optional pos _)
+ "Get the category applying to position POS.
+Return \"???\" when no category is set."
+ ;; Sync cache.
+ (or (org-entry-get-with-inheritance
+ "CATEGORY" nil (or pos (point)))
+ "???"))
;;; Refresh properties
@@ -15246,12 +15239,11 @@ appointments, statistics and subtree-local categories.
If you don't use these in the agenda, you can add them to this
list and agenda building will be a bit faster.
The value is a list, with zero or more of the symbols `effort', `appt',
-`stats' or `category'."
+or `stats'."
:type '(set :greedy t
(const effort)
(const appt)
- (const stats)
- (const category))
+ (const stats))
:version "26.1"
:package-version '(Org . "8.3")
:group 'org-agenda)
@@ -15536,8 +15528,6 @@ When a buffer is unmodified, it is just killed. When
modified, it is saved
(org-get-agenda-file-buffer file))
(org-with-wide-buffer
(org-set-regexps-and-options 'tags-only)
- (or (memq 'category org-agenda-ignore-properties)
- (org-refresh-category-properties))
(or (memq 'stats org-agenda-ignore-properties)
(org-refresh-stats-properties))
(or (memq 'effort org-agenda-ignore-properties)
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index e1bd00919e..bd8f905d7b 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -6911,47 +6911,39 @@ Paragraph<point>"
(org-refresh-properties "A" 'org-test))
(get-text-property (point) 'org-test)))))
-(ert-deftest test-org/refresh-category-properties ()
- "Test `org-refresh-category-properties' specifications"
+(ert-deftest test-org/get-category ()
+ "Test `org-get-category' specifications."
(should
(equal "cat1"
(org-test-with-temp-text
- ":PROPERTIES:\n:CATEGORY: cat1\n:END:"
- (org-refresh-category-properties)
- (org-get-category))))
+ ":PROPERTIES:\n:CATEGORY: cat1\n:END:"
+ (org-get-category))))
(should
(equal "cat1"
(org-test-with-temp-text
- "* H\n:PROPERTIES:\n:CATEGORY: cat1\n:END:"
- (org-refresh-category-properties)
- (org-get-category))))
+ "* H\n:PROPERTIES:\n:CATEGORY: cat1\n:END:"
+ (org-get-category))))
;; Even though property-inheritance is deactivated, category
;; property should be inherited. As described in
;; `org-use-property-inheritance'.
(should
(equal "cat1"
- (org-test-with-temp-text
- ":PROPERTIES:\n:CATEGORY: cat1\n:END:\n<point>* H"
- (org-mode-restart)
- (let ((org-use-property-inheritance nil))
- (org-refresh-category-properties))
- (org-get-category))))
+ (let ((org-use-property-inheritance nil))
+ (org-test-with-temp-text
+ ":PROPERTIES:\n:CATEGORY: cat1\n:END:\n<point>* H"
+ (org-get-category)))))
(should
(equal "cat1"
- (org-test-with-temp-text
- ":PROPERTIES:\n:CATEGORY: cat1\n:END:\n<point>* H"
- (org-mode-restart)
- (let ((org-use-property-inheritance t))
- (org-refresh-category-properties))
- (org-get-category))))
+ (let ((org-use-property-inheritance t))
+ (org-test-with-temp-text
+ ":PROPERTIES:\n:CATEGORY: cat1\n:END:\n<point>* H"
+ (org-get-category)))))
(should
(equal "cat2"
- (org-test-with-temp-text
- ":PROPERTIES:\n:CATEGORY: cat1\n:END:\n<point>*
H\n:PROPERTIES:\n:CATEGORY: cat2\n:END:\n"
- (org-mode-restart)
- (let ((org-use-property-inheritance t))
- (org-refresh-category-properties))
- (org-get-category)))))
+ (let ((org-use-property-inheritance t))
+ (org-test-with-temp-text
+ ":PROPERTIES:\n:CATEGORY: cat1\n:END:\n<point>*
H\n:PROPERTIES:\n:CATEGORY: cat2\n:END:\n"
+ (org-get-category))))))
;;; Refile
- [elpa] externals/org ae49451364 009/101: org-element-ast: New function `org-element-put-property-2', (continued)
- [elpa] externals/org ae49451364 009/101: org-element-ast: New function `org-element-put-property-2', ELPA Syncer, 2023/07/01
- [elpa] externals/org 6b20a23065 010/101: org-element-ast: New function `org-element-type-p', ELPA Syncer, 2023/07/01
- [elpa] externals/org f4aa3747e1 014/101: org-element: Preserve order of multiple affiliated keywords, ELPA Syncer, 2023/07/01
- [elpa] externals/org 71e2ea5698 025/101: org-element: Update docstrings using new syntax node terminology, ELPA Syncer, 2023/07/01
- [elpa] externals/org ad75fd2bae 016/101: org-element: Use `org-element-create' when parsing, ELPA Syncer, 2023/07/01
- [elpa] externals/org daebeb6446 020/101: org-element-inlinetask-parser: Use deferred properties, ELPA Syncer, 2023/07/01
- [elpa] externals/org 23f9347d1a 024/101: org-element-map: Allow TYPES t and add new arg NO-UNDEFER, ELPA Syncer, 2023/07/01
- [elpa] externals/org 2d22d7f515 036/101: ox.el: Rename `org-element-get-parent-element' and move to org-element, ELPA Syncer, 2023/07/01
- [elpa] externals/org 6a7aee2c35 034/101: org-texinfo--normalize-headlines: Use `org-element-create', ELPA Syncer, 2023/07/01
- [elpa] externals/org 3b1693c461 043/101: org-back-to-heading: Use org-element API, ELPA Syncer, 2023/07/01
- [elpa] externals/org eb0a293a02 048/101: Remove 'org-category text property cache,
ELPA Syncer <=
- [elpa] externals/org e3d690edf8 054/101: org-element-cache-map: Allow when cache is disabled, ELPA Syncer, 2023/07/01
- [elpa] externals/org ebbdd67a2a 059/101: Remove effort property cache, ELPA Syncer, 2023/07/01
- [elpa] externals/org c22697f472 023/101: Use new function names `org-element-extract' and `org-element-set', ELPA Syncer, 2023/07/01
- [elpa] externals/org a06dc07cc0 028/101: org-element: Defer more when parsing headings and inlinetasks, ELPA Syncer, 2023/07/01
- [elpa] externals/org ea4f4fdf58 035/101: Rename `org-export-get-parent' to `org-element-parent', ELPA Syncer, 2023/07/01
- [elpa] externals/org a2730b47fa 032/101: org-odt--paragraph-style: Use `org-element-lineage', ELPA Syncer, 2023/07/01
- [elpa] externals/org a43cc8c9aa 033/101: org-export-get-node-property: Use `org-element-property-inherited', ELPA Syncer, 2023/07/01
- [elpa] externals/org bc29f5de41 038/101: org-element: New `org-element-*property*' functions, ELPA Syncer, 2023/07/01
- [elpa] externals/org 7cbc441915 044/101: org-entry-get-with-inheritance: Use org-element API, ELPA Syncer, 2023/07/01
- [elpa] externals/org 31d53cb015 056/101: org-end-of-subtree: Use org-element API, ELPA Syncer, 2023/07/01