Add r as regexp alias

This commit is contained in:
Feng Shu 2019-12-08 13:58:47 +08:00
parent 70a1acde93
commit 2ae4d1b3ed

View file

@ -575,6 +575,11 @@ Replaces bare strings with (regexp) selectors, and appropriate
;; "h" alias. ;; "h" alias.
`(heading ,@args)) `(heading ,@args))
;; Regexps.
(`(r . ,args)
;; "r" alias.
`(regexp ,@args))
;; Outline paths. ;; Outline paths.
(`(,(or 'outline-path 'olp) . ,strings) (`(,(or 'outline-path 'olp) . ,strings)
;; Regexp quote headings. ;; Regexp quote headings.
@ -1127,7 +1132,7 @@ priority B)."
"Return non-nil if entry is a habit." "Return non-nil if entry is a habit."
(org-is-habit-p)) (org-is-habit-p))
(org-ql--defpred regexp (&rest regexps) (org-ql--defpred (regexp r) (&rest regexps)
"Return non-nil if current entry matches all of REGEXPS (regexp strings)." "Return non-nil if current entry matches all of REGEXPS (regexp strings)."
(let ((end (or (save-excursion (let ((end (or (save-excursion
(outline-next-heading)) (outline-next-heading))