[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/consult 61bb1c4059 2/3: Code cleanup
From: |
ELPA Syncer |
Subject: |
[elpa] externals/consult 61bb1c4059 2/3: Code cleanup |
Date: |
Wed, 13 Sep 2023 03:57:33 -0400 (EDT) |
branch: externals/consult
commit 61bb1c405912891bd06b89bda5c7ebc90370d4c8
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Code cleanup
---
CHANGELOG.org | 1 +
consult-org.el | 22 ++++++++++++----------
2 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/CHANGELOG.org b/CHANGELOG.org
index 960fb2c2b2..c6a49aa152 100644
--- a/CHANGELOG.org
+++ b/CHANGELOG.org
@@ -6,6 +6,7 @@
- =consult-fd=: New command based on the fast =fd/fdfind= search utility.
- =consult-outline=: New prefix argument to specify initial narrowing level.
+- =consult-org-heading=: Add annotation function.
* Version 0.35 (2023-07-02)
diff --git a/consult-org.el b/consult-org.el
index 7fa62b9516..5f8c887c64 100644
--- a/consult-org.el
+++ b/consult-org.el
@@ -97,19 +97,21 @@ MATCH, SCOPE and SKIP are as in `org-map-entries'."
(setq buf (current-buffer)))
(lambda (cand)
(unless (buffer-live-p buf)
- (setq buf (seq-find (lambda (b)
- (with-current-buffer b (derived-mode-p
#'org-mode)))
- (buffer-list))))
- (pcase-let ((`(,_level ,kwd . ,prio)
- (get-text-property 0 'consult-org--heading cand)))
+ (setq buf (seq-find
+ (lambda (b)
+ (with-current-buffer b (derived-mode-p #'org-mode)))
+ (buffer-list))))
(consult--annotate-align
cand
- (concat
- (propertize (or kwd "") 'face
- (with-current-buffer (or buf (current-buffer))
- ;; `org-get-todo-face' must be called inside an Org
buffer
+ (pcase-let ((`(,_level ,kwd . ,prio)
+ (get-text-property 0 'consult-org--heading cand)))
+ (when (or kwd prio)
+ (concat
+ (propertize (or kwd "") 'face
+ (with-current-buffer (or buf (current-buffer))
+ ;; `org-get-todo-face' must be called inside an
Org buffer
(org-get-todo-face kwd)))
- (and prio (format #(" [#%c]" 1 6 (face org-priority)) prio))))))))
+ (and prio (format #(" [#%c]" 1 6 (face org-priority))
prio)))))))))
;;;###autoload
(defun consult-org-heading (&optional match scope)