[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/ivy-hydra 16298bc 137/395: ivy.el (ivy-read-action-form
From: |
Basil L. Contovounesios |
Subject: |
[elpa] externals/ivy-hydra 16298bc 137/395: ivy.el (ivy-read-action-format-function): Upgrade to defcustom |
Date: |
Thu, 25 Feb 2021 08:31:48 -0500 (EST) |
branch: externals/ivy-hydra
commit 16298bcaee6e47347171c55b0246b149b66da72b
Author: Oleh Krehel <ohwoeowho@gmail.com>
Commit: Oleh Krehel <ohwoeowho@gmail.com>
ivy.el (ivy-read-action-format-function): Upgrade to defcustom
Re #2440
---
ivy.el | 51 +++++++++++++++++++++++++++------------------------
1 file changed, 27 insertions(+), 24 deletions(-)
diff --git a/ivy.el b/ivy.el
index d230c4e..8da4939 100644
--- a/ivy.el
+++ b/ivy.el
@@ -856,8 +856,11 @@ candidate, not the prompt."
(ivy--exhibit)
(ivy-dispatching-done))))
-(defvar ivy-read-action-format-function 'ivy-read-action-format-default
- "Function used to transform the actions list into a docstring.")
+(defcustom ivy-read-action-format-function 'ivy-read-action-format-default
+ "Function used to transform the actions list into a docstring."
+ :type '(radio
+ (function-item ivy-read-action-format-default)
+ (function-item ivy-read-action-format-columns)))
(defun ivy-read-action-format-default (actions)
"Create a docstring from ACTIONS.
@@ -884,38 +887,38 @@ key (a string), cmd and doc (a string)."
ACTIONS is a list. Each list item is a list of 3 items: key (a
string), cmd and doc (a string)."
(let ((length (length actions))
- (i 0)
- (max-rows (- ivy-height 1))
- rows cols col lwidth rwidth)
+ (i 0)
+ (max-rows (- ivy-height 1))
+ rows cols col lwidth rwidth)
(while (< i length)
(setq col (cl-subseq actions i (min length (cl-incf i max-rows))))
(setq lwidth (apply 'max (mapcar (lambda (x)
- (length (nth 0 x)))
- col)))
+ (length (nth 0 x)))
+ col)))
(setq rwidth (apply 'max (mapcar (lambda (x)
- (length (nth 2 x)))
- col)))
+ (length (nth 2 x)))
+ col)))
(setq col (mapcar (lambda (x)
- (format (format "%%%ds: %%-%ds" lwidth rwidth)
- (propertize (car x) 'face 'ivy-action)
- (nth 2 x)))
- col))
+ (format (format "%%%ds: %%-%ds" lwidth rwidth)
+ (propertize (car x) 'face 'ivy-action)
+ (nth 2 x)))
+ col))
(cond
- ((null rows)
- (setq rows (length col)))
- ((< (length col) rows)
- (setq col (append col (make-list (- rows (length col)) "")))))
+ ((null rows)
+ (setq rows (length col)))
+ ((< (length col) rows)
+ (setq col (append col (make-list (- rows (length col)) "")))))
(push col cols))
(format "%s\n%s\n"
(if (eq this-command 'ivy-read-action)
- "Select action: "
+ "Select action: "
(ivy-state-current ivy-last))
- (mapconcat 'identity
- (apply 'cl-mapcar
- (lambda (&rest args)
- (mapconcat 'identity args " | "))
- (nreverse cols))
- "\n"))))
+ (mapconcat 'identity
+ (apply 'cl-mapcar
+ (lambda (&rest args)
+ (mapconcat 'identity args " | "))
+ (nreverse cols))
+ "\n"))))
(defcustom ivy-read-action-function #'ivy-read-action-by-key
"Function used to read an action."
- [elpa] externals/ivy-hydra d2891aa 376/395: Percent-encode counsel-search query, (continued)
- [elpa] externals/ivy-hydra d2891aa 376/395: Percent-encode counsel-search query, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra f90c018 389/395: counsel.el (counsel-grep-like-occur): Use ivy-text as backup, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 3c53de1 390/395: * .elpaignore: New file., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 496a5e2 105/395: counsel.el: Fix ivy-occur ivy--regex-function bug, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6b4f43a 111/395: ivy.el (ivy--update-minibuffer): Return string, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 0ce0bf1 123/395: counsel.el (counsel-evil-marks): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra e05bc45 108/395: ivy.el (ivy--recompute-index): Take one less argument, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 723e4d6 126/395: counsel.el: Point to evil-common for evil-global-marker-p declaration., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 04e7942 130/395: counsel-kmacro: Small improvements to functions and documentation strings., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 4d161cc 128/395: counsel-kmacro: Clarify copying of values for next macro user defines., Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 16298bc 137/395: ivy.el (ivy-read-action-format-function): Upgrade to defcustom,
Basil L. Contovounesios <=
- [elpa] externals/ivy-hydra 269583d 125/395: counsel.el (counsel-locate-cmd-es): Switch flags order, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 098f8fe 133/395: swiper.el (swiper-isearch-toggle): Fix up, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra b20a6db 135/395: counsel.el (counsel-recentf-candidates): Sort remote files better, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra d1c3613 140/395: Fix ivy-{next, previous}-line-or-history when input is empty, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 2229801 142/395: counsel.el (counsel-M-x-action): Trim left ^, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra af51ffd 139/395: ivy.el (ivy-read-action-ivy): Don't reset ivy-marked-candidates to nil, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 8f3e589 138/395: counsel.el: Add "overwrite" action to counsel-bookmark, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 6930d72 143/395: ivy.el (ivy--kill-current-candidate): Specialize and fix for buffers, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra 22028d4 146/395: counsel.el (counsel--string-trim-left): Add, Basil L. Contovounesios, 2021/02/25
- [elpa] externals/ivy-hydra ba4c1d5 151/395: swiper.el (swiper-C-s): New command bound to "C-s" for swiper, Basil L. Contovounesios, 2021/02/25