(org-ql--priority-p) Convert to function
I don't remember why I had made it a macro, but it needs to be a function so it can be called correctly in org-ql--query.
This commit is contained in:
parent
9050b756ba
commit
d1f26eec2f
1 changed files with 14 additions and 14 deletions
|
|
@ -174,7 +174,7 @@ like one returned by `date-to-day'."
|
|||
(defsubst org-ql--closed-p (&optional comparator target-date)
|
||||
(org-agenda-ng--date-p :closed comparator target-date))
|
||||
|
||||
(defmacro org-ql--priority-p (&optional comparator-or-priority priority)
|
||||
(defun org-ql--priority-p (&optional comparator-or-priority priority)
|
||||
"Return non-nil if current heading has a certain priority.
|
||||
COMPARATOR-OR-PRIORITY should be either a comparator function,
|
||||
like `<=', or a priority string, like \"A\" (in which case (\` =)
|
||||
|
|
@ -197,7 +197,7 @@ comparator, PRIORITY should be a priority string."
|
|||
(= '=)
|
||||
(otherwise (user-error "Invalid comparator: %s" comparator))))
|
||||
(setq priority (* 1000 (- org-lowest-priority (string-to-char priority))))
|
||||
`(when-let ((item-priority (save-excursion
|
||||
(when-let ((item-priority (save-excursion
|
||||
(save-match-data
|
||||
;; FIXME: Is the save-match-data above necessary?
|
||||
(when (and (looking-at org-heading-regexp)
|
||||
|
|
@ -209,7 +209,7 @@ comparator, PRIORITY should be a priority string."
|
|||
;; useful IMO. Better to do it
|
||||
;; like in org-super-agenda.
|
||||
(org-get-priority (match-string 0)))))))
|
||||
(funcall ',comparator ,priority item-priority))))
|
||||
(funcall comparator priority item-priority))))
|
||||
|
||||
(defun org-ql--habit-p ()
|
||||
(org-is-habit-p))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue