[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 13def15 318/348: ivy.el (ivy-case-fold-search): Add additi
From: |
Oleh Krehel |
Subject: |
[elpa] master 13def15 318/348: ivy.el (ivy-case-fold-search): Add additional value 'always |
Date: |
Sat, 8 Apr 2017 11:04:22 -0400 (EDT) |
branch: master
commit 13def15753c4f6cb84fc7911b846073c3e7785f0
Author: fabacino <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-case-fold-search): Add additional value 'always
If the value of ivy-case-fold-search is set to 'always, the search is
always case-insensive, regardless of the input.
Fixes #916
---
ivy.el | 30 +++++++++++++++++++++---------
1 file changed, 21 insertions(+), 9 deletions(-)
diff --git a/ivy.el b/ivy.el
index bfd2c35..fa0ea2c 100644
--- a/ivy.el
+++ b/ivy.el
@@ -457,7 +457,14 @@ When non-nil, it should contain at least one %d.")
(defvar ivy--old-text ""
"Store old `ivy-text' for dynamic completion.")
-(defvar ivy-case-fold-search 'auto
+(defcustom ivy-case-fold-search-default 'auto
+ "The default value for `ivy-case-fold-search'."
+ :type '(choice
+ (const :tag "Auto" auto)
+ (const :tag "Always" always)
+ (const :tag "Never" nil)))
+
+(defvar ivy-case-fold-search ivy-case-fold-search-default
"Store the current overriding `case-fold-search'.")
(defvar Info-current-file)
@@ -1557,7 +1564,7 @@ This is useful for recursive `ivy-read'."
(setq initial-input (cdr (assoc this-command
ivy-initial-inputs-alist))))
(setq ivy--directory nil)
- (setq ivy-case-fold-search 'auto)
+ (setq ivy-case-fold-search ivy-case-fold-search-default)
(setq ivy--regex-function
(or re-builder
(and (functionp collection)
@@ -2404,18 +2411,22 @@ Should be run via minibuffer `post-command-hook'."
'(setq ivy--flx-cache (flx-make-string-cache)))
(defun ivy-toggle-case-fold ()
- "Toggle the case folding between nil and auto.
-In any completion session, the case folding starts in auto:
+ "Toggle the case folding between nil and auto/always.
+
+If auto, `case-fold-search' is t, when the input is all lower case,
+otherwise nil.
+
+If always, `case-fold-search' is always t, regardless of the input.
-- when the input is all lower case, `case-fold-search' is t
-- otherwise nil.
+Otherwise `case-fold-search' is always nil, regardless of the input.
-You can toggle this to make `case-fold-search' nil regardless of input."
+In any completion session, the case folding starts in
+`ivy-case-fold-search-default'."
(interactive)
(setq ivy-case-fold-search
(if ivy-case-fold-search
nil
- 'auto))
+ (or ivy-case-fold-search-default 'auto)))
;; reset cache so that the candidate list updates
(setq ivy--old-re nil))
@@ -2450,7 +2461,8 @@ CANDIDATES are assumed to be static."
(matcher (ivy-state-matcher ivy-last))
(case-fold-search
(and ivy-case-fold-search
- (string= name (downcase name))))
+ (or (eq ivy-case-fold-search 'always)
+ (string= name (downcase name)))))
(cands (cond
(matcher
(funcall matcher re candidates))
- [elpa] master 9b28927 187/348: counsel.el (counsel-hydra-heads): Fixup, (continued)
- [elpa] master 9b28927 187/348: counsel.el (counsel-hydra-heads): Fixup, Oleh Krehel, 2017/04/08
- [elpa] master 00219da 181/348: Fix for older Emacs, Oleh Krehel, 2017/04/08
- [elpa] master 8f87f74 178/348: counsel.el (counsel-git-grep): Update for Windows, Oleh Krehel, 2017/04/08
- [elpa] master 79105a5 208/348: counsel.el (counsel-info-lookup-symbol): Add preselect, Oleh Krehel, 2017/04/08
- [elpa] master 222a5e6 217/348: ivy.el (ivy--virtual-buffers): Move to silence compiler, Oleh Krehel, 2017/04/08
- [elpa] master 35b5d29 230/348: New example to show how to associate values, Oleh Krehel, 2017/04/08
- [elpa] master e9c274a 236/348: Allow to customize ivy-display-function per caller, Oleh Krehel, 2017/04/08
- [elpa] master c14ceac 245/348: Add support for counsel-find-library, Oleh Krehel, 2017/04/08
- [elpa] master ca84f24 269/348: Add highlighter function configuration to ivy, Oleh Krehel, 2017/04/08
- [elpa] master 5701444 314/348: ivy.el (ivy-occur-revert-buffer): Restore ivy-occur-last, Oleh Krehel, 2017/04/08
- [elpa] master 13def15 318/348: ivy.el (ivy-case-fold-search): Add additional value 'always,
Oleh Krehel <=
- [elpa] master 54c5447 319/348: counsel.el (counsel-grep-function): Add shell-quote-argument, Oleh Krehel, 2017/04/08
- [elpa] master bf8dc5f 326/348: Make swiper-avy work with more regexp builders, Oleh Krehel, 2017/04/08
- [elpa] master 03f90af 324/348: ivy.el (ivy-rotate-sort): Guard against nil sort, Oleh Krehel, 2017/04/08
- [elpa] master ac944ea 325/348: ivy.el: Remove with-ivy-window, Oleh Krehel, 2017/04/08
- [elpa] master 18da759 320/348: ivy.el: Remove ivy--current, Oleh Krehel, 2017/04/08
- [elpa] master 20744aa 337/348: doc/Changelog.org: Prepare for 0.9.0, Oleh Krehel, 2017/04/08
- [elpa] master 13a3f2d 342/348: doc/Changelog.org: Sort stuff, Oleh Krehel, 2017/04/08
- [elpa] master 69dfed9 146/348: counsel.el (counsel-dpkg): Remove typo, Oleh Krehel, 2017/04/08
- [elpa] master 55a90c9 152/348: Make with-ivy-window not necessary in action, Oleh Krehel, 2017/04/08
- [elpa] master 9d693ec 158/348: Use a lighter color for ivy-remote in dark themes, Oleh Krehel, 2017/04/08