[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult 3052c57969 2/2: Update changelog, Improve consu
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult 3052c57969 2/2: Update changelog, Improve consult-org--headings |
Date: |
Wed, 15 Mar 2023 11:57:39 -0400 (EDT) |
branch: externals/consult
commit 3052c57969ddd7dc23e325a2703b5f14d33d1133
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Update changelog, Improve consult-org--headings
---
CHANGELOG.org | 4 ++++
consult-org.el | 27 ++++++++++++++++-----------
2 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org
index deaf60d9ba..900a3b3a94 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -2,6 +2,10 @@
#+author: Daniel Mendler
#+language: en
+* Development
+
+- =consult-org-heading=: Support tag inheritance.
+
* Version 0.33 (2023-03-11)
- BREAKING: The key convention has been updated. The old key convention is not
diff --git a/consult-org.el b/consult-org.el
index 5253730425..ed96e39b0a 100644
--- a/consult-org.el
+++ b/consult-org.el
@@ -59,25 +59,30 @@
If PREFIX is non-nil, prefix the candidates with the buffer name.
MATCH, SCOPE and SKIP are as in `org-map-entries'."
- (let (buffer)
+ (let (buffer (idx 0))
(apply
#'org-map-entries
(lambda ()
- ;; Reset the cache when the buffer changes, since
`org-get-outline-path' uses the cache
+ ;; Reset the cache when the buffer changes, since
`org-get-outline-path' uses the cache
(unless (eq buffer (buffer-name))
(setq buffer (buffer-name)
org-outline-path-cache nil))
- (pcase-let ((`(_ ,level ,todo ,prio ,_hl) (org-heading-components))
- (tags (org-get-tags))
- (cand (org-format-outline-path
- (org-get-outline-path 'with-self 'use-cache)
- most-positive-fixnum)))
+ (pcase-let* ((`(_ ,level ,todo ,prio ,_hl ,tags)
(org-heading-components))
+ (tags (if org-use-tag-inheritance
+ (when-let ((tags (org-get-tags)))
+ (concat ":" (string-join tags ":") ":"))
+ tags))
+ (cand (org-format-outline-path
+ (org-get-outline-path 'with-self 'use-cache)
+ most-positive-fixnum)))
(when tags
- (setq tags (concat " :" (string-join tags ":") ":"))
- (put-text-property 1 (length tags) 'face 'org-tag tags))
+ (put-text-property 0 (length tags) 'face 'org-tag tags))
(setq cand (if prefix
- (concat buffer " " cand tags (consult--tofu-encode
(point)))
- (concat cand tags (consult--tofu-encode (point)))))
+ (concat buffer " " cand (and tags " ")
+ tags (consult--tofu-encode idx))
+ (concat cand (and tags " ")
+ tags (consult--tofu-encode idx))))
+ (cl-incf idx)
(add-text-properties 0 1
`(consult--candidate ,(point-marker)
consult-org--heading (,level ,todo . ,prio))