[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/dtache 471a2f57c7 058/158: Update dtache-session-annota
From: |
ELPA Syncer |
Subject: |
[elpa] externals/dtache 471a2f57c7 058/158: Update dtache-session-annotation |
Date: |
Wed, 19 Jan 2022 18:57:56 -0500 (EST) |
branch: externals/dtache
commit 471a2f57c712c369c20586301751c82fc5d5764f
Author: Niklas Eklund <niklas.eklund@posteo.net>
Commit: Niklas Eklund <niklas.eklund@posteo.net>
Update dtache-session-annotation
Make the function more reusable by adding an initial association step
to match the session based on an item. This change makes the function
reusable in consult-dtache.
---
dtache.el | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dtache.el b/dtache.el
index 848f1a5a9c..db7628bf12 100644
--- a/dtache.el
+++ b/dtache.el
@@ -452,17 +452,18 @@ Optionally make the path LOCAL to host."
(setcar session (format "%s%s" (car session) (make-string
identifier-width ?\s)))))
(seq-reverse reverse-sessions)))
-(defun dtache-session-annotation (session)
- "Return annotation string for SESSION."
- (mapconcat
- #'identity
- (cl-loop for annotation in dtache-annotation-format
- collect (let ((str (funcall (plist-get annotation :function)
session)))
- (truncate-string-to-width
- (propertize str 'face (plist-get annotation :face))
- (plist-get annotation :width)
- 0 ?\s)))
- " "))
+(defun dtache-session-annotation (item)
+ "Associate ITEM to a session and return ts annotation."
+ (let ((session (cdr (assoc item dtache--session-candidates))))
+ (mapconcat
+ #'identity
+ (cl-loop for annotation in dtache-annotation-format
+ collect (let ((str (funcall (plist-get annotation :function)
session)))
+ (truncate-string-to-width
+ (propertize str 'face (plist-get annotation :face))
+ (plist-get annotation :width)
+ 0 ?\s)))
+ " ")))
(defun dtache-update-session (session)
"Update SESSION."
@@ -623,12 +624,11 @@ Optionally make the path LOCAL to host."
(category . dtache)
(cycle-sort-function . identity)
(display-sort-function . identity)
- (annotation-function . ,(lambda (s)
- (dtache-session-annotation (cdr
(assoc s candidates)))))
+ (annotation-function . dtache-session-annotation)
(affixation-function .
,(lambda (cands)
(seq-map (lambda (s)
- `(,s nil
,(dtache-session-annotation (cdr (assoc s candidates)))))
+ `(,s nil
,(dtache-session-annotation s)))
cands)))))
(collection (lambda (string predicate action)
(if (eq action 'metadata)
- [elpa] externals/dtache 6037219c0a 018/158: Update documentation, (continued)
- [elpa] externals/dtache 6037219c0a 018/158: Update documentation, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 199c4cffaa 070/158: Update incorrect regexp for dtache-message, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache b2b2b6ecd1 138/158: Fix error in dtache-attach, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 28cb384d96 143/158: Update attach with fallback, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 7ddd1e29ef 146/158: Fix error on remote hosts, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 9e0acd552d 150/158: Fix typo in dtache-test-dtach-command test, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache b8ab11cda6 091/158: Make sure to set current session in shell command, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache b1e4ead73e 094/158: Remove start-process advice, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 2c4520a3c5 015/158: Add missing variable to tail-mode, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache b247ddc6dd 077/158: Rewrite dtache-dtach-command, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 471a2f57c7 058/158: Update dtache-session-annotation,
ELPA Syncer <=
- [elpa] externals/dtache e3a12a9dc8 073/158: Add connection local variable to timer, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 9b7e7ffd2e 086/158: Rename session-type to session-origin, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache e8bc20f563 095/158: Fix error in dtache-shell-command, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache c40f0b2203 102/158: Make some public functions private, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 9c16dd3751 109/158: Update active to state, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 3cc493e6b0 115/158: Add missing dtache-log-mode to detach-dwim, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache ebf9b491bd 117/158: Add variable for dtache-shell-command buffer, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache e9f6794621 129/158: Rename log-directory to directory, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache 3969524f23 125/158: Improve dtache session header, ELPA Syncer, 2022/01/19
- [elpa] externals/dtache e0a45c055c 133/158: Address error in eshell/shell extension, ELPA Syncer, 2022/01/19