[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 0c85d9a 58/67: Add a custom `ivy-count-format'
From: |
Oleh Krehel |
Subject: |
[elpa] master 0c85d9a 58/67: Add a custom `ivy-count-format' |
Date: |
Sun, 22 Mar 2015 17:34:10 +0000 |
branch: master
commit 0c85d9ac62a67e8cc175a19779cf28876fc58930
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Add a custom `ivy-count-format'
* ivy.el (ivy-count-format): New defcustom.
(ivy-read): Use `ivy-count-format', unless PROMPT already has a %d spec.
Set `ivy-count-format' to nil or "" if you don't want to see an
auto-updating match count in the minibuffer.
Re #23.
---
ivy.el | 14 +++++++++++---
1 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/ivy.el b/ivy.el
index 34f7ad8..21e6f12 100644
--- a/ivy.el
+++ b/ivy.el
@@ -50,6 +50,11 @@
"Number of lines for the minibuffer window."
:type 'integer)
+(defcustom ivy-count-format "%-4d "
+ "The style of showing the current candidate count for `ivy-read'.
+Set this to nil if you don't want the count."
+ :type 'string)
+
;;* User Visible
;;** Keymap
(require 'delsel)
@@ -166,9 +171,12 @@ the ones that match INITIAL-INPUT."
(setq ivy-exit nil)
(setq ivy--default (or (thing-at-point 'symbol) ""))
(setq ivy--prompt
- (if (string-match "%.*d" prompt)
- prompt
- nil))
+ (cond ((string-match "%.*d" prompt)
+ prompt)
+ ((string-match "%.*d" ivy-count-format)
+ (concat ivy-count-format prompt))
+ (t
+ nil)))
(unwind-protect
(minibuffer-with-setup-hook
#'ivy--minibuffer-setup
- [elpa] master 588dab6 49/67: ivy-test.el: Add testing, (continued)
- [elpa] master 588dab6 49/67: ivy-test.el: Add testing, Oleh Krehel, 2015/03/22
- [elpa] master f754835 47/67: swiper.el: Silence a few compilation warnings, Oleh Krehel, 2015/03/22
- [elpa] master cc4bf75 52/67: README.md: Add build status, Oleh Krehel, 2015/03/22
- [elpa] master 2b8e4e1 53/67: ivy.el: Remove while-no-input, Oleh Krehel, 2015/03/22
- [elpa] master 2191bdb 54/67: ivy.el (ivy-completions): Simplify, Oleh Krehel, 2015/03/22
- [elpa] master d587fa2 51/67: ivy.el (ivy-read): Allow for format-style PROMPT, Oleh Krehel, 2015/03/22
- [elpa] master 9f9c4dc 57/67: swiper-helm.el: Fix typo, Oleh Krehel, 2015/03/22
- [elpa] master 3a08a88 50/67: ivy.el (ivy-read): Change index to preselect, Oleh Krehel, 2015/03/22
- [elpa] master d2b2813 55/67: swiper-helm.el: Copy all helm stuff here, Oleh Krehel, 2015/03/22
- [elpa] master c4acef9 56/67: swiper.el: Remove the helm bits, Oleh Krehel, 2015/03/22
- [elpa] master 0c85d9a 58/67: Add a custom `ivy-count-format',
Oleh Krehel <=
- [elpa] master c2e58e9 59/67: Fix invalid package header line, Oleh Krehel, 2015/03/22
- [elpa] master a275a2a 60/67: Use `font-lock-append-text-property' to non-destructively modify a, Oleh Krehel, 2015/03/22
- [elpa] master 7876619 61/67: Update "C-n" and "C-p" bindings, Oleh Krehel, 2015/03/22
- [elpa] master f20b287 62/67: swiper.el (swiper--init): Set `swiper--opoint', Oleh Krehel, 2015/03/22
- [elpa] master bb6c40c 63/67: swiper.el (swiper-min-highlight): New defcustom, Oleh Krehel, 2015/03/22
- [elpa] master cf71b09 64/67: ivy.el (ivy-wrap): New defcustom, Oleh Krehel, 2015/03/22
- [elpa] master 55414c3 66/67: Update Copyright, Oleh Krehel, 2015/03/22
- [elpa] master 4358c03 65/67: Move swiper-helm to another repo, Oleh Krehel, 2015/03/22
- [elpa] master 302a16a 67/67: Add 'packages/swiper/' from commit '55414c321ca07bd86f0f1efaf8f6130617e6fad6', Oleh Krehel, 2015/03/22