[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/hydra b7279c7c19 33/46: hydra.el (hydra--hint-row): Pre
From: |
Stefan Monnier |
Subject: |
[elpa] externals/hydra b7279c7c19 33/46: hydra.el (hydra--hint-row): Prep to return list |
Date: |
Tue, 25 Oct 2022 22:27:22 -0400 (EDT) |
branch: externals/hydra
commit b7279c7c1957afe1e562b30e36672ff4d1cf772a
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
hydra.el (hydra--hint-row): Prep to return list
---
hydra.el | 28 +++++++++++++++-------------
1 file changed, 15 insertions(+), 13 deletions(-)
diff --git a/hydra.el b/hydra.el
index 61f92ec2f4..521a65e7f4 100644
--- a/hydra.el
+++ b/hydra.el
@@ -1112,19 +1112,21 @@ representing the maximum dimension of their owning
group.
(nreverse (cdr res))))
(defun hydra--hint-row (heads body)
- (let ((lst (hydra-interpose
- "| "
- (mapcar (lambda (head)
- (funcall hydra-key-doc-function
- (hydra-fontify-head head body)
- (let ((n (hydra--head-property head
:max-key-len)))
- (+ n (cl-count ?% (car head))))
- (nth 2 head) ;; doc
- (hydra--head-property head :max-doc-len)))
- heads))))
- (replace-regexp-in-string
- "\s+$" ""
- (apply #'concat lst))))
+ (let* ((lst (hydra-interpose
+ "| "
+ (mapcar (lambda (head)
+ (funcall hydra-key-doc-function
+ (hydra-fontify-head head body)
+ (let ((n (hydra--head-property head
:max-key-len)))
+ (+ n (cl-count ?% (car head))))
+ (nth 2 head) ;; doc
+ (hydra--head-property head :max-doc-len)))
+ heads)))
+ (len (length lst))
+ (new-last (replace-regexp-in-string "\s+$" "" (car (last lst)))))
+ (when (= 0 (length (setf (nth (- len 1) lst) new-last)))
+ (setf (nth (- len 2) lst) "|"))
+ (apply #'concat lst)))
(defun hydra--hint-from-matrix (body heads-matrix)
"Generate a formated table-style docstring according to BODY and
HEADS-MATRIX.
- [elpa] externals/hydra 6842731f08 43/46: hydra.el (hydra-lv): Declare obsolete, (continued)
- [elpa] externals/hydra 6842731f08 43/46: hydra.el (hydra-lv): Declare obsolete, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 7081ee6d44 46/46: Merge commit 'f27fce1b2f0a9162e159557bdeb2c0c94defb4d2' into externals/hydra, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra f27fce1b2f 45/46: hydra.el: Bump version, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra aa55bbd196 37/46: hydra.el (hydra--hint-from-matrix): Don't wrap with concat, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra d96180865c 40/46: hydra.el (hydra-hint-display-alist): Add, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 480ae63137 42/46: Declare dependency on separate lv package, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra acb69859f3 44/46: hydra-test.el: Update tests for the last commit, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra b4fb3298cd 02/46: hydra.el (hydra--hint-heads-wocol): Ignore dynamic hints, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 2ad0b01611 25/46: hydra.el (hydra--normalize-body): Fixup for Emacs24, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra 9ca93bdffb 28/46: hydra.el (defhydra+): Add, Stefan Monnier, 2022/10/25
- [elpa] externals/hydra b7279c7c19 33/46: hydra.el (hydra--hint-row): Prep to return list,
Stefan Monnier <=
- [elpa] externals/hydra 8e3698fb53 41/46: hydra-examples.el (hydra-rectangle): Change "p" to "x", Stefan Monnier, 2022/10/25