Obsolete `org-cached-entry-get' in favor of `org-entry-get'
We have a better performing cache mechanism in `org-entry-get'. * lisp/org.el (org-make-tags-matcher): Replace uses of `org-cached-entry-get' with `org-entry-get'. (org-cached-entry-get): Move to ... * lisp/org-compat.el (org-cached-entry-get): ... here. Obsolete in favor of `org-entry-get'.
This commit is contained in:
parent
c6bbde4c78
commit
646f6ec133
|
@ -649,6 +649,29 @@ Counting starts at 1."
|
||||||
(define-obsolete-variable-alias 'org-plantuml-executable-args 'org-plantuml-args
|
(define-obsolete-variable-alias 'org-plantuml-executable-args 'org-plantuml-args
|
||||||
"Org 9.6")
|
"Org 9.6")
|
||||||
|
|
||||||
|
(defvar org-cached-props nil)
|
||||||
|
(defvar org-use-property-inheritance)
|
||||||
|
(declare-function org-entry-get "org" (epom property &optional inherit literal-nil))
|
||||||
|
(declare-function org-entry-properties "org" (&optional epom which))
|
||||||
|
(defun org-cached-entry-get (pom property)
|
||||||
|
(if (or (eq t org-use-property-inheritance)
|
||||||
|
(and (stringp org-use-property-inheritance)
|
||||||
|
(let ((case-fold-search t))
|
||||||
|
(string-match-p org-use-property-inheritance property)))
|
||||||
|
(and (listp org-use-property-inheritance)
|
||||||
|
(member-ignore-case property org-use-property-inheritance)))
|
||||||
|
;; Caching is not possible, check it directly.
|
||||||
|
(org-entry-get pom property 'inherit)
|
||||||
|
;; Get all properties, so we can do complicated checks easily.
|
||||||
|
(cdr (assoc-string property
|
||||||
|
(or org-cached-props
|
||||||
|
(setq org-cached-props (org-entry-properties pom)))
|
||||||
|
t))))
|
||||||
|
|
||||||
|
(make-obsolete 'org-cached-entry-get
|
||||||
|
"Performs badly. Instead use `org-entry-get' with the argument INHERIT set to `selective'"
|
||||||
|
"9.7")
|
||||||
|
|
||||||
(defconst org-latex-line-break-safe "\\\\[0pt]"
|
(defconst org-latex-line-break-safe "\\\\[0pt]"
|
||||||
"Linebreak protecting the following [...].
|
"Linebreak protecting the following [...].
|
||||||
|
|
||||||
|
|
20
lisp/org.el
20
lisp/org.el
|
@ -11480,22 +11480,6 @@ are also TODO tasks."
|
||||||
|
|
||||||
(defalias 'org-tags-sparse-tree 'org-match-sparse-tree)
|
(defalias 'org-tags-sparse-tree 'org-match-sparse-tree)
|
||||||
|
|
||||||
(defvar org-cached-props nil)
|
|
||||||
(defun org-cached-entry-get (pom property)
|
|
||||||
(if (or (eq t org-use-property-inheritance)
|
|
||||||
(and (stringp org-use-property-inheritance)
|
|
||||||
(let ((case-fold-search t))
|
|
||||||
(string-match-p org-use-property-inheritance property)))
|
|
||||||
(and (listp org-use-property-inheritance)
|
|
||||||
(member-ignore-case property org-use-property-inheritance)))
|
|
||||||
;; Caching is not possible, check it directly.
|
|
||||||
(org-entry-get pom property 'inherit)
|
|
||||||
;; Get all properties, so we can do complicated checks easily.
|
|
||||||
(cdr (assoc-string property
|
|
||||||
(or org-cached-props
|
|
||||||
(setq org-cached-props (org-entry-properties pom)))
|
|
||||||
t))))
|
|
||||||
|
|
||||||
(defun org-global-tags-completion-table (&optional files)
|
(defun org-global-tags-completion-table (&optional files)
|
||||||
"Return the list of all tags in all agenda buffer/files.
|
"Return the list of all tags in all agenda buffer/files.
|
||||||
Optional FILES argument is a list of files which can be used
|
Optional FILES argument is a list of files which can be used
|
||||||
|
@ -11670,7 +11654,7 @@ See also `org-scan-tags'."
|
||||||
("CATEGORY"
|
("CATEGORY"
|
||||||
'(org-get-category (point)))
|
'(org-get-category (point)))
|
||||||
("TODO" 'todo)
|
("TODO" 'todo)
|
||||||
(p `(org-cached-entry-get nil ,p))))
|
(p `(org-entry-get (point) ,p 'selective))))
|
||||||
;; Determine operand (aka. property
|
;; Determine operand (aka. property
|
||||||
;; value).
|
;; value).
|
||||||
(pv (match-string 8 term))
|
(pv (match-string 8 term))
|
||||||
|
@ -11707,7 +11691,7 @@ See also `org-scan-tags'."
|
||||||
(setq term rest)))
|
(setq term rest)))
|
||||||
(push `(and ,@tagsmatcher) orlist)
|
(push `(and ,@tagsmatcher) orlist)
|
||||||
(setq tagsmatcher nil))
|
(setq tagsmatcher nil))
|
||||||
(setq tagsmatcher `(progn (setq org-cached-props nil) (or ,@orlist)))))
|
(setq tagsmatcher `(or ,@orlist))))
|
||||||
|
|
||||||
;; Make the TODO matcher.
|
;; Make the TODO matcher.
|
||||||
(when (org-string-nw-p todomatch)
|
(when (org-string-nw-p todomatch)
|
||||||
|
|
Loading…
Reference in New Issue