[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/counsel 7fc8676: Select the files relevant for the `cou
From: |
Stefan Monnier |
Subject: |
[elpa] externals/counsel 7fc8676: Select the files relevant for the `counsel` package |
Date: |
Wed, 2 Dec 2020 13:31:18 -0500 (EST) |
branch: externals/counsel
commit 7fc867635b4a5a0854098b75b7165bb4aa6b7843
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>
Select the files relevant for the `counsel` package
---
.github/FUNDING.yml | 3 -
.gitignore | 3 +-
.travis.yml | 18 -
CONTRIBUTING.org | 73 -
Makefile | 34 -
README.md | 141 -
colir.el | 124 -
doc/Changelog.org | 5195 --------------------
doc/Makefile | 11 -
doc/fdl-1.3.txt | 451 --
doc/gpl-3.0.txt | 674 ---
doc/ivy-help.org | 138 -
doc/ivy-ox.el | 200 -
doc/ivy.org | 1389 ------
doc/ivy.texi | 1813 -------
doc/scripts.el | 4 -
elpa.el | 6 -
ivy-hydra.el | 133 -
ivy-overlay.el | 154 -
ivy-test.el | 1437 ------
ivy.el | 5056 -------------------
swiper.el | 1673 -------
targets/checkdoc.el | 6 -
targets/install-deps.el | 38 -
targets/obsolete-config.el | 3 -
targets/plain.el | 9 -
.../directories-with-spaces/bar baz i/file1 | 0
.../directories-with-spaces/bar baz ii/file2 | 0
tests/find-file/dotfiles/.foobar1 | 0
tests/find-file/dotfiles/.foobar2 | 0
tests/find-file/dotfiles/foo/placeholder | 0
tests/find-file/files-with-dollar/$ | 0
tests/find-file/files-with-dollar/foo$ | 0
tests/find-file/files-with-dollar/one | 0
tests/find-file/files-with-dollar/two | 0
35 files changed, 2 insertions(+), 18784 deletions(-)
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
deleted file mode 100644
index baf06fb..0000000
--- a/.github/FUNDING.yml
+++ /dev/null
@@ -1,3 +0,0 @@
-github: abo-abo
-liberapay: abo-abo
-patreon: abo_abo
diff --git a/.gitignore b/.gitignore
index a2fa335..3398f81 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,7 @@
+/*-pkg.el
*.elc
*~
/doc/dir
*.info
-*-autoloads.el
+/*-autoloads.el
.dir-locals-2.el
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index a050e89..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,18 +0,0 @@
-language: emacs-lisp
-env:
- - EVM_EMACS=emacs-24.3-travis
- - EVM_EMACS=emacs-24.5-travis
- - EVM_EMACS=emacs-25.3-travis
- - EVM_EMACS=emacs-26.2-travis
- - EVM_EMACS=emacs-git-snapshot-travis
-
-before_install:
- - git clone https://github.com/rejeep/evm.git $HOME/.evm
- - export PATH=$HOME/.evm/bin:$PATH
-
- - evm config path /tmp
- - evm install $EVM_EMACS --use --skip
-
-script:
- - make deps
- - make test
diff --git a/CONTRIBUTING.org b/CONTRIBUTING.org
deleted file mode 100644
index 8d30208..0000000
--- a/CONTRIBUTING.org
+++ /dev/null
@@ -1,73 +0,0 @@
-* Reporting issues
-
-Before reporting a bug, please take a look at:
-- the [[https://github.com/abo-abo/swiper/blob/master/README.md][FAQ]]
-- the [[https://oremacs.com/swiper/][manual]]
-- the [[https://github.com/abo-abo/swiper/wiki][wiki]]
-- the [[https://github.com/abo-abo/swiper/issues][open issues]]
-
-To understand what's going on, we need a reproducible bug scenario.
-It is important that we can rule out interference with other Emacs
-packages or customizations, therefore use =emacs -Q= to bypass your
-init file.
-
-This shortcut will start =emacs -Q= for you with =ivy-mode= already
-loaded:
-#+begin_src sh
-git clone https://github.com/abo-abo/swiper/
-cd swiper
-make plain
-#+end_src
-
-* Contributing code
-Here are the important settings for code style:
-#+begin_src elisp
-(setq indent-tabs-mode nil)
-(require 'cl-indent)
-(setq lisp-indent-function #'common-lisp-indent-function)
-(put 'if 'common-lisp-indent-function 2)
-(put 'defface 'common-lisp-indent-function 1)
-(put 'defalias 'common-lisp-indent-function 1)
-(put 'define-minor-mode 'common-lisp-indent-function 1)
-(put 'define-derived-mode 'common-lisp-indent-function 3)
-(put 'cl-flet 'common-lisp-indent-function
- (get 'flet 'common-lisp-indent-function))
-(put 'cl-labels 'common-lisp-indent-function
- (get 'labels 'common-lisp-indent-function))
-#+end_src
-
-The setting for =indent-tabs-mode= is automatically applied by
-=.dir-locals.el=. Emacs produces a warning when setting
-=lisp-indent-function= in =.dir-locals.el=, so that line is commented
-out. Please uncomment it and add the following code to disable the
-warning:
-
-#+begin_src elisp
-(add-to-list 'safe-local-variable-values
- '(lisp-indent-function . common-lisp-indent-function))
-#+end_src
-
-Before submitting a change, run:
-- =make compile= - check for new compilation warnings
-- =make test= - check for failing tests
-- =make checkdoc= - check documentation guidelines
-
-Use your own judgment for the commit messages, I recommend a verbose
-style using =magit-commit-add-log=.
-
-* Copyright Assignment
-These packages are subject to the same
[[https://www.gnu.org/prep/maintain/html_node/Copyright-Papers.html][Copyright
Assignment]] policy as
-Emacs itself, org-mode, CEDET and other packages in
[[https://elpa.gnu.org/packages/][GNU ELPA]].
-
-Any
[[https://www.gnu.org/prep/maintain/html_node/Legally-Significant.html#Legally-Significant][legally
significant]] contributions can only be accepted after the
-author has completed their paperwork. Please see
[[https://git.savannah.gnu.org/cgit/gnulib.git/tree/doc/Copyright/request-assign.future][the
request form]] if
-you want to proceed with the assignment.
-
-The copyright assignment isn't a big deal, it just says that the
-copyright for your submitted changes to Emacs belongs to the FSF.
-This assignment works for all projects related to Emacs. To obtain it
-you need to:
-- send one email
-- then send one letter (if you live in the US, it's digital)
-- wait for some time (in my case, I had to wait for one month; but
- recently it's less than a week)
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 8cf9c54..0000000
--- a/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-emacs ?= emacs
-elmake = $(emacs) -batch -l makefi.el -f
-
-LOAD = -l elpa.el -l colir.el -l ivy-overlay.el -l ivy.el -l swiper.el -l
counsel.el
-RM ?= rm -f
-
-all: test
-
-deps:
- $(emacs) -batch -l targets/install-deps.el
-
-test:
- $(emacs) -batch $(LOAD) -l ivy-test.el -f ivy-test-run-tests
-
-checkdoc:
- $(emacs) -batch -l targets/checkdoc.el
-
-compile:
- $(emacs) -batch -L . -f batch-byte-compile colir.el ivy-overlay.el
ivy.el swiper.el counsel.el
-
-plain:
- $(emacs) --version
- $(emacs) -Q $(LOAD) -l targets/plain.el
-
-obsolete:
- $(emacs) -batch -l targets/obsolete-config.el
-
-update-issues:
- $(elmake) update-issues
-
-clean:
- $(RM) *.elc
-
-.PHONY: all test checkdoc compile plain obsolete update-issues clean
diff --git a/README.md b/README.md
deleted file mode 100644
index 658504f..0000000
--- a/README.md
+++ /dev/null
@@ -1,141 +0,0 @@
-[](https://travis-ci.org/abo-abo/swiper)
-
-***flexible, simple tools for minibuffer completion in Emacs***
-
-This repository contains:
-
-**Ivy**, a generic completion mechanism for Emacs.
-
-**Counsel**, a collection of Ivy-enhanced versions of common Emacs
-commands.
-
-**Swiper**, an Ivy-enhanced alternative to isearch.
-
-# Ivy
-
-[](https://melpa.org/#/ivy)
-[](https://stable.melpa.org/#/ivy)
-
-Ivy is a generic completion mechanism for Emacs. While it operates
-similarly to other completion schemes such as `icomplete-mode`, Ivy
-aims to be more efficient, smaller, simpler, and smoother to use yet
-highly customizable.
-
-To try Ivy, just call <kbd>M-x</kbd> `ivy-mode`. This will enable
-generic Ivy completion, including specific completion for file and
-buffer names.
-
-### Installation
-
-Install the `ivy` package from MELPA / GNU ELPA.
-
-Users of Debian ≥10 (and derivatives such as Ubuntu ≥18.04) can
-install Ivy, Counsel, and Swiper with `sudo apt install elpa-counsel`.
-To add Hydra support `sudo apt install elpa-ivy-hydra`.
-
-## Documentation
-
-### Manual
-The manual is available as [HTML](https://oremacs.com/swiper/).
-
-After installing from MELPA, the manual is also available through the `(ivy)`
Info node.
-
-The source file for the Info page is
-[here](https://github.com/abo-abo/swiper/blob/master/doc/ivy.org).
-
-### Wiki
-Ivy and Swiper wiki is here: [the
wiki](https://github.com/abo-abo/swiper/wiki).
-
-### Small config example
-
-```elisp
-(ivy-mode 1)
-(setq ivy-use-virtual-buffers t)
-(setq enable-recursive-minibuffers t)
-;; enable this if you want `swiper' to use it
-;; (setq search-default-mode #'char-fold-to-regexp)
-(global-set-key "\C-s" 'swiper)
-(global-set-key (kbd "C-c C-r") 'ivy-resume)
-(global-set-key (kbd "<f6>") 'ivy-resume)
-(global-set-key (kbd "M-x") 'counsel-M-x)
-(global-set-key (kbd "C-x C-f") 'counsel-find-file)
-(global-set-key (kbd "<f1> f") 'counsel-describe-function)
-(global-set-key (kbd "<f1> v") 'counsel-describe-variable)
-(global-set-key (kbd "<f1> l") 'counsel-find-library)
-(global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
-(global-set-key (kbd "<f2> u") 'counsel-unicode-char)
-(global-set-key (kbd "C-c g") 'counsel-git)
-(global-set-key (kbd "C-c j") 'counsel-git-grep)
-(global-set-key (kbd "C-c k") 'counsel-ag)
-(global-set-key (kbd "C-x l") 'counsel-locate)
-(global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
-(define-key minibuffer-local-map (kbd "C-r") 'counsel-minibuffer-history)
-```
-
-Note: parts of this config can be replaced by using `counsel-mode`.
-
-# Counsel
-
-[](https://melpa.org/#/counsel)
-[](https://stable.melpa.org/#/counsel)
-
-`ivy-mode` ensures that any Emacs command using
-`completing-read-function` uses ivy for completion.
-
-Counsel takes this further, providing versions of common Emacs
-commands that are customised to make the best use of ivy. For example,
-`counsel-find-file` has some additional keybindings. Pressing
-<kbd>DEL</kbd> will move you to the parent directory.
-
-Enabling `counsel-mode` remaps built-in Emacs functions that have
-counsel replacements:
-
-| Emacs command | Counsel equivalent |
-|--------------------------|----------------------------|
-| execute-extended-command | counsel-M-x |
-| describe-bindings | counsel-descbinds |
-| describe-function | counsel-describe-function |
-| describe-variable | counsel-describe-variable |
-| apropos-command | counsel-apropos |
-| describe-face | counsel-describe-face |
-| list-faces-display | counsel-faces |
-| find-file | counsel-find-file |
-| find-library | counsel-find-library |
-| imenu | counsel-imenu |
-| load-library | counsel-load-library |
-| load-theme | counsel-load-theme |
-| yank-pop | counsel-yank-pop |
-| info-lookup-symbol | counsel-info-lookup-symbol |
-| pop-to-mark-command | counsel-mark-ring |
-| bookmark-jump | counsel-bookmark |
-
-# Swiper
-
-[](https://melpa.org/#/swiper)
-[](https://stable.melpa.org/#/swiper)
-
-Swiper is an alternative to isearch that uses ivy to show an overview
-of all matches.
-
-
-
-A helm version of swiper is also available:
-[swiper-helm](https://github.com/abo-abo/swiper-helm).
-
-## Screenshots
-
-
-
-There's also a ten minute [video
demo](https://www.youtube.com/watch?v=VvnJQpTFVDc).
-
-# Frequently asked questions
-
-Q: How do I enter an input that matches one of the candidates instead
- of this candidate? Example: create a file `bar` when a file
- `barricade` exists in the current directory.
-
-A: Press <kbd>C-M-j</kbd>. Alternatively, you can make the prompt line
selectable with `(setq ivy-use-selectable-prompt t)`.
-
-# Contributing
-
-Please see the
[guidelines](https://github.com/abo-abo/swiper/blob/master/CONTRIBUTING.org)
for reporting issues and opening pull requests.
diff --git a/colir.el b/colir.el
deleted file mode 100644
index 9e61273..0000000
--- a/colir.el
+++ /dev/null
@@ -1,124 +0,0 @@
-;;; colir.el --- Color blending library -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2019 Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-
-;; This file is part of GNU Emacs.
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; For a full copy of the GNU General Public License
-;; see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package solves the problem of adding a face with a background
-;; to text which may already have a background. In all conflicting
-;; areas, instead of choosing either the original or the new
-;; background face, their blended sum is used.
-;;
-;; The blend mode functions are taken from URL
-;; `https://en.wikipedia.org/wiki/Blend_modes'.
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'color)
-
-(defcustom colir-compose-method #'colir-compose-alpha
- "Select a method to compose two color channels."
- :group 'ivy
- :type '(radio
- (function-item colir-compose-alpha)
- (function-item colir-compose-overlay)
- (function-item colir-compose-soft-light)))
-
-(defun colir-compose-soft-light (a b)
- "Compose A and B channels."
- (if (< b 0.5)
- (+ (* 2 a b) (* a a (- 1 b b)))
- (+ (* 2 a (- 1 b)) (* (sqrt a) (- (* 2 b) 1)))))
-
-(defun colir-compose-overlay (a b)
- "Compose A and B channels."
- (if (< a 0.5)
- (* 2 a b)
- (- 1 (* 2 (- 1 a) (- 1 b)))))
-
-(defun colir-compose-alpha (a b &optional alpha gamma)
- "Compose A and B channels.
-Optional argument ALPHA is a number between 0.0 and 1.0 which corresponds
-to the influence of A on the result. Default value is 0.5.
-Optional argument GAMMA is used for gamma correction. Default value is 2.2."
- (setq alpha (or alpha 0.5))
- (setq gamma (or gamma 2.2))
- (+ (* (expt a gamma) alpha) (* (expt b gamma) (- 1 alpha))))
-
-(defun colir-blend (c1 c2)
- "Blend the two colors C1 and C2 using `colir-compose-method'.
-C1 and C2 are triples of floats in [0.0 1.0] range."
- (apply #'color-rgb-to-hex
- (cl-mapcar
- (if (eq (frame-parameter nil 'background-mode) 'dark)
- ;; this method works nicely for dark themes
- 'colir-compose-soft-light
- colir-compose-method)
- c1 c2)))
-
-(defun colir-color-parse (color)
- "Convert string COLOR to triple of floats in [0.0 1.0]."
- (if (string-match
"#\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{2\\}\\)\\([[:xdigit:]]\\{2\\}\\)"
color)
- (mapcar (lambda (v) (/ (string-to-number v 16) 255.0))
- (list (match-string 1 color) (match-string 2 color)
(match-string 3 color)))
- ;; does not work properly in terminal (maps color to nearest color
- ;; from available color palette).
- (color-name-to-rgb color)))
-
-(defun colir--blend-background (start next prevn face object)
- (let ((background-prev (face-background prevn)))
- (progn
- (put-text-property
- start next 'face
- (if background-prev
- (cons `(background-color
- . ,(colir-blend
- (colir-color-parse background-prev)
- (colir-color-parse (face-background face nil t))))
- prevn)
- (list face prevn))
- object))))
-
-(defun colir-blend-face-background (start end face &optional object)
- "Append to the face property of the text from START to END the face FACE.
-When the text already has a face with a non-plain background,
-blend it with the background of FACE.
-Optional argument OBJECT is the string or buffer containing the text.
-See also `font-lock-append-text-property'."
- (let (next prev prevn)
- (while (/= start end)
- (setq next (next-single-property-change start 'face object end))
- (setq prev (get-text-property start 'face object))
- (setq prevn (if (listp prev)
- (cl-find-if #'atom prev)
- prev))
- (cond
- ((or (keywordp (car-safe prev)) (consp (car-safe prev)))
- (put-text-property start next 'face (cons face prev) object))
- ((facep prevn)
- (colir--blend-background start next prevn face object))
- (t
- (put-text-property start next 'face face object)))
- (setq start next))))
-
-(provide 'colir)
-
-;;; colir.el ends here
diff --git a/doc/Changelog.org b/doc/Changelog.org
deleted file mode 100644
index 587997b..0000000
--- a/doc/Changelog.org
+++ /dev/null
@@ -1,5195 +0,0 @@
-#+TITLE: Ivy CHANGELOG
-#+OPTIONS: H:4 num:nil toc:3
-#+SETUPFILE: ~/git/org-html-themes/setup/theme-readtheorg.setup
-#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="css/kbd-style.css"/>
-
-* 0.6.0
-:PROPERTIES:
-:CUSTOM_ID: 0.6.0
-:END:
------
-** Fixes
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fixes
-:END:
-*** =swiper-avy= should use only the current window
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-swiper-avy-should-use-only-the-current-window
-:END:
-Not all windows. See [[https://github.com/abo-abo/swiper/issues/117][#117]].
------
-*** fix wrap-around for =ivy-next-line=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-fix-wrap-around-for-ivy-next-line
-:END:
-See [[https://github.com/abo-abo/swiper/issues/118][#118]].
------
-*** =swiper-avy= should do nothing for empty input
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-swiper-avy-should-do-nothing-for-empty-input
-:END:
-See [[https://github.com/abo-abo/avy/issues/50][#50]].
------
-*** =ivy-alt-done= should require TRAMP if necessary
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-ivy-alt-done-should-require-tramp-if-necessary
-:END:
-See [[https://github.com/abo-abo/swiper/pull/145][#145]].
------
-*** =swiper-query-replace= shouldn't miss the first occurrence
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-swiper-query-replace-shouldnt-miss-the-first-occurrence
-:END:
-See [[https://github.com/abo-abo/swiper/pull/144][#144]].
------
-*** =swiper= should not deactivate mark
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-swiper-should-not-deactivate-mark
-:END:
-*** =ivy-mode= should not switch to TRAMP for certain input
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-ivy-mode-should-not-switch-to-tramp-for-certain-input
-:END:
-See [[https://github.com/abo-abo/swiper/pull/145][#145]].
------
-*** =counsel-find-file= should work better with TRAMP
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-counsel-find-file-should-work-better-with-tramp
-:END:
-"/ssh:foo" should not be cut off
-See [[https://github.com/abo-abo/swiper/pull/145][#145]].
------
-*** =counsel-find-file= supports Windows drive letters
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-counsel-find-file-supports-windows-drive-letters
-:END:
-See [[https://github.com/abo-abo/swiper/pull/155][#155]].
------
-*** =counsel-file-file= should work better with files that contain "~"
-:PROPERTIES:
-:CUSTOM_ID:
0-6-0-fx-counsel-file-file-should-work-better-with-files-that-contain-
-:END:
-See [[https://github.com/abo-abo/swiper/pull/157][#157]].
------
-*** =counsel-M-x= should respect =ivy-format-function=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-counsel-m-x-should-respect-ivy-format-function
-:END:
-See [[https://github.com/abo-abo/swiper/pull/150][#150]].
------
-*** =counsel-git-grep= should position better on exit
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-counsel-git-grep-should-position-better-on-exit
-:END:
-See [[https://github.com/abo-abo/swiper/pull/153][#153]].
------
-*** =ivy-mode= should re-scale text to minibuffer height
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-ivy-mode-should-re-scale-text-to-minibuffer-height
-:END:
-See [[https://github.com/abo-abo/swiper/pull/151][#151]].
------
-*** =counsel-unicode-char= should use action-style call
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-counsel-unicode-char-should-use-action-style-call
-:END:
-See [[https://github.com/abo-abo/swiper/pull/160][#160]].
------
-*** =ivy-read= should allow % in prompt string
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-ivy-read-should-allow--in-prompt-string
-:END:
-See [[https://github.com/abo-abo/swiper/pull/171][#171]].
------
-*** =ivy-call= should execute in proper window
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-ivy-call-should-execute-in-proper-window
-:END:
-See [[https://github.com/abo-abo/swiper/pull/176][#176]].
-** New Features
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-fx-new-features
-:END:
-*** =ivy-mode=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nf-ivy-mode
-:END:
-**** Open an Info file on the file system
-When in =Info-mode=, press ~g~ and select either "(./)" or "(../)" to
-switch to file name completion. That file will be opened with Info.
------
-**** Account for =minibuffer-depth-indication-mode=
-If you have =minibuffer-depth-indication-mode= on, the minibuffer
-prompt will indicate the current depth.
-See [[https://github.com/abo-abo/swiper/pull/134][#134]].
------
-**** Add fuzzy matching function
-To enable fuzzy matching, set your =ivy-re-builders-alist= accordingly:
-#+begin_src elisp
-(setq ivy-re-builders-alist
- '((t . ivy--regex-fuzzy)))
-#+end_src
-See [[https://github.com/abo-abo/swiper/pull/136][#136]].
-
-See also [[https://github.com/abo-abo/swiper/pull/142][#142]] for toggling
fuzzy matching with ~C-o m~.
------
-**** =case-fold-search= optimization
-Bind case-fold-search to t when the input is all lower-case:
-
-- input "the" matches both "the" and "The".
-- input "The" matches only "The".
-
-See [[https://github.com/abo-abo/swiper/pull/166][#166]].
------
-**** Allow to see the candidate index a la =anzu= via =ivy-count-format=
-To have this feature, use something like this:
-#+begin_src elisp
-(setq ivy-count-format "(%d/%d) ")
-#+end_src
-See [[https://github.com/abo-abo/swiper/pull/167][#167]].
-
-You can also set this to "", if you don't want any count, see
[[https://github.com/abo-abo/swiper/pull/188][#188]].
------
-**** Allow to add additional exit points for any command
-Example for =ivy-switch-to-buffer=:
-#+begin_src elisp
-(ivy-set-actions
- 'ivy-switch-buffer
- '(("k"
- (lambda (x)
- (kill-buffer x)
- (ivy--reset-state ivy-last))
- "kill")
- ("j"
- ivy--switch-buffer-other-window-action
- "other")))
-#+end_src
-
-After this:
-
-- use ~M-o k~ to kill a buffer
-- use ~M-o j~ to switch to a buffer in other window
-
-You can always use ~M-o o~ to access the default action. When there is
-only one action, ~M-o~ does the same as ~C-m~.
-
-See [[https://github.com/abo-abo/swiper/pull/164][#164]].
-
-
-
-
-
-
-
-
------
-*** =counsel-describe-function= and =counsel-decribe-variable=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nf-counsel-describe-function-and-counsel-decribe-variable
-:END:
-**** Add a binding to look up the symbol in info
-Press ~C-,~ to look up the symbol in info, instead of the default
-describe action.
-See [[https://github.com/abo-abo/swiper/pull/121][#121]].
------
-**** Handle symbol-at-point better in non-Elisp buffers
-See [[https://github.com/abo-abo/swiper/pull/126][#126]].
------
-*** =ivy-switch-buffer=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nf-ivy-switch-buffer
-:END:
-**** New face =ivy-virtual=
-See [[https://github.com/abo-abo/swiper/pull/129][#129]].
------
-**** Deal better with invisible buffers
-See [[https://github.com/abo-abo/swiper/pull/135][#135]].
------
-**** Add custom keymap
-You can customize =ivy-switch-buffer-map=.
-
-See [[https://github.com/abo-abo/swiper/pull/164][#164]].
------
-**** Add extra actions
-Add a =kill-buffer= action, and =switch-to-buffer-other-window= action.
------
-*** =counsel-git-grep=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nf-counsel-git-grep
-:END:
-**** Add Async
-Make it fully async: the process =git grep= will be killed and
-restarted on new input. This results in almost no keyboard delay.
------
-**** Own history variable
-*** =swiper=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nf-swiper
-:END:
-**** Own history variable
-Having own history variable allows to get more use of ~M-p~, ~M-n~ and ~C-r~.
------
-*** =counsel-el=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nf-counsel-el
-:END:
-**** Switch to action-style call
-This allows to make use of ~C-M-n~ and ~C-M-p~.
------
-*** =counsel-locate=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nf-counsel-locate
-:END:
-**** Add Async
-**** Add extra actions
-In addition to the default action of opening a file add:
-
-- =xdg-open= action
-- =dired= action
-
-Press ~M-o~ or ~C-o~ to access these actions.
------
-**** Add own history
-
------
-*** API
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nf-api
-:END:
-**** Add :matcher
-A matcher is a function that accepts a regexp and a list of candidates
-and returns the filtered list of candidates.
-
-The default matcher is basically =cl-remove-if-not= + =string-match=.
-If you'd like to customize this, pass your own matcher.
-
-See =counsel-git-grep-matcher= for an example.
------
-**** Allow to customize the initial input for all commands
-Customize =ivy-initial-inputs-alist= for this.
-See [[https://github.com/abo-abo/swiper/pull/140][#140]].
------
-**** =ivy-sort-functions-alist= should also examine =this-command=
-**** :dynamic-collection is now a boolean
-Pass the collection function as the second var instead.
-
-** New Commands
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nf-new-commands
-:END:
-*** =ivy-call=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-ivy-call
-:END:
-Execute the current action for the current candidate without exiting
-the minibuffer. Bound to ~C-M-m~ or ~M-RET~ or ~C-o g~.
-
-
------
-*** =counsel-find-file=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-counsel-find-file
-:END:
-Forward to =find-file= with Ivy completion.
-
-=ivy-next-line-and-call= as well as =ivy-resume= should work for this command.
-
-The variable =counsel-find-file-ignore-regexp= allows to ignore
-certain files, like dot files. Input a leading dot to see all files.
-
-The variable =counsel-find-file-at-point= allows to automatically use
-=ffap=. You also can do it manually with ~M-n~ when the point is on a file
name.
-
-The variable =counsel-find-file-map= allows to customize the
-minibuffer key bindings for this command.
-
-Recommended binding:
-
-#+begin_src elisp
-(global-set-key (kbd "C-x C-f") 'counsel-find-file)
-#+end_src
-
-You can peek at files with ~C-M-n~ and ~C-M-p~.
-
-See [[https://github.com/abo-abo/swiper/issues/122][#122]] and
[[https://github.com/abo-abo/swiper/issues/123][#123]].
-
-See [[https://github.com/abo-abo/swiper/pull/152][#152]] about ~M-n~, ~M-p~
and ~M-i~ switching directories when necessary.
-
------
-*** =ivy-recentf=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-ivy-recentf
-:END:
-Find a file on =recentf-list=.
-
-Note that if your set =ivy-use-virtual-buffers=, =recentf-list= is
-merged into candidates list for =ivy-switch-buffer=. But if you want
-it separately, you can use this command.
-
-See [[https://github.com/abo-abo/swiper/issues/124][#124]].
------
-*** =ivy-yank-word=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-ivy-yank-word
-:END:
-Add word at point to minibuffer input.
-
-This is similar to what ~C-w~ does for =isearch=. However it's bound
-to ~M-j~ instead of ~C-w~, since ~C-w~ is bound to =kill-region= - a
-useful command.
-
-See [[https://github.com/abo-abo/swiper/issues/125][#125]].
------
-*** =counsel-M-x=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-counsel-m-x
-:END:
-Forward to =execute-extended-command= with Ivy completion.
-The candidate list will also display the key binding for each bound command.
-
-This command will piggyback on =smex= for sorting, if =smex= is installed.
-
-Use =counsel-M-x-initial-input= to customize the initial input for
-this command. By default, it's "^" - the regex character that
-indicates beginning of string. This results in much faster matching,
-since you usually type the command name from the start.
-
-See [[https://github.com/abo-abo/swiper/pull/136][#136]] and
[[https://github.com/abo-abo/swiper/pull/138][#138]].
-
------
-*** =hydra-ivy=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-hydra-ivy
-:END:
-Press ~C-o~ to toggle the Hydra for Ivy.
-It gives access to shorter bindings and many customizable options.
-
-Use ~C-o >~ to grow the minibuffer.
-Use ~C-o <~ to shrink the minibuffer.
-
-See [[https://github.com/abo-abo/swiper/pull/151][#151]].
-
------
-*** =ivy-toggle-calling=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-ivy-toggle-calling
-:END:
-Toggle executing the current action each time a new candidate is selected.
-
-This command is bound to ~C-o c~.
-
-To explain how this is useful: ~C-M-m C-M-f C-M-f C-M-f~ is equivalent to
~C-o cjjj~.
-
------
-*** =ivy-insert-current=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-ivy-insert-current
-:END:
-Inserts the current candidate into the minibuffer.
-
-Press ~M-i~ if you want something close to the current candidate. You
-can follow up with an edit and select.
-
-I find this very useful when creating new files with a similar name to
-the existing file: ~C-x C-f M-i~ + a bit of editing is very fast.
-
-See [[https://github.com/abo-abo/swiper/pull/141][#141]].
-
------
-*** =counsel-load-theme=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-counsel-load-theme
-:END:
-Forward to =load-theme= with Ivy completion. Allows to rapidly try themes
(e.g. with ~C-M-n~).
-
------
-*** =ivy-reverse-i-search=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-ivy-reverse-i-search
-:END:
-Allow to recursively match history with ~C-r~.
-
-I like this command from bash shell. The usual way to search through
-history is with ~M-p~ and ~M-n~. Using =ivy-reverse-i-search= will
-open a recursive completion session with the current history as the
-candidates.
------
-*** =counsel-rhythmbox=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-counsel-rhythmbox
-:END:
-[[https://oremacs.com/2015/07/09/counsel-rhythmbox/][Control Rhythmbox from
Emacs.]]
------
-*** =ivy-dispatching-done=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-ivy-dispatching-done
-:END:
-Select an action for the current candidate and execute it. Bound to ~M-o~.
-
-Some commands that support ~M-o~:
-
-- =counsel-rhythmbox=
-- =counsel-describe-function=
-- =counsel-describe-variable=
-- =ivy-switch-buffer=
-- =counsel-locate=
-
------
-*** =counsel-org-tag=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-counsel-org-tag
-:END:
-Forward to =org-set-tags= with Ivy completion.
-
-Selecting any tag each time will toggle it on/off.
-The current list of selected tags will be displayed in the prompt.
-
-See [[https://github.com/abo-abo/swiper/pull/177][#177]] and
[[https://github.com/abo-abo/swiper/pull/91][#91]].
-
------
-*** =counsel-org-tag-agenda=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-counsel-org-tag-agenda
-:END:
-Forward to =org-agenda-set-tags= with Ivy completion.
-See [[https://github.com/abo-abo/swiper/pull/177][#177]].
-
------
-*** =counsel-ag=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-counsel-ag
-:END:
-Interactively =ag= using Ivy completion.
-
------
-*** =counsel-recoll=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-counsel-recoll
-:END:
-Use =recoll= with Ivy completion.
-See [[https://oremacs.com/2015/07/27/counsel-recoll/][Using Recoll desktop
search database with Emacs]].
-
-Install recoll with =sudo apt-get install recoll=.
-
------
-*** =swiper-from-isearch=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-swiper-from-isearch
-:END:
-Start =swiper= from the current =isearch= input.
-
------
-*** =ivy-immediate-done=
-:PROPERTIES:
-:CUSTOM_ID: 0-6-0-nc-ivy-immediate-done
-:END:
-Use this command to exit the minibuffer choosing not the current
-candidate, but the current text. Bound to ~C-M-j~ or ~C-u C-j~.
-
-See [[https://github.com/abo-abo/swiper/pull/183][#183]].
-
------
-* 0.7.0
-:PROPERTIES:
-:CUSTOM_ID: 0.7.0
-:END:
------
-** Fixes
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fixes
-:END:
-*** Fix :dynamic-collection not being sorted
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-fix-dynamic-collection-not-being-sorted
-:END:
-*** When :initial-input contains a plus, escape it
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-when-initial-input-contains-a-plus,-escape-it
-:END:
-See [[https://github.com/abo-abo/swiper/issues/195][#195]].
------
-*** Set line-spacing to 0 in the minibuffer
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-set-line-spacing-to-0-in-the-minibuffer
-:END:
-See [[https://github.com/abo-abo/swiper/issues/198][#198]].
------
-*** Enlarge the minibuffer window if the candidate list doesn't fit
-:PROPERTIES:
-:CUSTOM_ID:
0-7-0-fx-enlarge-the-minibuffer-window-if-the-candidate-list-doesnt-fit
-:END:
-See [[https://github.com/abo-abo/swiper/issues/198][#198]] and
[[https://github.com/abo-abo/swiper/issues/161][#161]] and
[[https://github.com/abo-abo/swiper/issues/220][#220]].
------
-*** Fix minibuffer collapsing to one line
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-fix-minibuffer-collapsing-to-one-line
-:END:
-See [[https://github.com/abo-abo/swiper/issues/237][#237]],
[[https://github.com/abo-abo/swiper/issues/229][#229]] and
[[https://github.com/abo-abo/swiper/issues/77][#77]].
------
-*** Use minibuffer-allow-text-properties
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-use-minibuffer-allow-text-properties
-:END:
-Allows =ivy-read= to return a propertized string.
------
-*** Improve ~C-g~ out of a long-running async process
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-improve-c-g-out-of-a-long-running-async-process
-:END:
-Use =counsel-delete-process= as =:unwind=.
------
-*** Don't regexp-quote :preselect
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-dont-regexp-quote-preselect
-:END:
-See [[https://github.com/abo-abo/swiper/issues/245][#245]].
------
-*** Fix ivy-partial for fuzzy completion
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-fix-ivy-partial-for-fuzzy-completion
-:END:
-See [[https://github.com/abo-abo/swiper/issues/266][#266]].
------
-*** ivy-resume should pass :caller
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-ivy-resume-should-pass-caller
-:END:
-See [[https://github.com/abo-abo/swiper/issues/245][#245]].
------
-*** Fix the regression in perfect match logic
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-fix-the-regression-in-perfect-match-logic
-:END:
-See [[https://github.com/abo-abo/swiper/issues/270][#270]].
------
-*** Fix pasting file paths on Windows
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-fix-pasting-file-paths-on-windows
-:END:
-*** ~C-j~ should no stop completion for a pasted file path
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-c-j-should-no-stop-completion-for-a-pasted-file-path
-:END:
-*** ~C-M-j~ should use =ivy--directory=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-c-m-j-should-use-ivy--directory
-:END:
-When completing file names, expand the file name properly.
-See [[https://github.com/abo-abo/swiper/issues/275][#275]].
------
-*** Use a specific blend method for dark themes
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-use-a-specific-blend-method-for-dark-themes
-:END:
-See [[https://github.com/abo-abo/swiper/issues/278][#278]].
------
-*** Fix one-off bug in =ivy-scroll-up-command= and =ivy-scroll-down-command=
-:PROPERTIES:
-:CUSTOM_ID:
0-7-0-fx-fix-one-off-bug-in-ivy-scroll-up-command-and-ivy-scroll-down-command
-:END:
-*** ~M-o~ shouldn't set the action permanently
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-m-o-shouldnt-set-the-action-permanently
-:END:
-So now it's possible to e.g. =counsel-describe-function= -> ~M-o d~ ->
-=ivy-resume= -> ~M-o o~ -> =ivy-resume= -> ~M-o i~.
------
-*** Fix swiper preselect issue with similar or identical lines
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-fix-swiper-preselect-issue-with-similar-or-identical-lines
-:END:
-See [[https://github.com/abo-abo/swiper/issues/290][#290]].
------
-*** Make ivy-completing-read handle history as cons
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-make-ivy-completing-read-handle-history-as-cons
-:END:
-See [[https://github.com/abo-abo/swiper/issues/295][#295]].
------
-*** Perform string-match in the original buffer
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-perform-string-match-in-the-original-buffer
-:END:
-The syntax for whitespace, separators etc. is different for modes. See
[[https://github.com/abo-abo/swiper/issues/298][#298]].
-** New Features
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-fx-new-features
-:END:
-*** =swiper=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-swiper
-:END:
-**** Make line numbers into display properties
-Each candidate is now a single space plus the original string. The
-display property of the single space holds the line number. This means
-that it's no longer possible to match line numbers in queries, which
-is a good thing if you're searching for numbers.
------
-**** Extend =swiper-font-lock-ensure=
-Add =mu4e-view-mode=, =mu4e-headers-mode=, =help-mode=,
-=elfeed-show-mode=, =emms-stream-mode=, =debbugs-gnu-mode=,
-=occur-mode=, =occur-edit-mode=, =bongo-mode=, =eww-mode=, =vc-dir-mode=.
------
-**** Add support for =evil-jumper/backward=
-See [[https://github.com/abo-abo/swiper/issues/268][#268]].
------
-**** Make compatible with =visual-line-mode=
-=swiper= will split the lines when =visual-line-mode= is on. This is
-convenient for small buffers. For large buffers, it can be very slow,
-since =visual-line-mode= is slow.
-See [[https://github.com/abo-abo/swiper/issues/227][#227]].
------
-**** Add =swiper-toggle-face-matching=
-Bound to ~C-c C-f~.
-At each start of =swiper=, the face at point will be stored.
-Use this command to toggle matching only the candidates with that face.
-See [[https://github.com/abo-abo/swiper/issues/288][#288]].
------
-**** =push-mark= only if exited the minibuffer
-~C-M-n~ and ~C-M-p~ will no longer push mark and annoy with messages.
------
-**** =ivy-resume= should restore the buffer for =swiper=
-See [[https://github.com/abo-abo/swiper/issues/302][#302]].
------
-**** Enable recursive =swiper= calls
-While you =swiper= buffer-1, you can switch out of the minibuffer into
-buffer-2 and call =swiper= again. Exiting the second minibuffer will
-restore the first minibuffer.
-
-To use this, you need to enable recursive minibuffers.
-#+begin_src elisp
-(setq enable-recursive-minibuffers t)
-#+end_src
-
-It's also useful to indicate the current depth:
-
-#+begin_src elisp
-(minibuffer-depth-indicate-mode 1)
-#+end_src
-
-See [[https://github.com/abo-abo/swiper/issues/309][#309]].
------
-**** Fix for =twittering-mode=
-The =field= text property is now removed before inserting text into
-the minibuffer. This fixes the =swiper= problems with
-=twittering-mode=. See [[https://github.com/abo-abo/swiper/issues/310][#310]].
-
-
-
-
------
-*** =ivy=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-ivy
-:END:
-**** Add manual
-In the current state, the manual covers the most basic topics, like
-the minibuffer key bindings and the regexp builders.
------
-**** Make <left> and <right> behave as in fundamental-mode
-**** Truncate minibuffer prompts longer than window-width
-See [[https://github.com/abo-abo/swiper/issues/240][#240]].
------
-**** ~C-M-n~ should not leave the minibuffer
-Make sure that the minibuffer window remains selected as long as the
-completion hasn't finished. For example, ~<f1> f~ to call
-=counsel-describe-function=, input "forward" and spam ~C-M-n~ to read
-the doc for each function that starts with "forward". The =*Help*=
-window popup would move the window focus, but this change moves it
-back to the minibuffer.
------
-**** Add =flx= sorting
-See [[https://github.com/abo-abo/swiper/issues/207][#207]].
-Since flx is costly, move the caching to an earlier point. This means
-immediate return for when the input hasn't changed, i.e. for ~C-n~ or
-~C-p~. When =flx= is installed, and =(eq ivy--regex-function
'ivy--regex-fuzzy)=
-for current function (through =ivy-re-builders-alist=), then sort the final
candidates with
-=ivy--flx-sort=.
-
-In the worst case, when some error pops up, return the same list. In
-the best case sort the =cands= that all match =name= by closeness to
-=name=.
-
-How to use:
-1. Have =flx= installed - =(require 'flx)= should succeed.
-2. Configure =ivy-re-builders-alist= appropriately to use =ivy--regex-fuzzy=.
-
-For example:
-
-#+begin_src elisp
-(setq ivy-re-builders-alist
- '((t . ivy--regex-fuzzy)))
-#+end_src
------
-**** Support hash tables
-Since =all-completions= also works for hash tables, no reason not to support
them.
------
-**** Improve documentation of =ivy-count-format=
-Now possible to set it with Customize.
------
-**** Add =ivy-index-functions-alist=
-Customize this to decide how the index, i.e. the currently selected
-candidate, is updated with new input.
-For example, one strategy is not reset it to 0 after each change.
-
-Another strategy, used for =swiper=, is to try to select the first
-appropriate candidate after (inclusive) the first previously selected
-candidate. This way, if you're typing something that matches what is
-currently selected, the selection won't change.
-
-See [[https://github.com/abo-abo/swiper/issues/253][#253]].
------
-**** Add =ivy-virtual-abbreviate=
-The mode of abbreviation for virtual buffer names.
------
-**** Add =ivy-case-fold-search=
-Used to override =case-fold-search=. See
[[https://github.com/abo-abo/swiper/issues/259][#259]].
------
-**** Add feedback for long-running async processes
-Each time 0.5s pass after the last input, if the external process
-hasn't finished yet, update minibuffer with the amount of candidates
-collected so far. This is useful to see that long running commands
-like =counsel-locate= or =counsel-ag= (when in a very large directory)
-aren't stuck.
------
-**** Promote =ivy-extra-directories= to defcustom
-**** Promote =ivy-sort-function-alist= to defcustom
-**** ~M-n~ should prefer url at point to symbol at point
-**** ~C-x C-f M-n~ calls =ffap-url-fetcher= when at URL
-**** Highlight modified file buffers with =ivy-modified-buffer= face
-This new face is blank by default, but you can use e.g.:
-#+begin_src elisp
-(custom-set-faces
- '(ivy-modified-buffer ((t (:background "#ff7777")))))
-#+end_src
------
-**** Work with =enable-recursive-minibuffers=
-Store the old =ivy-last= in case =ivy-read= is called while inside the
-minibuffer. Restore it after =ivy-call=.
------
-**** Allow user-specified matched candidate sorting
-New defcustom =ivy-sort-matches-functions-alist=.
-See [[https://github.com/abo-abo/swiper/issues/269][#269]]
[[https://github.com/abo-abo/swiper/issues/265][#265]]
[[https://github.com/abo-abo/swiper/issues/213][#213]].
-
-By default, Ivy doesn't sort the matched candidates, they remain in
-the same order as in the original collection. This option is the
-default, since it's fast and simple.
-
-A small problem with this approach is that we usually want prefix
-matches to be displayed first. One solution to this is to input "^" to
-see only the prefix matches.
-
-Now, another solution is to can set:
-#+begin_src elisp
-(setq ivy-sort-matches-functions-alist
- '((t . ivy--prefix-sort)))
-#+end_src
-
-Here's another example of using this defcustom:
-#+begin_src elisp
-(add-to-list
- 'ivy-sort-matches-functions-alist
- '(read-file-name-internal . ivy--sort-files-by-date))
-#+end_src
-
-After this, during file name completion, most recently changed files
-will be ahead.
------
-**** =ivy-display-style=
-Adds fancy highlighting to the minibuffer.
-See [[https://github.com/abo-abo/swiper/issues/212][#212]],
[[https://github.com/abo-abo/swiper/issues/217][#217]], .
------
-*** =ivy-hydra=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-ivy-hydra
-:END:
-**** Bind ~t~ to =toggle-truncate-lines=
-See [[https://github.com/abo-abo/swiper/issues/214][#214]].
------
-**** Bind ~a~ to =ivy-read-action=
-*** =ivy-switch-buffer=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-ivy-switch-buffer
-:END:
-**** Make ~M-o r~ rename the buffer instead of switching.
-See [[https://github.com/abo-abo/swiper/issues/233][#233]].
------
-*** =counsel-locate=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-counsel-locate
-:END:
-**** Allow customizing locate options
-See =counsel-locate-options=.
-The current setting is:
-#+begin_src elisp
-(setq counsel-locate-options '("-i" "--regex"))
-#+end_src
------
-**** Support OSX
-Use =open= instead of =xdg-open=. Modify =counsel-locate-options= for
-OSX, since there =locate= doesn't support =--regex=.
------
-**** Use single quotes for the regex
-See [[https://github.com/abo-abo/swiper/issues/194][#194]].
------
-**** Add initial-input argument
-See [[https://github.com/abo-abo/swiper/issues/289][#289]].
------
-*** =counsel-org-tag=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-counsel-org-tag
-:END:
-**** Now works in agenda
-See [[https://github.com/abo-abo/swiper/issues/200][#200]].
------
-*** =counsel-unicode-char=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-counsel-unicode-char
-:END:
-**** Add own history
-*** =counsel-M-x=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-counsel-m-x
-:END:
-**** Add "definition" action
-Use ~M-o d~ to jump to definition.
------
-**** Show =current-prefix-arg= in the prompt
-See [[https://github.com/abo-abo/swiper/issues/287][#287]].
------
-*** =counsel-find-file=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-counsel-find-file
-:END:
-**** Input '/sudo::' goes to current directory instead of root's home
-See [[https://github.com/abo-abo/swiper/issues/283][#283]].
------
-**** Fix directory validity check
-See [[https://github.com/abo-abo/swiper/issues/283][#283]]
[[https://github.com/abo-abo/swiper/issues/284][#284]].
------
-**** Improve TRAMP support
-Selecting items after ~//~ now works properly.
------
-*** =counsel-git-grep=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-counsel-git-grep
-:END:
-**** Use prefix arg to specify the shell command.
-Remember to use ~M-i~ to insert the current candidate into the
-minibuffer.
-
-See [[https://github.com/abo-abo/swiper/issues/244][#244]].
------
-**** Allow =counsel-git-grep= -> =ivy-occur= -> =wgrep=
-Using ~C-c C-o~ (=ivy-occur=) while in =counsel-git-grep= will produce
-a =wgrep=-compatible buffer.
------
-**** =ivy-occur= gives full candidates
-This means that the =" | head -n 200"= speed-up isn't used and full
-candidates are returned.
------
-*** =counsel--find-symbol=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-counsel--find-symbol
-:END:
-**** Allow to jump back with pop-tag-mark
-Using ~C-.~ in:
-
-- =counsel-describe-function=
-- =counsel-describe-variable=
-- =counsel-load-library=
-
-will change the current buffer. The buffer and point can be restored
-with ~M-*~ (=pop-tag-mark=).
-
-I also recommend this binding:
-
-#+begin_src elisp
-(global-set-key (kbd "M-,") 'pop-tag-mark)
-#+end_src
------
-**** Resolve the name clash better
-When the symbol is both bound and fbound, prefer the fbound one,
-unless the =:caller= is =counsel-describe-variable=.
------
-*** =counsel-ag=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-counsel-ag
-:END:
-**** Add =initial-directory=
-Support alternative initial directory which helps other packages call
-this function with their unique starting directory.
------
-**** Fix on Windows
-Using the "--vimgrep" argument improves things.
-** New Commands
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nf-new-commands
-:END:
-*** =ivy-occur=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-ivy-occur
-:END:
-Bound to ~C-c C-o~. Store the current completion session to its own
-buffer. You can have an unlimited amount of these buffers.
------
-*** =ivy-avy=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-ivy-avy
-:END:
-Bound to ~C-'~.
-
-Speeds up selecting a candidate that's currently visible in the minibuffer.
------
-*** =ivy-kill-ring-save=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-ivy-kill-ring-save
-:END:
-Bound to ~M-w~.
-
-When the region is active, call =kill-ring-save=. Otherwise, store
-all selected candidates to the kill ring.
------
-*** =ivy-dispatching-call=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-ivy-dispatching-call
-:END:
-Bound to ~C-M-o~.
-
-This is a non-exiting version of ~M-o~ (=ivy-dispatching-done=).
------
-*** =ivy-read-action=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-ivy-read-action
-:END:
-Bound to ~C-M-a~. Select the current action. Don't call it yet.
------
-*** =swiper-multi=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-swiper-multi
-:END:
-Use =swiper= in multiple buffers.
-See [[https://github.com/abo-abo/swiper/issues/182][#182]].
-
-Basic usage tips for selecting multiple buffers:
-
-- Use ~C-M-m~ (=ivy-call=) to add or remove one more buffer without exiting.
-- Use ~C-m~ (=ivy-done=) to add one last buffer.
-- Or use ~C-M-j~ (=ivy-immediate-done=) to finish without adding more buffers.
-- Hold ~C-M-n~ (=ivy-next-line-and-call=) to add a lot of buffers at once.
------
-*** =swiper-mc=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-swiper-mc
-:END:
-Open multiple cursors at all selected candidates.
------
-*** =swiper-all=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-swiper-all
-:END:
-New command to launch =swiper= for all open file buffers. Note that
-this can be excruciatingly slow if you don't clean up your buffer list
-often.
------
-*** =counsel-grep=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-counsel-grep
-:END:
-This is essentially =swiper= for huge files. It's not as smooth as
-=swiper= for small files, but has a faster startup and faster matching
-for files that measure in megabytes.
------
-*** =counsel-git-grep-query-replace=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-counsel-git-grep-query-replace
-:END:
-Bound to ~M-q~. Perform =query-replace= on all matches in all buffers.
------
-*** =counsel-jedi=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-counsel-jedi
-:END:
-Complete Python symbols using Jedi.
------
-*** =counsel-cl=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-counsel-cl
-:END:
-Complete Common Lisp symbols using SLIME.
------
-*** =counsel-yank-pop=
-:PROPERTIES:
-:CUSTOM_ID: 0-7-0-nc-counsel-yank-pop
-:END:
-Give completion for inserting from the kill ring.
-See =counsel-yank-pop-truncate= defcustom and
[[https://github.com/abo-abo/swiper/issues/218][#218]].
------
-* 0.8.0
-:PROPERTIES:
-:CUSTOM_ID: 0.8.0
-:END:
------
-** Package rename
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-package-rename
-:END:
-Due to popular demand, =swiper-0.7.0= is succeeded by =ivy-0.8.0= in GNU
-ELPA. The contents of the package don't change, only the name. Make
-sure to remove the =~/.emacs.d/elpa/swiper-0.7.0= directory if you
-have it and ~M-x~ =package-install ivy=.
-** Documentation
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-documentation
-:END:
-HTML documentation is available at [[https://oremacs.com/swiper/]].
-
-Texinfo documentation is in doc/ivy.texi.
-
-The HTML file shouldn't be in this repository to avoid bloat, instead
-it's in the gh-pages branch at
-https://github.com/abo-abo/swiper/tree/gh-pages.
-** Fixes
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fixes
-:END:
-*** =ivy-read=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-read
-:END:
-**** Fix recursive minibuffer exit with ~C-g~
-Make it so e.g. ~C-h f C-h v C-g~ goes back to the =describe-function=
selection.
------
-**** Ensure the return result
-In some cases, =read-from-minibuffer= will return the whole minibuffer
-contents (i.e. all available candidates). Return =ivy--current= instead.
------
-**** Properly support matching ignoring order
-See [[https://github.com/abo-abo/swiper/issues/296][#296]] and
[[https://github.com/abo-abo/swiper/issues/329][#329]].
------
-**** Insert intermediate candidates during async completions
-See [[https://github.com/abo-abo/swiper/issues/340][#340]].
------
-**** Initialize =ivy-last= to empty state
-See [[https://github.com/abo-abo/swiper/issues/352][#352]].
------
-**** Fix extra actions for =completing-read=
-See [[https://github.com/abo-abo/swiper/issues/337][#337]].
------
-**** Support a list of symbols as collection
-See [[https://github.com/abo-abo/swiper/issues/375][#375]].
------
-**** Define =setq-local= and =defvar-local= unless defined
-With this commit, Ivy works on emacs-24.2.
-See [[https://github.com/abo-abo/swiper/issues/415][#415]].
------
-**** Make ~M-o~ not modify the action
-See [[https://github.com/abo-abo/swiper/issues/454][#454]].
------
-**** Make sure user keybindings are respected
-See [[https://github.com/abo-abo/swiper/issues/466][#466]].
------
-**** Fix =read-file-name= with a specified dir
-See [[https://github.com/abo-abo/swiper/issues/475][#475]].
------
-**** Don't highlight the match in the file part
-See [[https://github.com/abo-abo/swiper/issues/483][#483]].
------
-**** Add a few tests for alists
------
-*** =ivy-occur=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-occur
-:END:
-**** Fix =default-directory=
-This way, =next-error= etc will work properly.
------
-*** =ivy--resize-minibuffer-to-fit=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy--resize-minibuffer-to-fit
-:END:
-**** Fix for small delta
-See [[https://github.com/abo-abo/swiper/issues/339][#339]].
------
-**** Check =frame-root-window-p=
-See [[https://github.com/abo-abo/swiper/issues/380][#380]].
------
-*** =ivy-completing-read=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-completing-read
-:END:
-**** Use =completing-read-default= for tmm
-See [[https://github.com/abo-abo/swiper/issues/316][#316]].
------
-*** =ivy--regex-plus=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy--regex-plus
-:END:
-**** Recognize ! at the beginning of the str
-See [[https://github.com/abo-abo/swiper/issues/318][#318]].
------
-**** Prettify a bit
-See [[https://github.com/abo-abo/swiper/issues/344][#344]].
------
-**** Don't consider =\\(?...\)= a group
-See [[https://github.com/abo-abo/swiper/issues/393][#393]].
------
-*** =ivy--get-window=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy--get-window
-:END:
-**** Always return a valid window
-Even if =state= is invalid.
------
-*** =ivy--recompute-index=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy--recompute-index
-:END:
-**** Update =cl-position= logic
-See [[https://github.com/abo-abo/swiper/issues/207][#207]].
------
-*** =ivy-reverse-i-search=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-reverse-i-search
-:END:
-**** Fix due to recursive update
-See [[https://github.com/abo-abo/swiper/issues/323][#323]].
------
-*** =ivy--reset-state=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy--reset-state
-:END:
-**** Don't null =initial-input=
-This is specifically for ='read-file-name-internal= collection. The
-input needs to be set to nil for e.g. =rgrep=, which supplies the
-*absolute* path as =initial-input=, resulting in a mess.
-
-For now, don't set input to nil if =:action= was passed to =ivy-read=.
-See [[https://github.com/abo-abo/swiper/issues/336][#336]].
------
-**** Don't deactivate region
-See [[https://github.com/abo-abo/swiper/issues/377][#377]].
------
-*** =ivy-completion-in-region=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-completion-in-region
-:END:
-**** Use =completion-all-completions=
-See [[https://github.com/abo-abo/swiper/issues/341][#341]].
------
-**** Optimize for 1 candidate
-When there's only one candidate, call the action immediately.
------
-**** Add feedback for 1 candidate
-When the sole completion is the same as the input, notify the user.
-See [[https://github.com/abo-abo/swiper/issues/350][#350]].
------
-**** Bind =completion-ignore-case=
-It's convenient to have it the same value as =case-fold-search=.
------
-*** =ivy-read-action=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-read-action
-:END:
-**** Give enough minibuffer space
-See [[https://github.com/abo-abo/swiper/issues/402][#402]].
------
-**** Allow to customize the action hint formatter
-See [[https://github.com/abo-abo/swiper/issues/469][#469]].
------
-*** =ivy-count-format=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-count-format
-:END:
-**** Fix for nil value
-See [[https://github.com/abo-abo/swiper/issues/349][#349]].
------
-*** =ivy-switch-buffer=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-switch-buffer
-:END:
-**** Don't fall back to =switch-to-buffer=
-See [[https://github.com/abo-abo/swiper/issues/410][#410]].
------
-*** =ivy-next-history-element=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-next-history-element
-:END:
-**** No "\\_<" for dynamic-collection
-"\\_<" regex is Emacs-specific and should only be done if
-=:dynamic-collection= is nil. It is nil for =counsel-git-grep= with
-repositories < 20000 lines, but non-nil for larger ones.
-
-Fixes [[https://github.com/abo-abo/swiper/issues/409][#409]].
------
-*** =ivy-occur-press=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-occur-press
-:END:
-**** Pulse no longer
-Repeated pulses within a short time span resulted in horrible window
-flickering.
------
-*** =ivy-resume=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-resume
-:END:
-**** Add a guard against null =:action=
------
-*** =ivy-avy=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-avy
-:END:
-**** Make ~C-g~ cancel gracefully
-See abo-abo/avy[[https://github.com/abo-abo/swiper/issues/140][#140]].
------
-*** =ivy-dispatching-done=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-ivy-dispatching-done
-:END:
-Allow to exit with no candidates.
------
-*** =swiper=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-swiper
-:END:
-**** Improve for multiple occurrences on one line
-See [[https://github.com/abo-abo/swiper/issues/314][#314]].
------
-**** Fix "backward" search
-When none of the previous candidates after the point match the current
-input, instead of returning 0, return the index of the last matching
-candidate. This is a good choice, because that candidate is the
-closest to the point of the initial search start.
-
-See [[https://github.com/abo-abo/swiper/issues/319][#319]].
------
-**** Return point
-See [[https://github.com/abo-abo/swiper/issues/370][#370]].
------
-**** Update =regexp-search-ring=
-See [[https://github.com/abo-abo/swiper/issues/89][#89]].
------
-**** Always remove '(field) text property
-Allows to search better in modes for shell interaction.
------
-*** =swiper-font-lock-ensure=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-swiper-font-lock-ensure
-:END:
-**** Add modes
-Add bongo-library-mode, bongo-playlist-mode, sauron-mode.
-
-See [[https://github.com/abo-abo/swiper/issues/19][#19]].
------
-**** Don't fail when font-lock is off
-See [[https://github.com/abo-abo/swiper/issues/400][#400]].
------
-*** =swiper--multi-candidates=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-swiper--multi-candidates
-:END:
-**** Add check for =make-string=
-See [[https://github.com/abo-abo/swiper/issues/481][#481]].
------
-*** =counsel--async-sentinel=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-counsel--async-sentinel
-:END:
-**** Fix issue with =ivy--regex-ignore-order=
-See [[https://github.com/abo-abo/swiper/issues/342][#342]].
------
-**** Re-display when no cands
-**** Recognize error codes other than 1
-See [[https://github.com/abo-abo/swiper/issues/394][#394]].
------
-*** =counsel-git=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-counsel-git
-:END:
-**** Fix window selection.
-Use =with-ivy-window=, so that each new file chosen with e.g. ~C-M-n~ is
-selected in the same window.
------
-*** =counsel-recoll=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-counsel-recoll
-:END:
-**** Add =:unwind=
-See [[https://github.com/abo-abo/swiper/issues/403][#403]].
------
-*** compilation warnings
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-compilation-warnings
-:END:
-See [[https://github.com/abo-abo/swiper/issues/324][#324]].
------
-** New Features
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-fx-new-features
-:END:
-*** =ivy-read=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-read
-:END:
-**** Use =flx= for highlighting fuzzy matches
-See [[https://github.com/abo-abo/swiper/issues/207][#207]].
------
-**** Simplify the signature for =:dynamic-collection= functions
-When given =:dynamic-collection=, assume the collection function only
-needs one argument - the string input.
------
-**** Modify ~M-n~ prediction when region is active
-When the region is active and ~M-n~ is called, insert the region
-contents into the minibuffer and deactivate the region. The region
-deactivation is done for =swiper=, to make it easier to search for
-multiple words or a subword.
------
-**** Allow to compose collections
-***** Example 1: async collection
-Stack =recentf= on top of =counsel-locate=:
-
-#+begin_src elisp
-(defun small-test ()
- (cl-subseq recentf-list 0 10))
-
-(ivy-set-sources
- 'counsel-locate
- '((small-test)
- (original-source)))
-#+end_src
-
-Here, (original-source) represents the async candidates of
-=counsel-locate=. All extra sources are static - each function is called
-once to generate a list of strings, which will be filtered later.
-
-The order matters, so you can have e.g.:
-
-#+begin_src elisp
-(ivy-set-sources
- 'counsel-locate
- '((original-source)
- (small-test)))
-#+end_src
-
-See [[https://github.com/abo-abo/swiper/issues/373][#373]].
------
-***** Example 2: sync collection
-#+begin_src elisp
-(defun my-extra-source ()
- (append
- (when (eq 'Git (vc-backend (buffer-file-name)))
- (list "git1" "git2" "git3"))
- (when (file-exists-p "doc/Changelog.org")
- (list (propertize "doc/Changelog.org" 'face '(:background "red"))))))
-
-(defun my-find-file ()
- (interactive)
- (ivy-read "Find file: " 'read-file-name-internal
- :action (lambda (x)
- (with-ivy-window
- (find-file (expand-file-name x ivy--directory))))
- :require-match 'confirm-after-completion
- :history 'file-name-history
- :caller 'my-find-file))
-
-(ivy-set-sources
- 'my-find-file
- '((my-extra-source)
- (original-source)))
-#+end_src
-
-The function =my-find-file= knows nothing about the extra source, it's
-only purpose is to introduce a =:caller= to attach things to, as to not
-to mess up e.g. =counsel-find-file=.
-
-The function =my-extra-source= gets called once in =ivy-read= via
-=ivy--reset-state=. It takes no args and returns a list of strings,
-possibly empty.
------
-**** Improve documentation UI
-Bind ~C-h m~ to =ivy-help=.
-
-=ivy-help-file= is a new defvar pointing to the ivy-help.org file.
-
-Bind ~D~ in =hydra-ivy= to go to hydra's definition.
-
-See [[https://github.com/abo-abo/swiper/issues/376][#376]] and
[[https://github.com/abo-abo/swiper/issues/379][#379]].
------
-**** Add ignore pattern toggling
-~C-c C-a~ is bound to =ivy-toggle-ignore= - a new command to toggle ignore
-patterns (user-configured filtering). If the ignore patterns are
-enabled and there are zero candidates after ignoring, display the ones
-that match the current text. This feature currently works for
-=ivy-switch-buffer= and =counsel-find-file=.
-
-See [[https://github.com/abo-abo/swiper/issues/369][#369]].
------
-*** =ivy-mode=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-mode
-:END:
-**** Set =completion-in-region-function=
-See [[https://github.com/abo-abo/swiper/issues/331][#331]].
------
-**** Improve ~M-n~ for ='read-file-name-internal=
------
-*** =ivy-set-occur=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-set-occur
-:END:
-Allows to customize =ivy-occur= per-command.
------
-**** Add custom occur for =ivy-switch-buffer=
-See [[https://github.com/abo-abo/swiper/issues/438][#438]] and
[[https://github.com/abo-abo/swiper/issues/440][#440]].
------
-*** =ivy-occur-mode=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-occur-mode
-:END:
-**** New commands on ~j~, ~k~, ~c~
-(ivy-occur-toggle-calling): New command bound to ~c~.
-(ivy-occur-next-line): New command bound to ~j~.
-(ivy-occur-previous-line): New command bound to ~k~.
-
-This makes =ivy-occur= much more convenient, instead of ~gjgjgjg~, just
-~cjjj~. Especially good for commands that change the contents of the
-other window, like =describe-function= or =counsel-git-grep=.
-
-Example:
-
-- ~C-h f~ (=describe-funtion=)
-- =run= (=self-insert-command=)
-- ~C-c C-o~ (=ivy-occur=); ~C-o u~ also works.
-- ~cjjjjkkkk~
------
-**** New command =ivy-occur-revert-buffer= on ~g~
-Does what e.g. =revert-buffer= does for *Help* buffers.
-
-Has special handling for =counsel-git-grep=, =counsel-ag= and
-=counsel-grep=: will run the shell command once more and reflect the
-updates in files.
-
-Move =ivy-occur-press= from ~g~ to ~f~.
------
-**** Improve the feedback for ~j~ and ~k~
-The overlays will be more responsive now.
------
-*** =ivy-re-builders-alist=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-re-builders-alist
-:END:
-**** Allow =this-command= to be a key
-Example:
-#+begin_src elisp
-(defun asdf ()
- (interactive)
- (completing-read "prompt: " '("abc" "abcd" "def")))
-
-(global-set-key (kbd "C-c t") 'asdf)
-
-(setq ivy-re-builders-alist
- '(
- (asdf . ivy--regex-fuzzy)
- (t . ivy--regex-plus)))
-#+end_src
-This is useful for commands that you didn't write. For new commands
-that you write, consider using =ivy-read= and =:caller=.
-
-See [[https://github.com/abo-abo/swiper/issues/330][#330]].
------
-*** =ivy-set-actions=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-set-actions
-:END:
-**** Call with =t= to affect all commands
-Example:
-
-#+begin_src elisp
-(ivy-set-actions
- t
- '(("i" insert "insert")))
-#+end_src
-
-Now an "insert" action will be available for all =ivy-read= sessions
-when pressing ~M-o~.
-
-See [[https://github.com/abo-abo/swiper/issues/337][#337]].
------
-*** =ivy-faces=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-faces
-:END:
-New defcustom group.
-See [[https://github.com/abo-abo/swiper/issues/389][#389]].
------
-*** =ivy-flx-limit=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-flx-limit
-:END:
-New variable. Configure when =flx= is used.
-See [[https://github.com/abo-abo/swiper/issues/207][#207]].
------
-*** =ivy-inhibit-action=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-inhibit-action
-:END:
-New variable. See [[https://github.com/abo-abo/swiper/issues/363][#363]].
------
-*** =ivy-do-completion-in-region=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-do-completion-in-region
-:END:
-New defcustom. See [[https://github.com/abo-abo/swiper/issues/367][#367]].
------
-*** =ivy-fixed-height-minibuffer=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-fixed-height-minibuffer
-:END:
-New defcustom.
-
-When non nil, fix the height of the minibuffer during ivy completion
-at =ivy-height=. This effectively sets the minimum height at this level
-and tries to ensure that it does not change depending on the number of
-candidates.
-
-See [[https://github.com/abo-abo/swiper/issues/353][#353]].
------
-*** =ivy-set-display-transformer=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-set-display-transformer
-:END:
-New API function.
-
-Now used by =switch-to-buffer= and =read-file-name=.
-
-See [[https://github.com/abo-abo/swiper/issues/399][#399]].
------
-*** =ivy-ignore-buffers=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-ignore-buffers
-:END:
-New defcustom similar to =ido-ignore-buffers=.
-
-See [[https://github.com/abo-abo/swiper/issues/382][#382]] and
[[https://github.com/abo-abo/swiper/issues/366][#366]].
------
-*** =ivy-add-newline-after-prompt=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-add-newline-after-prompt
-:END:
-New defcustom.
-
-See [[https://github.com/abo-abo/swiper/issues/451][#451]].
------
-*** =ivy-switch-buffer=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-switch-buffer
-:END:
-**** Add virtual views
-=ivy-views= variable stores pre-defined views. Allows to set a window
-configuration with many buffers from =ivy-switch-buffer=.
-
-How to use: just set =ivy-views= appropriately. An example value is
-provided (but nulled, so that it's empty initially).
------
-*** =ivy-use-ignore-default=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-ivy-use-ignore-default
-:END:
-New defcustom
-
-See [[https://github.com/abo-abo/swiper/issues/477][#477]].
------
-*** =swiper=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-swiper
-:END:
-**** Improve =swiper-query-replace=
-To replace a symbol with a similar symbol,
-
-1. Press ~C-s M-n~ for =swiper= and select the symbol at point as input.
-2. Press ~M-q~ for =swiper-query-replace=
-3. Press ~M-n~ to yank the symbol to replace.
-4. Edit the replacement and ~RET~.
-
-Here step-3 was modified to yank e.g. "symbol" instead of
-"\_<symbol\_>" previously.
------
-*** =swiper-font-lock-exclude=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-swiper-font-lock-exclude
-:END:
-New variable for major modes that misbehave with =font-lock-ensure=.
-See [[https://github.com/abo-abo/swiper/issues/346][#346]].
------
-*** =swiper-all=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-swiper-all
-:END:
-**** New auto-updates position
-See [[https://github.com/abo-abo/swiper/issues/401][#401]].
------
-*** =counsel-mode=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-mode
-:END:
-A minor-mode that remaps built-in functions that have counsel
-replacements available.
-
-See [[https://github.com/abo-abo/swiper/issues/414][#414]].
------
-**** Allow use of describe-prefix-bindings
-See [[https://github.com/abo-abo/swiper/issues/441][#441]].
------
-*** =counsel-find-file=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-find-file
-:END:
-**** Add =initial-input=
-See [[https://github.com/abo-abo/swiper/issues/336][#336]].
------
-**** Change tramp prompt from "Find File: " to "user@host: "
-**** Bind =counsel-up-directory= to ~C-DEL~
-New function that moves up to the parent directory and at the same
-time preselects the current directory. This is useful for moving up
-and down a file tree quickly.
-
-See [[https://github.com/abo-abo/swiper/issues/343][#343]].
------
-**** Customize =M-n= action
-This feature allows to quickly visit Github issues from either
-=magit-commit-mode= or from a version-controlled file. The point has to
-be at the "#" char in e.g.
"[[https://github.com/abo-abo/swiper/issues/123][#123]]", that represents an
issue.
-
-It's possible to customize =ivy-ffap-url-functions= to do a similar
-thing for places other than Github.
-
-The ~C-x C-f M-n~ key binding will work better with =counsel-find-file=,
-for plain =find-file= it will open a =dired= buffer in addition to opening
-the URL.
------
-**** Can un-ignore dotfiles with a leading dot input
-When =ivy-text= starts with a dot, don't use
-=counsel-find-file-ignore-regexp=. The generic way to do this is with
-~C-c C-a~ (=ivy-toggle-ignore=), but this is faster and more convenient.
-
-See [[https://github.com/abo-abo/swiper/issues/408][#408]].
------
-**** Bind ~M-o f~ to =find-file-other-window=
-**** Correctly expand file name at point
-See [[https://github.com/abo-abo/swiper/issues/430][#430]].
------
-**** Add display transformer
-See [[https://github.com/abo-abo/swiper/issues/458][#458]].
------
-**** Add magic slash that changes the directory
-Update to the behavior: the slash ("/") will enter a directory even if
-its name isn't completely typed out if either:
-
-1. It's the only candidate.
-2. The candidate index isn't 0, i.e. "C-n" has been typed at least once.
-3. The input isn't "/".
-
-The above rules still allow to keep the old behavior with "//" moving
-to root and "/ssh:" opening tramp.
-
-This is an experimental feature, please report if it breaks someone's
-workflow.
-
-See [[https://github.com/abo-abo/swiper/issues/321][#321]] and
[[https://github.com/abo-abo/swiper/issues/480][#480]].
------
-*** =counsel-git-grep=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-git-grep
-:END:
-**** Bind ~C-c C-m~ to =counsel-git-grep-switch-cmd=
-The initial command always runs on all files.
-
-To run only on *.el files, ~C-c C-m~ followed by ~M-i~ =-- *.el=.
-To run on *.c and *.h files, ~C-c C-m~ followed by ~M-i~ =-- *.c *.h=.
-To switch to all files again, ~C-c C-m~ and select the appropriate
-entry.
-
-See [[https://github.com/abo-abo/swiper/issues/420][#420]].
------
-*** =counsel-locate=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-locate
-:END:
-**** counsel-locate-cmd
-New defcustom that replaces =counsel-locate-options=.
-
-See [[https://github.com/abo-abo/swiper/issues/385][#385]].
------
-**** counsel-locate-cmd-mdfind
-New function.
-See [[https://github.com/abo-abo/swiper/issues/390][#390]].
------
-**** counsel-locate-cmd-es
-New function.
-See [[https://github.com/abo-abo/swiper/issues/426][#426]].
------
-*** =counsel-yank-pop=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-yank-pop
-:END:
-**** Truncate during display
-During the completion, only the context around the match will be shown.
-By default, the context is +2 lines above and +2 lines below the match.
-It can be adjusted with =counsel-yank-pop-truncate-radius=.
-Additionally, =ivy-height= is temporarily bound to 5 during completion.
-This way, the maximum minibuffer height should be 1+4*5=21 lines.
-
-See [[https://github.com/abo-abo/swiper/issues/315][#315]].
------
-*** =counsel-unicode-char=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-unicode-char
-:END:
-Display hex codes in left column.
------
-*** =counsel-rhythmbox=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-rhythmbox
-:END:
-**** Preselect the current song
------
-*** =counsel-ag=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-ag
-:END:
-**** =counsel-ag-base-command=
-Allows the command run by =counsel-ag-function= to be customized. There
-are several reasons to allow this: The vimgrep option is a recent
-addition; on windows it's more convenient to use pt; and the user
-might want to customize ignored files.
-
-Standard value:
-#+begin_src elisp
-(setq counsel-ag-base-command "ag --nocolor --nogroup %s -- .")
-#+end_src
-
-See [[https://github.com/abo-abo/swiper/issues/335][#335]].
------
-**** Add dir prompt for ~C-u~
-See [[https://github.com/abo-abo/swiper/issues/429][#429]].
------
-**** Add =counsel-ag-map=
-See [[https://github.com/abo-abo/swiper/issues/462][#462]].
------
-*** =counsel-async-split-string-re=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-async-split-string-re
-:END:
-New defcustom.
------
-*** =counsel--async-cmd=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel--async-cmd
-:END:
-**** Add optional exit-code table
-This argument can be used to associate exit codes with the underlying
-reason. Used in counsel-ag-function to signal that an exit code of 1
-means that no matches were found.
-
-See [[https://github.com/abo-abo/swiper/issues/421][#421]].
------
-*** =counsel-prompt-function=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-prompt-function
-:END:
-New defcustom
-
-See [[https://github.com/abo-abo/swiper/issues/424][#424]] and
[[https://github.com/abo-abo/swiper/issues/425][#425]].
------
-*** =counsel-grep=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-grep
-:END:
-**** Reveal outlines
-Just like =swiper=.
------
-**** Should pick candidates closest to point
-Fixes the algorithm selecting the first matching candidate in case
-there are 0 matching candidates following point. Now the last matching
-candidate will be selected, resulting in less scrolling.
------
-**** Speed up x40 times
-The default shell command will not use =--ignore-case= switch for
-=grep=. It's a bit less convenient, but results in a huge speed-up.
------
-*** =counsel-M-x=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-counsel-m-x
-:END:
-**** Add help action
-Bound to ~M-o h~ by default.
-
-See [[https://github.com/abo-abo/swiper/issues/452][#452]].
-** New Commands
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nf-new-commands
-:END:
-*** =counsel-tmm=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-tmm
-:END:
-Completion for the menu bar items. For example:
-
-=counsel-tmm= -> =Options= -> =Set Default Font...=.
-
-Thanks to completion, the latter stages of the chain would look like: =op=
~RET~ =set= ~RET~.
------
-*** =counsel-imenu=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-imenu
-:END:
-Jump to a buffer position indexed by imenu.
------
-*** =counsel-decbinds=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-decbinds
-:END:
-Show a list of all defined keys, and their definitions. Describe the
-selected candidate.
-See [[https://github.com/abo-abo/swiper/issues/332][#332]].
------
-*** =counsel-list-processes=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-list-processes
-:END:
-Offer completion for =process-list=
-
-The default action deletes the selected process. An extra action
-allows to switch to the process buffer.
-
-See [[https://github.com/abo-abo/swiper/issues/357][#357]] and
[[https://github.com/abo-abo/swiper/issues/398][#398]].
------
-*** =ivy-switch-buffer-other-window=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-ivy-switch-buffer-other-window
-:END:
-Remap =switch-to-buffer-other-window= to =ivy-switch-buffer-other-window= for
=ivy-mode=.
-
-See [[https://github.com/abo-abo/swiper/issues/361][#361]].
------
-*** =counsel-git-stash=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-git-stash
-:END:
-Search through all available git stashes.
-
-See [[https://github.com/abo-abo/swiper/issues/374][#374]].
------
-*** =counsel-git-log=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-git-log
-:END:
-Call the =git log --grep= shell command and search through the output.
------
-*** =counsel-pt=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-pt
-:END:
-Grep for a string in the current directory using pt.
-
-See [[https://github.com/abo-abo/swiper/issues/434][#434]].
------
-*** =counsel-linux-app=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-linux-app
-:END:
-Launch a Linux desktop application, similar to Alt-<F2>.
-
-See [[https://github.com/abo-abo/swiper/issues/446][#446]].
------
-*** =counsel-ace-link=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-ace-link
-:END:
-Ivy completion for =ace-link=.
------
-*** =counsel-esh-history=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-esh-history
-:END:
-Browse Eshell history.
-
-See [[https://github.com/abo-abo/swiper/issues/459][#459]].
------
-*** =counsel-shell-history=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-shell-history
-:END:
-Browse shell history.
------
-*** =counsel-grep-or-swiper=
-:PROPERTIES:
-:CUSTOM_ID: 0-8-0-nc-counsel-grep-or-swiper
-:END:
-New command: automatically use =swiper= for smaller buffers and
-=counsel-grep= for larger buffers.
-
-Adjust with:
-#+begin_src elisp
-(setq counsel-grep-swiper-limit 300000)
-#+end_src
-
-By default, the splitting predicate is 300K bytes in a file.
------
-#+BEGIN_EXPORT html
-<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
-<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
-<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
-#+END_EXPORT
-* 0.9.0
-:PROPERTIES:
-:CUSTOM_ID: 0.9.0
-:END:
------
-** Fixes
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fixes
-:END:
-*** =colir-parse-color=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-colir-parse-color
-:END:
-Fix color parsing in terminal. See
[[https://github.com/abo-abo/swiper/issues/541][#541]] and
[[https://github.com/abo-abo/swiper/issues/543][#543]].
------
-*** =counsel--gg-sentinel=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel--gg-sentinel
-:END:
-Check for an additional 141 return code.
------
-*** =counsel-ace-link=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-ace-link
-:END:
-Use =cdr= for action. See
[[https://github.com/abo-abo/swiper/issues/835][#835]].
------
-*** =counsel-ag=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-ag
-:END:
-**** Use sync on remote
-See [[https://github.com/abo-abo/swiper/issues/669][#669]].
-**** Add missing parameter
-See [[https://github.com/abo-abo/swiper/issues/858][#858]],
[[https://github.com/abo-abo/swiper/issues/861][#861]].
------
-*** =counsel-find-file=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-find-file
-:END:
-**** Improve stability on arcane systems
-It can happen that =(all-completions "" 'read-file-name-internal)= may
-fail on systems with symlinks. I think it's related to the file
-functions trying to compute occupied space. In any case, a plain
-=directory-files= is roughly the equivalent and is less likely to fail.
-**** Check compat between preselect and initial-input
-See [[https://github.com/abo-abo/swiper/issues/514][#514]],
[[https://github.com/abo-abo/swiper/issues/515][#515]].
-**** Prevent expand-file-name nil
-See [[https://github.com/abo-abo/swiper/issues/518][#518]].
-**** Don't crash if default-directory is nil
-See [[https://github.com/abo-abo/swiper/issues/586][#586]].
-**** Allow to ~C-y~ a "/ssh:" file
-**** Press ~M-n~ on issue works for newer magit version
-See [[https://github.com/abo-abo/swiper/issues/692][#692]].
-**** Fix when initial input is a file name
-See [[https://github.com/abo-abo/swiper/issues/744][#744]].
-**** Account for =file-name-directory= returning nil
-See [[https://github.com/abo-abo/swiper/issues/780][#780]].
-**** Fix ~RET~ on no input
-See [[https://github.com/abo-abo/swiper/issues/782][#782]].
-**** Fix ~RET~ when file exists
-See [[https://github.com/abo-abo/swiper/issues/792][#792]].
------
-*** =counsel-git=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-git
-:END:
-**** Add a better error message.
-See [[https://github.com/abo-abo/swiper/issues/537][#537]].
-**** Add ~x~ action
-To open externally.
------
-*** =counsel-grep=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-grep
-:END:
-Quote =:preselect=.
------
-*** =counsel-grep-or-swiper=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-grep-or-swiper
-:END:
-Don't grep on compressed files. See
[[https://github.com/abo-abo/swiper/issues/536][#536]].
------
-*** =counsel-imenu=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-imenu
-:END:
-**** Improve readability
-See [[https://github.com/abo-abo/swiper/issues/558][#558]].
-**** Force rescan if requested
-See [[https://github.com/abo-abo/swiper/issues/631][#631]].
------
-*** =counsel-info-lookup-symbol=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-info-lookup-symbol
-:END:
-Fix doc, see [[https://github.com/abo-abo/swiper/issues/721][#721]].
-Add preselect, see [[https://github.com/abo-abo/swiper/issues/722][#722]].
------
-*** =counsel-linux-app=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-linux-app
-:END:
-**** Don't quit on bad data
-See [[https://github.com/abo-abo/swiper/issues/604][#604]].
-**** Check if dir exists
-See [[https://github.com/abo-abo/swiper/issues/896][#896]].
------
-*** =counsel-load-theme=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-load-theme
-:END:
-Add noconfirm flag in =counsel-load-theme-action=.
------
-*** =counsel-locate=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-locate
-:END:
-**** Make =counsel-locate-action-extern= interactive
-See [[https://github.com/abo-abo/swiper/issues/605][#605]].
-**** Add w32 support to =counsel-locate-action-extern=
-See [[https://github.com/abo-abo/swiper/issues/607][#607]],
[[https://github.com/abo-abo/swiper/issues/688][#688]].
------
-*** =counsel-M-x=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-m-x
-:END:
-**** Fix interaction with =repeat=
-See [[https://github.com/abo-abo/swiper/issues/564][#564]].
-**** Preserve =last-command=
-See [[https://github.com/abo-abo/swiper/issues/891][#891]],
[[https://github.com/abo-abo/swiper/issues/893][#893]].
------
-*** =counsel-org-tag-action=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-org-tag-action
-:END:
-Perform in the minibuffer. See
[[https://github.com/abo-abo/swiper/issues/890][#890]].
------
-*** =counsel-recoll=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-recoll
-:END:
-Add =shell-quote-argument=. See
[[https://github.com/abo-abo/swiper/issues/713][#713]].
------
-*** =counsel-rhythmbox=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-rhythmbox
-:END:
-No longer depends on =helm-rhythmbox=.
------
-*** =counsel-yank-pop=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-counsel-yank-pop
-:END:
-Fix candidates not showing sometimes.
------
-*** doc
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-doc
-:END:
-**** Fixed typos in the doc
-See [[https://github.com/abo-abo/swiper/issues/497][#497]],
[[https://github.com/abo-abo/swiper/issues/809][#809]].
-**** Added =ivy-format-function= to the doc
-See [[https://github.com/abo-abo/swiper/issues/577][#577]].
-**** Added info on generating the doc
-See [[https://github.com/abo-abo/swiper/issues/601][#601]].
-**** Added info on associating values
-See [[https://github.com/abo-abo/swiper/issues/714][#714]].
-**** Update package names on ELPA/MELPA
-See [[https://github.com/abo-abo/swiper/issues/833][#833]].
------
-*** =ivy--filter=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy--filter-recompute-index-after-filter
-:END:
-Recompute index after filter.
-
-See [[https://github.com/abo-abo/swiper/issues/491][#491]].
------
-*** =ivy--flx-sort=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy--flx-sort
-:END:
-Improve. See [[https://github.com/abo-abo/swiper/issues/843][#843]].
------
-*** =ivy--format-minibuffer-line=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy--format-minibuffer-line
-:END:
-Fix for =ivy-display-style= nil. See
[[https://github.com/abo-abo/swiper/issues/828][#828]].
------
-*** =ivy--minibuffer-setup=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy--minibuffer-setup
-:END:
-Fix =max-mini-window-height=. See
[[https://github.com/abo-abo/swiper/issues/732][#732]].
------
-*** =ivy--occur-insert-lines=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy--occur-insert-lines
-:END:
-Scroll to first command. See
[[https://github.com/abo-abo/swiper/issues/829][#829]].
------
-*** =ivy--regex-ignore-order=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy--regex-ignore-order
-:END:
-Ensure it returns legal regexps. See
[[https://github.com/abo-abo/swiper/issues/765][#765]].
------
-*** =ivy--reset-state=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy--reset-state
-:END:
-Simplify. See [[https://github.com/abo-abo/swiper/issues/827][#827]].
------
-*** =ivy--virtual-buffers=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy--virtual-buffers
-:END:
-Don't modify recentfs or bookmarks. See
[[https://github.com/abo-abo/swiper/issues/821][#821]].
------
-*** =ivy-call=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-call
-:END:
-Set =default-directory=, see
[[https://github.com/abo-abo/swiper/issues/717][#717]],
[[https://github.com/abo-abo/swiper/issues/760][#760]],
[[https://github.com/abo-abo/swiper/issues/779][#779]],
[[https://github.com/abo-abo/swiper/issues/810][#810]].
-Recursive logic, see [[https://github.com/abo-abo/swiper/issues/924][#924]],
[[https://github.com/abo-abo/swiper/issues/937][#937]].
------
-*** =ivy-completion-in-region=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-completion-in-region
-:END:
-Fix double insert bug.
-Fix common length bug. See
[[https://github.com/abo-abo/swiper/issues/528][#528]].
-Remove =:require-match=, see
[[https://github.com/abo-abo/swiper/issues/907][#907]].
------
-*** =ivy-completion-in-region-action=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-completion-in-region-action
-:END:
-Remove string properties, see
[[https://github.com/abo-abo/swiper/issues/517][#517]].
-Remove =with-ivy-window=, see
[[https://github.com/abo-abo/swiper/issues/928][#928]].
------
-*** =ivy-fixed-height-minibuffer=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-fixed-height-minibuffer
-:END:
-Add correction. See [[https://github.com/abo-abo/swiper/issues/737][#737]].
------
-*** =ivy-help-file=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-help-file
-:END:
-Define with =defconst=, see
[[https://github.com/abo-abo/swiper/issues/938][#938]].
------
-*** =ivy-hydra= is now a separate package on MELPA
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-hydra-is-now-a-separate-package-on-melpa
-:END:
-See [[https://github.com/abo-abo/swiper/issues/464][#464]],
[[https://github.com/abo-abo/swiper/issues/512][#512]].
------
-*** =ivy-immediate-done=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-immediate-done
-:END:
-Update docstring, see [[https://github.com/abo-abo/swiper/issues/525][#525]].
------
-*** =ivy-minibuffer-map=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-minibuffer-map
-:END:
-**** Move =ivy-toggle-regexp-quote= from ~M-q~ to ~M-r~.
-See [[https://github.com/abo-abo/swiper/issues/566][#566]].
-**** Remap scroll-up/down-command
-Instead of assigning ~C-v~ / ~M-v~ so page up/down works.
-See [[https://github.com/abo-abo/swiper/issues/797][#797]],
[[https://github.com/abo-abo/swiper/issues/798][#798]].
-**** Remap =backward-delete-char-untabify= to =ivy-backward-delete-char=
-**** Rebind ~C-v~ and ~M-v~
-The ultimate solution to have PgUp and PgDown and whatever else was
-mapped to =scroll-up-command= bound in =ivy-minibuffer-map=. While
-still having the standard ~C-v~ and ~M-v~ bindings.
-
-See [[https://github.com/abo-abo/swiper/issues/797][#797]],
[[https://github.com/abo-abo/swiper/issues/798][#798]],
[[https://github.com/abo-abo/swiper/issues/535][#535]].
------
-*** =ivy-occur-press=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-occur-press
-:END:
-Pass the whole cons cell to action, see
[[https://github.com/abo-abo/swiper/issues/634][#634]].
------
-*** =ivy-partial=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-partial
-:END:
-Fix for =:dynamic-collection=.
-See [[https://github.com/abo-abo/swiper/issues/946][#946]].
------
-*** =ivy-read=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-read
-:END:
-**** Document all args
-See [[https://github.com/abo-abo/swiper/issues/533][#533]].
-**** Use predicate when reading file names
-See [[https://github.com/abo-abo/swiper/issues/804][#804]].
------
-*** =ivy-remote=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-remote
-:END:
-Use a lighter color for dark themes, see
[[https://github.com/abo-abo/swiper/issues/646][#646]].
------
-*** =ivy-resume=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-resume
-:END:
-The original =default-directory= will be restored, see
[[https://github.com/abo-abo/swiper/issues/591][#591]].
------
-*** =ivy-sort-functions-alist=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-sort-functions-alist
-:END:
-Improve. See [[https://github.com/abo-abo/swiper/issues/870][#870]].
------
-*** =ivy-switch-buffer=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-switch-buffer
-:END:
-**** Reset index to 0 on input
-See [[https://github.com/abo-abo/swiper/issues/522][#522]],
[[https://github.com/abo-abo/swiper/issues/513][#513]].
------
-*** =ivy-switch-buffer-other-window=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-ivy-switch-buffer-other-window
-:END:
-Obey =ivy-ignore-buffers=. See
[[https://github.com/abo-abo/swiper/issues/745][#745]].
------
-*** Recursive minibuffers with two emacsclients
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-recursive-minibuffers-with-two-emacsclients
-:END:
-See [[https://github.com/abo-abo/swiper/issues/738][#738]].
------
-*** shrink minibuffer after reading actions
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-shrink-minibuffer-after-reading-actions
-:END:
-See [[https://github.com/abo-abo/swiper/issues/764][#764]],
[[https://github.com/abo-abo/swiper/issues/402][#402]].
------
-*** =swiper=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-swiper
-:END:
-**** Fix "foo!bar" syntax
-See [[https://github.com/abo-abo/swiper/issues/565][#565]].
-**** Now respects =ivy-re-builders-alist=
-See [[https://github.com/abo-abo/swiper/issues/613][#613]].
-
-Example:
-#+begin_src
-(setq ivy-re-builders-alist
- '((swiper . ivy--regex-fuzzy)
- (t . ivy--regex-plus)))
-#+end_src
------
-*** =swiper-avy=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-swiper-avy
-:END:
-Require =avy=, see [[https://github.com/abo-abo/swiper/issues/593][#593]].
------
-*** =swiper-font-lock-exclude=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-swiper-font-lock-exclude
-:END:
-Add =forth-mode=, see [[https://github.com/abo-abo/swiper/issues/526][#526]].
-Add =forth-block-mode=, see
[[https://github.com/abo-abo/swiper/issues/527][#527]].
-Add =bookmark-bmenu-mode=.
-Add =nix-mode=, see [[https://github.com/abo-abo/swiper/issues/879][#879]].
-Add =circe-mode=, see [[https://github.com/abo-abo/swiper/issues/900][#900]],
[[https://github.com/abo-abo/swiper/issues/901][#901]].
------
-*** =swiper-multi=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-fx-swiper-multi
-:END:
-Fix regression, See [[https://github.com/abo-abo/swiper/issues/673][#673]].
-Don't use virtual buffers, See
[[https://github.com/abo-abo/swiper/issues/705][#705]].
------
-** New Features
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-new-features
-:END:
-*** =counsel-ag=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-ag
-:END:
-**** Extend more
-See [[https://github.com/abo-abo/swiper/issues/576][#576]].
-**** Prompt for extra args when using prefix arg
-See [[https://github.com/abo-abo/swiper/issues/774][#774]].
-**** Support limiting in files
-See [[https://github.com/abo-abo/swiper/issues/820][#820]],
[[https://github.com/abo-abo/swiper/issues/822][#822]],
[[https://github.com/abo-abo/swiper/issues/823][#823]].
-**** =counsel-grep-post-action-hook=
-New hook for counsel-ag/grep/pt. See
[[https://github.com/abo-abo/swiper/issues/800][#800]],
[[https://github.com/abo-abo/swiper/issues/751][#751]].
------
-*** =counsel-bookmark=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-bookmark
-:END:
-**** =counsel-bookmark-avoid-dired=
-When non-nil and a directory is selected from =counsel-bookmark=,
-forward the choice to =counsel-find-file= instead of opening a =dired=
-buffer. See [[https://github.com/abo-abo/swiper/issues/813][#813]].
------
-*** =counsel-find-file=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-find-file
-:END:
-**** Add binding to jump to a bookmarked directory without quit
-Press ~M-o b~ to set the current directory to one of the virtual
-buffers' directories. You continue to select a file from that directory.
-
-See [[https://github.com/abo-abo/swiper/issues/531][#531]].
-**** Add =counsel-find-file-root=
-Press ~M-o r~ to find the current file as root.
-See [[https://github.com/abo-abo/swiper/issues/948][#948]].
------
-*** =counsel-git=
-**** Add =counsel-git-cmd=
-See [[https://github.com/abo-abo/swiper/issues/590][#590]].
-*** =counsel-git-grep=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-git-grep
-:END:
-**** Support custom per-project commands
-The idea is to grep several Git repositories at once. For example, my
-Emacs config is a Git repository with many Git submodule repositories
-inside.
-
-When used with ~C-u~, and inside =counsel-git-grep-projects-alist=, use
-the corresponding command instead. Additionally,
-=counsel-git-grep-proj-function= is used.
-
-For a possible implementation of the custom git-grep command, see:
-https://github.com/abo-abo/oremacs/commit/c7effdb94749dc600b1204ea7a9db319ebdb0f00
-
-See [[https://github.com/abo-abo/swiper/issues/616][#616]].
-**** Reveal text hidden in outlines
-**** Works with "Git for Windows" and native Emacs build
-**** Fix for files with spaces in the name
-See [[https://github.com/abo-abo/swiper/issues/700][#700]].
-**** Fix ~g~ (=counsel-git-grep-occur=)
-Things go wrong when `ivy-text' is changed from the original value.
-Extract =ivy-text= from the buffer name.
-
-Quote the directory name. See
[[https://github.com/abo-abo/swiper/issues/811][#811]].
-**** Update quoting
-See [[https://github.com/abo-abo/swiper/issues/876][#876]].
-**** =counsel-git-grep-cmd-default=
-The initial value for =counsel-git-grep-cmd=.
------
-*** =counsel-git-log=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-git-log
-:END:
-**** Add =counsel-git-log-cmd=
-Allows to customize the command, see
[[https://github.com/abo-abo/swiper/issues/652][#652]].
------
-*** =counsel-linux-app=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-linux-app
-:END:
-**** =counsel-linux-apps-directories=
-Customize the search path.
------
-*** =counsel-load-library=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-load-library
-:END:
-**** Allow to find library with an action
-See [[https://github.com/abo-abo/swiper/issues/873][#873]].
------
-*** =counsel-mode=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-mode
-:END:
-**** Bind =counsel-info-lookup-symbol=
-Substitutes =info-lookup-symbol=, see
[[https://github.com/abo-abo/swiper/issues/493][#493]].
-**** Bind ~C-r~ for =eval-expression= and =shell-command=
-Press ~C-r~ while inside the minibuffer during =eval-expression= or
-=shell-command= to get completion for history.
------
-*** =counsel-pt=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-pt
-:END:
-Add =initial-input= arg. See
[[https://github.com/abo-abo/swiper/issues/757][#757]].
------
-*** =counsel-unicode-char=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-unicode-char
-:END:
-**** Add leading zeros to the display
-See [[https://github.com/abo-abo/swiper/issues/662][#662]].
-**** Support universal argument
-See [[https://github.com/abo-abo/swiper/issues/868][#868]].
------
-*** =counsel-yank-pop=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-counsel-yank-pop
-:END:
-**** Add =counsel-yank-pop-separator=
-Allows to customize the separator.
-See [[https://github.com/abo-abo/swiper/issues/660][#660]].
------
-*** =ivy=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-ivy
-:END:
-**** completion at point
-- =ivy-display-functions-alist= ::
- New defcustom, which decides how to display the candidates.
-=ivy-completion-in-region= will use completion at point by default.
-
-Related: [[https://github.com/abo-abo/swiper/issues/707][#707]],
[[https://github.com/abo-abo/swiper/issues/712][#712]],
[[https://github.com/abo-abo/swiper/issues/788][#788]].
-**** =ivy-action-wrap=
-Set this to have =ivy-next-action= and =ivy-prev-action= wrap around.
-**** =ivy-add-actions=
-This is a convenience extension to the existing =ivy-set-actions=.
-See [[https://github.com/abo-abo/swiper/issues/470][#470]].
-**** =ivy-case-fold-search= 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.
-See [[https://github.com/abo-abo/swiper/issues/916][#916]].
-**** =ivy-completion-in-region-action=
-Add support for =multiple-cursors=, see
[[https://github.com/abo-abo/swiper/issues/547][#547]].
-**** =ivy-highlight-functions-alist=
-Customize the highlighters. See
[[https://github.com/abo-abo/swiper/issues/691][#691]],
[[https://github.com/abo-abo/swiper/issues/654][#654]],
[[https://github.com/abo-abo/swiper/issues/827][#827]].
-**** =ivy-magic-tilde=
-New defcustom. Decide if =~= or =~/= should cd home.
-
-See [[https://github.com/abo-abo/swiper/issues/687][#687]],
[[https://github.com/abo-abo/swiper/issues/679][#679]].
-**** =ivy-set-prompt=
-Allow to set the prompt using the =:caller= as key.
-**** =ivy-set-prompt-text-properties-function=
-An advanced override of the prompt string.
-**** =ivy-sort-file-function-using-ido=
-Extends the options for sorting file names. See
[[https://github.com/abo-abo/swiper/issues/498][#498]].
------
-*** =ivy-completing-read=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-ivy-completing-read
-:END:
-**** Set =:caller= to =this-command=
-Improves sorting customization. See
[[https://github.com/abo-abo/swiper/issues/899][#899]].
-**** Don't =:require-match= for null
-See [[https://github.com/abo-abo/swiper/issues/909][#909]].
-**** =ivy-completing-read-handlers-alist=
-New defcustom. See [[https://github.com/abo-abo/swiper/issues/892][#892]].
------
-*** =ivy-minibuffer-map=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-ivy-minibuffer-map
-:END:
-**** Alternative action list ~M-o~ using Hydra
-Not hiding the candidates and using a single line for actions results
-in a more distraction-free experience.
-
-Use this code to turn it on:
-#+begin_src elisp
-(require 'ivy-hydra)
-#+end_src
------
-*** =ivy-occur-mode=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-ivy-occur-mode
-:END:
-**** ~RET~ now switches to candidate window
-**** =read-only-mode= is enabled
-See [[https://github.com/abo-abo/swiper/issues/720][#720]].
-**** Set =view-read-only= locally
-See [[https://github.com/abo-abo/swiper/issues/789][#789]].
-**** Run =wgrep-setup=
-See [[https://github.com/abo-abo/swiper/issues/904][#904]].
------
-*** =ivy-read=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-ivy-read
-:END:
-**** Make key binding for other window action consistent
-By default, ~M-o j~ will select the file or buffer in other window, for
-both =ivy-switch-buffer= and =counsel-find-file=.
-**** Facilitate sorting of cons cells
-See [[https://github.com/abo-abo/swiper/issues/554][#554]].
-#+begin_src elisp
-(defvar ivy-sorter-data '(("b 1" . 1) ("a 2" . 2) ("d 0" . 0) ("c 5" . 5)))
-
-(defun isn (a b)
- (< (cdr a) (cdr b)))
-
-(add-to-list 'ivy-sort-functions-alist '(ivy-sorter . isn))
-
-(ivy-read "string: " ivy-sorter-data
- :sort t
- :caller 'ivy-sorter)
-#+end_src
-**** Add prefix arg for action functions
-See [[https://github.com/abo-abo/swiper/issues/552][#552]].
-
-Single actions:
-| C-m | ivy-done | store prefix |
-| M-o | ivy-dispatching-done | store prefix |
-| C-j | ivy-alt-done | store prefix |
-| C-M-j | ivy-immediate-done | store prefix |
-| TAB TAB | ivy-partial-or-done | unsupported |
-| C-' | ivy-avy | unsupported |
-
-Multiple actions:
-| C-M-m | ivy-call | store prefix, type prefix again for
next call |
-| C-M-o | ivy-dispatching-call | store prefix, type prefix again for
next call |
-| C-M-n | ivy-next-line-and-call | store prefix, type prefix again for
next call |
-| C-M-p | ivy-previous-line-and-call | store prefix, type prefix again for
next call |
-
-An example application:
-
-no prefix prints first number in a message-box
-one prefix prints last number in a message-box
-numeric prefix selects the index to print in a message-box
-#+begin_src elisp
-(ivy-read "choose: " '(("a" 1 2 3)
- ("b" 3 4 5))
- :action
- (lambda (x)
- (message-box "%s"
- (cond
- ((null ivy-current-prefix-arg)
- (elt x 0))
- ((equal '(4) ivy-current-prefix-arg)
- (car (last x)))
- (t
- (elt x (prefix-numeric-value
ivy-current-prefix-arg)))))))
-#+end_src
-**** Breaking change for alist type collection actions
-The action will be called with collection's =ITEM=, instead of =(cdr
-ITEM)= like before. This allows to simplify the logic of complex action
-functions: they don't have to look up the full item by string in their
-own collection, moreover they don't have to know anything about their
-collection.
-**** Implement unique index for alist completion
-The uniqueness assumption is that the completion system is passed a
-list of /unique/ strings, of which one (or more) are selected.
-
-Unlike plain string completion, alists may require violating the
-uniqueness assumption: there may be two elements with the same =car= but
-different =cdr=. Example: C function declaration and definition for tag
-completion.
-
-Until now, whenever two equal strings were sent to =ivy-read=, only the
-first one could be selected. Now, each alist car gets an integer index
-assigned to it as a text property ='idx=. So it's possible to
-differentiate two alist items with the same key.
-**** Make =with-ivy-window= not necessary in the action function
-This allows for a lot of simplification, e.g. use =insert= instead of
-=(lambda (x) (with-ivy-window (insert x)))=.
-
-See [[https://github.com/abo-abo/swiper/issues/639][#639]].
------
-*** =ivy-switch-buffer=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-ivy-switch-buffer
-:END:
-**** Add =ivy-sort-function-buffer=
-Puts e.g. the =*scratch*= buffer ahead of the =misc= buffer if the input
-is "sc", since it's almost like a prefix match.
-
-See [[https://github.com/abo-abo/swiper/issues/595][#595]].
-**** Sort virtual buffers after open buffers
-See [[https://github.com/abo-abo/swiper/issues/706][#706]],
[[https://github.com/abo-abo/swiper/issues/743][#743]].
-**** =ivy-switch-buffer-faces-alist=
-Allow to customize faces in =ivy-switch-buffer= by the mode of each buffer.
-
-Example:
-#+begin_src elisp
-(setq ivy-switch-buffer-faces-alist
- '((emacs-lisp-mode . swiper-match-face-1)
- (dired-mode . ivy-subdir)
- (org-mode . org-level-4)))
-#+end_src
------
-*** =swiper=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-swiper
-:END:
-**** Add option for swiper line number to be searchable
-See =swiper-include-line-number-in-search= and
[[https://github.com/abo-abo/swiper/issues/562][#562]].
-**** Restore window position after using swiper.
-Relevant for high settings of =scroll-conservatively=.
-See [[https://github.com/abo-abo/swiper/issues/643][#643]].
-**** Improve fuzzy highlight
-If you've set the regex builder to fuzzy (non-default), you'll get a
-highlight quality on par with the default one. See
[[https://github.com/abo-abo/swiper/issues/651][#651]],
[[https://github.com/abo-abo/swiper/issues/653][#653]].
-**** Add =char-fold-to-regexp=
-See [[https://github.com/abo-abo/swiper/issues/622][#622]].
-**** Add compatibility with =evil-ex-search=
-See [[https://github.com/abo-abo/swiper/issues/887][#887]].
-**** Apply =evil= search highlighting
-See [[https://github.com/abo-abo/swiper/issues/888][#888]].
-**** Set =evil-ex-search-direction=
-See [[https://github.com/abo-abo/swiper/issues/947][#947]].
-**** =swiper-goto-start-of-match=
-New defcustom. When non-nil, swiper default action will go to the
-beginning of the match instead of on its end. This behavior is
-inspired by vim's and evil's way of searching.
-
-See [[https://github.com/abo-abo/swiper/issues/944][#944]],
[[https://github.com/abo-abo/swiper/issues/942][#942]].
-**** =swiper-avy= works with more regexp builders
-See [[https://github.com/abo-abo/swiper/issues/932][#932]].
------
-*** =swiper-all=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nf-swiper-all
-:END:
-**** Is now async
-This means extremely fast startup time.
-
-Additionally, the feedback to input is quite fast even with a hundred
-buffers. This is because, unlike =swiper=, line numbers are not
-computed. Computing line numbers, while situationally useful, is
-really slow for huge buffers, and even slower for dozens of huge
-buffers.
-
-See [[https://github.com/abo-abo/swiper/issues/620][#620]].
-**** Press ~M-q~ for query-replace
-See [[https://github.com/abo-abo/swiper/issues/623][#623]].
-**** Ignore TAGS buffers
-See [[https://github.com/abo-abo/swiper/issues/787][#787]].
-**** Consider magit stash buffers
-See [[https://github.com/abo-abo/swiper/issues/819][#819]].
-**** Fix =case-fold-search=
-See [[https://github.com/abo-abo/swiper/issues/880][#880]].
------
-** New Commands
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-new-commands
-:END:
-*** =counsel-bookmark=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-bookmark
-:END:
-Completion for =bookmark-jump=.
-
-Can delete and rename bookmarks, see
[[https://github.com/abo-abo/swiper/issues/758][#758]].
------
-*** =counsel-colors-emacs=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-colors-emacs
-:END:
-See [[https://github.com/abo-abo/swiper/issues/815][#815]],
[[https://github.com/abo-abo/swiper/issues/921][#921]].
------
-*** =counsel-colors-web=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-colors-web
-:END:
-See [[https://github.com/abo-abo/swiper/issues/815][#815]].
------
-*** =counsel-command-history=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-command-history
-:END:
-See [[https://github.com/abo-abo/swiper/issues/826][#826]].
------
-*** =counsel-company=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-company
-:END:
-Picks up company's candidates and inserts the result into the buffer.
-See [[https://github.com/abo-abo/swiper/issues/331][#331]],
[[https://github.com/abo-abo/swiper/issues/547][#547]].
------
-*** =counsel-describe-face=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-describe-face
-:END:
-See [[https://github.com/abo-abo/swiper/issues/585][#585]],
[[https://github.com/abo-abo/swiper/issues/703][#703]].
------
-*** =counsel-dired-jump=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-dired-jump
-:END:
-Like, =counsel-file-jump=, but for directories.
------
-*** =counsel-dpkg=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-dpkg
-:END:
-Completion for =dpkg -l=.
------
-*** =counsel-faces=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-faces
-:END:
-See [[https://github.com/abo-abo/swiper/issues/815][#815]].
------
-*** =counsel-file-jump=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-file-jump
-:END:
-Jump to a file from a list of all files in the current directory, see
[[https://github.com/abo-abo/swiper/issues/609][#609]],
[[https://github.com/abo-abo/swiper/issues/610][#610]].
------
-*** =counsel-find-library=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-find-library
-:END:
-A helpful and unsurprising alternative to using ~C-.~ with
-=counsel-load-library=.
-See [[https://github.com/abo-abo/swiper/issues/794][#794]],
[[https://github.com/abo-abo/swiper/issues/801][#801]].
------
-*** =counsel-hydra-heads=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-hydra-heads
-:END:
-Call a head of the current/last hydra by name.
-See [[https://github.com/abo-abo/swiper/issues/696][#696]].
------
-*** =counsel-irony=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-irony
-:END:
-Inline C++ completion using Irony.
------
-*** =counsel-mark-ring=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-mark-ring
-:END:
-See [[https://github.com/abo-abo/swiper/issues/834][#834]].
------
-*** =counsel-org-agenda-headlines=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-org-agenda-headlines
-:END:
-See [[https://github.com/abo-abo/swiper/issues/825][#825]].
------
-*** =counsel-outline=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-outline
-:END:
-Completion for outlines in the current buffer.
------
-*** =counsel-package=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-package
-:END:
-Manage packages. Allows installing, deleting, describing etc.
-See [[https://github.com/abo-abo/swiper/issues/869][#869]],
[[https://github.com/abo-abo/swiper/issues/872][#872]].
------
-*** =counsel-recentf=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-recentf
-:END:
-Renamed from =ivy-recentf=, see
[[https://github.com/abo-abo/swiper/issues/624][#624]].
-
-Added actions in [[https://github.com/abo-abo/swiper/issues/701][#701]]:
-
-- ~j~ for =find-file-other-window=
-- ~x~ for =counsel-find-file-extern=
-
-Remove text properties, see
[[https://github.com/abo-abo/swiper/issues/770][#770]].
------
-*** =counsel-rg=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-rg
-:END:
-Grep for a string in the current directory using =rg=.
-Use =counsel-rg-base-command= to customize.
-See [[https://github.com/abo-abo/swiper/issues/784][#784]],
[[https://github.com/abo-abo/swiper/issues/785][#785]],
[[https://github.com/abo-abo/swiper/issues/795][#795]],
[[https://github.com/abo-abo/swiper/issues/796][#796]].
------
-*** =counsel-rpm=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-rpm
-:END:
-Call the =rpm= shell command. See
[[https://github.com/abo-abo/swiper/issues/695][#695]].
------
-*** =counsel-semantic=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-semantic
-:END:
-Completion for semantic tags.
------
-*** =counsel-set-variable=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-set-variable
-:END:
-Completion for setting a variable to a value.
-See [[https://github.com/abo-abo/swiper/issues/544][#544]],
[[https://github.com/abo-abo/swiper/issues/546][#546]],
[[https://github.com/abo-abo/swiper/issues/549][#549]],
[[https://github.com/abo-abo/swiper/issues/550][#550]],
[[https://github.com/abo-abo/swiper/issues/556][#556]].
------
-*** =counsel-shell-command-history=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-counsel-shell-command-history
-:END:
-Search through history in =shell-mode=. See
[[https://github.com/abo-abo/swiper/issues/689][#689]].
-
-When =counsel-mode= is on, ~M-! C-r~ will call
-=counsel-shell-command-history=.
------
-*** =ivy-push-view=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-ivy-push-view
-:END:
-And =ivy-pop-view=.
-
-1. Use =ivy-push-view= to store a view - your current window tree. This
- contains: all windows on the current frame, and their configuration
- w.r.t. horizontal or vertical splits. The point positions in each
- window are stored as well.
-
-2. Use =ivy-switch-buffer= to select stored views.
-
-3. Use =ivy-pop-view= to delete a stored view that you don't want any
- more.
-
-See [[https://github.com/abo-abo/swiper/issues/584][#584]].
------
-*** =ivy-rotate-sort=
-:PROPERTIES:
-:CUSTOM_ID: 0-9-0-nc-ivy-rotate-sort
-:END:
-Modify =ivy-sort-functions-alist= to allow a list of sorting functions
-to apply to a collection. The car of this list is the current
-one. =ivy-rotate-sort= then rotates this list through the different
-possibilities. Bound to ~C-c C-s~. Here is a simple example to
-illustrate.
-
-#+begin_src elisp
-(setq ivy-sort-functions-alist
- '((read-file-name-internal .
- (ivy-sort-file-function-default string-lessp
string-greaterp))
- (internal-complete-buffer . nil)
- (counsel-git-grep-function . nil)
- (Man-goto-section . nil)
- (org-refile . nil)
- (t . string-lessp)))
-#+end_src
-
-~M-x~ =find-file= ~RET C-c C-s~ now switches from the default sorting to
-using =string-lessp=. ~C-c C-s~ again switches to =string-greaterp= and so
-on.
-
-See [[https://github.com/abo-abo/swiper/issues/845][#845]],
[[https://github.com/abo-abo/swiper/issues/927][#927]].
------
-#+BEGIN_EXPORT html
-<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
-<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
-<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
-#+END_EXPORT
-* 0.10.0
-:PROPERTIES:
-:CUSTOM_ID: 0.10.0
-:END:
------
-** Fixes
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fixes
-:END:
-*** counsel-ag
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-ag
-:END:
-Fix default ag command on Windows, see
[[https://github.com/abo-abo/swiper/issues/1221][#1221]].
------
-*** counsel-ag-occur
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-ag-occur
-:END:
-Don't break when search string begins with "-", see
[[https://github.com/abo-abo/swiper/issues/1048][#1048]].
-
-Fix quoting, see [[https://github.com/abo-abo/swiper/issues/1240][#1240]].
------
-*** counsel-company
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-company
-:END:
-Various fixes, see [[https://github.com/abo-abo/swiper/issues/969][#969]].
------
-*** counsel-descbinds
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-descbinds
-:END:
-Fix regex, see [[https://github.com/abo-abo/swiper/issues/1089][#1089]].
------
-*** counsel-dired-jump
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-dired-jump
-:END:
-Obey =find-program=, see
[[https://github.com/abo-abo/swiper/issues/1181][#1181]].
------
-*** counsel-find-file
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-find-file
-:END:
-Fix ~C-y~ when pasting a file path.
-
-Fix magic slash regression, see
[[https://github.com/abo-abo/swiper/issues/1027][#1027]].
-
-Don't quote regex for =initial-input=.
-
-Don't bind =find-file-hook= if not necessary, see
[[https://github.com/abo-abo/swiper/issues/627][#627]],
[[https://github.com/abo-abo/swiper/issues/1118][#1118]].
-
-Fix completion of relative directories, see
[[https://github.com/abo-abo/swiper/issues/1055][#1055]].
-
-Make sure foo/ directory goes before foo-bar/ directory, see
[[https://github.com/abo-abo/swiper/issues/1315][#1315]].
------
-*** counsel-find-file-occur
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-find-file-occur
-:END:
-Use =xargs -d '\n'=, see
[[https://github.com/abo-abo/swiper/issues/1323][#1323]].
------
-*** counsel-git-grep
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-git-grep
-:END:
-Fix error on 24.5, see
[[https://github.com/abo-abo/swiper/issues/1107][#1107]].
-Fix for Windows, see [[https://github.com/abo-abo/swiper/issues/1176][#1176]].
------
-*** counsel-git-grep-occur
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-git-grep-occur
-:END:
-Fix output with negative pattern, see
[[https://github.com/abo-abo/swiper/issues/1173][#1173]].
-
-Fix bug, see [[https://github.com/abo-abo/swiper/issues/1225][#1225]].
------
-*** counsel-git-grep-recenter
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-git-grep-recenter
-:END:
-Fix warning, see [[https://github.com/abo-abo/swiper/issues/1097][#1097]].
------
-*** counsel-git-grep-transformer
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-git-grep-transformer
-:END:
-Optimize text props, see
[[https://github.com/abo-abo/swiper/issues/1264][#1264]].
------
-*** counsel-git-log
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-git-log
-:END:
-Ignore blank candidates, see
[[https://github.com/abo-abo/swiper/issues/1122][#1122]].
------
-*** counsel-git-occur
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-git-occur
-:END:
-Fix regex, see [[https://github.com/abo-abo/swiper/issues/1299][#1299]].
------
-*** counsel-grep-base-command
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-grep-base-command
-:END:
-Add "--", see [[https://github.com/abo-abo/swiper/issues/1266][#1266]].
------
-*** counsel-imenu
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-imenu
-:END:
-Add trailing space to prompt, see
[[https://github.com/abo-abo/swiper/issues/1245][#1245]].
------
-*** counsel-irony
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-irony
-:END:
-Various fixes, see [[https://github.com/abo-abo/swiper/issues/1018][#1018]].
------
-*** counsel-locate-action-extern
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-locate-action-extern
-:END:
-Handle cygwin, see [[https://github.com/abo-abo/swiper/issues/1314][#1314]].
------
-*** counsel-M-x
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-m-x
-:END:
-Don't rebuild cache on every call, see
[[https://github.com/abo-abo/swiper/issues/1085][#1085]].
-Add own history, see [[https://github.com/abo-abo/swiper/issues/1185][#1185]].
------
-*** counsel-package
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-package
-:END:
-Fix package removal, see
[[https://github.com/abo-abo/swiper/issues/970][#970]].
------
-*** counsel-set-variable
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-set-variable
-:END:
-Handle defcustom with multiple entries, see
[[https://github.com/abo-abo/swiper/issues/960][#960]].
------
-*** counsel-shell-history
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-shell-history
-:END:
-Work around =ring-elements=, see
[[https://github.com/abo-abo/swiper/issues/1148][#1148]].
------
-*** counsel-unquote-regex-parens
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-counsel-unquote-regex-parens
-:END:
-Handle cons arg, see [[https://github.com/abo-abo/swiper/issues/1322][#1322]].
------
-*** ivy
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy
-:END:
-Various fixes, see [[https://github.com/abo-abo/swiper/issues/997][#997]],
[[https://github.com/abo-abo/swiper/issues/1327][#1327]],
[[https://github.com/abo-abo/swiper/issues/1334][#1334]],
[[https://github.com/abo-abo/swiper/issues/1336][#1336]].
-
-Don't add =:preselect= to collection, see
[[https://github.com/abo-abo/swiper/issues/1017][#1017]].
-
-Avoid setting ivy window as minibuffer, see
[[https://github.com/abo-abo/swiper/issues/1051][#1051]],
[[https://github.com/abo-abo/swiper/issues/1053][#1053]].
-
-Init index with 0, see
[[https://github.com/abo-abo/swiper/issues/1080][#1080]].
-
-=ivy-initial-inputs-alist= should use =:caller= first, see
[[https://github.com/abo-abo/swiper/issues/1068][#1068]].
-
-=ivy--sorted-files= should always use predicate, see
[[https://github.com/abo-abo/swiper/issues/1121][#1121]].
-
-Simplify re-builder / highlight, see
[[https://github.com/abo-abo/swiper/issues/1147][#1147]].
-
-Ensure bookmarks are loaded, see
[[https://github.com/abo-abo/swiper/issues/1160][#1160]].
-
-Fix arrows not working for =ivy--regex-ignore-order=, see
[[https://github.com/abo-abo/swiper/issues/1159][#1159]].
-
-Fix ~C-M-j~ for =ivy-completion-in-region-action=, see
[[https://github.com/abo-abo/swiper/issues/1178][#1178]].
-
-Correct spelling, see [[https://github.com/abo-abo/swiper/issues/1179][#1179]].
-
-Ensure action and display transformer are called from initial
-buffer. See [[https://github.com/abo-abo/swiper/issues/1182][#1182]].
-
-Allow "!" and space to be escaped in =ivy--regex-ignore-order=. See
[[https://github.com/abo-abo/swiper/issues/976][#976]].
-
-Call =ivy-overlay-cleanup= only when needed, see
[[https://github.com/abo-abo/swiper/issues/1211][#1211]].
-
-Don't require prompt to end in ": ", see
[[https://github.com/abo-abo/swiper/issues/1207][#1207]].
-
-Remove empty string from collection, see
[[https://github.com/abo-abo/swiper/issues/1230][#1230]],
[[https://github.com/abo-abo/swiper/issues/1236][#1236]].
-
-Fix "/sudo::" in current dir, see
[[https://github.com/abo-abo/swiper/issues/1232][#1232]].
-
-Fix prefix issue, see [[https://github.com/abo-abo/swiper/issues/1244][#1244]].
-
-Update prompt even if there are no candidates. See
[[https://github.com/abo-abo/swiper/issues/1183][#1183]].
-
-Also check =this-command= for sorting, see
[[https://github.com/abo-abo/swiper/issues/1294][#1294]].
------
-*** ivy-add-actions
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-add-actions
-:END:
-Delete action duplicates by key, see
[[https://github.com/abo-abo/swiper/issues/1296][#1296]].
------
-*** ivy-avy
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-avy
-:END:
-Fix logic when scrolled, see
[[https://github.com/abo-abo/swiper/issues/1004][#1004]].
-
-Exit silently, see [[https://github.com/abo-abo/swiper/issues/1073][#1073]].
-
-Select correct candidate when using display transformer, see
[[https://github.com/abo-abo/swiper/issues/1255][#1255]].
------
-*** ivy-completing-read-handlers-alist
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-completing-read-handlers-alist
-:END:
-Add some entries, and tests. See
[[https://github.com/abo-abo/swiper/issues/1049][#1049]].
------
-*** ivy-completion-in-region
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-completion-in-region
-:END:
-Fix length bug, see [[https://github.com/abo-abo/swiper/issues/1251][#1251]].
-
-Fix sole match case, see
[[https://github.com/abo-abo/swiper/issues/1252][#1252]].
------
-*** ivy-display-function-overlay
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-display-function-overlay
-:END:
-Fall back when there's no space, see
[[https://github.com/abo-abo/swiper/issues/1136][#1136]].
-Fall back when there's no vertical space, see
[[https://github.com/abo-abo/swiper/issues/1136][#1136]].
-Check for point-min, see
[[https://github.com/abo-abo/swiper/issues/1267][#1267]].
-Fix for =org-indent-mode=.
------
-*** ivy-ffap-url-functions
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-ffap-url-functions
-:END:
-Check if git is present, see
[[https://github.com/abo-abo/swiper/issues/1216][#1216]].
-
------
-*** ivy-format-function-arrow
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-format-function-arrow
-:END:
-Fixup, see [[https://github.com/abo-abo/swiper/issues/1004][#1004]].
------
-*** ivy-initial-inputs-alist
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-initial-inputs-alist
-:END:
-Fix entry for man, see
[[https://github.com/abo-abo/swiper/issues/1226][#1226]].
------
-*** ivy-occur
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-occur
-:END:
-Fix double =pop-to-buffer= issue, see
[[https://github.com/abo-abo/swiper/issues/1284][#1284]].
-
-Don't fail if buffer was killed.
-
-Fix regex passed to grep, see
[[https://github.com/abo-abo/swiper/issues/1299][#1299]].
-
-Use =setq-local=, see [[https://github.com/abo-abo/swiper/issues/1318][#1318]].
-
-Add =ivy--dirname-p=, see
[[https://github.com/abo-abo/swiper/issues/1317][#1317]].
------
-*** ivy-partial
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-partial
-:END:
-Fix interaction with case-folding, see
[[https://github.com/abo-abo/swiper/issues/1019][#1019]],
[[https://github.com/abo-abo/swiper/issues/1021][#1021]].
-Fix downcase for non-string, see
[[https://github.com/abo-abo/swiper/issues/1024][#1024]],
[[https://github.com/abo-abo/swiper/issues/1036][#1036]].
------
-*** ivy-previous-line-or-history
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-previous-line-or-history
-:END:
-Should not insert the last history item unless the currently-selected
-completion candidate is the first in the list, otherwise it's
-impossible to navigate back up with successive applications of this
-command, see [[https://github.com/abo-abo/swiper/issues/1137][#1137]].
------
-*** ivy-re-builders-alist
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-re-builders-alist
-:END:
-Extend docstring, see [[https://github.com/abo-abo/swiper/issues/1308][#1308]].
------
-*** ivy-with-r
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-ivy-with-r
-:END:
-Use =with-output-to-string=, see
[[https://github.com/abo-abo/swiper/issues/1300][#1300]].
------
-*** swiper
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-swiper
-:END:
-Protect against =match-beginning= / =match-end= not integerp. See
[[https://github.com/abo-abo/swiper/issues/1188][#1188]],
-[[https://github.com/abo-abo/swiper/issues/1192][#1192]].
------
-*** swiper--init
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-swiper--init
-:END:
-Turn off =reveal-mode= for the duration, see
[[https://github.com/abo-abo/swiper/issues/1312][#1312]].
------
-*** swiper-all-buffer-p
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-swiper-all-buffer-p
-:END:
-Various mode additions.
------
-*** swiper-font-lock-exclude
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-fx-swiper-font-lock-exclude
-:END:
-Add treemacs-mode, see
[[https://github.com/abo-abo/swiper/issues/1212][#1212]].
-
-Add magit-popup-mode, see
[[https://github.com/abo-abo/swiper/issues/1274][#1274]].
-
-Add adoc-mode, see [[https://github.com/abo-abo/swiper/issues/1275][#1275]].
-
-Add bbdb-mode, see [[https://github.com/abo-abo/swiper/issues/1276][#1276]].
------
-** New Features
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-new-features
-:END:
-*** counsel
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel
-:END:
-When an external program output is used, first check if the program is
-installed, see [[https://github.com/abo-abo/swiper/issues/1076][#1076]].
-
-Allow async commands on Tramp buffers, see
[[https://github.com/abo-abo/swiper/issues/1229][#1229]],
[[https://github.com/abo-abo/swiper/issues/1233][#1233]].
------
-*** counsel-async-filter-update-time
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-async-filter-update-time
-:END:
-Configure async delay. See
[[https://github.com/abo-abo/swiper/issues/1149][#1149]].
------
-*** counsel-async-ignore-re
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-async-ignore-re
-:END:
-New defcustom. See [[https://github.com/abo-abo/swiper/issues/1122][#1122]].
------
-*** counsel-describe-function
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-describe-function
-:END:
-Highlight interactive functions, see
[[https://github.com/abo-abo/swiper/issues/981][#981]],
[[https://github.com/abo-abo/swiper/issues/982][#982]].
------
-*** counsel-describe-function-function
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-describe-function-function
-:END:
-Customize =counsel-describe-function=. Useful for
-https://github.com/Wilfred/helpful. See
[[https://github.com/abo-abo/swiper/issues/1321][#1321]].
------
-*** counsel-describe-function-preselect
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-describe-function-preselect
-:END:
-Customize which symbol will be initial for =counsel-describe-function=,
-see [[https://github.com/abo-abo/swiper/issues/1088][#1088]],
[[https://github.com/abo-abo/swiper/issues/1330][#1330]].
------
-*** counsel-describe-variable
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-describe-variable
-:END:
-Highlight custom variables, see
[[https://github.com/abo-abo/swiper/issues/980][#980]],
[[https://github.com/abo-abo/swiper/issues/982][#982]].
------
-*** counsel-find-file-ignore-regexp
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-find-file-ignore-regexp
-:END:
-Offer =completion-ignored-extensions=, see
[[https://github.com/abo-abo/swiper/issues/1092][#1092]].
------
-*** counsel-fzf-dir-function
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-fzf-dir-function
-:END:
-Allow to customize fzf work directory.
------
-*** counsel-git
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-git
-:END:
-Add optional =initial-input=, see
[[https://github.com/abo-abo/swiper/issues/1074][#1074]].
------
-*** counsel-git-grep-skip-counting-lines
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-git-grep-skip-counting-lines
-:END:
-New defcustom, see [[https://github.com/abo-abo/swiper/issues/524][#524]],
[[https://github.com/abo-abo/swiper/issues/1042][#1042]].
------
-*** counsel-git-log-split-string-re
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-git-log-split-string-re
-:END:
-New defcustom. See [[https://github.com/abo-abo/swiper/issues/1122][#1122]].
------
-*** counsel-grep-or-swiper
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-grep-or-swiper
-:END:
-Don't attempt to save readonly files, see
[[https://github.com/abo-abo/swiper/issues/999][#999]].
-
-Prevent opening an already opened file, see
[[https://github.com/abo-abo/swiper/issues/1001][#1001]].
-
-Improve logic, see [[https://github.com/abo-abo/swiper/issues/1290][#1290]].
-
-More uniform interface, see
[[https://github.com/abo-abo/swiper/issues/1313][#1313]].
------
-*** counsel-imenu-map
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-imenu-map
-:END:
-Allows to use ~C-l~ to recenter. See
[[https://github.com/abo-abo/swiper/issues/1180][#1180]].
------
-*** counsel-linux-app
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-linux-app
-:END:
-Various improvements, see
[[https://github.com/abo-abo/swiper/issues/897][#897]],
[[https://github.com/abo-abo/swiper/issues/959][#959]].
-
-Press ~M-o d~ to open the desktop file, see
[[https://github.com/abo-abo/swiper/issues/897][#897]].
------
-*** counsel-mark-ring
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-mark-ring
-:END:
-Sort by location, see [[https://github.com/abo-abo/swiper/issues/1006][#1006]].
-
-Fixes, see [[https://github.com/abo-abo/swiper/issues/1328][#1328]],
[[https://github.com/abo-abo/swiper/issues/1329][#1329]].
------
-*** counsel-mode-map
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-mode-map
-:END:
-Add =counsel-faces=, see
[[https://github.com/abo-abo/swiper/issues/1259][#1259]].
------
-*** counsel-rg
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-rg
-:END:
-Limit results to 150 columns, see
[[https://github.com/abo-abo/swiper/issues/988][#988]].
-
-Never use color results, see
[[https://github.com/abo-abo/swiper/issues/1060][#1060]].
-
-Search whole Git repository, not the current directory.
------
-*** counsel-unicode-char
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-unicode-char
-:END:
-Show candidates in order, see
[[https://github.com/abo-abo/swiper/issues/1003][#1003]].
-
-Adapt to =ucs-names= being a hash table in emacs-26, see
[[https://github.com/abo-abo/swiper/issues/1223][#1223]].
-
-Make lazy, see [[https://github.com/abo-abo/swiper/issues/1204][#1204]].
------
-*** counsel-up-directory
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-up-directory
-:END:
-If the current directory is remote and it's not possible to go up any
-further, make the remote prefix editable. See
[[https://github.com/abo-abo/swiper/issues/1242][#1242]],
[[https://github.com/abo-abo/swiper/issues/1227][#1227]].
------
-*** counsel-url-expand
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-url-expand
-:END:
-Added to =ivy-ffap-url-functions= by default.
-
-Customize =counsel-url-expansions= to be able to browse various links
-with ~C-x C-f M-n~. See
[[https://github.com/abo-abo/swiper/issues/1164][#1164]].
------
-*** counsel-yank-pop
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-counsel-yank-pop
-:END:
-Don't restrict to 3 chars or more, see
[[https://github.com/abo-abo/swiper/issues/973][#973]].
-
-Press ~M-o d~ to remove an item from the kill ring.
-
-Ignore empty candidates, see
[[https://github.com/abo-abo/swiper/issues/1043][#1043]].
------
-*** ivy
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy
-:END:
-**** Add ~i~ and ~w~ as global actions
-:PROPERTIES:
-:CUSTOM_ID: add-~i~-and-~w~-as-global-actions
-:END:
-In any completion session:
-- Press ~M-o w~ to copy the current candidate to the kill ring.
-- Press ~M-o i~ to insert the current candidate into the buffer.
-**** Bind ~<next>~ and ~<prior>~
-:PROPERTIES:
-:CUSTOM_ID: bind-~<next>~-and-~<prior>~
-:END:
-**** Add CONTRIBUTING.org
-:PROPERTIES:
-:CUSTOM_ID: add-contributing.org
-:END:
-See [[https://github.com/abo-abo/swiper/issues/1260][#1260]],
[[https://github.com/abo-abo/swiper/issues/1332][#1332]].
------
-*** ivy-auto-select-single-candidate
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-auto-select-single-candidate
-:END:
-Off by default. When on, and there's only one candidate, use it
-automatically without a completion session.
------
-*** ivy-backward-delete-char
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-backward-delete-char
-:END:
-Preselect last dir, see
[[https://github.com/abo-abo/swiper/issues/1257][#1257]].
------
-*** ivy-completion-in-region
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-completion-in-region
-:END:
-Use =:initial-input= and =:unwind=. Previously, Ivy's "prefixing" and
-"perfect match" index logic was messed up for
-completion-in-region. The reason being is that the initial prefix was
-never passed to Ivy: instead, the collection was pre-filtered on the
-prefix and a "new" completion session didn't know about it.
------
-*** ivy-dispatching-done-hydra
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-dispatching-done-hydra
-:END:
-Quit with ~C-g~, see [[https://github.com/abo-abo/swiper/issues/922][#922]].
-
-Break hint into columns, see
[[https://github.com/abo-abo/swiper/issues/953][#953]].
------
-*** ivy-magic-slash-non-match-action
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-magic-slash-non-match-action
-:END:
-Customize what ~/~ does when completing file names, see
[[https://github.com/abo-abo/swiper/issues/998][#998]],
[[https://github.com/abo-abo/swiper/issues/1009][#1009]].
------
-*** ivy-occur
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-occur
-:END:
-When completing file names, =counsel-cmd-to-dired= is called, resulting
-in a Dired buffer.
------
-*** ivy-occur-mode-map
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-occur-mode-map
-:END:
-Bind ~R~ to =read-only-mode=, see
[[https://github.com/abo-abo/swiper/issues/1273][#1273]].
------
-*** ivy-read
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-read
-:END:
-Add new argument =def=, see
[[https://github.com/abo-abo/swiper/issues/1047][#1047]],
[[https://github.com/abo-abo/swiper/issues/1049][#1049]],
[[https://github.com/abo-abo/swiper/issues/1052][#1052]],
[[https://github.com/abo-abo/swiper/issues/1112][#1112]].
------
-*** ivy-read-action
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-read-action
-:END:
-Allow to quit with ~ESC~ for better work with evil, see
[[https://github.com/abo-abo/swiper/issues/952][#952]].
------
-*** ivy-rotate-preferred-builders
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-rotate-preferred-builders
-:END:
-Bound to ~C-o m~. Customize with =ivy-preferred-re-builders=.
-See [[https://github.com/abo-abo/swiper/issues/1093][#1093]],
[[https://github.com/abo-abo/swiper/issues/1094][#1094]].
------
-*** ivy-switch-buffer
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-switch-buffer
-:END:
-Compose faces better, see
[[https://github.com/abo-abo/swiper/issues/992][#992]].
-
-~M-o f~ will call =counsel-find-file= from current directory, see
[[https://github.com/abo-abo/swiper/issues/1298][#1298]],
-[[https://github.com/abo-abo/swiper/issues/1295][#1295]].
------
-*** ivy-truncate-lines
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-truncate-lines
-:END:
-New defcustom. See [[https://github.com/abo-abo/swiper/issues/1110][#1110]].
------
-*** ivy-use-selectable-prompt
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-ivy-use-selectable-prompt
-:END:
-When non-nil, make the prompt line selectable like a candidate.
-
-Calling =ivy-done= or =ivy-alt-done= on a selected prompt forwards to
-=ivy-immediate-done=, thus exiting with the current user input instead
-of the selected candidate.
-
-See [[https://github.com/abo-abo/swiper/issues/1059][#1059]],
[[https://github.com/abo-abo/swiper/issues/1063][#1063]],
[[https://github.com/abo-abo/swiper/issues/1090][#1090]].
------
-*** swiper-query-replace
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nf-swiper-query-replace
-:END:
-Disable read-only for the duration, see
[[https://github.com/abo-abo/swiper/issues/1273][#1273]].
------
-** New Commands
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-new-commands
-:END:
-*** counsel-ack
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-ack
-:END:
-Like =counsel-ag=, but with [[https://beyondgrep.com/][ack]]. See
[[https://github.com/abo-abo/swiper/issues/1075][#1075]].
------
-*** counsel-apropos
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-apropos
-:END:
-Completion for
[[https://www.gnu.org/software/emacs/manual/html_node/emacs/Apropos.html][apropos]],
see [[https://github.com/abo-abo/swiper/issues/1014][#1014]].
------
-*** counsel-file-register
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-file-register
-:END:
-Completion for
[[https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Registers.html][file
registers]], see [[https://github.com/abo-abo/swiper/issues/1057][#1057]],
[[https://github.com/abo-abo/swiper/issues/1066][#1066]].
------
-*** counsel-fzf
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-fzf
-:END:
-Completion for [[https://github.com/junegunn/fzf][fzf]]. See
[[https://github.com/abo-abo/swiper/issues/1151][#1151]],
[[https://github.com/abo-abo/swiper/issues/1263][#1263]].
------
-*** counsel-git-change-worktree
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-git-change-worktree
-:END:
-Completion for [[https://git-scm.com/docs/git-worktree][git-worktree]].
-See [[https://github.com/abo-abo/swiper/issues/989][#989]],
[[https://github.com/abo-abo/swiper/issues/1114][#1114]],
[[https://github.com/abo-abo/swiper/issues/1115][#1115]].
------
-*** counsel-git-checkout
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-git-checkout
-:END:
-Completion for [[https://git-scm.com/docs/git-checkout][git-checkout]]. See
[[https://github.com/abo-abo/swiper/issues/1187][#1187]].
------
-*** counsel-minibuffer-history
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-minibuffer-history
-:END:
-Supersedes =counsel-expression-history= and
-=counsel-shell-command-history=. See
[[https://github.com/abo-abo/swiper/issues/1237][#1237]].
------
-*** counsel-org-capture
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-org-capture
-:END:
-Completion for [[https://orgmode.org/manual/Capture.html][org-capture]]. See
[[https://github.com/abo-abo/swiper/issues/1320][#1320]].
------
-*** counsel-org-file
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-org-file
-:END:
-Browse all attachments for the current Org file.
------
-*** counsel-org-goto
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-org-goto
-:END:
-Completion for Org headings. See
[[https://github.com/abo-abo/swiper/issues/1005][#1005]],
[[https://github.com/abo-abo/swiper/issues/1008][#1008]],
[[https://github.com/abo-abo/swiper/issues/1011][#1011]],
[[https://github.com/abo-abo/swiper/issues/1012][#1012]],
[[https://github.com/abo-abo/swiper/issues/1013][#1013]].
------
-*** counsel-org-goto-all
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-org-goto-all
-:END:
-Completion for Org headings in all open buffers. See
[[https://github.com/abo-abo/swiper/issues/1005][#1005]].
------
-*** counsel-switch-to-shell-buffer
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-counsel-switch-to-shell-buffer
-:END:
-Switch to a shell buffer, or create one. See
[[https://github.com/abo-abo/swiper/issues/990][#990]].
------
-*** ivy-occur-delete-candidate
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-ivy-occur-delete-candidate
-:END:
-Bound to ~C-d~ in =ivy-occur-mode=. Allows a sort of a todo-list workflow.
------
-*** ivy-switch-view
-:PROPERTIES:
-:CUSTOM_ID: 0-10-0-nc-ivy-switch-view
-:END:
-Switch to one of the window views stored by =ivy-push-view=.
-You can use it separately from =ivy-switch-buffer= now.
-See [[https://github.com/abo-abo/swiper/issues/929][#929]],
[[https://github.com/abo-abo/swiper/issues/1109][#1109]].
------
-* 0.11.0
-:PROPERTIES:
-:CUSTOM_ID: 0.11.0
-:END:
------
-** Fixes
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fixes
-:END:
-*** colir-blend-face-foreground
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-colir-blend-face-foreground
-:END:
-Add hack for =:foreground=. Related to =ansi-color-apply=. See
[[https://github.com/abo-abo/swiper/issues/1293][#1293]].
------
-*** counsel
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel
-:END:
-Make process sentinels more robust. See
[[https://github.com/abo-abo/swiper/issues/1483][#1483]].
-
-Fix behavior on remote. See
[[https://github.com/abo-abo/swiper/issues/1522][#1522]].
-
-Extend unquote-regex-parens tests. See
[[https://github.com/abo-abo/swiper/issues/1704][#1704]],
[[https://github.com/abo-abo/swiper/issues/1708][#1708]],
[[https://github.com/abo-abo/swiper/issues/1863][#1863]].
-
-Use =counsel-async-split-string-re= more. See
[[https://github.com/abo-abo/swiper/issues/1384][#1384]],
[[https://github.com/abo-abo/swiper/issues/1778][#1778]].
-
-Use =start-file-process= for =counsel--async-command=. See
[[https://github.com/abo-abo/swiper/issues/1821][#1821]].
-
-=counsel--async-filter= should write candidates only in the
-minibuffer. See [[https://github.com/abo-abo/swiper/issues/1772][#1772]],
[[https://github.com/abo-abo/swiper/issues/1837][#1837]],
[[https://github.com/abo-abo/swiper/issues/1857][#1857]].
-
-Robustify grep-like ivy-occur. See
[[https://github.com/abo-abo/swiper/issues/1845][#1845]],
[[https://github.com/abo-abo/swiper/issues/1800][#1800]],
[[https://github.com/abo-abo/swiper/issues/1835][#1835]].
------
-*** counsel-ag
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-ag
-:END:
-Allow no space before "--" when specifying extra args. See
[[https://github.com/abo-abo/swiper/issues/1498][#1498]].
-
-Allow to override the minimum search term length. See
[[https://github.com/abo-abo/swiper/issues/1780][#1780]].
-
-Fix "./" issue. See [[https://github.com/abo-abo/swiper/issues/1841][#1841]].
------
-*** counsel-bookmark
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-bookmark
-:END:
-Specify =:history=. See
[[https://github.com/abo-abo/swiper/issues/1698][#1698]].
------
-*** counsel-colors-list
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-colors-list
-:END:
-Improve the display of the current candidate. See
[[https://github.com/abo-abo/swiper/issues/921][#921]],
[[https://github.com/abo-abo/swiper/issues/1436][#1436]].
-
-Protect against invalid input. See
[[https://github.com/abo-abo/swiper/issues/1854][#1854]].
------
-*** counsel-company
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-company
-:END:
-Unwind with =company-abort=. See
[[https://github.com/abo-abo/swiper/issues/1793][#1793]].
------
-*** counsel-describe-face
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-describe-face
-:END:
-Add caller. See [[https://github.com/abo-abo/swiper/issues/1619][#1619]].
------
-*** counsel-describe-function
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-describe-function
-:END:
-Fix erroring. See [[https://github.com/abo-abo/swiper/issues/1647][#1647]],
[[https://github.com/abo-abo/swiper/issues/1649][#1649]].
-
-Describe also unbound but documented function symbols. See
[[https://github.com/abo-abo/swiper/issues/1707][#1707]].
------
-*** counsel-find-file
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-find-file
-:END:
-Don't treat URLs as dirs. See
[[https://github.com/abo-abo/swiper/issues/1398][#1398]].
-
-Allow use of "$" in dirs. See
[[https://github.com/abo-abo/swiper/issues/1316][#1316]].
-
-Fix for ignore-order. See
[[https://github.com/abo-abo/swiper/issues/1466][#1466]].
-
-Fix file expansion. See
[[https://github.com/abo-abo/swiper/issues/1494][#1494]].
-
-Fix =ivy-resume= not working when the current candidate was a
-directory. See [[https://github.com/abo-abo/swiper/issues/1508][#1508]].
-
-=counsel-find-file-mkdir-action= should use =ivy-text=. See
[[https://github.com/abo-abo/swiper/issues/1513][#1513]].
-
-Fix dir or file logic error. See
[[https://github.com/abo-abo/swiper/issues/1103][#1103]],
[[https://github.com/abo-abo/swiper/issues/1623][#1623]].
-
-Fix inability to create a file. See
[[https://github.com/abo-abo/swiper/issues/1623][#1623]].
-
-Fix issue of minibuffer height 1. See
[[https://github.com/abo-abo/swiper/issues/1667][#1667]].
-
-Remove the change to =post-command-hook= by ESS. See
[[https://github.com/abo-abo/swiper/issues/1660][#1660]].
-
-Update minibuffer state after =counsel-find-file-delete=. See
[[https://github.com/abo-abo/swiper/issues/1726][#1726]].
-
-Fix for partial match of TRAMP method.
-
-Fix Emacs26 regression when completing TRAMP methods. See
[[https://github.com/abo-abo/swiper/issues/1733][#1733]].
-
-Fix Emacs25/26 compat for =ivy--cd=.
-
-Avoid TRAMP related errors in ZIP files. See
[[https://github.com/abo-abo/swiper/issues/1797][#1797]].
------
-*** counsel-find-library
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-find-library
-:END:
-Check if dirs in =load-path= exist. See
[[https://github.com/abo-abo/swiper/issues/1720][#1720]].
------
-*** counsel-fzf
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-fzf
-:END:
-Add quotes to =counsel-fzf-cmd=. See
[[https://github.com/abo-abo/swiper/issues/1544][#1544]].
-
-Remove 2nd prompt colon. See
[[https://github.com/abo-abo/swiper/issues/1768][#1768]].
------
-*** counsel-git-grep
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-git-grep
-:END:
-Fix conflicting directories in two ivy-occur buffers. See
[[https://github.com/abo-abo/swiper/issues/1392][#1392]].
-
-Run count in base directory. See
[[https://github.com/abo-abo/swiper/issues/1402][#1402]].
-
-Rely on =du -s= for repo size. See
[[https://github.com/abo-abo/swiper/issues/1402][#1402]].
-
-Ignore =du= errors. See
[[https://github.com/abo-abo/swiper/issues/1502][#1502]].
-
-Run =du= only on =.git=.
-
-Call =du= directly. See
[[https://github.com/abo-abo/swiper/issues/1502][#1502]],
[[https://github.com/abo-abo/swiper/issues/1827][#1827]].
------
-*** counsel-grep
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-grep
-:END:
-Reject file-less buffers. See
[[https://github.com/abo-abo/swiper/issues/1343][#1343]].
-
-Don't pass too long lines as =:preselect=. See
[[https://github.com/abo-abo/swiper/issues/1644][#1644]].
-
-Obey current matcher. See
[[https://github.com/abo-abo/swiper/issues/1801][#1801]].
------
-*** counsel-list-processes
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-list-processes
-:END:
-Don't mess up the current buffer with a header line.
------
-*** counsel-locate
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-locate
-:END:
-Fix for es.exe. Fixes [[https://github.com/abo-abo/swiper/issues/1633][#1633]].
-
-Fix =xdg-open= on Ubuntu. See
[[https://github.com/abo-abo/swiper/issues/863][#863]],
[[https://github.com/abo-abo/swiper/issues/1401][#1401]],
[[https://github.com/abo-abo/swiper/issues/1759][#1759]].
-
-Simplify =xdg-open= call. See
[[https://github.com/abo-abo/swiper/issues/1537][#1537]],
[[https://github.com/abo-abo/swiper/issues/1759][#1759]],
[[https://github.com/abo-abo/swiper/issues/1760][#1760]].
------
-*** counsel-locate-action-extern
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-locate-action-extern
-:END:
-Use =start-process-shell-command=. See
[[https://github.com/abo-abo/swiper/issues/1401][#1401]].
------
-*** counsel-minibuffer-history
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-minibuffer-history
-:END:
-Add =delete-dups=. See
[[https://github.com/abo-abo/swiper/issues/1358][#1358]].
------
-*** counsel-M-x
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-m-x
-:END:
-Prefer "<f2>" over "C-x 6". See
[[https://github.com/abo-abo/swiper/issues/1534][#1534]].
-
-Add =counsel-key-binding= face. See
[[https://github.com/abo-abo/swiper/issues/1548][#1548]].
------
-*** counsel-org-agenda-headlines
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-org-agenda-headlines
-:END:
-Require org. See [[https://github.com/abo-abo/swiper/issues/1642][#1642]].
------
-*** counsel-org-capture
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-org-capture
-:END:
-Don't overlook templates contexts. See
[[https://github.com/abo-abo/swiper/issues/1669][#1669]].
------
-*** counsel-org-files
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-org-files
-:END:
-Support =org-attach-directory= variable. See
[[https://github.com/abo-abo/swiper/issues/1340][#1340]].
-
-Use =org-attach= API. See
[[https://github.com/abo-abo/swiper/issues/1345][#1345]].
------
-*** counsel-org-goto
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-org-goto
-:END:
-Increase org-goto/org-agenda-headlines UI consistency. See
[[https://github.com/abo-abo/swiper/issues/1324][#1324]].
-
-Support older Org. See
[[https://github.com/abo-abo/swiper/issues/1422][#1422]], 1431.
------
-*** counsel-org-tag
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-org-tag
-:END:
-Fix for Org 9. See [[https://github.com/abo-abo/swiper/issues/1654][#1654]],
[[https://github.com/abo-abo/swiper/issues/1656][#1656]],
[[https://github.com/abo-abo/swiper/issues/1896][#1896]].
-
-No need to bind =org-setting-tags=. See
[[https://github.com/abo-abo/swiper/issues/1656][#1656]].
------
-*** counsel-outline
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-outline
-:END:
-Only look for outline regexp at bol. See
[[https://github.com/abo-abo/swiper/issues/1681][#1681]].
------
-*** counsel-rg
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-rg
-:END:
-Store command persistently. See
[[https://github.com/abo-abo/swiper/issues/1474][#1474]].
------
-*** counsel-switch-to-shell-buffer
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-switch-to-shell-buffer
-:END:
-Various improvements. See
[[https://github.com/abo-abo/swiper/issues/1570][#1570]].
------
-*** counsel-unicode-char
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-unicode-char
-:END:
-Optimize. See [[https://github.com/abo-abo/swiper/issues/1704][#1704]].
------
-*** counsel-yank-pop
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-counsel-yank-pop
-:END:
-Liken to =yank-pop=. Respects =kill-ring-yank-pointer=. See
[[https://github.com/abo-abo/swiper/issues/1190][#1190]],
[[https://github.com/abo-abo/swiper/issues/1356][#1356]].
-
-Interoperate better with =kill-ring=. See
[[https://github.com/abo-abo/swiper/issues/1133][#1133]],
[[https://github.com/abo-abo/swiper/issues/1360][#1360]].
-
-Save =window-start= to avoid recentering of the buffer. See
[[https://github.com/abo-abo/swiper/issues/1370][#1370]].
-
-Make position more robust. See
[[https://github.com/abo-abo/swiper/issues/1420][#1420]].
-
-Make it work in read-only buffers. See
[[https://github.com/abo-abo/swiper/issues/1523][#1523]].
-
-Work with =interprogram-paste-function=. See
[[https://github.com/abo-abo/swiper/issues/1523][#1523]].
------
-*** docs
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-docs
-:END:
-Fixed typos. See [[https://github.com/abo-abo/swiper/issues/1405][#1405]],
[[https://github.com/abo-abo/swiper/issues/1412][#1412]],
[[https://github.com/abo-abo/swiper/issues/1448][#1448]],
[[https://github.com/abo-abo/swiper/issues/1477][#1477]],
[[https://github.com/abo-abo/swiper/issues/1483][#1483]],
[[https://github.com/abo-abo/swiper/issues/1519][#1519]],
[[https://github.com/abo-abo/swiper/issues/1521][#1521]],
-[[https://github.com/abo-abo/swiper/issues/1535][#1535]],
[[https://github.com/abo-abo/swiper/issues/1539][#1539]],
[[https://github.com/abo-abo/swiper/issues/1540][#1540]],
[[https://github.com/abo-abo/swiper/issues/1575][#1575]],
[[https://github.com/abo-abo/swiper/issues/1602][#1602]],
[[https://github.com/abo-abo/swiper/issues/1612][#1612]],
[[https://github.com/abo-abo/swiper/issues/1620][#1620]],
[[https://github.com/abo-abo/swiper/issues/1624][#1624]],
[[https://github.com/abo-abo [...]
-[[https://github.com/abo-abo/swiper/issues/1629][#1629]],
[[https://github.com/abo-abo/swiper/issues/1630][#1630]],
[[https://github.com/abo-abo/swiper/issues/1672][#1672]],
[[https://github.com/abo-abo/swiper/issues/1675][#1675]],
[[https://github.com/abo-abo/swiper/issues/1677][#1677]],
[[https://github.com/abo-abo/swiper/issues/1678][#1678]],
[[https://github.com/abo-abo/swiper/issues/1682][#1682]],
[[https://github.com/abo-abo/swiper/issues/1684][#1684]],
[[https://github.com/abo-abo [...]
-[[https://github.com/abo-abo/swiper/issues/1715][#1715]],
[[https://github.com/abo-abo/swiper/issues/1717][#1717]],
[[https://github.com/abo-abo/swiper/issues/1738][#1738]],
[[https://github.com/abo-abo/swiper/issues/1804][#1804]],
[[https://github.com/abo-abo/swiper/issues/1816][#1816]], 1794,
[[https://github.com/abo-abo/swiper/issues/1817][#1817]],
[[https://github.com/abo-abo/swiper/issues/1828][#1828]],
[[https://github.com/abo-abo/swiper/issues/1849][#1849]].
------
-*** ivy
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy
-:END:
-Disable =ivy-auto-select-single-candidate= for user@host entry.
-See [[https://github.com/abo-abo/swiper/issues/1326][#1326]],
[[https://github.com/abo-abo/swiper/issues/1338][#1338]].
-
-Handle =ivy-state-buffer= getting killed. See
[[https://github.com/abo-abo/swiper/issues/572][#572]].
-
-Correct highlighting for negation, e.g. =counsel-M-x= "vi mo!ew".
-See [[https://github.com/abo-abo/swiper/issues/1418][#1418]].
-
-Fold case during index recomputation. See
[[https://github.com/abo-abo/swiper/issues/1447][#1447]],
[[https://github.com/abo-abo/swiper/issues/1449][#1449]].
-
-Simplify string splitting logic. See
[[https://github.com/abo-abo/swiper/issues/1453][#1453]].
-
-Fix =:preselect= getting deselected with new input. When there's new
-input, and it still matches =:preselect=, the current candidate should
-not change.
-
-Handle fallback in =ivy--sort-function=. See
[[https://github.com/abo-abo/swiper/issues/1561][#1561]],
[[https://github.com/abo-abo/swiper/issues/1565][#1565]],
[[https://github.com/abo-abo/swiper/issues/1567][#1567]].
-
-=ivy--sort-function= should handle anonymous fns. See
[[https://github.com/abo-abo/swiper/issues/1574][#1574]].
-
-Use =ivy-sort-max-size= for collection functions. See
[[https://github.com/abo-abo/swiper/issues/1592][#1592]].
-
-Use =copy-sequence= when sorting to avoid corrupting external data.
-See [[https://github.com/abo-abo/swiper/issues/1617][#1617]].
-
-Default =:caller= to =this-command=. See
[[https://github.com/abo-abo/swiper/issues/1297][#1297]],
[[https://github.com/abo-abo/swiper/issues/1606][#1606]],
[[https://github.com/abo-abo/swiper/issues/1619][#1619]],
[[https://github.com/abo-abo/swiper/issues/1621][#1621]].
-
-=ivy-call= should restore previous buffer. See
[[https://github.com/abo-abo/swiper/issues/1607][#1607]].
-
-=ivy--insert-prompt= should use =ivy-add-face-text-property= for
-compat. See [[https://github.com/abo-abo/swiper/issues/1634][#1634]].
-
-Use compat shim for =add-face-text-property=. See
[[https://github.com/abo-abo/swiper/issues/1635][#1635]].
-
-Move =colir= require to top-level to improve performance. See
[[https://github.com/abo-abo/swiper/issues/1571][#1571]].
-
-Fix =:predicate= not getting applied. See
[[https://github.com/abo-abo/swiper/issues/1158][#1158]].
-
-Drop preselected candidate after input. See
[[https://github.com/abo-abo/swiper/issues/1563][#1563]],
[[https://github.com/abo-abo/swiper/issues/1573][#1573]].
-
-Fix =ivy-left-pad= when there's horizontal scroll.
-
-Fix =ivy-state-collection= alist idx not in sync. See
[[https://github.com/abo-abo/swiper/issues/1680][#1680]].
-
-Support :annotation-function of completion-extra-properties.
-See [[https://github.com/abo-abo/swiper/issues/1489][#1489]].
-
-Fix for alists that require sorting. See
[[https://github.com/abo-abo/swiper/issues/1687][#1687]].
-
-Fontify completion annotations. See
[[https://github.com/abo-abo/swiper/issues/1489][#1489]],
[[https://github.com/abo-abo/swiper/issues/1702][#1702]].
-
-Filter sorted alist. See
[[https://github.com/abo-abo/swiper/issues/1705][#1705]].
-
-Avoid modifying alist collection. See
[[https://github.com/abo-abo/swiper/issues/1706][#1706]].
-
-Use =string-match-p= where applicable. See
[[https://github.com/abo-abo/swiper/issues/1517][#1517]].
-
-Strip text properties from returned alist candidate. See
[[https://github.com/abo-abo/swiper/issues/1706][#1706]],
[[https://github.com/abo-abo/swiper/issues/1724][#1724]].
-
-Don't trigger =ivy--magic-file-slash= from ~TAB~. See
[[https://github.com/abo-abo/swiper/issues/1716][#1716]].
-
-Fix for terminals. See [[https://github.com/abo-abo/swiper/issues/199][#199]],
[[https://github.com/abo-abo/swiper/issues/1528][#1528]],
[[https://github.com/abo-abo/swiper/issues/1728][#1728]].
-
-Fix overlay interacting with org-mode src blocks. See
[[https://github.com/abo-abo/swiper/issues/1732][#1732]].
-
-Don't restore buffer after action. See
[[https://github.com/abo-abo/swiper/issues/1766][#1766]],
[[https://github.com/abo-abo/swiper/issues/1767][#1767]].
-
-Remove webjump =completing-read= handler. See
[[https://github.com/abo-abo/swiper/issues/1802][#1802]],
[[https://github.com/abo-abo/swiper/issues/1049][#1049]].
-
-Use =ivy-truncate-lines= also for non-graphical Emacs. See
[[https://github.com/abo-abo/swiper/issues/1809][#1809]].
-
-For non-graphical Emacs set resize-mini-windows to 'grow-only.
-See [[https://github.com/abo-abo/swiper/issues/1809][#1809]].
-
-Fix minibuffer truncation and resizing. See
[[https://github.com/abo-abo/swiper/issues/1811][#1811]].
-
-Work around void =Info-complete-menu-buffer=. See
[[https://github.com/abo-abo/swiper/issues/1814][#1814]].
-
-Handle Windows path separator for =ivy-occur=. See
[[https://github.com/abo-abo/swiper/issues/1817][#1817]].
-
-Don't switch to a killed buffer for =ivy-occur-press=.
-See [[https://github.com/abo-abo/swiper/issues/1834][#1834]],
[[https://github.com/abo-abo/swiper/issues/1842][#1842]].
-
-Improve performance =ivy--select-occur-buffer= by avoiding
-=pop-to-buffer=.
-
-Use =all-completions= and add test. See
[[https://github.com/abo-abo/swiper/issues/1832][#1832]].
-
-Do not let ivy virtual buffer faces creep into the recentf file. See
[[https://github.com/abo-abo/swiper/issues/1898][#1898]].
------
-*** ivy-completing-read
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy-completing-read
-:END:
-Add compat for non-string defaults. See
[[https://github.com/abo-abo/swiper/issues/1526][#1526]],
[[https://github.com/abo-abo/swiper/issues/1810][#1810]].
-
-Simplify. See [[https://github.com/abo-abo/swiper/issues/1606][#1606]].
------
-*** ivy-completion-in-region
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy-completion-in-region
-:END:
-Expand =(s-c-t-s)= appropriately. See
[[https://github.com/abo-abo/swiper/issues/1361][#1361]].
-
-Allow sorting. See [[https://github.com/abo-abo/swiper/issues/1432][#1432]].
-
-Don't apply predicate twice. See
[[https://github.com/abo-abo/swiper/issues/1648][#1648]].
------
-*** ivy--kill-buffer-action
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy--kill-buffer-action
-:END:
-Remove virtual buffers from =recentf-list=. See
[[https://github.com/abo-abo/swiper/issues/1888][#1888]].
------*** ivy--magic-file-slash
-Misc fixes. See [[https://github.com/abo-abo/swiper/issues/1831][#1831]].
------
-*** ivy--occur-insert-lines
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy--occur-insert-lines
-:END:
-Fix incorrect regexp. See
[[https://github.com/abo-abo/swiper/issues/1846][#1846]].
-
-Speed up regex from 5s to 0.01s for 4000 cands.
------
-*** ivy-occur-press
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy-occur-press
-:END:
-Don't hard-code =display-buffer=. See
[[https://github.com/abo-abo/swiper/issues/1838][#1838]],
[[https://github.com/abo-abo/swiper/issues/1865][#1865]].
------
-*** ivy-overlay-show-after
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy-overlay-show-after
-:END:
-Don't inherit existing face.
-See [[https://github.com/abo-abo/swiper/issues/1488][#1488]],
[[https://github.com/abo-abo/swiper/issues/1547][#1547]],
[[https://github.com/abo-abo/swiper/issues/1016][#1016]], 1520,
[[https://github.com/abo-abo/swiper/issues/1808][#1808]],
[[https://github.com/abo-abo/swiper/issues/1825][#1825]].
------
-*** ivy-partial
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy-partial
-:END:
-Can change current dir when completing files. See
[[https://github.com/abo-abo/swiper/issues/86][#86]].
------
-*** ivy--regex-fuzzy
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy--regex-fuzzy
-:END:
-Regexp-quote chars to improve performance for searches like
-".env.foo". See [[https://github.com/abo-abo/swiper/issues/1435][#1435]].
-
-Generalize. Fix =ivy-occur= highlighting. See
[[https://github.com/abo-abo/swiper/issues/1795][#1795]].
-
-Optimize regex "(a).*?(b)" -> "(a)[^b]*(b)". See
[[https://github.com/abo-abo/swiper/issues/848][#848]].
------
-*** ivy--regex-ignore-order
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy--regex-ignore-order
-:END:
-Improve handling of invalid regexes. See
[[https://github.com/abo-abo/swiper/issues/1545][#1545]].
------
-*** ivy--regex-plus
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy--regex-plus
-:END:
-Update and add test for "add path!" input. See
[[https://github.com/abo-abo/swiper/issues/1418][#1418]].
-
-Search "defun \([^ ]+\)" now works.
------
-*** ivy-rotate-preferred-builders
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy-rotate-preferred-builders
-:END:
-Update in the documentation. See
[[https://github.com/abo-abo/swiper/issues/1376][#1376]].
------
-*** ivy-string<
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy-string<
-:END:
-Handle heterogeneous args. See
[[https://github.com/abo-abo/swiper/issues/1743][#1743]],
[[https://github.com/abo-abo/swiper/issues/1744][#1744]].
------
-*** ivy-thing-at-point
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-ivy-thing-at-point
-:END:
-Prevent error when =url-handler-mode= is on. See
[[https://github.com/abo-abo/swiper/issues/1446][#1446]].
-
-Strip text properties. See
[[https://github.com/abo-abo/swiper/issues/1594][#1594]].
------
-*** swiper
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-swiper
-:END:
-Fix history modified on each char. Fix history duplicate. See
[[https://github.com/abo-abo/swiper/issues/1391][#1391]].
-
-Don't replace tabs with spaces (prevents =wgrep= from working
-correctly). See [[https://github.com/abo-abo/swiper/issues/1468][#1468]].
-
-Allow =scroll-other-window= use. See
[[https://github.com/abo-abo/swiper/issues/1504][#1504]].
-
-Replace obsolete =isearch-lazy-highlight-face=. See
[[https://github.com/abo-abo/swiper/issues/1591][#1591]].
-
-Highlight multiple regexps correctly.
-See [[https://github.com/abo-abo/swiper/issues/654][#654]],
[[https://github.com/abo-abo/swiper/issues/1550][#1550]],
[[https://github.com/abo-abo/swiper/issues/1551][#1551]],
[[https://github.com/abo-abo/swiper/issues/1587][#1587]],
[[https://github.com/abo-abo/swiper/issues/1600][#1600]].
-
-Fix when re-builder returns list. See
[[https://github.com/abo-abo/swiper/issues/1692][#1692]].
-
-Add =inhibit-field-text-motion=. See
[[https://github.com/abo-abo/swiper/issues/1713][#1713]].
-
-Fix incorrect jump to first match. See
[[https://github.com/abo-abo/swiper/issues/1791][#1791]].
------
-*** swiper-avy
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-swiper-avy
-:END:
-Fix when there's scroll. See
[[https://github.com/abo-abo/swiper/issues/1541][#1541]].
-
-Fix off-by-one. See [[https://github.com/abo-abo/swiper/issues/1775][#1775]].
-
-Fix for =ivy-format-function-arrow=. See
[[https://github.com/abo-abo/swiper/issues/1885][#1885]].
------
-*** swiper-multi
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-fx-swiper-multi
-:END:
-Add text property =buffer= to candidates. See
[[https://github.com/abo-abo/swiper/issues/1491][#1491]],
[[https://github.com/abo-abo/swiper/issues/1492][#1492]].
------
-
-** New Features
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-new-features
-:END:
-*** counsel
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel
-:END:
-New var =counsel-more-chars-alist= to customize per-function the minimum
-amount of chars. See [[https://github.com/abo-abo/swiper/issues/1663][#1663]].
-
-New face =counsel-variable-documentation=, =counsel-application-name=,
-=counsel-outline-1=, ..., =counsel-outline-8=, =counsel-outline-default=.
-See [[https://github.com/abo-abo/swiper/issues/1847][#1847]].
------
-*** counsel-bookmark
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-bookmark
-:END:
-Add two actions. See [[https://github.com/abo-abo/swiper/issues/948][#948]],
[[https://github.com/abo-abo/swiper/issues/1385][#1385]].
------
-*** counsel-dired-jump
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-dired-jump
-:END:
-New var =counsel-dired-jump-args=. See
[[https://github.com/abo-abo/swiper/issues/1889][#1889]].
------*** counsel-find-file
-New var =counsel-find-file-occur-cmd=. Use it to customize what ~C-c C-o~
-calls. See [[https://github.com/abo-abo/swiper/issues/1299][#1299]],
[[https://github.com/abo-abo/swiper/issues/1351][#1351]],
[[https://github.com/abo-abo/swiper/issues/1441][#1441]].
-
-New var =counsel-preselect-current-file=. When non-nil, preselect the
-current file in the list of candidates. See
[[https://github.com/abo-abo/swiper/issues/1363][#1363]].
-
-Bind ~C-M-y~ to =counsel-yank-directory=. Useful when you want to edit
-part of the directory name. See
[[https://github.com/abo-abo/swiper/issues/1333][#1333]].
-
-Bind ~M-o d~ to new action =counsel-find-file-mkdir-action=. See
[[https://github.com/abo-abo/swiper/issues/1471][#1471]].
-
-Bind ~M-o f~ to =find-file-other-frame=. See
[[https://github.com/abo-abo/swiper/issues/1510][#1510]].
-
-Bind ~M-o k~ to =counsel-find-file-delete=. See
[[https://github.com/abo-abo/swiper/issues/1671][#1671]].
-
-Bind ~M-o m~ to =counsel-find-file-move=. See
[[https://github.com/abo-abo/swiper/issues/1671][#1671]].
-
-=counsel-find-file-occur-use-find= defaults to t on Linux. See
[[https://github.com/abo-abo/swiper/issues/1686][#1686]].
-
-Make =counsel-find-file-delete= ask for confirmation. See
[[https://github.com/abo-abo/swiper/issues/1774][#1774]].
-
-Make =counsel-find-file-delete= clean up buffers. See
[[https://github.com/abo-abo/swiper/issues/1779][#1779]].
------
-*** counsel-find-file-jump
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-find-file-jump
-:END:
-New var =counsel-file-jump-args=. See
[[https://github.com/abo-abo/swiper/issues/1889][#1889]].
------
-*** counsel-fzf
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-fzf
-:END:
-Support =universal-argument=. See
[[https://github.com/abo-abo/swiper/issues/1281][#1281]],
[[https://github.com/abo-abo/swiper/issues/1279][#1279]].
------
-*** counsel-git-grep
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-git-grep
-:END:
-Also works on remote. See
[[https://github.com/abo-abo/swiper/issues/1463][#1463]].
-
-New var =counsel--git-grep-count-threshold=. See
[[https://github.com/abo-abo/swiper/issues/1470][#1470]].
-
-Add "-I" to =counsel-git-grep-cmd-default= to ignore binaries. Files are
-marked as binary in =.gitattributes=.
-
-Calculate the repo size correctly for submodules. See
[[https://github.com/abo-abo/swiper/issues/1558][#1558]].
------
-*** counsel-grep
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-grep
-:END:
-New var =counsel-grep-map=. Bind =swiper-avy= there. See
[[https://github.com/abo-abo/swiper/issues/1711][#1711]].
------
-*** counsel-imenu
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-imenu
-:END:
-Show functions as "Functions: func". See
[[https://github.com/abo-abo/swiper/issues/775][#775]].
------
-*** counsel-linux-app
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-linux-app
-:END:
-Add =~/.local/share/applications/=. See
[[https://github.com/abo-abo/swiper/issues/1390][#1390]].
-
-Add guixsd's application directory. See
[[https://github.com/abo-abo/swiper/issues/1476][#1476]].
-
-Call =gtk-launch= asynchronously. See
[[https://github.com/abo-abo/swiper/issues/1537][#1537]].
-
-Add dir for flatpack. See
[[https://github.com/abo-abo/swiper/issues/1754][#1754]].
-
-Ignore non-readable desktop files. See
[[https://github.com/abo-abo/swiper/issues/1757][#1757]].
-
-Show also hidden desktop files with prefix arg.
-
-Add XDG defaults. See [[https://github.com/abo-abo/swiper/issues/1851][#1851]].
-
-Truncate Exec to 45 chars.
------
-*** counsel-locate
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-locate
-:END:
-Bind ~M-o r~ to =counsel-find-file-as-root=. See
[[https://github.com/abo-abo/swiper/issues/1676][#1676]].
-
-Works over TRAMP. See [[https://github.com/abo-abo/swiper/issues/1735][#1735]].
------
-*** counsel-mode
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-mode
-:END:
-Add =counsel-bookmark=. See
[[https://github.com/abo-abo/swiper/issues/1381][#1381]].
-
-Add more info to the docs. See
[[https://github.com/abo-abo/swiper/issues/1400][#1400]].
-
-Add =counsel-apropos=. See
[[https://github.com/abo-abo/swiper/issues/1582][#1582]].
-
-Display local keymap in mode doc. See
[[https://github.com/abo-abo/swiper/issues/1718][#1718]].
------
-*** counsel-M-x
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-m-x
-:END:
-Support =amx= in addition to =smex=. See
[[https://github.com/abo-abo/swiper/issues/1557][#1557]],
[[https://github.com/abo-abo/swiper/issues/1585][#1585]],
[[https://github.com/abo-abo/swiper/issues/1613][#1613]],
[[https://github.com/abo-abo/swiper/issues/1615][#1615]].
-
-Filter obsolete commands. See
[[https://github.com/abo-abo/swiper/issues/1843][#1843]],
[[https://github.com/abo-abo/swiper/issues/1844][#1844]].
------
-*** counsel-rg
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-rg
-:END:
-Read extra args when =current-prefix-arg= is given. See
[[https://github.com/abo-abo/swiper/issues/851][#851]].
-
-Use smart case "-S" in =counsel-rg-base-command=. See
[[https://github.com/abo-abo/swiper/issues/1393][#1393]].
-
-To look for e.g. "map}", input "map\}". See
[[https://github.com/abo-abo/swiper/issues/1566][#1566]].
-
-Interactively specify switches.
-Example in this repo: "-g*.el -- require", "-g*.org -- require",
-"-g!*.el -- require". See
[[https://github.com/abo-abo/swiper/issues/1408][#1408]],
[[https://github.com/abo-abo/swiper/issues/1512][#1512]],
[[https://github.com/abo-abo/swiper/issues/1688][#1688]],
[[https://github.com/abo-abo/swiper/issues/1559][#1559]].
------
-*** counsel-rhythmbox
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-rhythmbox
-:END:
-Refresh list with prefix arg.
-
-Re-launch rhythmbox if not playing.
-
-Bind ~M-o s~ to =counsel-rhythmbox-toggle-shuffle=.
------
-*** counsel-semantic
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-semantic
-:END:
-Add pretty formatting, expand types recursively. See
[[https://github.com/abo-abo/swiper/issues/702][#702]].
------
-*** counsel-set-variable
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-set-variable
-:END:
-Can also be used non-interactively. See
[[https://github.com/abo-abo/swiper/issues/1409][#1409]].
-
-Show docstring if =lv= is available. See
[[https://github.com/abo-abo/swiper/issues/1595][#1595]].
-
-Add prefix arg behavior: filter out vars without custom-type
-properties. See [[https://github.com/abo-abo/swiper/issues/1643][#1643]].
------
-*** counsel-yank-pop
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-counsel-yank-pop
-:END:
-New var =counsel-yank-pop-height=: configure =ivy-height=. See
[[https://github.com/abo-abo/swiper/issues/1365][#1365]].
-
-New var =counsel-yank-pop-filter=: All elements of =kill-ring= for which
-this function returns nil will be permanently deleted from =kill-ring=
-before completion. See
[[https://github.com/abo-abo/swiper/issues/1356][#1356]],
[[https://github.com/abo-abo/swiper/issues/1367][#1367]].
-
-New var =counsel-yank-pop-preselect-last=: customize whether preselect
-the last kill by default. See
[[https://github.com/abo-abo/swiper/issues/1371][#1371]],
[[https://github.com/abo-abo/swiper/issues/1373][#1373]],
[[https://github.com/abo-abo/swiper/issues/1374][#1374]].
-
-New var =counsel-yank-pop-after-point=. See
[[https://github.com/abo-abo/swiper/issues/884][#884]],
[[https://github.com/abo-abo/swiper/issues/1761][#1761]],
[[https://github.com/abo-abo/swiper/issues/1762][#1762]].
-
-New face =ivy-separator=. See
[[https://github.com/abo-abo/swiper/issues/1815][#1815]].
------
-*** ivy
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-ivy
-:END:
-Interpret mouse events in the minibuffer managed by ivy. You can now
-scroll with the mouse wheel and click to select a candidate.
-See [[https://github.com/abo-abo/swiper/issues/1278][#1278]],
[[https://github.com/abo-abo/swiper/issues/1279][#1279]].
-
-Support multi-character action keys. See
[[https://github.com/abo-abo/swiper/issues/1394][#1394]].
-
-=ivy-display-functions-alist= can use t key as fallback. See
[[https://github.com/abo-abo/swiper/issues/1443][#1443]].
-
-New var =ivy-display-functions-props= useful when customizing display
-functions.
-See [[https://github.com/abo-abo/swiper/issues/1443][#1443]].
-
-New cmd =ivy-kill-whole-line= overrides =kill-whole-line= in the
-minibuffer. See [[https://github.com/abo-abo/swiper/issues/1456][#1456]].
-
-New option for =ivy-virtual-abbreviate=: ='abbreviate=. See
[[https://github.com/abo-abo/swiper/issues/1460][#1460]].
-
-New var =ivy-height-alist=. Customize =ivy-height= per-command. See
[[https://github.com/abo-abo/swiper/issues/1531][#1531]],
[[https://github.com/abo-abo/swiper/issues/1722][#1722]].
-
-New var =ivy-completing-read-dynamic-collection=. See
[[https://github.com/abo-abo/swiper/issues/1524][#1524]].
-
-New cmd =ivy-yank-char= similar to =isearch-yank-char=. See
[[https://github.com/abo-abo/swiper/issues/1588][#1588]].
-
-New cmd =ivy-yank-symbol=. See
[[https://github.com/abo-abo/swiper/issues/1604][#1604]].
-
-Bind ~<right>~ to =ivy-forward-char=. See
[[https://github.com/abo-abo/swiper/issues/1622][#1622]].
-
-New var =ivy-highlight-grep-commands= that lists counsel grep-like
-commands. See [[https://github.com/abo-abo/swiper/issues/1661][#1661]].
-
-New face =ivy-modified-outside-buffer=. See
[[https://github.com/abo-abo/swiper/issues/1742][#1742]],
[[https://github.com/abo-abo/swiper/issues/1745][#1745]].
-
-Propertize matches in =ivy-occur= buffers. See
[[https://github.com/abo-abo/swiper/issues/1795][#1795]].
-
-=ivy-immediate-done= with empty input will return the default.
-See [[https://github.com/abo-abo/swiper/issues/1170][#1170]],
[[https://github.com/abo-abo/swiper/issues/1719][#1719]].
-
-=ivy-read= argument =prompt= is no longer a format string. Use only
-=ivy-count-format= to add/remove candidate count. See
[[https://github.com/abo-abo/swiper/issues/1350][#1350]].
-
-New face =ivy-grep-info= and =ivy-grep-line-number=. See
[[https://github.com/abo-abo/swiper/issues/1839][#1839]],
[[https://github.com/abo-abo/swiper/issues/1840][#1840]].
-
-New face =ivy-org=, =ivy-completions-annotations=. See
[[https://github.com/abo-abo/swiper/issues/1847][#1847]].
-
-Highlight yanked word. New face =ivy-yanked-word=.
-See [[https://github.com/abo-abo/swiper/issues/1581][#1581]],
[[https://github.com/abo-abo/swiper/issues/1850][#1850]],
[[https://github.com/abo-abo/swiper/issues/1856][#1856]],
[[https://github.com/abo-abo/swiper/issues/1859][#1859]],
[[https://github.com/abo-abo/swiper/issues/1861][#1861]].
-
-New var =ivy-pulse-delay=. See
[[https://github.com/abo-abo/swiper/issues/1859][#1859]].
-
-=ivy-initial-inputs-alist= entries can be functions. See
[[https://github.com/abo-abo/swiper/issues/1867][#1867]],
[[https://github.com/abo-abo/swiper/issues/1868][#1868]].
-
-New var =ivy-hooks-alist=. See
[[https://github.com/abo-abo/swiper/issues/1899][#1899]].
------
-*** ivy-occur-grep-mode
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-ivy-occur-grep-mode
-:END:
-Press ~w~ for =ivy-wgrep-change-to-wgrep-mode=. See
[[https://github.com/abo-abo/swiper/issues/1341][#1341]].
------
-*** ivy-occur-next-line
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-ivy-occur-next-line
-:END:
-Useful also in the original buffer.
-
-Jump to first candidate when in header.
------
-*** ivy-preferred-re-builders
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-ivy-preferred-re-builders
-:END:
-Renamed from =ivy-preferred-re-builders=.
------
-*** ivy-push-view
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-ivy-push-view
-:END:
-Overwrite view with prefix arg. See
[[https://github.com/abo-abo/swiper/issues/1737][#1737]].
------
-*** ivy-switch-buffer
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-ivy-switch-buffer
-:END:
-Extract all actions to defuns so that they can be advised or
-reused. See [[https://github.com/abo-abo/swiper/issues/1490][#1490]].
------
-*** swiper
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-swiper
-:END:
-Add test to history even for ~C-g~. See
[[https://github.com/abo-abo/swiper/issues/1305][#1305]].
-
-New var =swiper-stay-on-quit=. When non-nil don't go back to
-search start on abort. See
[[https://github.com/abo-abo/swiper/issues/1319][#1319]].
-
-Add integration with evil s expressions. See
[[https://github.com/abo-abo/swiper/issues/1406][#1406]],
[[https://github.com/abo-abo/swiper/issues/1452][#1452]].
-
-Obey =dired-isearch-filenames=. See
[[https://github.com/abo-abo/swiper/issues/1415][#1415]].
-
-Better negation highlighting. For example, in ivy.el search for "ivy
-len!--". See [[https://github.com/abo-abo/swiper/issues/1418][#1418]].
------
-*** swiper-all
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-swiper-all
-:END:
-Add optional =initial-input= arg. See
[[https://github.com/abo-abo/swiper/issues/1375][#1375]].
------
-*** swiper-font-lock-exclude
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-swiper-font-lock-exclude
-:END:
-Add =eshell-mode=, =helpful-mode=. See
[[https://github.com/abo-abo/swiper/issues/1416][#1416]].
-
-Add =matrix-client-mode=. See
[[https://github.com/abo-abo/swiper/issues/1886][#1886]].
-
-Add =deadgrep-mode=. See
[[https://github.com/abo-abo/swiper/issues/1902][#1902]].
------
-*** swiper-occur
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nf-swiper-occur
-:END:
-Allow to capture groups from input.
-Example: "defvar \([a-z-]+\)" ~C-c C-o~.
------
-
-** New Commands
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-new-commands
-:END:
------
-*** counsel-bookmarked-directory
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nc-counsel-bookmarked-directory
-:END:
-Completion for bookmarked directories. See
[[https://github.com/abo-abo/swiper/issues/1657][#1657]].
------
-*** counsel-down-directory
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nc-counsel-down-directory
-:END:
-Descend into a directory for =counsel-find-file=. See
[[https://github.com/abo-abo/swiper/issues/1891][#1891]].
------
-
-*** counsel-evil-registers
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nc-counsel-evil-registers
-:END:
-Ivy replacement for =evil-show-registers=. See
[[https://github.com/abo-abo/swiper/issues/1368][#1368]].
------
-*** counsel-ibuffer
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nc-counsel-ibuffer
-:END:
-Completion for =ibuffer=. See
[[https://github.com/abo-abo/swiper/issues/1467][#1467]],
[[https://github.com/abo-abo/swiper/issues/1569][#1569]].
------
-*** counsel-org-entity
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nc-counsel-org-entity
-:END:
-Insert an Org entity using ivy. See
[[https://github.com/abo-abo/swiper/issues/1459][#1459]].
------
-*** counsel-semantic-or-imenu
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nc-counsel-semantic-or-imenu
-:END:
-New command that uses either =counsel-semantic= or =counsel-imenu=. See
-[[https://github.com/abo-abo/swiper/issues/702][#702]],
[[https://github.com/abo-abo/swiper/issues/1389][#1389]].
------
-*** counsel-wmctrl
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nc-counsel-wmctrl
-:END:
-Select a desktop window with completion.
------
-*** ivy-switch-buffer-kill
-:PROPERTIES:
-:CUSTOM_ID: 0-11-0-nc-ivy-switch-buffer-kill
-:END:
-New command bound to ~C-c C-k~ for =ivy-switch-buffer=. Use this to kill
-one or more buffers while still in the minibuffer.
------
-
-#+BEGIN_EXPORT html
-<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
-<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
-<br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
-#+END_EXPORT
-* 0.12.0
-:PROPERTIES:
-:CUSTOM_ID: 0.12.0
-:END:
------
-** Fixes
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fixes
-:END:
------
-*** counsel-ag
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-ag
-:END:
-Don't allow newlines in wildcards when using el:ivy--regex-fuzzy. See
[[https://github.com/abo-abo/swiper/issues/1907][#1907]].
------
-*** counsel-company
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-company
-:END:
-Add caller. See [[https://github.com/abo-abo/swiper/issues/2051][#2051]].
-
-Use el:company-prefix. See
[[https://github.com/abo-abo/swiper/issues/2054][#2054]],
[[https://github.com/abo-abo/swiper/issues/2074][#2074]].
-
-Don't rely on el:company-point See
[[https://github.com/abo-abo/swiper/issues/2071][#2071]].
------
-*** counsel-dired-jump
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-dired-jump
-:END:
-Fix "-type d". See [[https://github.com/abo-abo/swiper/issues/1965][#1965]].
-
-Fix for OSX. See [[https://github.com/abo-abo/swiper/issues/1990][#1990]].
------
-*** counsel-file-jump
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-file-jump
-:END:
-Fix file expansion. See
[[https://github.com/abo-abo/swiper/issues/1903][#1903]].
-
-Fix dotfiles not being shown. See
[[https://github.com/abo-abo/swiper/issues/1820][#1820]].
------
-*** counsel-find-file
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-find-file
-:END:
-Add nested hidden dotfiles to el:counsel-find-file-ignore-regexp. See
[[https://github.com/abo-abo/swiper/issues/1820][#1820]].
-
-Add lockfiles to el:counsel-find-file-ignore-regexp. See
[[https://github.com/abo-abo/swiper/issues/2117][#2117]].
-
-Improve mkdir action with el:ivy-call: cd into the created directory.
-
-Improve delete action with el:ivy-call: stay in the directory.
-
-Improve copy and move actions. See
[[https://github.com/abo-abo/swiper/issues/2053][#2053]].
------
-*** counsel-git-checkout
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-git-checkout
-:END:
-Quote branch names. See
[[https://github.com/abo-abo/swiper/issues/1905][#1905]],
[[https://github.com/abo-abo/swiper/issues/1906][#1906]].
------
-*** counsel-git-log
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-git-log
-:END:
-Change el:counsel-git-log-split-string-re. See
[[https://github.com/abo-abo/swiper/issues/2129][#2129]].
-
-Fix el:ivy-resume. See
[[https://github.com/abo-abo/swiper/issues/2133][#2133]].
------
-*** counsel-locate
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-locate
-:END:
-Use a non-regex locate on BSD. See
[[https://github.com/abo-abo/swiper/issues/1950][#1950]].
------
-*** counsel-org-file
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-org-file
-:END:
-Handle =ATTACH_DIR= property. Re-use el:org-attach-dir. See
[[https://github.com/abo-abo/swiper/issues/2042][#2042]].
------
-*** counsel-org-goto-all
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-org-goto-all
-:END:
-Use org-mode outline settings. See
[[https://github.com/abo-abo/swiper/issues/1947][#1947]].
------
-*** counsel-org-tag-agenda
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-org-tag-agenda
-:END:
-Fix due to Org 9.2.3 API change. See
[[https://github.com/abo-abo/swiper/issues/1997][#1997]].
-
-Fix el:org-version testing. See
[[https://github.com/abo-abo/swiper/issues/2006][#2006]].
------
-*** counsel-package
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-package
-:END:
-Strip space from the initial input. See
[[https://github.com/abo-abo/swiper/issues/1998][#1998]].
------
-*** counsel-recentf
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-recentf
-:END:
-Require match. See [[https://github.com/abo-abo/swiper/issues/2043][#2043]].
------
-*** counsel-rhythmbox
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-rhythmbox
-:END:
-Add =:require-match=.
------
-*** counsel-unicode-char
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-counsel-unicode-char
-:END:
-Don't sort every time. See
[[https://github.com/abo-abo/swiper/issues/1204][#1204]],
[[https://github.com/abo-abo/swiper/issues/1988][#1988]].
-
-Modify copy action to use actual result. See
[[https://github.com/abo-abo/swiper/issues/2075][#2075]].
------
-*** documentation
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-documentation
-:END:
-el:ivy-initial-inputs-alist is now a defcustom.
-
-el:swiper-mc docstring. See
[[https://github.com/abo-abo/swiper/issues/1879][#1879]].
-
-Update ivy.org. See [[https://github.com/abo-abo/swiper/issues/1951][#1951]],
[[https://github.com/abo-abo/swiper/issues/2046][#2046]],
[[https://github.com/abo-abo/swiper/issues/2143][#2143]].
-
-Mention el:char-fold-to-regexp. See
[[https://github.com/abo-abo/swiper/issues/1977][#1977]].
-
-Mention automatically integrated packages in ivy.org. See
[[https://github.com/abo-abo/swiper/issues/1674][#1674]].
-
-Remove outdated magit customization. See
[[https://github.com/abo-abo/swiper/issues/2035][#2035]].
-
-el:ivy-read docstring. See
[[https://github.com/abo-abo/swiper/issues/2107][#2107]].
-
-el:ivy-reverse-i-search docstring. See
[[https://github.com/abo-abo/swiper/issues/2126][#2126]].
-
-Add autoloads for various commands. See
[[https://github.com/abo-abo/swiper/issues/2131][#2131]].
------
-*** ivy-avy
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-avy
-:END:
-Fix when there's a scroll.
------
-*** ivy-completion-in-region
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-completion-in-region
-:END:
-Don't insert initial-input if nil. See
[[https://github.com/abo-abo/swiper/issues/2086][#2086]].
------
-*** ivy-display-function-overlay
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-display-function-overlay
-:END:
-Don't assume in-buffer completion. See
[[https://github.com/abo-abo/swiper/issues/2048][#2048]],
[[https://github.com/abo-abo/swiper/issues/2049][#2049]].
------
-*** ivy-help
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-help
-:END:
-Set el:org-hide-emphasis-markers. Reveal all Org contents. See
[[https://github.com/abo-abo/swiper/issues/2021][#2021]].
-Hide Org markup locally. See
[[https://github.com/abo-abo/swiper/issues/2085][#2085]].
------
-*** ivy-immediate-done
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-immediate-done
-:END:
-Improve for el:make-directory. See
[[https://github.com/abo-abo/swiper/issues/1170][#1170]],
[[https://github.com/abo-abo/swiper/issues/1719][#1719]],
[[https://github.com/abo-abo/swiper/issues/2139][#2139]].
------
-*** ivy-insert-current
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-insert-current
-:END:
-Insert text without properties. See
[[https://github.com/abo-abo/swiper/issues/2040][#2040]].
------
-*** ivy-next-history-element
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-next-history-element
-:END:
-Use el:minibuffer-default for el:dired-dwim-target.
-
-#+begin_src elisp
-(setq dired-dwim-target t)
-#+end_src
-
-Is a nice productivity boost. Except for the situation when you want to copy
the file to
-the current directory, and a different directory is preselected instead. When
this
-happens, you can now press ~M-n~ to select the current directory.
------
-*** ivy-occur
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-occur
-:END:
-Make ivy-switch-buffer-occur work with multi-pass regex builders. See
[[https://github.com/abo-abo/swiper/issues/1973][#1973]].
-
-Make find-file-occur work with multi-pass regex builders. See
[[https://github.com/abo-abo/swiper/issues/1984][#1984]].
-
-Make grep-occur work with multi-pass regex builders. See
[[https://github.com/abo-abo/swiper/issues/2033][#2033]].
-
-Make swiper occur wgrep work for narrowed buffers. See
[[https://github.com/abo-abo/swiper/issues/1848][#1848]].
-
-Don't setq-local el:ivy--directory. See
[[https://github.com/abo-abo/swiper/issues/1866][#1866]].
-
-Don't hightlight the file name part. See
[[https://github.com/abo-abo/swiper/issues/2073][#2073]].
-
-Fix missing line numbers. See
[[https://github.com/abo-abo/swiper/issues/2076][#2076]].
-
-Fix for el:counsel-find-file. See
[[https://github.com/abo-abo/swiper/issues/2094][#2094]].
-
-el:ivy-occur-revert-buffer should stay on the same line.
------
-*** ivy-occur-press
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-occur-press
-:END:
-Improve when the window config was changed.
------
-*** ivy-partial
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-partial
-:END:
-Works better when selecting files. See
[[https://github.com/abo-abo/swiper/issues/2103][#2103]].
------
-*** ivy-previous-line-or-history
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-previous-line-or-history
-:END:
-Improve. See [[https://github.com/abo-abo/swiper/issues/2137][#2137]],
[[https://github.com/abo-abo/swiper/issues/2138][#2138]],
[[https://github.com/abo-abo/swiper/issues/1137][#1137]].
------
-*** ivy-read
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-read
-:END:
-Allow to override global actions per command. See
[[https://github.com/abo-abo/swiper/issues/1873][#1873]].
-
-Require TRAMP earlier so that there's completion. See
[[https://github.com/abo-abo/swiper/issues/1918][#1918]].
-
-Allow all re-builders to use el:ivy-highlight-grep-commands. See
[[https://github.com/abo-abo/swiper/issues/1983][#1983]].
-
-Improve column calculation in el:ivy-dispatching-done-hydra.
-
-Allow recursive minibuffers to use el:ivy-display-functions-alist. See
[[https://github.com/abo-abo/swiper/issues/1995][#1995]].
-
-Don't use invalid =:preselect= as a regexp. See
[[https://github.com/abo-abo/swiper/issues/2002][#2002]].
-
-Allow to select "" when prompt is selectable. See
[[https://github.com/abo-abo/swiper/issues/1924][#1924]].
-
-Fix el:all-completions returning $$. See
[[https://github.com/abo-abo/swiper/issues/2012][#2012]].
-
-Fix matcher not called on input "". See
[[https://github.com/abo-abo/swiper/issues/2013][#2013]].
-
-Fix filter for el:ivy--regex-ignore-order. See
[[https://github.com/abo-abo/swiper/issues/2015][#2015]].
-
-Don't offer virtual buffers for plain el:switch-to-buffer. See
[[https://github.com/abo-abo/swiper/issues/839][#839]].
-
-el:ivy-completion-in-region-action obeys :exit-function.
-
-Shrink ivy window after reading action. See
[[https://github.com/abo-abo/swiper/issues/2079][#2079]].
-
-Use single face for highlighting adjacent groups. See
[[https://github.com/abo-abo/swiper/issues/2080][#2080]].
-
-Use el:ivy-flx-limit more. See
[[https://github.com/abo-abo/swiper/issues/2081][#2081]].
-
-Fix el:ivy-read-action. See
[[https://github.com/abo-abo/swiper/issues/2082][#2082]].
-
-Set el:line-spacing to nil in the minibuffer. See
[[https://github.com/abo-abo/swiper/issues/2118][#2118]].
------
-*** ivy-reverse-i-search
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-reverse-i-search
-:END:
-Don't bind ivy-recursive-restore to nil. See
[[https://github.com/abo-abo/swiper/issues/1215][#1215]].
------
-*** ivy--sort
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy--sort
-:END:
-Higher priority for el:ivy-sort-matches-functions-alist. See
[[https://github.com/abo-abo/swiper/issues/2136][#2136]].
------
-*** ivy-switch-buffer
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-switch-buffer
-:END:
-Preserve the index after kill. See
[[https://github.com/abo-abo/swiper/issues/1787][#1787]],
[[https://github.com/abo-abo/swiper/issues/1910][#1910]].
-
-Fix ~M-o f~ for virtual buffers. See
[[https://github.com/abo-abo/swiper/issues/2111][#2111]].
------
-*** ivy-thing-at-point
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-thing-at-point
-:END:
-Extend. See [[https://github.com/abo-abo/swiper/issues/1871][#1871]].
------
-*** ivy-use-selectable-prompt
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-ivy-use-selectable-prompt
-:END:
-Don't highlight if not needed.
------
-*** swiper
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-swiper
-:END:
-Fix blinks in non-graphical Emacs. See
[[https://github.com/abo-abo/swiper/issues/1921][#1921]],
[[https://github.com/abo-abo/swiper/issues/1923][#1923]].
-
-Documentation. See [[https://github.com/abo-abo/swiper/issues/643][#643]].
-
-Don't rely on el:window-start in terminal. el:window-start and el:window-end
is not
-reliable when in a terminal. It can be made reliable if a el:redisplay is
performed, but
-then we get annoying blinking. See
[[https://github.com/abo-abo/swiper/issues/1928][#1928]].
-
-Add extra condition to recenter in terminal. See
[[https://github.com/abo-abo/swiper/issues/2059][#2059]].
-
-Fix overlays clean up. See
[[https://github.com/abo-abo/swiper/issues/2064][#2064]].
-
-Obey el:search-invisible. See
[[https://github.com/abo-abo/swiper/issues/1739][#1739]].
-
-Improve highlighting with el:char-fold-to-regexp. See
[[https://github.com/abo-abo/swiper/issues/2124][#2124]].
-
-Add group for faces. See
[[https://github.com/abo-abo/swiper/issues/2135][#2135]].
------
-*** swiper-avy
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-swiper-avy
-:END:
-If the input is 1 char, re-highlight. See
[[https://github.com/abo-abo/swiper/issues/1915][#1915]].
-
-Warn if no input.
-
-Fix for el:swiper-background-faces. See
[[https://github.com/abo-abo/swiper/issues/2019][#2019]].
-
-Handle quit. See [[https://github.com/abo-abo/swiper/issues/2062][#2062]].
-
-Work for el:swiper-isearch. See
[[https://github.com/abo-abo/swiper/issues/2134][#2134]].
------
-*** swiper-font-lock-exclude-p
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-swiper-font-lock-exclude-p
-:END:
-Exclude el:xref--xref-buffer-mode from font-lock. See
[[https://github.com/abo-abo/swiper/issues/1917][#1917]].
-
-Try checking for non prog-mode.
------
-*** swiper-multi
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-swiper-multi
-:END:
-Misc fixes. See [[https://github.com/abo-abo/swiper/issues/2101][#2101]],
[[https://github.com/abo-abo/swiper/issues/2102][#2102]].
------
-*** swiper-query-replace
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-fx-swiper-query-replace
-:END:
-Fix for el:ivy--regex-ignore-order.
-
-Check for empty input. See
[[https://github.com/abo-abo/swiper/issues/2066][#2066]].
-** New Features
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-new-features
-:END:
------
-*** counsel-descbinds
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-descbinds
-:END:
-Add ~M-o x~ el:counsel-descbinds-action-exec. See
[[https://github.com/abo-abo/swiper/issues/2024][#2024]].
------
-*** counsel-file-jump
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-file-jump
-:END:
-Add ~M-o d~ that opens the item in el:dired. See
[[https://github.com/abo-abo/swiper/issues/2057][#2057]].
------
-*** counsel-find-file
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-find-file
-:END:
-Press ~`~ to get completion for bookmarks. This allows you to efficiently jump
between
-recent directories. See
[[https://github.com/abo-abo/swiper/issues/1956][#1956]],
[[https://github.com/abo-abo/swiper/issues/1958][#1958]].
-
-Press ~$~ to get completion for your environment variables that are
directories. See [[https://github.com/abo-abo/swiper/issues/1932][#1932]],
-[[https://github.com/abo-abo/swiper/issues/1937][#1937]].
-
-New action: ~M-o c~ el:counsel-find-file-copy. See
[[https://github.com/abo-abo/swiper/issues/1955][#1955]].
-
-New var el:counsel-up-directory-level that customizes ~C-DEL~. See
[[https://github.com/abo-abo/swiper/issues/1096][#1096]].
-
-New var el:counsel-find-file-extern-extensions. Allows to press ~RET~ instead
of ~M-o x~ for
-selected file types, for which it doesn't make sense to be opened in Emacs.
-
-When on a remote, ~//~ will cd to the remote root, instead of the local root.
If you want to
-go to the local root, use ~/ C-j~. See
[[https://github.com/abo-abo/swiper/issues/1487][#1487]].
-
-When on a remote, ~~~ will cd to the remote home, instead of the local home.
If you want to
-go to the local home, use ~/ C-j ~~. You can also try =`=.
-
-New binding when completing file names ~C-M-y~ el:ivy-insert-current-full that
obsoletes
-el:counsel-yank-directory. See
[[https://github.com/abo-abo/swiper/issues/2092][#2092]].
-
-You can now use ~RET~ or ~C-m~ (in place of ~C-M-j~) to create a directory,
even if it matches
-an existing file.
------
-*** counsel-git-grep
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-git-grep
-:END:
-New variable el:counsel-git-grep-cmd-function. Customize how git-grep is
called based on
-input.
------
-*** counsel-git-log
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-git-log
-:END:
-Bind ~M-o v~ el:counsel-git-log-show-commit-action to visit the item in
-el:magit-show-commit. See
[[https://github.com/abo-abo/swiper/issues/2129][#2129]],
[[https://github.com/abo-abo/swiper/issues/2148][#2148]].
------
-*** counsel-grep
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-grep
-:END:
-Add el:counsel-grep-history. See
[[https://github.com/abo-abo/swiper/issues/1914][#1914]].
------
-*** counsel-grep-use-swiper-p
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-grep-use-swiper-p
-:END:
-When this function returns non-nil, el:counsel-grep-or-swiper will call
el:swiper, else
-el:counsel-grep-or-swiper. See
[[https://github.com/abo-abo/swiper/issues/1908][#1908]].
------
-*** counsel-locate
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-locate
-:END:
-Automatically call =updatedb= when your home folder is encrypted.
-Use el:counsel-locate-db-path to customize.
------
-*** counsel-mark-ring
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-mark-ring
-:END:
-Add preview and highlight by candidate. See
[[https://github.com/abo-abo/swiper/issues/2078][#2078]].
-
-New variable el:counsel-descbinds-function. See
[[https://github.com/abo-abo/swiper/issues/1876][#1876]],
[[https://github.com/abo-abo/swiper/issues/2091][#2091]].
------
-*** counsel-M-x
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-m-x
-:END:
-Optionally expand aliases. For example, if =rb= is aliased to
el:revert-buffer, and bound
-to ~C-c r~, el:counsel-M-x will show: =rb (revert-buffer) (C-c r)=.
-Customize with el:counsel-alias-expand, enabled by default.
-See [[https://github.com/abo-abo/swiper/issues/1904][#1904]].
------
-*** counsel-rg
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-rg
-:END:
-Dynamically handle look-arounds. See
[[https://github.com/abo-abo/swiper/issues/1935][#1935]].
-
-Anchor pcre lookarounds to bol. See
[[https://github.com/abo-abo/swiper/issues/1976][#1976]],
[[https://github.com/abo-abo/swiper/issues/1979][#1979]].
-
-Add an example of inclusion patterns to the doc.
-
-Press ~C-x C-d~ calls el:counsel-cd that allows you to change the current
directory.
-
-Add dynamic case folding. Make sure el:counsel-ag-base-command or
-el:counsel-rg-base-command does not include "-i": it will be added
automatically based on
-your input and el:ivy-case-fold-search. See
[[https://github.com/abo-abo/swiper/issues/1869][#1869]].
------
-*** counsel-set-variable
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-counsel-set-variable
-:END:
-Better annotations for options.
-If the option is e.g.:
-#+begin_example
-(const :tag "Dotfiles and Lockfiles" "\\(?:\\`\\|[/\\]\\)\\(?:[#.]\\)")
-#+end_example
-then display:
-#+begin_example
-Dotfiles and Lockfiles: \(?:\`\|[/\]\)\(?:[#.]\)
-#+end_example
-instead of:
-#+begin_example
-\\(?:\\`\\|[/\\]\\)\\(?:[#.]\\)
-#+end_example
-
-If the option's value is nil, but a =:tag= is present, display the option.
------
-*** ivy-avy
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-ivy-avy
-:END:
-Allow to scroll with ~C-v~ and ~M-v~.
------
-*** ivy-dispatching-done-hydra
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-ivy-dispatching-done-hydra
-:END:
-New variable el:ivy-dispatching-done-hydra-exit-keys. In case you bind
-el:ivy-dispatching-done-hydra to a custom key.
------
-*** ivy-read
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-ivy-read
-:END:
-Allow to mark/unmark candidates with ~m~, ~u~, ~DEL~, ~t~. The bindings are
similar to what
-el:dired provides. They are available in the ~C-o~ hydra. See
[[https://github.com/abo-abo/swiper/issues/561][#561]].
-
-Add =:multi-action= argument. If multiple candidates are marked and this
argument is
-present, call it with the whole list of marked candidates, instead of calling
=:action= in
-turn for each marked candidate. See
[[https://github.com/abo-abo/swiper/issues/561][#561]],
[[https://github.com/abo-abo/swiper/issues/2068][#2068]].
-
-el:ivy-inhibit-action can be a function. This allows you to effectively
override the
-=:action= argument to el:ivy-read.
-
-New var el:ivy-dispatching-done-idle can delay the hint by a specified amount
of seconds.
-
-=:update-fn= argument can now be ='auto=. This will call =:action= each time
the current
-candidate changes.
-
-New var el:ivy-format-functions-alist that obsoletes el:ivy-format-function.
See [[https://github.com/abo-abo/swiper/issues/2083][#2083]],
-[[https://github.com/abo-abo/swiper/issues/2084][#2084]],
[[https://github.com/abo-abo/swiper/issues/2130][#2130]].
-
-New var el:ivy-display-functions-alist that obsoletes el:ivy-display-function.
See [[https://github.com/abo-abo/swiper/issues/2089][#2089]].
-
-Add ability to resume dynamic collections. See
[[https://github.com/abo-abo/swiper/issues/1095][#1095]],
[[https://github.com/abo-abo/swiper/issues/2112][#2112]].
------
-*** ivy--regex
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-ivy--regex
-:END:
-Match initial dot in the input as a literal dot. This brings much more
usability,
-e.g. enter ".org" to switch between Org-mode files, ".el" for Elisp etc.
------
-*** ivy-reverse-i-search
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-ivy-reverse-i-search
-:END:
-New binding ~C-k~ el:ivy-reverse-i-search-kill. Remove elements from history.
------
-*** ivy-sort-matches-functions-alist
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-ivy-sort-matches-functions-alist
-:END:
-Sort shorter matches first for el:ivy-completion-in-region.
------
-*** ivy-switch-buffer
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-ivy-switch-buffer
-:END:
-Add ~M-o x~ el:counsel-open-buffer-file-externally. See
[[https://github.com/abo-abo/swiper/issues/2108][#2108]],
[[https://github.com/abo-abo/swiper/issues/2115][#2115]].
-
-Move ~C-c C-k~ el:ivy-switch-buffer-kill to ~C-k~.
-
-Fix el:ivy-push-view windows layout. See
[[https://github.com/abo-abo/swiper/issues/2109][#2109]].
------
-*** swiper
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-swiper
-:END:
-New variable el:swiper-use-visual-line-p. Configure to prevent el:swiper from
becoming
-slow in huge buffers where el:visual-line-mode is enabled.
-
-Add preview overlays. See
[[https://github.com/abo-abo/swiper/issues/1948][#1948]].
------
-*** swiper-query-replace
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nf-swiper-query-replace
-:END:
-Use el:query-replace-compile-replacement to allow using Elisp in replacements.
Simply use
-~M-i~ to insert and edit the suggested replacement. See
[[https://github.com/abo-abo/swiper/issues/2096][#2096]].
-
-For example, suppose in swiper.el, we want to rename:
-#+begin_example
-(defTYPE swiper- to (defTYPE ivy
-#+end_example
-where TYPE is (group, face, fun, var ...).
-
-1. el:swiper-isearch for =(def\sw+ swiper=
-2. ~M-q~ to replace and ~TAB~ to get: =\,(concat \1 " " \2)=
-3. Modify it to =\,(concat \1 " ivy")=
-** New Commands
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-new-commands
-:END:
------
-*** counsel-compile
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-counsel-compile
-:END:
-Call el:compile, completing with smart suggestions. See
[[https://github.com/abo-abo/swiper/issues/1941][#1941]],
[[https://github.com/abo-abo/swiper/issues/1963][#1963]],
[[https://github.com/abo-abo/swiper/issues/1966][#1966]],
[[https://github.com/abo-abo/swiper/issues/1968][#1968]],
[[https://github.com/abo-abo/swiper/issues/1972][#1972]],
-[[https://github.com/abo-abo/swiper/issues/2077][#2077]].
-
-Add el:counsel-compile-env. See
[[https://github.com/abo-abo/swiper/issues/2030][#2030]].
------
-*** counsel-dired
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-counsel-dired
-:END:
-Like el:counsel-find-file, but open el:dired instead. See
[[https://github.com/abo-abo/swiper/issues/1993][#1993]],
[[https://github.com/abo-abo/swiper/issues/1999][#1999]].
------
-*** counsel-minor
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-counsel-minor
-:END:
-Toggle minor mode. The interface is similar to el:counsel-package, you enable
modes with
-"+mode" and disable with "-mode". See
[[https://github.com/abo-abo/swiper/issues/2000][#2000]],
[[https://github.com/abo-abo/swiper/issues/2070][#2070]].
------
-*** counsel-register
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-counsel-register
-:END:
-Completion for registers: buffer positions, text, rectangles, window configs,
frame
-configs, macros etc. See
[[https://github.com/abo-abo/swiper/issues/2056][#2056]].
------
-*** counsel-switch-buffer
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-counsel-switch-buffer
-:END:
-Like el:ivy-switch-buffer, but you get automatic live preview.
-See [[https://github.com/abo-abo/swiper/issues/1895][#1895]],
[[https://github.com/abo-abo/swiper/issues/1897][#1897]],
[[https://github.com/abo-abo/swiper/issues/1954][#1954]],
[[https://github.com/abo-abo/swiper/issues/1971][#1971]],
[[https://github.com/abo-abo/swiper/issues/1959][#1959]],
[[https://github.com/abo-abo/swiper/issues/2009][#2009]],
[[https://github.com/abo-abo/swiper/issues/2113][#2113]].
------
-*** counsel-switch-buffer-other-window
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-counsel-switch-buffer-other-window
-:END:
-Switch to another buffer in another window, with preview. See
[[https://github.com/abo-abo/swiper/issues/2022][#2022]],
[[https://github.com/abo-abo/swiper/issues/2067][#2067]].
------
-*** swiper-all-thing-at-point
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-swiper-all-thing-at-point
-:END:
-Start el:swiper-all with el:symbol-at-point as input. See
[[https://github.com/abo-abo/swiper/issues/2106][#2106]].
------
-*** swiper-isearch
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-swiper-isearch
-:END:
-A faster version of el:swiper that's not line-based:
-- Much faster startup
-- When there are many matches on the same line, you can select each on
individually
-
-See [[https://github.com/abo-abo/swiper/issues/1931][#1931]],
[[https://github.com/abo-abo/swiper/issues/2014][#2014]],
[[https://github.com/abo-abo/swiper/issues/2018][#2018]],
[[https://github.com/abo-abo/swiper/issues/2029][#2029]],
[[https://github.com/abo-abo/swiper/issues/2031][#2031]],
[[https://github.com/abo-abo/swiper/issues/2034][#2034]],
[[https://github.com/abo-abo/swiper/issues/2039][#2039]],
[[https://github.com/abo-abo/swiper/issues/2058][#2058]],
[[https://github.com/abo [...]
-
-New variable el:swiper-isearch-highlight-delay. Used to delay matches that are
just one
-character by 0.2s. Usually in that time frame a second key will be added to
the input.
-
-Obey el:search-default-mode. See
[[https://github.com/abo-abo/swiper/issues/622][#622]],
[[https://github.com/abo-abo/swiper/issues/2095][#2095]].
------
-*** swiper-isearch-thing-at-point
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-swiper-isearch-thing-at-point
-:END:
-Start el:swiper-isearch with el:symbol-at-point as input. See
[[https://github.com/abo-abo/swiper/issues/2025][#2025]],
[[https://github.com/abo-abo/swiper/issues/2029][#2029]].
------
-*** swiper-isearch-toggle
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-swiper-isearch-toggle
-:END:
-A two-way toggle between el:swiper and el:isearch-mode. See
[[https://github.com/abo-abo/swiper/issues/2061][#2061]],
[[https://github.com/abo-abo/swiper/issues/2065][#2065]].
------
-*** swiper-thing-at-point
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-swiper-thing-at-point
-:END:
-Start el:swiper with el:symbol-at-point as input. See
[[https://github.com/abo-abo/swiper/issues/2027][#2027]].
------
-*** swiper-backward
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-swiper-backward
-:END:
-el:isearch-backward with an overview. See
[[https://github.com/abo-abo/swiper/issues/1172][#1172]],
[[https://github.com/abo-abo/swiper/issues/2132][#2132]].
------
-*** counsel-grep-or-swiper-backward
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-counsel-grep-or-swiper-backward
-:END:
-See [[https://github.com/abo-abo/swiper/issues/2132][#2132]].
------
-*** swiper-isearch-backward
-:PROPERTIES:
-:CUSTOM_ID: 0-12-0-nc-swiper-isearch-backward
-:END:
-See [[https://github.com/abo-abo/swiper/issues/2125][#2125]].
------
diff --git a/doc/Makefile b/doc/Makefile
deleted file mode 100644
index 3b0f4a6..0000000
--- a/doc/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-INFO_INSTALL_DIR="${HOME}/git/gnu-elpa/packages/ivy"
-
-ivy.texi: ivy.org
- emacs -batch -l ivy-ox.el -l scripts.el --eval "(org-to-texi
\"ivy.org\")"
-
-ivy.info: ivy.texi
- makeinfo --no-split $^
-
-install: ivy.info
- cp $^ $(INFO_INSTALL_DIR)
- install-info --info-dir=$(INFO_INSTALL_DIR) --info-file=$^
diff --git a/doc/fdl-1.3.txt b/doc/fdl-1.3.txt
deleted file mode 100644
index bf128be..0000000
--- a/doc/fdl-1.3.txt
+++ /dev/null
@@ -1,451 +0,0 @@
-
- GNU Free Documentation License
- Version 1.3, 3 November 2008
-
-
- Copyright (C) 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.
- <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-0. PREAMBLE
-
-The purpose of this License is to make a manual, textbook, or other
-functional and useful document "free" in the sense of freedom: to
-assure everyone the effective freedom to copy and redistribute it,
-with or without modifying it, either commercially or noncommercially.
-Secondarily, this License preserves for the author and publisher a way
-to get credit for their work, while not being considered responsible
-for modifications made by others.
-
-This License is a kind of "copyleft", which means that derivative
-works of the document must themselves be free in the same sense. It
-complements the GNU General Public License, which is a copyleft
-license designed for free software.
-
-We have designed this License in order to use it for manuals for free
-software, because free software needs free documentation: a free
-program should come with manuals providing the same freedoms that the
-software does. But this License is not limited to software manuals;
-it can be used for any textual work, regardless of subject matter or
-whether it is published as a printed book. We recommend this License
-principally for works whose purpose is instruction or reference.
-
-
-1. APPLICABILITY AND DEFINITIONS
-
-This License applies to any manual or other work, in any medium, that
-contains a notice placed by the copyright holder saying it can be
-distributed under the terms of this License. Such a notice grants a
-world-wide, royalty-free license, unlimited in duration, to use that
-work under the conditions stated herein. The "Document", below,
-refers to any such manual or work. Any member of the public is a
-licensee, and is addressed as "you". You accept the license if you
-copy, modify or distribute the work in a way requiring permission
-under copyright law.
-
-A "Modified Version" of the Document means any work containing the
-Document or a portion of it, either copied verbatim, or with
-modifications and/or translated into another language.
-
-A "Secondary Section" is a named appendix or a front-matter section of
-the Document that deals exclusively with the relationship of the
-publishers or authors of the Document to the Document's overall
-subject (or to related matters) and contains nothing that could fall
-directly within that overall subject. (Thus, if the Document is in
-part a textbook of mathematics, a Secondary Section may not explain
-any mathematics.) The relationship could be a matter of historical
-connection with the subject or with related matters, or of legal,
-commercial, philosophical, ethical or political position regarding
-them.
-
-The "Invariant Sections" are certain Secondary Sections whose titles
-are designated, as being those of Invariant Sections, in the notice
-that says that the Document is released under this License. If a
-section does not fit the above definition of Secondary then it is not
-allowed to be designated as Invariant. The Document may contain zero
-Invariant Sections. If the Document does not identify any Invariant
-Sections then there are none.
-
-The "Cover Texts" are certain short passages of text that are listed,
-as Front-Cover Texts or Back-Cover Texts, in the notice that says that
-the Document is released under this License. A Front-Cover Text may
-be at most 5 words, and a Back-Cover Text may be at most 25 words.
-
-A "Transparent" copy of the Document means a machine-readable copy,
-represented in a format whose specification is available to the
-general public, that is suitable for revising the document
-straightforwardly with generic text editors or (for images composed of
-pixels) generic paint programs or (for drawings) some widely available
-drawing editor, and that is suitable for input to text formatters or
-for automatic translation to a variety of formats suitable for input
-to text formatters. A copy made in an otherwise Transparent file
-format whose markup, or absence of markup, has been arranged to thwart
-or discourage subsequent modification by readers is not Transparent.
-An image format is not Transparent if used for any substantial amount
-of text. A copy that is not "Transparent" is called "Opaque".
-
-Examples of suitable formats for Transparent copies include plain
-ASCII without markup, Texinfo input format, LaTeX input format, SGML
-or XML using a publicly available DTD, and standard-conforming simple
-HTML, PostScript or PDF designed for human modification. Examples of
-transparent image formats include PNG, XCF and JPG. Opaque formats
-include proprietary formats that can be read and edited only by
-proprietary word processors, SGML or XML for which the DTD and/or
-processing tools are not generally available, and the
-machine-generated HTML, PostScript or PDF produced by some word
-processors for output purposes only.
-
-The "Title Page" means, for a printed book, the title page itself,
-plus such following pages as are needed to hold, legibly, the material
-this License requires to appear in the title page. For works in
-formats which do not have any title page as such, "Title Page" means
-the text near the most prominent appearance of the work's title,
-preceding the beginning of the body of the text.
-
-The "publisher" means any person or entity that distributes copies of
-the Document to the public.
-
-A section "Entitled XYZ" means a named subunit of the Document whose
-title either is precisely XYZ or contains XYZ in parentheses following
-text that translates XYZ in another language. (Here XYZ stands for a
-specific section name mentioned below, such as "Acknowledgements",
-"Dedications", "Endorsements", or "History".) To "Preserve the Title"
-of such a section when you modify the Document means that it remains a
-section "Entitled XYZ" according to this definition.
-
-The Document may include Warranty Disclaimers next to the notice which
-states that this License applies to the Document. These Warranty
-Disclaimers are considered to be included by reference in this
-License, but only as regards disclaiming warranties: any other
-implication that these Warranty Disclaimers may have is void and has
-no effect on the meaning of this License.
-
-2. VERBATIM COPYING
-
-You may copy and distribute the Document in any medium, either
-commercially or noncommercially, provided that this License, the
-copyright notices, and the license notice saying this License applies
-to the Document are reproduced in all copies, and that you add no
-other conditions whatsoever to those of this License. You may not use
-technical measures to obstruct or control the reading or further
-copying of the copies you make or distribute. However, you may accept
-compensation in exchange for copies. If you distribute a large enough
-number of copies you must also follow the conditions in section 3.
-
-You may also lend copies, under the same conditions stated above, and
-you may publicly display copies.
-
-
-3. COPYING IN QUANTITY
-
-If you publish printed copies (or copies in media that commonly have
-printed covers) of the Document, numbering more than 100, and the
-Document's license notice requires Cover Texts, you must enclose the
-copies in covers that carry, clearly and legibly, all these Cover
-Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on
-the back cover. Both covers must also clearly and legibly identify
-you as the publisher of these copies. The front cover must present
-the full title with all words of the title equally prominent and
-visible. You may add other material on the covers in addition.
-Copying with changes limited to the covers, as long as they preserve
-the title of the Document and satisfy these conditions, can be treated
-as verbatim copying in other respects.
-
-If the required texts for either cover are too voluminous to fit
-legibly, you should put the first ones listed (as many as fit
-reasonably) on the actual cover, and continue the rest onto adjacent
-pages.
-
-If you publish or distribute Opaque copies of the Document numbering
-more than 100, you must either include a machine-readable Transparent
-copy along with each Opaque copy, or state in or with each Opaque copy
-a computer-network location from which the general network-using
-public has access to download using public-standard network protocols
-a complete Transparent copy of the Document, free of added material.
-If you use the latter option, you must take reasonably prudent steps,
-when you begin distribution of Opaque copies in quantity, to ensure
-that this Transparent copy will remain thus accessible at the stated
-location until at least one year after the last time you distribute an
-Opaque copy (directly or through your agents or retailers) of that
-edition to the public.
-
-It is requested, but not required, that you contact the authors of the
-Document well before redistributing any large number of copies, to
-give them a chance to provide you with an updated version of the
-Document.
-
-
-4. MODIFICATIONS
-
-You may copy and distribute a Modified Version of the Document under
-the conditions of sections 2 and 3 above, provided that you release
-the Modified Version under precisely this License, with the Modified
-Version filling the role of the Document, thus licensing distribution
-and modification of the Modified Version to whoever possesses a copy
-of it. In addition, you must do these things in the Modified Version:
-
-A. Use in the Title Page (and on the covers, if any) a title distinct
- from that of the Document, and from those of previous versions
- (which should, if there were any, be listed in the History section
- of the Document). You may use the same title as a previous version
- if the original publisher of that version gives permission.
-B. List on the Title Page, as authors, one or more persons or entities
- responsible for authorship of the modifications in the Modified
- Version, together with at least five of the principal authors of the
- Document (all of its principal authors, if it has fewer than five),
- unless they release you from this requirement.
-C. State on the Title page the name of the publisher of the
- Modified Version, as the publisher.
-D. Preserve all the copyright notices of the Document.
-E. Add an appropriate copyright notice for your modifications
- adjacent to the other copyright notices.
-F. Include, immediately after the copyright notices, a license notice
- giving the public permission to use the Modified Version under the
- terms of this License, in the form shown in the Addendum below.
-G. Preserve in that license notice the full lists of Invariant Sections
- and required Cover Texts given in the Document's license notice.
-H. Include an unaltered copy of this License.
-I. Preserve the section Entitled "History", Preserve its Title, and add
- to it an item stating at least the title, year, new authors, and
- publisher of the Modified Version as given on the Title Page. If
- there is no section Entitled "History" in the Document, create one
- stating the title, year, authors, and publisher of the Document as
- given on its Title Page, then add an item describing the Modified
- Version as stated in the previous sentence.
-J. Preserve the network location, if any, given in the Document for
- public access to a Transparent copy of the Document, and likewise
- the network locations given in the Document for previous versions
- it was based on. These may be placed in the "History" section.
- You may omit a network location for a work that was published at
- least four years before the Document itself, or if the original
- publisher of the version it refers to gives permission.
-K. For any section Entitled "Acknowledgements" or "Dedications",
- Preserve the Title of the section, and preserve in the section all
- the substance and tone of each of the contributor acknowledgements
- and/or dedications given therein.
-L. Preserve all the Invariant Sections of the Document,
- unaltered in their text and in their titles. Section numbers
- or the equivalent are not considered part of the section titles.
-M. Delete any section Entitled "Endorsements". Such a section
- may not be included in the Modified Version.
-N. Do not retitle any existing section to be Entitled "Endorsements"
- or to conflict in title with any Invariant Section.
-O. Preserve any Warranty Disclaimers.
-
-If the Modified Version includes new front-matter sections or
-appendices that qualify as Secondary Sections and contain no material
-copied from the Document, you may at your option designate some or all
-of these sections as invariant. To do this, add their titles to the
-list of Invariant Sections in the Modified Version's license notice.
-These titles must be distinct from any other section titles.
-
-You may add a section Entitled "Endorsements", provided it contains
-nothing but endorsements of your Modified Version by various
-parties--for example, statements of peer review or that the text has
-been approved by an organization as the authoritative definition of a
-standard.
-
-You may add a passage of up to five words as a Front-Cover Text, and a
-passage of up to 25 words as a Back-Cover Text, to the end of the list
-of Cover Texts in the Modified Version. Only one passage of
-Front-Cover Text and one of Back-Cover Text may be added by (or
-through arrangements made by) any one entity. If the Document already
-includes a cover text for the same cover, previously added by you or
-by arrangement made by the same entity you are acting on behalf of,
-you may not add another; but you may replace the old one, on explicit
-permission from the previous publisher that added the old one.
-
-The author(s) and publisher(s) of the Document do not by this License
-give permission to use their names for publicity for or to assert or
-imply endorsement of any Modified Version.
-
-
-5. COMBINING DOCUMENTS
-
-You may combine the Document with other documents released under this
-License, under the terms defined in section 4 above for modified
-versions, provided that you include in the combination all of the
-Invariant Sections of all of the original documents, unmodified, and
-list them all as Invariant Sections of your combined work in its
-license notice, and that you preserve all their Warranty Disclaimers.
-
-The combined work need only contain one copy of this License, and
-multiple identical Invariant Sections may be replaced with a single
-copy. If there are multiple Invariant Sections with the same name but
-different contents, make the title of each such section unique by
-adding at the end of it, in parentheses, the name of the original
-author or publisher of that section if known, or else a unique number.
-Make the same adjustment to the section titles in the list of
-Invariant Sections in the license notice of the combined work.
-
-In the combination, you must combine any sections Entitled "History"
-in the various original documents, forming one section Entitled
-"History"; likewise combine any sections Entitled "Acknowledgements",
-and any sections Entitled "Dedications". You must delete all sections
-Entitled "Endorsements".
-
-
-6. COLLECTIONS OF DOCUMENTS
-
-You may make a collection consisting of the Document and other
-documents released under this License, and replace the individual
-copies of this License in the various documents with a single copy
-that is included in the collection, provided that you follow the rules
-of this License for verbatim copying of each of the documents in all
-other respects.
-
-You may extract a single document from such a collection, and
-distribute it individually under this License, provided you insert a
-copy of this License into the extracted document, and follow this
-License in all other respects regarding verbatim copying of that
-document.
-
-
-7. AGGREGATION WITH INDEPENDENT WORKS
-
-A compilation of the Document or its derivatives with other separate
-and independent documents or works, in or on a volume of a storage or
-distribution medium, is called an "aggregate" if the copyright
-resulting from the compilation is not used to limit the legal rights
-of the compilation's users beyond what the individual works permit.
-When the Document is included in an aggregate, this License does not
-apply to the other works in the aggregate which are not themselves
-derivative works of the Document.
-
-If the Cover Text requirement of section 3 is applicable to these
-copies of the Document, then if the Document is less than one half of
-the entire aggregate, the Document's Cover Texts may be placed on
-covers that bracket the Document within the aggregate, or the
-electronic equivalent of covers if the Document is in electronic form.
-Otherwise they must appear on printed covers that bracket the whole
-aggregate.
-
-
-8. TRANSLATION
-
-Translation is considered a kind of modification, so you may
-distribute translations of the Document under the terms of section 4.
-Replacing Invariant Sections with translations requires special
-permission from their copyright holders, but you may include
-translations of some or all Invariant Sections in addition to the
-original versions of these Invariant Sections. You may include a
-translation of this License, and all the license notices in the
-Document, and any Warranty Disclaimers, provided that you also include
-the original English version of this License and the original versions
-of those notices and disclaimers. In case of a disagreement between
-the translation and the original version of this License or a notice
-or disclaimer, the original version will prevail.
-
-If a section in the Document is Entitled "Acknowledgements",
-"Dedications", or "History", the requirement (section 4) to Preserve
-its Title (section 1) will typically require changing the actual
-title.
-
-
-9. TERMINATION
-
-You may not copy, modify, sublicense, or distribute the Document
-except as expressly provided under this License. Any attempt
-otherwise to copy, modify, sublicense, or distribute it is void, and
-will automatically terminate your rights under this License.
-
-However, if you cease all violation of this License, then your license
-from a particular copyright holder is reinstated (a) provisionally,
-unless and until the copyright holder explicitly and finally
-terminates your license, and (b) permanently, if the copyright holder
-fails to notify you of the violation by some reasonable means prior to
-60 days after the cessation.
-
-Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
-Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, receipt of a copy of some or all of the same material does
-not give you any rights to use it.
-
-
-10. FUTURE REVISIONS OF THIS LICENSE
-
-The Free Software Foundation may publish new, revised versions of the
-GNU Free Documentation License from time to time. Such new versions
-will be similar in spirit to the present version, but may differ in
-detail to address new problems or concerns. See
-https://www.gnu.org/licenses/.
-
-Each version of the License is given a distinguishing version number.
-If the Document specifies that a particular numbered version of this
-License "or any later version" applies to it, you have the option of
-following the terms and conditions either of that specified version or
-of any later version that has been published (not as a draft) by the
-Free Software Foundation. If the Document does not specify a version
-number of this License, you may choose any version ever published (not
-as a draft) by the Free Software Foundation. If the Document
-specifies that a proxy can decide which future versions of this
-License can be used, that proxy's public statement of acceptance of a
-version permanently authorizes you to choose that version for the
-Document.
-
-11. RELICENSING
-
-"Massive Multiauthor Collaboration Site" (or "MMC Site") means any
-World Wide Web server that publishes copyrightable works and also
-provides prominent facilities for anybody to edit those works. A
-public wiki that anybody can edit is an example of such a server. A
-"Massive Multiauthor Collaboration" (or "MMC") contained in the site
-means any set of copyrightable works thus published on the MMC site.
-
-"CC-BY-SA" means the Creative Commons Attribution-Share Alike 3.0
-license published by Creative Commons Corporation, a not-for-profit
-corporation with a principal place of business in San Francisco,
-California, as well as future copyleft versions of that license
-published by that same organization.
-
-"Incorporate" means to publish or republish a Document, in whole or in
-part, as part of another Document.
-
-An MMC is "eligible for relicensing" if it is licensed under this
-License, and if all works that were first published under this License
-somewhere other than this MMC, and subsequently incorporated in whole or
-in part into the MMC, (1) had no cover texts or invariant sections, and
-(2) were thus incorporated prior to November 1, 2008.
-
-The operator of an MMC Site may republish an MMC contained in the site
-under CC-BY-SA on the same site at any time before August 1, 2009,
-provided the MMC is eligible for relicensing.
-
-
-ADDENDUM: How to use this License for your documents
-
-To use this License in a document you have written, include a copy of
-the License in the document and put the following copyright and
-license notices just after the title page:
-
- Copyright (c) YEAR YOUR NAME.
- Permission is granted to copy, distribute and/or modify this document
- under the terms of the GNU Free Documentation License, Version 1.3
- or any later version published by the Free Software Foundation;
- with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- A copy of the license is included in the section entitled "GNU
- Free Documentation License".
-
-If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts,
-replace the "with...Texts." line with this:
-
- with the Invariant Sections being LIST THEIR TITLES, with the
- Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
-
-If you have Invariant Sections without Cover Texts, or some other
-combination of the three, merge those two alternatives to suit the
-situation.
-
-If your document contains nontrivial examples of program code, we
-recommend releasing these examples in parallel under your choice of
-free software license, such as the GNU General Public License,
-to permit their use in free software.
diff --git a/doc/gpl-3.0.txt b/doc/gpl-3.0.txt
deleted file mode 100644
index f288702..0000000
--- a/doc/gpl-3.0.txt
+++ /dev/null
@@ -1,674 +0,0 @@
- GNU GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
- Preamble
-
- The GNU General Public License is a free, copyleft license for
-software and other kinds of works.
-
- The licenses for most software and other practical works are designed
-to take away your freedom to share and change the works. By contrast,
-the GNU General Public License is intended to guarantee your freedom to
-share and change all versions of a program--to make sure it remains free
-software for all its users. We, the Free Software Foundation, use the
-GNU General Public License for most of our software; it applies also to
-any other work released this way by its authors. You can apply it to
-your programs, too.
-
- When we speak of free software, we are referring to freedom, not
-price. Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-them if you wish), that you receive source code or can get it if you
-want it, that you can change the software or use pieces of it in new
-free programs, and that you know you can do these things.
-
- To protect your rights, we need to prevent others from denying you
-these rights or asking you to surrender the rights. Therefore, you have
-certain responsibilities if you distribute copies of the software, or if
-you modify it: responsibilities to respect the freedom of others.
-
- For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must pass on to the recipients the same
-freedoms that you received. You must make sure that they, too, receive
-or can get the source code. And you must show them these terms so they
-know their rights.
-
- Developers that use the GNU GPL protect your rights with two steps:
-(1) assert copyright on the software, and (2) offer you this License
-giving you legal permission to copy, distribute and/or modify it.
-
- For the developers' and authors' protection, the GPL clearly explains
-that there is no warranty for this free software. For both users' and
-authors' sake, the GPL requires that modified versions be marked as
-changed, so that their problems will not be attributed erroneously to
-authors of previous versions.
-
- Some devices are designed to deny users access to install or run
-modified versions of the software inside them, although the manufacturer
-can do so. This is fundamentally incompatible with the aim of
-protecting users' freedom to change the software. The systematic
-pattern of such abuse occurs in the area of products for individuals to
-use, which is precisely where it is most unacceptable. Therefore, we
-have designed this version of the GPL to prohibit the practice for those
-products. If such problems arise substantially in other domains, we
-stand ready to extend this provision to those domains in future versions
-of the GPL, as needed to protect the freedom of users.
-
- Finally, every program is threatened constantly by software patents.
-States should not allow patents to restrict development and use of
-software on general-purpose computers, but in those that do, we wish to
-avoid the special danger that patents applied to a free program could
-make it effectively proprietary. To prevent this, the GPL assures that
-patents cannot be used to render the program non-free.
-
- The precise terms and conditions for copying, distribution and
-modification follow.
-
- TERMS AND CONDITIONS
-
- 0. Definitions.
-
- "This License" refers to version 3 of the GNU General Public License.
-
- "Copyright" also means copyright-like laws that apply to other kinds of
-works, such as semiconductor masks.
-
- "The Program" refers to any copyrightable work licensed under this
-License. Each licensee is addressed as "you". "Licensees" and
-"recipients" may be individuals or organizations.
-
- To "modify" a work means to copy from or adapt all or part of the work
-in a fashion requiring copyright permission, other than the making of an
-exact copy. The resulting work is called a "modified version" of the
-earlier work or a work "based on" the earlier work.
-
- A "covered work" means either the unmodified Program or a work based
-on the Program.
-
- To "propagate" a work means to do anything with it that, without
-permission, would make you directly or secondarily liable for
-infringement under applicable copyright law, except executing it on a
-computer or modifying a private copy. Propagation includes copying,
-distribution (with or without modification), making available to the
-public, and in some countries other activities as well.
-
- To "convey" a work means any kind of propagation that enables other
-parties to make or receive copies. Mere interaction with a user through
-a computer network, with no transfer of a copy, is not conveying.
-
- An interactive user interface displays "Appropriate Legal Notices"
-to the extent that it includes a convenient and prominently visible
-feature that (1) displays an appropriate copyright notice, and (2)
-tells the user that there is no warranty for the work (except to the
-extent that warranties are provided), that licensees may convey the
-work under this License, and how to view a copy of this License. If
-the interface presents a list of user commands or options, such as a
-menu, a prominent item in the list meets this criterion.
-
- 1. Source Code.
-
- The "source code" for a work means the preferred form of the work
-for making modifications to it. "Object code" means any non-source
-form of a work.
-
- A "Standard Interface" means an interface that either is an official
-standard defined by a recognized standards body, or, in the case of
-interfaces specified for a particular programming language, one that
-is widely used among developers working in that language.
-
- The "System Libraries" of an executable work include anything, other
-than the work as a whole, that (a) is included in the normal form of
-packaging a Major Component, but which is not part of that Major
-Component, and (b) serves only to enable use of the work with that
-Major Component, or to implement a Standard Interface for which an
-implementation is available to the public in source code form. A
-"Major Component", in this context, means a major essential component
-(kernel, window system, and so on) of the specific operating system
-(if any) on which the executable work runs, or a compiler used to
-produce the work, or an object code interpreter used to run it.
-
- The "Corresponding Source" for a work in object code form means all
-the source code needed to generate, install, and (for an executable
-work) run the object code and to modify the work, including scripts to
-control those activities. However, it does not include the work's
-System Libraries, or general-purpose tools or generally available free
-programs which are used unmodified in performing those activities but
-which are not part of the work. For example, Corresponding Source
-includes interface definition files associated with source files for
-the work, and the source code for shared libraries and dynamically
-linked subprograms that the work is specifically designed to require,
-such as by intimate data communication or control flow between those
-subprograms and other parts of the work.
-
- The Corresponding Source need not include anything that users
-can regenerate automatically from other parts of the Corresponding
-Source.
-
- The Corresponding Source for a work in source code form is that
-same work.
-
- 2. Basic Permissions.
-
- All rights granted under this License are granted for the term of
-copyright on the Program, and are irrevocable provided the stated
-conditions are met. This License explicitly affirms your unlimited
-permission to run the unmodified Program. The output from running a
-covered work is covered by this License only if the output, given its
-content, constitutes a covered work. This License acknowledges your
-rights of fair use or other equivalent, as provided by copyright law.
-
- You may make, run and propagate covered works that you do not
-convey, without conditions so long as your license otherwise remains
-in force. You may convey covered works to others for the sole purpose
-of having them make modifications exclusively for you, or provide you
-with facilities for running those works, provided that you comply with
-the terms of this License in conveying all material for which you do
-not control copyright. Those thus making or running the covered works
-for you must do so exclusively on your behalf, under your direction
-and control, on terms that prohibit them from making any copies of
-your copyrighted material outside their relationship with you.
-
- Conveying under any other circumstances is permitted solely under
-the conditions stated below. Sublicensing is not allowed; section 10
-makes it unnecessary.
-
- 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
-
- No covered work shall be deemed part of an effective technological
-measure under any applicable law fulfilling obligations under article
-11 of the WIPO copyright treaty adopted on 20 December 1996, or
-similar laws prohibiting or restricting circumvention of such
-measures.
-
- When you convey a covered work, you waive any legal power to forbid
-circumvention of technological measures to the extent such circumvention
-is effected by exercising rights under this License with respect to
-the covered work, and you disclaim any intention to limit operation or
-modification of the work as a means of enforcing, against the work's
-users, your or third parties' legal rights to forbid circumvention of
-technological measures.
-
- 4. Conveying Verbatim Copies.
-
- You may convey verbatim copies of the Program's source code as you
-receive it, in any medium, provided that you conspicuously and
-appropriately publish on each copy an appropriate copyright notice;
-keep intact all notices stating that this License and any
-non-permissive terms added in accord with section 7 apply to the code;
-keep intact all notices of the absence of any warranty; and give all
-recipients a copy of this License along with the Program.
-
- You may charge any price or no price for each copy that you convey,
-and you may offer support or warranty protection for a fee.
-
- 5. Conveying Modified Source Versions.
-
- You may convey a work based on the Program, or the modifications to
-produce it from the Program, in the form of source code under the
-terms of section 4, provided that you also meet all of these conditions:
-
- a) The work must carry prominent notices stating that you modified
- it, and giving a relevant date.
-
- b) The work must carry prominent notices stating that it is
- released under this License and any conditions added under section
- 7. This requirement modifies the requirement in section 4 to
- "keep intact all notices".
-
- c) You must license the entire work, as a whole, under this
- License to anyone who comes into possession of a copy. This
- License will therefore apply, along with any applicable section 7
- additional terms, to the whole of the work, and all its parts,
- regardless of how they are packaged. This License gives no
- permission to license the work in any other way, but it does not
- invalidate such permission if you have separately received it.
-
- d) If the work has interactive user interfaces, each must display
- Appropriate Legal Notices; however, if the Program has interactive
- interfaces that do not display Appropriate Legal Notices, your
- work need not make them do so.
-
- A compilation of a covered work with other separate and independent
-works, which are not by their nature extensions of the covered work,
-and which are not combined with it such as to form a larger program,
-in or on a volume of a storage or distribution medium, is called an
-"aggregate" if the compilation and its resulting copyright are not
-used to limit the access or legal rights of the compilation's users
-beyond what the individual works permit. Inclusion of a covered work
-in an aggregate does not cause this License to apply to the other
-parts of the aggregate.
-
- 6. Conveying Non-Source Forms.
-
- You may convey a covered work in object code form under the terms
-of sections 4 and 5, provided that you also convey the
-machine-readable Corresponding Source under the terms of this License,
-in one of these ways:
-
- a) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by the
- Corresponding Source fixed on a durable physical medium
- customarily used for software interchange.
-
- b) Convey the object code in, or embodied in, a physical product
- (including a physical distribution medium), accompanied by a
- written offer, valid for at least three years and valid for as
- long as you offer spare parts or customer support for that product
- model, to give anyone who possesses the object code either (1) a
- copy of the Corresponding Source for all the software in the
- product that is covered by this License, on a durable physical
- medium customarily used for software interchange, for a price no
- more than your reasonable cost of physically performing this
- conveying of source, or (2) access to copy the
- Corresponding Source from a network server at no charge.
-
- c) Convey individual copies of the object code with a copy of the
- written offer to provide the Corresponding Source. This
- alternative is allowed only occasionally and noncommercially, and
- only if you received the object code with such an offer, in accord
- with subsection 6b.
-
- d) Convey the object code by offering access from a designated
- place (gratis or for a charge), and offer equivalent access to the
- Corresponding Source in the same way through the same place at no
- further charge. You need not require recipients to copy the
- Corresponding Source along with the object code. If the place to
- copy the object code is a network server, the Corresponding Source
- may be on a different server (operated by you or a third party)
- that supports equivalent copying facilities, provided you maintain
- clear directions next to the object code saying where to find the
- Corresponding Source. Regardless of what server hosts the
- Corresponding Source, you remain obligated to ensure that it is
- available for as long as needed to satisfy these requirements.
-
- e) Convey the object code using peer-to-peer transmission, provided
- you inform other peers where the object code and Corresponding
- Source of the work are being offered to the general public at no
- charge under subsection 6d.
-
- A separable portion of the object code, whose source code is excluded
-from the Corresponding Source as a System Library, need not be
-included in conveying the object code work.
-
- A "User Product" is either (1) a "consumer product", which means any
-tangible personal property which is normally used for personal, family,
-or household purposes, or (2) anything designed or sold for incorporation
-into a dwelling. In determining whether a product is a consumer product,
-doubtful cases shall be resolved in favor of coverage. For a particular
-product received by a particular user, "normally used" refers to a
-typical or common use of that class of product, regardless of the status
-of the particular user or of the way in which the particular user
-actually uses, or expects or is expected to use, the product. A product
-is a consumer product regardless of whether the product has substantial
-commercial, industrial or non-consumer uses, unless such uses represent
-the only significant mode of use of the product.
-
- "Installation Information" for a User Product means any methods,
-procedures, authorization keys, or other information required to install
-and execute modified versions of a covered work in that User Product from
-a modified version of its Corresponding Source. The information must
-suffice to ensure that the continued functioning of the modified object
-code is in no case prevented or interfered with solely because
-modification has been made.
-
- If you convey an object code work under this section in, or with, or
-specifically for use in, a User Product, and the conveying occurs as
-part of a transaction in which the right of possession and use of the
-User Product is transferred to the recipient in perpetuity or for a
-fixed term (regardless of how the transaction is characterized), the
-Corresponding Source conveyed under this section must be accompanied
-by the Installation Information. But this requirement does not apply
-if neither you nor any third party retains the ability to install
-modified object code on the User Product (for example, the work has
-been installed in ROM).
-
- The requirement to provide Installation Information does not include a
-requirement to continue to provide support service, warranty, or updates
-for a work that has been modified or installed by the recipient, or for
-the User Product in which it has been modified or installed. Access to a
-network may be denied when the modification itself materially and
-adversely affects the operation of the network or violates the rules and
-protocols for communication across the network.
-
- Corresponding Source conveyed, and Installation Information provided,
-in accord with this section must be in a format that is publicly
-documented (and with an implementation available to the public in
-source code form), and must require no special password or key for
-unpacking, reading or copying.
-
- 7. Additional Terms.
-
- "Additional permissions" are terms that supplement the terms of this
-License by making exceptions from one or more of its conditions.
-Additional permissions that are applicable to the entire Program shall
-be treated as though they were included in this License, to the extent
-that they are valid under applicable law. If additional permissions
-apply only to part of the Program, that part may be used separately
-under those permissions, but the entire Program remains governed by
-this License without regard to the additional permissions.
-
- When you convey a copy of a covered work, you may at your option
-remove any additional permissions from that copy, or from any part of
-it. (Additional permissions may be written to require their own
-removal in certain cases when you modify the work.) You may place
-additional permissions on material, added by you to a covered work,
-for which you have or can give appropriate copyright permission.
-
- Notwithstanding any other provision of this License, for material you
-add to a covered work, you may (if authorized by the copyright holders of
-that material) supplement the terms of this License with terms:
-
- a) Disclaiming warranty or limiting liability differently from the
- terms of sections 15 and 16 of this License; or
-
- b) Requiring preservation of specified reasonable legal notices or
- author attributions in that material or in the Appropriate Legal
- Notices displayed by works containing it; or
-
- c) Prohibiting misrepresentation of the origin of that material, or
- requiring that modified versions of such material be marked in
- reasonable ways as different from the original version; or
-
- d) Limiting the use for publicity purposes of names of licensors or
- authors of the material; or
-
- e) Declining to grant rights under trademark law for use of some
- trade names, trademarks, or service marks; or
-
- f) Requiring indemnification of licensors and authors of that
- material by anyone who conveys the material (or modified versions of
- it) with contractual assumptions of liability to the recipient, for
- any liability that these contractual assumptions directly impose on
- those licensors and authors.
-
- All other non-permissive additional terms are considered "further
-restrictions" within the meaning of section 10. If the Program as you
-received it, or any part of it, contains a notice stating that it is
-governed by this License along with a term that is a further
-restriction, you may remove that term. If a license document contains
-a further restriction but permits relicensing or conveying under this
-License, you may add to a covered work material governed by the terms
-of that license document, provided that the further restriction does
-not survive such relicensing or conveying.
-
- If you add terms to a covered work in accord with this section, you
-must place, in the relevant source files, a statement of the
-additional terms that apply to those files, or a notice indicating
-where to find the applicable terms.
-
- Additional terms, permissive or non-permissive, may be stated in the
-form of a separately written license, or stated as exceptions;
-the above requirements apply either way.
-
- 8. Termination.
-
- You may not propagate or modify a covered work except as expressly
-provided under this License. Any attempt otherwise to propagate or
-modify it is void, and will automatically terminate your rights under
-this License (including any patent licenses granted under the third
-paragraph of section 11).
-
- However, if you cease all violation of this License, then your
-license from a particular copyright holder is reinstated (a)
-provisionally, unless and until the copyright holder explicitly and
-finally terminates your license, and (b) permanently, if the copyright
-holder fails to notify you of the violation by some reasonable means
-prior to 60 days after the cessation.
-
- Moreover, your license from a particular copyright holder is
-reinstated permanently if the copyright holder notifies you of the
-violation by some reasonable means, this is the first time you have
-received notice of violation of this License (for any work) from that
-copyright holder, and you cure the violation prior to 30 days after
-your receipt of the notice.
-
- Termination of your rights under this section does not terminate the
-licenses of parties who have received copies or rights from you under
-this License. If your rights have been terminated and not permanently
-reinstated, you do not qualify to receive new licenses for the same
-material under section 10.
-
- 9. Acceptance Not Required for Having Copies.
-
- You are not required to accept this License in order to receive or
-run a copy of the Program. Ancillary propagation of a covered work
-occurring solely as a consequence of using peer-to-peer transmission
-to receive a copy likewise does not require acceptance. However,
-nothing other than this License grants you permission to propagate or
-modify any covered work. These actions infringe copyright if you do
-not accept this License. Therefore, by modifying or propagating a
-covered work, you indicate your acceptance of this License to do so.
-
- 10. Automatic Licensing of Downstream Recipients.
-
- Each time you convey a covered work, the recipient automatically
-receives a license from the original licensors, to run, modify and
-propagate that work, subject to this License. You are not responsible
-for enforcing compliance by third parties with this License.
-
- An "entity transaction" is a transaction transferring control of an
-organization, or substantially all assets of one, or subdividing an
-organization, or merging organizations. If propagation of a covered
-work results from an entity transaction, each party to that
-transaction who receives a copy of the work also receives whatever
-licenses to the work the party's predecessor in interest had or could
-give under the previous paragraph, plus a right to possession of the
-Corresponding Source of the work from the predecessor in interest, if
-the predecessor has it or can get it with reasonable efforts.
-
- You may not impose any further restrictions on the exercise of the
-rights granted or affirmed under this License. For example, you may
-not impose a license fee, royalty, or other charge for exercise of
-rights granted under this License, and you may not initiate litigation
-(including a cross-claim or counterclaim in a lawsuit) alleging that
-any patent claim is infringed by making, using, selling, offering for
-sale, or importing the Program or any portion of it.
-
- 11. Patents.
-
- A "contributor" is a copyright holder who authorizes use under this
-License of the Program or a work on which the Program is based. The
-work thus licensed is called the contributor's "contributor version".
-
- A contributor's "essential patent claims" are all patent claims
-owned or controlled by the contributor, whether already acquired or
-hereafter acquired, that would be infringed by some manner, permitted
-by this License, of making, using, or selling its contributor version,
-but do not include claims that would be infringed only as a
-consequence of further modification of the contributor version. For
-purposes of this definition, "control" includes the right to grant
-patent sublicenses in a manner consistent with the requirements of
-this License.
-
- Each contributor grants you a non-exclusive, worldwide, royalty-free
-patent license under the contributor's essential patent claims, to
-make, use, sell, offer for sale, import and otherwise run, modify and
-propagate the contents of its contributor version.
-
- In the following three paragraphs, a "patent license" is any express
-agreement or commitment, however denominated, not to enforce a patent
-(such as an express permission to practice a patent or covenant not to
-sue for patent infringement). To "grant" such a patent license to a
-party means to make such an agreement or commitment not to enforce a
-patent against the party.
-
- If you convey a covered work, knowingly relying on a patent license,
-and the Corresponding Source of the work is not available for anyone
-to copy, free of charge and under the terms of this License, through a
-publicly available network server or other readily accessible means,
-then you must either (1) cause the Corresponding Source to be so
-available, or (2) arrange to deprive yourself of the benefit of the
-patent license for this particular work, or (3) arrange, in a manner
-consistent with the requirements of this License, to extend the patent
-license to downstream recipients. "Knowingly relying" means you have
-actual knowledge that, but for the patent license, your conveying the
-covered work in a country, or your recipient's use of the covered work
-in a country, would infringe one or more identifiable patents in that
-country that you have reason to believe are valid.
-
- If, pursuant to or in connection with a single transaction or
-arrangement, you convey, or propagate by procuring conveyance of, a
-covered work, and grant a patent license to some of the parties
-receiving the covered work authorizing them to use, propagate, modify
-or convey a specific copy of the covered work, then the patent license
-you grant is automatically extended to all recipients of the covered
-work and works based on it.
-
- A patent license is "discriminatory" if it does not include within
-the scope of its coverage, prohibits the exercise of, or is
-conditioned on the non-exercise of one or more of the rights that are
-specifically granted under this License. You may not convey a covered
-work if you are a party to an arrangement with a third party that is
-in the business of distributing software, under which you make payment
-to the third party based on the extent of your activity of conveying
-the work, and under which the third party grants, to any of the
-parties who would receive the covered work from you, a discriminatory
-patent license (a) in connection with copies of the covered work
-conveyed by you (or copies made from those copies), or (b) primarily
-for and in connection with specific products or compilations that
-contain the covered work, unless you entered into that arrangement,
-or that patent license was granted, prior to 28 March 2007.
-
- Nothing in this License shall be construed as excluding or limiting
-any implied license or other defenses to infringement that may
-otherwise be available to you under applicable patent law.
-
- 12. No Surrender of Others' Freedom.
-
- If conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License. If you cannot convey a
-covered work so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you may
-not convey it at all. For example, if you agree to terms that obligate you
-to collect a royalty for further conveying from those to whom you convey
-the Program, the only way you could satisfy both those terms and this
-License would be to refrain entirely from conveying the Program.
-
- 13. Use with the GNU Affero General Public License.
-
- Notwithstanding any other provision of this License, you have
-permission to link or combine any covered work with a work licensed
-under version 3 of the GNU Affero General Public License into a single
-combined work, and to convey the resulting work. The terms of this
-License will continue to apply to the part which is the covered work,
-but the special requirements of the GNU Affero General Public License,
-section 13, concerning interaction through a network will apply to the
-combination as such.
-
- 14. Revised Versions of this License.
-
- The Free Software Foundation may publish revised and/or new versions of
-the GNU General Public License from time to time. Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Program specifies that a certain numbered version of the GNU General
-Public License "or any later version" applies to it, you have the
-option of following the terms and conditions either of that numbered
-version or of any later version published by the Free Software
-Foundation. If the Program does not specify a version number of the
-GNU General Public License, you may choose any version ever published
-by the Free Software Foundation.
-
- If the Program specifies that a proxy can decide which future
-versions of the GNU General Public License can be used, that proxy's
-public statement of acceptance of a version permanently authorizes you
-to choose that version for the Program.
-
- Later license versions may give you additional or different
-permissions. However, no additional obligations are imposed on any
-author or copyright holder as a result of your choosing to follow a
-later version.
-
- 15. Disclaimer of Warranty.
-
- THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
-APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
-HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
-OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
-THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
-IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
-ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
-
- 16. Limitation of Liability.
-
- IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
-THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
-GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
-USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
-DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
-PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
-EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
-SUCH DAMAGES.
-
- 17. Interpretation of Sections 15 and 16.
-
- If the disclaimer of warranty and limitation of liability provided
-above cannot be given local legal effect according to their terms,
-reviewing courts shall apply local law that most closely approximates
-an absolute waiver of all civil liability in connection with the
-Program, unless a warranty or assumption of liability accompanies a
-copy of the Program in return for a fee.
-
- END OF TERMS AND CONDITIONS
-
- How to Apply These Terms to Your New Programs
-
- If you develop a new program, and you want it to be of the greatest
-possible use to the public, the best way to achieve this is to make it
-free software which everyone can redistribute and change under these terms.
-
- To do so, attach the following notices to the program. It is safest
-to attach them to the start of each source file to most effectively
-state the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
- <one line to give the program's name and a brief idea of what it does.>
- Copyright (C) <year> <name of author>
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-Also add information on how to contact you by electronic and paper mail.
-
- If the program does terminal interaction, make it output a short
-notice like this when it starts in an interactive mode:
-
- <program> Copyright (C) <year> <name of author>
- This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it
- under certain conditions; type `show c' for details.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License. Of course, your program's commands
-might be different; for a GUI interface, you would use an "about box".
-
- You should also get your employer (if you work as a programmer) or school,
-if any, to sign a "copyright disclaimer" for the program, if necessary.
-For more information on this, and how to apply and follow the GNU GPL, see
-<https://www.gnu.org/licenses/>.
-
- The GNU General Public License does not permit incorporating your program
-into proprietary programs. If your program is a subroutine library, you
-may consider it more useful to permit linking proprietary applications with
-the library. If this is what you want to do, use the GNU Lesser General
-Public License instead of this License. But first, please read
-<https://www.gnu.org/licenses/why-not-lgpl.html>.
diff --git a/doc/ivy-help.org b/doc/ivy-help.org
deleted file mode 100644
index 3a94118..0000000
--- a/doc/ivy-help.org
+++ /dev/null
@@ -1,138 +0,0 @@
-* Ivy Generic Help
-
-=ivy= is an Emacs incremental completion framework.
-
-- Narrow the list by typing some pattern,
-- Multiple patterns are allowed by separating with a space,
-- Select with ~C-n~ and ~C-p~, choose with ~RET~.
-
-** Help
-
-- ~C-h m~ :: Pop to this generic help buffer.
-
-** Basic Operations
-*** Key bindings for navigation
-
-- ~C-n~ (=ivy-next-line=) :: next candidate.
-- ~C-p~ (=ivy-previous-line=) :: previous candidate.
-- ~C-v~ (=ivy-scroll-up-command=) :: next page.
-- ~M-v~ (=ivy-scroll-down-command=) :: previous page.
-- ~M-<~ (=ivy-beginning-of-buffer=) :: first candidate.
-- ~M->~ (=ivy-end-of-buffer=) :: last candidate.
-
-*** Key bindings for single selection
-
-When selecting a candidate, an action is called on it. You can think
-of an action as a function that takes the selected candidate as an
-argument and does something with it.
-
-Ivy can offer several actions from which to choose. This can be
-independently composed with whether you want to end completion when
-the action is called. Depending on this, the short term is either
-"calling an action" or "exiting with action".
-
-~C-m~ or ~RET~ (=ivy-done=) - exit with the current action.
-
-~M-o~ (=ivy-dispatching-done=) - select an action and exit with it.
-
-~C-j~ (=ivy-alt-done=) - when the candidate is a directory, enter
-it. Otherwise, exit with the current action.
-
-~TAB~ (=ivy-partial-or-done=) - attempt partial completion, extending
-the current input as much as possible. ~TAB TAB~ is the same as ~C-j~.
-
-~C-M-j~ (=ivy-immediate-done=) - exit with the current action, calling
-it on the /current input/ instead of the current candidate. This is
-useful especially when creating new files or directories - often the
-input will match an existing file, which you don't want to select.
-
-~C-'~ (=ivy-avy=) - select a candidate from the current page with avy
-and exit with the current action.
-
-** Advanced Operations
-*** Key bindings for multiple selection
-
-For repeatedly applying multiple actions or acting on multiple
-candidates, Ivy does not close the minibuffer between commands. It
-keeps the minibuffer open for applying subsequent actions.
-
-Adding an extra meta key to the normal key chord invokes the special
-version of the regular commands that enables applying multiple
-actions.
-
-~C-M-m~ (=ivy-call=) is the non-exiting version of ~C-m~ (=ivy-done=).
-
-~C-M-n~ (=ivy-next-line-and-call=) combines ~C-n~ and ~C-M-m~.
-
-~C-M-p~ (=ivy-previous-line-and-call=) combines ~C-p~ and ~C-M-m~.
-
-~C-M-o~ (=ivy-dispatching-call=) is a non-exiting version of ~M-o~
-(=ivy-dispatching-done=).
-
-*** Key bindings that alter the minibuffer input
-
-~M-n~ (=ivy-next-history-element=) select the next history element or
-symbol/URL at point.
-
-~M-p~ (=ivy-previous-history-element=) select the previous history
-element.
-
-~C-r~ (=ivy-reverse-i-search=) start a recursive completion session to
-select a history element.
-
-~M-i~ (=ivy-insert-current=) insert the current candidate into the
-minibuffer. Useful for copying and renaming files, for example: ~M-i~
-to insert the original file name string, edit it, and then ~C-m~ to
-complete the renaming.
-
-~M-j~ (=ivy-yank-word=) insert the sub-word at point into the
-minibuffer.
-
-~S-SPC~ (=ivy-restrict-to-matches=) deletes the current input, and
-resets the candidates list to the currently restricted matches. This
-is how Ivy provides narrowing in successive tiers.
-
-*** Other key bindings
-
-~M-w~ (=ivy-kill-ring-save=) copies the selected candidates to the
-kill ring; when the region is active, copies the active region.
-
-*** Saving the current completion session to a buffer
-
-~C-c C-o~ (=ivy-occur=) saves the current candidates to a new buffer;
-the list is active in the new buffer.
-
-~RET~ or ~mouse-1~ in the new buffer calls the appropriate action on
-the selected candidate.
-
-Ivy has no limit on the number of active buffers like these.
-
-Ivy takes care of making these buffer names unique. It applies
-descriptive names, for example: =*ivy-occur counsel-describe-variable
-"function$*=.
-
-*** Global key bindings
-
-=ivy-resume= recalls the state of the completion session just before
-its last exit. Useful after an accidental ~C-m~ (=ivy-done=).
-Recommended global binding: ~C-c C-r~.
-
-*** Hydra in the minibuffer
-
-~C-o~ (=hydra-ivy/body=) invokes Hydra menus with key shortcuts.
-
-When in Hydra, ~C-o~ or ~i~ resumes editing.
-
-Hydra reduces key strokes, for example: ~C-n C-n C-n C-n~ is ~C-o
-jjjj~ in Hydra. Besides certain shorter keys, Hydra shows useful info
-such as case folding and the current action.
-
-Additionally, here are the keys that are otherwise not bound:
-
-- ~<~ and ~>~ adjust the height of the minibuffer.
-- ~c~ (=ivy-toggle-calling=) - toggle calling the current action each
- time a different candidate is selected.
-- ~M~ (=ivy-rotate-preferred-builders=) - rotate regex matcher.
-- ~w~ and ~s~ scroll the actions list.
-
-Minibuffer editing is disabled when Hydra is active.
diff --git a/doc/ivy-ox.el b/doc/ivy-ox.el
deleted file mode 100644
index 22ab7a4..0000000
--- a/doc/ivy-ox.el
+++ /dev/null
@@ -1,200 +0,0 @@
-;;; ivy-ox.el --- org-export settings for Ivy -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2018 Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel
-
-;; This file is part of GNU Emacs.
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; For a full copy of the GNU General Public License
-;; see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;;; Code:
-
-;;* ox-texinfo
-(require 'ox-texinfo)
-(eval-when-compile (require 'subr-x))
-(org-export-define-backend 'texinfo
- '((bold . org-texinfo-bold)
- (center-block . org-texinfo-center-block)
- (clock . org-texinfo-clock)
- (code . org-texinfo-kbd)
- (drawer . org-texinfo-drawer)
- (dynamic-block . org-texinfo-dynamic-block)
- (entity . org-texinfo-entity)
- (example-block . org-texinfo-example-block)
- (export-block . org-texinfo-export-block)
- (export-snippet . org-texinfo-export-snippet)
- (fixed-width . org-texinfo-fixed-width)
- (footnote-definition . org-texinfo-footnote-definition)
- (footnote-reference . org-texinfo-footnote-reference)
- (headline . org-texinfo-headline)
- (inline-src-block . org-texinfo-inline-src-block)
- (inlinetask . org-texinfo-inlinetask)
- (italic . org-texinfo-italic)
- (item . org-texinfo-item)
- (keyword . org-texinfo-keyword)
- (line-break . org-texinfo-line-break)
- (link . org-texinfo-link)
- (node-property . org-texinfo-node-property)
- (paragraph . org-texinfo-paragraph)
- (plain-list . org-texinfo-plain-list)
- (plain-text . org-texinfo-plain-text)
- (planning . org-texinfo-planning)
- (property-drawer . org-texinfo-property-drawer)
- (quote-block . org-texinfo-quote-block)
- (radio-target . org-texinfo-radio-target)
- (section . org-texinfo-section)
- (special-block . org-texinfo-special-block)
- (src-block . org-texinfo-src-block)
- (statistics-cookie . org-texinfo-statistics-cookie)
- (subscript . org-texinfo-subscript)
- (superscript . org-texinfo-superscript)
- (table . org-texinfo-table)
- (table-cell . org-texinfo-table-cell)
- (table-row . org-texinfo-table-row)
- (target . org-texinfo-target)
- (template . org-texinfo-template)
- (timestamp . org-texinfo-timestamp)
- (verbatim . org-texinfo-code)
- (verse-block . org-texinfo-verse-block))
- :filters-alist
- '((:filter-headline . org-texinfo--filter-section-blank-lines)
- (:filter-parse-tree . org-texinfo--normalize-headlines)
- (:filter-section . org-texinfo--filter-section-blank-lines))
- :menu-entry
- '(?i "Export to Texinfo"
- ((?t "As TEXI file" org-texinfo-export-to-texinfo)
- (?i "As INFO file" org-texinfo-export-to-info)
- (?o "As INFO file and open"
- (lambda (a s v b)
- (if a (org-texinfo-export-to-info t s v b)
- (org-open-file (org-texinfo-export-to-info nil s v b)))))))
- :options-alist
- '((:texinfo-filename "TEXINFO_FILENAME" nil nil t)
- (:texinfo-class "TEXINFO_CLASS" nil org-texinfo-default-class t)
- (:texinfo-header "TEXINFO_HEADER" nil nil newline)
- (:texinfo-post-header "TEXINFO_POST_HEADER" nil nil newline)
- (:subtitle "SUBTITLE" nil nil parse)
- (:subauthor "SUBAUTHOR" nil nil newline)
- (:texinfo-dircat "TEXINFO_DIR_CATEGORY" nil nil t)
- (:texinfo-dirtitle "TEXINFO_DIR_TITLE" nil nil t)
- (:texinfo-dirdesc "TEXINFO_DIR_DESC" nil nil t)
- (:texinfo-printed-title "TEXINFO_PRINTED_TITLE" nil nil t)
- ;; Other variables.
- (:texinfo-classes nil nil org-texinfo-classes)
- (:texinfo-format-headline-function nil nil
org-texinfo-format-headline-function)
- (:texinfo-node-description-column nil nil
org-texinfo-node-description-column)
- (:texinfo-active-timestamp-format nil nil
org-texinfo-active-timestamp-format)
- (:texinfo-inactive-timestamp-format nil nil
org-texinfo-inactive-timestamp-format)
- (:texinfo-diary-timestamp-format nil nil
org-texinfo-diary-timestamp-format)
- (:texinfo-link-with-unknown-path-format nil nil
org-texinfo-link-with-unknown-path-format)
- (:texinfo-tables-verbatim nil nil org-texinfo-tables-verbatim)
- (:texinfo-table-scientific-notation nil nil
org-texinfo-table-scientific-notation)
- (:texinfo-def-table-markup nil nil org-texinfo-def-table-markup)
- (:texinfo-text-markup-alist nil nil org-texinfo-text-markup-alist)
- (:texinfo-format-drawer-function nil nil
org-texinfo-format-drawer-function)
- (:texinfo-format-inlinetask-function nil nil
org-texinfo-format-inlinetask-function)))
-
-(defun org-texinfo-kbd (code _contents _info)
- "Transcode a CODE object from Org to Texinfo."
- (format "@kbd{%s}" (org-element-property :value code)))
-
-(defun org-texinfo-plain-list (plain-list contents info)
- "Transcode a PLAIN-LIST element from Org to Texinfo.
-CONTENTS is the contents of the list. INFO is a plist holding
-contextual information."
- (let* ((attr (org-export-read-attribute :attr_texinfo plain-list))
- (indic (or (plist-get attr :indic)
- (plist-get info :texinfo-def-table-markup)))
- (table-type (plist-get attr :table-type))
- (type (org-element-property :type plain-list))
- (list-type (cond
- ((eq type 'ordered) "enumerate")
- ((eq type 'unordered) "itemize")
- ((member table-type '("ftable" "vtable")) table-type)
- (t "table"))))
- (if (equal list-type "table")
- (mapconcat (lambda (s)
- (cond ((string-match "\\`User Option @code{\\(.*\\)}$" s)
- (format "@defopt %s\n%s\n@end defopt\n"
- (match-string-no-properties 1 s)
- (string-trim
- (substring s (1+ (match-end 1))))))
- ((string-match "\\(.*\\)$" s)
- (let* ((line (match-string 1 s))
- (body (string-trim
- (substring s (1+ (match-end 1)))))
- (symbol-index
- (if (string-match
"@code{\\(\\(?:ivy\\|swiper\\|counsel\\)-[^}]+\\)}" line)
- (format "@vindex %s\n" (match-string 1
line))
- ""))
- (key-index
- (apply #'concat
- (mapcar
- (lambda (s)
- (format "@kindex %s\n" s))
- (iox-extract-kbd line)))))
- (format "@subsubheading
%s\n%s@indentedblock\n%s\n@end indentedblock"
- line
- (concat symbol-index
- key-index)
- body)))
- (t
- (concat "@subsubheading " s))))
- (split-string (substring-no-properties contents) "^@item "
t)
- "\n")
- (format "@%s\n%s@end %s"
- (if (eq type 'descriptive) (concat list-type " " indic)
list-type)
- contents
- list-type))))
-
-(defun iox-extract-kbd (str)
- (let ((start 0)
- res)
- (while (string-match "@kbd{\\([^}]+\\)}" str start)
- (setq start (match-end 0))
- (push (match-string 1 str) res))
- (nreverse res)))
-
-;;* ox-html
-(require 'ox-html)
-(setq org-html-validation-link nil)
-(setq org-html-postamble nil)
-(setq org-html-text-markup-alist
- '((bold . "<b>%s</b>")
- (code . "<kbd>%s</kbd>")
- (italic . "<i>%s</i>")
- (strike-through . "<del>%s</del>")
- (underline . "<span class=\"underline\">%s</span>")
- (verbatim . "<code>%s</code>")))
-(setq org-html-style-default nil)
-
-(defvar ivy-info-dir (file-name-directory
- (or load-file-name
- buffer-file-name)))
-
-(defun info-ivy ()
- (interactive)
- (let ((buf (get-buffer "*info*")))
- (when buf
- (kill-buffer buf)))
- (Info-find-node
- (expand-file-name "ivy.info" ivy-info-dir)
- "Top"))
-
-(provide 'ivy-ox)
-
-;;; ivy-ox.el ends here
diff --git a/doc/ivy.org b/doc/ivy.org
deleted file mode 100644
index a49569d..0000000
--- a/doc/ivy.org
+++ /dev/null
@@ -1,1389 +0,0 @@
-#+TITLE: Ivy User Manual
-#+AUTHOR: Oleh Krehel
-#+EMAIL: ohwoeowho@gmail.com
-#+LANGUAGE: en
-
-#+TEXINFO_DIR_CATEGORY: Emacs
-#+TEXINFO_DIR_TITLE: Ivy: (ivy).
-#+TEXINFO_DIR_DESC: Using Ivy for completion.
-
-#+HTML_HEAD: <script
src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
-#+HTML_HEAD: <script
src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
-#+HTML_HEAD: <script type="text/javascript"
src="https://fniessen.github.io/org-html-themes/styles/lib/js/jquery.stickytableheaders.min.js"></script>
-#+HTML_HEAD: <script type="text/javascript"
src="https://fniessen.github.io/org-html-themes/styles/readtheorg/js/readtheorg.js"></script>
-#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="css/htmlize.css"/>
-#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="css/readtheorg.css"/>
-#+HTML_HEAD: <link rel="stylesheet" type="text/css" href="css/kbd-style.css"/>
-#+OPTIONS: H:6 num:6 toc:4
-#+STARTUP: indent
-* Setup
:noexport:
-#+BEGIN_SRC elisp :exports results :results silent
-(add-to-list 'load-path default-directory)
-(require 'ivy-ox)
-#+END_SRC
-* Writing this manual
:noexport:
-To highlight a section without introducing a new subheading use
-definition lists. The definition list "owns" the subsequent text if
-the text is indented by 5 spaces. Use ~C-q~ to indent the
-paragraphs. Start new paragraphs with 5 spaces indented. To separate
-definition lists from regular lists, use two newlines.
-
-A typical definition list:
-#+BEGIN_EXAMPLE
-- ~C-M-j~ (=ivy-immediate-done=) ::
-#+END_EXAMPLE
-The code and kbd part is recognized and added as =@vindex= and
-=@kindex= respectively.
-
-Use definition lists to declare a =@defopt= section for =defcustom=
-or =defvar=. For proper Texinfo export, use this form:
-
-#+BEGIN_EXAMPLE
-User Option =ivy-wrap= ::
-#+END_EXAMPLE
-
-Set =CUSTOM_ID= property to name each heading. For example, =worf='s
-~C-u L~. This will result in consistent HTML node names.
-
-Keep one empty line before each source block for proper Texinfo
-exports.
-
-** Exporting to texinfo
-
-ivy.texi is generated from ivy.org. To update the .texi file, eval
-ivy-ox.el then ~C-c C-e i t~ in the ivy.org buffer.
-* Copying
-:PROPERTIES:
-:COPYING: t
-:CUSTOM_ID: copying
-:END:
-#+TEXINFO: @ifnottex
-Ivy manual, version 0.12.0
-
-Ivy is an interactive interface for completion in Emacs. Emacs uses
-completion mechanism in a variety of contexts: code, menus, commands,
-variables, functions, etc. Completion entails listing, sorting,
-filtering, previewing, and applying actions on selected items. When
-active, =ivy-mode= completes the selection process by narrowing
-available choices while previewing in the minibuffer. Selecting the
-final candidate is either through simple keyboard character inputs or
-through powerful regular expressions.
-#+TEXINFO: @end ifnottex
-
-Copyright (C) 2015-2019 Free Software Foundation, Inc.
-
-#+BEGIN_QUOTE
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3
-or any later version published by the Free Software Foundation;
-with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
-A copy of the license is included in the section entitled "GNU
-Free Documentation License".
-#+END_QUOTE
-
-#+HTML: <a
href="https://github.com/abo-abo/swiper/blob/master/doc/ivy.org">This manual
source</a>
-* Introduction
-:PROPERTIES:
-:CUSTOM_ID: introduction
-:END:
-Ivy is for quick and easy selection from a list. When Emacs prompts
-for a string from a list of several possible choices, Ivy springs into
-action to assist in narrowing and picking the right string from a vast
-number of choices.
-
-Ivy strives for minimalism, simplicity, customizability and
-discoverability.
-
-- Minimalism ::
- Uncluttered minibuffer is minimalism. Ivy shows the completion
- defaults, the number of matches, and 10 candidate matches below
- the input line. Customize =ivy-height= to adjust the number of
- candidate matches displayed in the minibuffer.
-
-- Simplicity ::
- Simplicity is about Ivy's behavior in the minibuffer. It is also
- about the code interface to extend Ivy's functionality. The
- minibuffer area behaves as close to =fundamental-mode= as
- possible. ~SPC~ inserts a space, for example, instead of being
- bound to the more complex =minibuffer-complete-word=. Ivy's code
- uses easy-to-examine global variables; avoids needless
- complications with branch-introducing custom macros.
-
-- Customizability ::
- Customizability is about being able to use different methods and
- interfaces of completion to tailor the selection process. For
- example, adding a custom display function that points to a
- selected candidate with =>=, instead of highlighting the selected
- candidate with the =ivy-current-match= face (see
- =ivy-format-functions-alist=). Or take the customization of actions, say
- after the candidate function is selected. ~RET~ uses
- =counsel-describe-function= to describe the function, whereas
- ~M-o d~ jumps to that function's definition in the code. The
- ~M-o~ prefix can be uniformly used with characters like ~d~ to
- group similar actions.
-
-- Discoverability ::
- Ivy displays easily discoverable commands through the hydra
- facility. ~C-o~ in the minibuffer displays a hydra menu. It
- opens up within an expanded minibuffer area. Each menu item comes
- with short documentation strings and highlighted one-key
- completions. So discovering even seldom used keys is simply a
- matter of ~C-o~ in the minibuffer while in the midst of the Ivy
- interaction. This discoverability minimizes exiting Ivy interface
- for documentation look-ups.
-
-* Installation
-:PROPERTIES:
-:CUSTOM_ID: installation
-:END:
-
-Install Ivy automatically through Emacs's package manager, or manually
-from Ivy's development repository.
-
-Emacs 24.3 is the oldest version to run Ivy. Emacs 24.4 is the oldest
-version that runs Ivy with fancy faces display.
-
-** Installing from Emacs Package Manager
-:PROPERTIES:
-:CUSTOM_ID: installing-from-emacs-package-manager
-:END:
-
-~M-x~ =package-install= ~RET~ =ivy= ~RET~
-
-Ivy is installed as part of =ivy= package, which is available from two
-different package archives, GNU ELPA and MELPA. For the latest stable
-version, use the GNU ELPA archives using the above M-x command.
-
-For current hourly builds, use the MELPA archives. In MELPA, Ivy is
-split into three packages: =ivy=, =swiper= and =counsel=; you can simply
-install =counsel= which will bring in the other two as dependencies.
-See the code below for adding MELPA to the list of package archives:
-
-#+begin_src elisp
-(require 'package)
-(add-to-list 'package-archives
- '("melpa" . "https://melpa.org/packages/"))
-#+end_src
-
-After this do ~M-x~ =package-refresh-contents= ~RET~, followed by ~M-x~
-=package-install= ~RET~ =counsel= ~RET~.
-
-For package manager details, see [[info:emacs#Packages]].
-
-** Installing from the Git repository
-:PROPERTIES:
-:CUSTOM_ID: installing-from-the-git-repository
-:END:
-
-- Why install from Git? ::
-
- - No need to wait for MELPA's hourly builds
- - Easy to revert to previous versions
- - Contribute to Ivy's development; send patches; pull requests
-
-
-- Configuration steps ::
- First clone the Swiper repository with:
-
- #+begin_src sh
- cd ~/git && git clone https://github.com/abo-abo/swiper
- cd swiper && make compile
- #+end_src
-
- Second, add these lines to the Emacs init file:
-
- #+begin_src elisp
- (add-to-list 'load-path "~/git/swiper/")
- (require 'ivy)
- #+end_src
-
- Then, update the code with:
-
- #+begin_src sh
- git pull
- make
- #+end_src
-
-* Getting started
-:PROPERTIES:
-:CUSTOM_ID: getting-started
-:END:
-First enable Ivy completion everywhere:
-
-#+begin_src elisp
-(ivy-mode 1)
-#+end_src
-
-Note: =ivy-mode= can be toggled on and off with ~M-x~ =ivy-mode=.
-** Basic customization
-:PROPERTIES:
-:CUSTOM_ID: basic-customization
-:END:
-Here are some basic settings particularly useful for new Ivy users:
-
-#+begin_src elisp
-(setq ivy-use-virtual-buffers t)
-(setq ivy-count-format "(%d/%d) ")
-#+end_src
-
-If you want, you can go without any customizations at all. The above
-settings are the most bang for the buck in terms of customization. So
-users that typically don't like customize a lot are advised to look at
-these settings first.
-
-For more advanced customizations, refer to =M-x describe-variable=
-documentation.
-
-* Key bindings
-:PROPERTIES:
-:CUSTOM_ID: key-bindings
-:END:
-** Global key bindings
-:PROPERTIES:
-:CUSTOM_ID: global-key-bindings
-:END:
-Here is a list of commands that are useful to be bound globally, along
-with some sample bindings:
-
-- Ivy-based interface to standard commands ::
-
- #+begin_src elisp
- (global-set-key (kbd "C-s") 'swiper-isearch)
- (global-set-key (kbd "M-x") 'counsel-M-x)
- (global-set-key (kbd "C-x C-f") 'counsel-find-file)
- (global-set-key (kbd "M-y") 'counsel-yank-pop)
- (global-set-key (kbd "<f1> f") 'counsel-describe-function)
- (global-set-key (kbd "<f1> v") 'counsel-describe-variable)
- (global-set-key (kbd "<f1> l") 'counsel-find-library)
- (global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
- (global-set-key (kbd "<f2> u") 'counsel-unicode-char)
- (global-set-key (kbd "<f2> j") 'counsel-set-variable)
- (global-set-key (kbd "C-x b") 'ivy-switch-buffer)
- (global-set-key (kbd "C-c v") 'ivy-push-view)
- (global-set-key (kbd "C-c V") 'ivy-pop-view)
- #+end_src
-
-- Ivy-based interface to shell and system tools ::
-
- #+begin_src elisp
- (global-set-key (kbd "C-c c") 'counsel-compile)
- (global-set-key (kbd "C-c g") 'counsel-git)
- (global-set-key (kbd "C-c j") 'counsel-git-grep)
- (global-set-key (kbd "C-c L") 'counsel-git-log)
- (global-set-key (kbd "C-c k") 'counsel-rg)
- (global-set-key (kbd "C-c m") 'counsel-linux-app)
- (global-set-key (kbd "C-c n") 'counsel-fzf)
- (global-set-key (kbd "C-x l") 'counsel-locate)
- (global-set-key (kbd "C-c J") 'counsel-file-jump)
- (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
- (global-set-key (kbd "C-c w") 'counsel-wmctrl)
- #+end_src
-
-- Ivy-resume and other commands ::
-
- =ivy-resume= resumes the last Ivy-based completion.
-
- #+begin_src elisp
- (global-set-key (kbd "C-c C-r") 'ivy-resume)
- (global-set-key (kbd "C-c b") 'counsel-bookmark)
- (global-set-key (kbd "C-c d") 'counsel-descbinds)
- (global-set-key (kbd "C-c g") 'counsel-git)
- (global-set-key (kbd "C-c o") 'counsel-outline)
- (global-set-key (kbd "C-c t") 'counsel-load-theme)
- (global-set-key (kbd "C-c F") 'counsel-org-file)
- #+end_src
-
-You can also enable =counsel-mode= to make some global key binding remapping
for you.
-
-** Minibuffer key bindings
-:PROPERTIES:
-:CUSTOM_ID: minibuffer-key-bindings
-:END:
-
-#+VINDEX: ivy-minibuffer-map
-Ivy includes several minibuffer bindings, which are defined in the
-=ivy-minibuffer-map= keymap variable. The most frequently used ones
-are described here.
-
-=swiper= or =counsel-M-x= add more key bindings through the =keymap=
-argument to =ivy-read=. These keys, also active in the minibuffer, are
-described under their respective commands.
-
-A key feature of =ivy-minibuffer-map= is its full editing capability
-where the familiar ~C-a~, ~C-f~, ~M-d~, ~M-DEL~, ~M-b~, ~M-w~, ~C-k~,
-~C-y~ key bindings work the same as in =fundamental-mode=.
-
-*** Key bindings for navigation
-:PROPERTIES:
-:CUSTOM_ID: key-bindings-for-navigation
-:END:
-
-- ~C-n~ (=ivy-next-line=) selects the next candidate
-- ~C-p~ (=ivy-previous-line=) selects the previous candidate
-- ~M-<~ (=ivy-beginning-of-buffer=) selects the first candidate
-- ~M->~ (=ivy-end-of-buffer=) selects the last candidate
-- ~C-v~ (=ivy-scroll-up-command=) scrolls up by =ivy-height= lines
-- ~M-v~ (=ivy-scroll-down-command=) scrolls down by =ivy-height= lines
-
-
-- User Option =ivy-wrap= ::
- Specifies the wrap-around behavior for ~C-n~ and ~C-p~. When
- =ivy-wrap= is set to =t=, =ivy-next-line= and =ivy-previous-line=
- will cycle past the last and the first candidates respectively.
-
- Wrap-around behavior is off by default.
-
-- User Option =ivy-height= ::
- Use this option to adjust the minibuffer height, which also
- affects scroll size when using ~C-v~ and ~M-v~ key bindings.
-
- =ivy-height= is 10 lines by default.
-
-*** Key bindings for single selection, action, then exit minibuffer
-:PROPERTIES:
-:CUSTOM_ID: key-bindings-for-single-selection-action-then-exit-minibuffer
-:END:
-
-Ivy can offer several actions from which to choose which action to
-run. This "calling an action" operates on the selected candidate. For
-example, when viewing a list of files, one action could open it for
-editing, one to view it, another to invoke a special function, and so
-on. Custom actions can be added to this interface. The precise action
-to call on the selected candidate can be delayed until after the
-narrowing is completed. No need to exit the interface if unsure which
-action to run. This delayed flexibility and customization of actions
-extends usability of lists in Emacs.
-
-- ~C-m~ or ~RET~ (=ivy-done=) ::
- Calls the default action and then exits the minibuffer.
-
-- ~M-o~ (=ivy-dispatching-done=) ::
- Presents valid actions from which to choose. When only one action
- is available, there is no difference between ~M-o~ and ~C-m~.
-
-- ~C-j~ (=ivy-alt-done=) ::
- When completing file names, selects the current directory
- candidate and starts a new completion session there. Otherwise,
- it is the same as =ivy-done=.
-
-- ~TAB~ (=ivy-partial-or-done=) ::
- Attempts partial completion, extending current input as much as
- possible. ~TAB TAB~ is the same as ~C-j~ (=ivy-alt-done=).
-
- Example ERT test:
-
- #+begin_src elisp
- (should
- (equal (ivy-with
- '(progn
- (ivy-read "Test: " '("can do" "can't, sorry" "other"))
- ivy-text)
- "c <tab>")
- "can"))
- #+end_src
-
-- ~C-M-j~ (=ivy-immediate-done=) ::
- Exits with /the current input/ instead of /the current candidate/
- (like other commands).
-
- This is useful e.g. when you call =find-file= to create a new
- file, but the desired name matches an existing file. In that
- case, using ~C-j~ would select that existing file, which isn't
- what you want - use this command instead.
-
-- ~C-'~ (=ivy-avy=) ::
- Uses avy to select one of the candidates on the current candidate
- page. This can often be faster than multiple ~C-n~ or ~C-p~
- keystrokes followed by ~C-m~.
-
-*** Key bindings for multiple selections and actions, keep minibuffer open
-:PROPERTIES:
-:CUSTOM_ID:
key-bindings-for-multiple-selections-and-actions-keep-minibuffer-open
-:END:
-
-For repeatedly applying multiple actions or acting on multiple
-candidates, Ivy does not close the minibuffer between commands. It
-keeps the minibuffer open for applying subsequent actions.
-
-Adding an extra meta key to the normal key chord invokes the special
-version of the regular commands that enables applying multiple
-actions.
-
-- ~C-M-m~ (=ivy-call=) ::
- Is the non-exiting version of ~C-m~ (=ivy-done=).
-
- Instead of closing the minibuffer, ~C-M-m~ allows selecting
- another candidate or another action. For example, ~C-M-m~ on
- functions list invokes =describe-function=. When combined with
- ~C-n~, function descriptions can be invoked quickly in
- succession.
-
-- ~C-M-o~ (=ivy-dispatching-call=) ::
- Is the non-exiting version of ~M-o~ (=ivy-dispatching-done=).
-
- For example, during the =counsel-rhythmbox= completion, press
- ~C-M-o e~ to en-queue the selected candidate, followed by ~C-n
- C-m~ to play the next candidate - the current action reverts to
- the default one after ~C-M-o~.
-
-- ~C-M-n~ (=ivy-next-line-and-call=) ::
- Combines ~C-n~ and ~C-M-m~. Moves to next line and applies an action.
-
- Comes in handy when opening multiple files from
- =counsel-find-file=, =counsel-git-grep=, =counsel-ag=, =counsel-rg=, or
- =counsel-locate= lists. Just hold ~C-M-n~ for rapid-fire default
- action on each successive element of the list.
-
-- ~C-M-p~ (=ivy-previous-line-and-call=) ::
- Combines ~C-p~ and ~C-M-m~.
-
- Similar to the above except it moves through the list in the
- other direction.
-
-- =ivy-resume= ::
- Recalls the state of the completion session just before its last
- exit.
-
- Useful after an accidental ~C-m~ (=ivy-done=).
-
-*** Key bindings that alter the minibuffer input
-:PROPERTIES:
-:CUSTOM_ID: key-bindings-that-alter-the-minibuffer-input
-:END:
-
-- ~M-n~ (=ivy-next-history-element=) ::
- Cycles forward through the Ivy command history.
-
- Ivy updates an internal history list after each action. When this
- history list is empty, ~M-n~ inserts symbol (or URL) at point
- into the minibuffer.
-
-- ~M-p~ (=ivy-previous-history-element=) ::
- Cycles forward through the Ivy command history.
-
-- ~M-i~ (=ivy-insert-current=) ::
- Inserts the current candidate into the minibuffer.
-
- Useful for copying and renaming files, for example: ~M-i~ to
- insert the original file name string, edit it, and then ~C-m~ to
- complete the renaming.
-
-- ~M-j~ (=ivy-yank-word=) ::
- Inserts the sub-word at point into the minibuffer.
-
- This is similar to ~C-s C-w~ with =isearch=. Ivy reserves ~C-w~
- for =kill-region=. See also =ivy-yank-symbol= and
- =ivy-yank-char=.
-
-- ~S-SPC~ (=ivy-restrict-to-matches=) ::
- Deletes the current input, and resets the candidates list to the
- currently restricted matches.
-
- This is how Ivy provides narrowing in successive tiers.
-
-- ~C-r~ (=ivy-reverse-i-search=) ::
- Starts a recursive completion session through the command's
- history.
-
- This works just like ~C-r~ at the bash command prompt, where the
- completion candidates are the history items. Upon completion, the
- selected candidate string is inserted into the minibuffer.
-
-*** Other key bindings
-:PROPERTIES:
-:CUSTOM_ID: other-key-bindings
-:END:
-
-- ~M-w~ (=ivy-kill-ring-save=) ::
- Copies selected candidates to the kill ring.
-
- Copies the region if the region is active.
-
-*** Hydra in the minibuffer
-:PROPERTIES:
-:CUSTOM_ID: hydra-in-the-minibuffer
-:END:
-
-- ~C-o~ (=hydra-ivy/body=) ::
- Invokes the hydra menu with short key bindings.
-
-When Hydra is active, minibuffer editing is disabled and menus
-display short aliases:
-
-| Short | Normal | Command name |
-|-------+---------+-------------------------|
-| ~o~ | ~C-g~ | =keyboard-escape-quit= |
-| ~j~ | ~C-n~ | =ivy-next-line= |
-| ~k~ | ~C-p~ | =ivy-previous-line= |
-| ~h~ | ~M-<~ | =ivy-beginning-of-buffer= |
-| ~l~ | ~M->~ | =ivy-end-of-buffer= |
-| ~d~ | ~C-m~ | =ivy-done= |
-| ~f~ | ~C-j~ | =ivy-alt-done= |
-| ~g~ | ~C-M-m~ | =ivy-call= |
-| ~u~ | ~C-c C-o~ | =ivy-occur= |
-
-Hydra reduces key strokes, for example: ~C-n C-n C-n C-n~ is ~C-o
-jjjj~ in Hydra.
-
-Hydra menu offers these additional bindings:
-
-- ~c~ (=ivy-toggle-calling=) ::
- Toggle calling the action after each candidate change. It
- modifies ~j~ to ~jg~, ~k~ to ~kg~ etc.
-
-- ~m~ (=ivy-rotate-preferred-builders=) ::
- Rotate the current regexp matcher.
-
-- ~>~ (=ivy-minibuffer-grow=) ::
- Increase =ivy-height= for the current minibuffer.
-
-- ~<~ (=ivy-minibuffer-shrink=) ::
- Decrease =ivy-height= for the current minibuffer.
-
-- ~w~ (=ivy-prev-action=) ::
- Select the previous action.
-
-- ~s~ (=ivy-next-action=) ::
- Select the next action.
-
-- ~a~ (=ivy-read-action=) ::
- Use a menu to select an action.
-
-- ~C~ (=ivy-toggle-case-fold=) ::
- Toggle case folding (match both upper and lower case
- characters for lower case input).
-
-Hydra menu also offers bindings for marking multiple candidates:
-
-| Key | Command name |
-|-----+---------------------|
-| ~m~ | =ivy-mark= |
-| ~u~ | =ivy-unmark= |
-| ~DEL~ | =ivy-unmark-backward= |
-| ~t~ | =ivy-toggle-marks= |
-
-The action is called on each marked candidate one by one.
-
-*** Saving the current completion session to a buffer
-:PROPERTIES:
-:CUSTOM_ID: saving-the-current-completion-session-to-a-buffer
-:END:
-
-- ~C-c C-o~ (=ivy-occur=) ::
- Saves the current candidates to a new buffer and exits
- completion.
-
-The new buffer is read-only and has a few useful bindings defined.
-
-- ~RET~ or ~f~ (=ivy-occur-press=) ::
- Call the current action on the selected candidate.
-
-- ~mouse-1~ (=ivy-occur-click=) ::
- Call the current action on the selected candidate.
-
-- ~j~ (=next-line=) ::
- Move to next line.
-
-- ~k~ (=previous-line=) ::
- Move to previous line.
-
-- ~a~ (=ivy-occur-read-action=) ::
- Read an action and make it current for this buffer.
-
-- ~o~ (=ivy-occur-dispatch=) ::
- Read an action and call it on the selected candidate.
-
-- ~q~ (=quit-window=) ::
- Bury the current buffer.
-
-
-Ivy has no limit on the number of active buffers like these.
-
-Ivy takes care of naming buffers uniquely by constructing descriptive
-names. For example: =*ivy-occur counsel-describe-variable
-"function$*=.
-
-* Completion Styles
-:PROPERTIES:
-:CUSTOM_ID: completion-styles
-:END:
-
-Ivy's completion functions rely on a regex builder - a function that
-transforms a string input to a string regex. All current candidates
-simply have to match this regex. Each collection can be assigned its
-own regex builder by customizing =ivy-re-builders-alist=.
-
-The keys of this alist are collection names, and the values are one of
-the following:
-- =ivy--regex=
-- =ivy--regex-plus=
-- =ivy--regex-ignore-order=
-- =ivy--regex-fuzzy=
-- =regexp-quote=
-
-A catch-all key, =t=, applies to all collections that don't have their
-own key.
-
-The default is:
-
-#+begin_src elisp
-(setq ivy-re-builders-alist
- '((t . ivy--regex-plus)))
-#+end_src
-
-This example shows a custom regex builder assigned to file name
-completion:
-
-#+begin_src elisp
-(setq ivy-re-builders-alist
- '((read-file-name-internal . ivy--regex-fuzzy)
- (t . ivy--regex-plus)))
-#+end_src
-
-Here, =read-file-name-internal= is a function that is passed as the
-second argument to =completing-read= for file name completion.
-
-The regex builder resolves as follows (in order of priority):
-1. =re-builder= argument passed to =ivy-read=.
-2. =collection= argument passed to =ivy-read= is a function and has an
- entry on =ivy-re-builders-alist=.
-3. =caller= argument passed to =ivy-read= has an entry on
- =ivy-re-builders-alist=.
-4. =this-command= has an entry on =ivy-re-builders-alist=.
-5. =t= has an entry on =ivy-re-builders-alist=.
-6. =ivy--regex=.
-
-** ivy--regex-plus
-:PROPERTIES:
-:CUSTOM_ID: ivy--regex-plus
-:END:
-
-=ivy--regex-plus= is Ivy's default completion method.
-
-=ivy--regex-plus= matches by splitting the input by spaces and
-rebuilding it into a regex.
-
-As the search string is typed in Ivy's minibuffer, it is transformed
-into valid regex syntax. If the string is ="for example"=, it is
-transformed into
-
-#+begin_src elisp
-"\\(for\\).*\\(example\\)"
-#+end_src
-
-which in regex terminology matches ="for"= followed by a wild card and
-then ="example"=. Note how Ivy uses the space character to build wild
-cards. To match a literal white space, use an extra space. So to match
-one space type two spaces, to match two spaces type three spaces, and
-so on.
-
-As Ivy transforms typed characters into regex strings, it provides an
-intuitive feedback through font highlights.
-
-Ivy supports regexp negation with ="!"=.
-For example, ="define key ! ivy quit"= first selects everything
-matching ="define.*key"=, then removes everything matching ="ivy"=,
-and finally removes everything matching ="quit"=. What remains is the
-final result set of the negation regexp.
-
-Since Ivy treats minibuffer input as a regexp, the standard regexp
-identifiers work: ="^"=, ="$"=, ="\b"= or ="[a-z]"=. The exceptions
-are spaces, which translate to =".*"=, and ="!"= that signal the
-beginning of a negation group.
-
-** ivy--regex-ignore-order
-:PROPERTIES:
-:CUSTOM_ID: ivy--regex-ignore-order
-:END:
-
-=ivy--regex-ignore-order= ignores the order of regexp tokens when
-searching for matching candidates. For instance, the input
-="for example"= will match ="example test for"=.
-
-** ivy--regex-fuzzy
-:PROPERTIES:
-:CUSTOM_ID: ivy--regex-fuzzy
-:END:
-
-=ivy--regex-fuzzy= splits each character with a wild card. Searching
-for ="for"= returns all ="f.*o.*r"= matches, resulting in a large
-number of hits. Yet some searches need these extra hits. Ivy sorts
-such large lists using =flx= package's scoring mechanism, if it's
-installed.
-
-~C-o m~ toggles the current regexp builder.
-
-* Customization
-:PROPERTIES:
-:CUSTOM_ID: customization
-:END:
-** Faces
-:PROPERTIES:
-:CUSTOM_ID: faces
-:END:
-- =ivy-current-match= ::
- Highlights the currently selected candidate.
-- =ivy-minibuffer-match-face-1= ::
- Highlights the background of the match.
-- =ivy-minibuffer-match-face-2= ::
- Highlights the first (modulo 3) matched group.
-- =ivy-minibuffer-match-face-3= ::
- Highlights the second (modulo 3) matched group.
-- =ivy-minibuffer-match-face-4= ::
- Highlights the third (modulo 3) matched group.
-- =ivy-confirm-face= ::
- Highlights the "(confirm)" part of the prompt.
-
- When =confirm-nonexistent-file-or-buffer= set to =t=, then
- confirming non-existent files in =ivy-mode= requires an
- additional ~RET~.
-
- The confirmation prompt will use this face.
-
- For example:
-
- #+begin_src elisp
- (setq confirm-nonexistent-file-or-buffer t)
- #+end_src
-
- Then call =find-file=, enter "eldorado" and press ~RET~ - the
- prompt will be appended with "(confirm)". Press ~RET~ once more
- to confirm, or any key to continue the completion.
-- =ivy-match-required-face= ::
- Highlights the "(match required)" part of the prompt.
-
- When completions have to match available candidates and cannot
- take random input, the "(match required)" prompt signals this
- constraint.
-
- For example, call =describe-variable=, enter "waldo" and press
- ~RET~ - "(match required)" is prompted.
- Press any key for the prompt to disappear.
-- =ivy-subdir= ::
- Highlights directories when completing file names.
-- =ivy-remote= ::
- Highlights remote files when completing file names.
-- =ivy-virtual= ::
- Highlights virtual buffers when completing buffer names.
-
- Virtual buffers correspond to bookmarks and recent files list,
- =recentf=.
-
- Enable virtual buffers with:
-
- #+begin_src elisp
- (setq ivy-use-virtual-buffers t)
- #+end_src
-
-- =ivy-modified-buffer= ::
- Highlights modified buffers when switching buffer.
-- =ivy-modified-outside-buffer= ::
- Highlights buffers modified outside Emacs when switching buffer.
-
- This takes precedence over =ivy-modified-buffer=.
-
-** Defcustoms
-:PROPERTIES:
-:CUSTOM_ID: defcustoms
-:END:
-- User Option =ivy-count-format= ::
- A string that specifies display of number of candidates and
- current candidate, if one exists.
-
- The number of matching candidates by default is shown as a right-
- padded integer value.
-
- To disable showing the number of candidates:
-
- #+begin_src elisp
- (setq ivy-count-format "")
- #+end_src
-
- To also display the current candidate:
-
- #+begin_src elisp
- (setq ivy-count-format "(%d/%d) ")
- #+end_src
-
- The =format=-style switches this variable uses are described
- in the =format= documentation.
-
-- User Option =ivy-display-style= ::
- Specifies highlighting candidates in the minibuffer.
-
- The default setting is ='fancy= in Emacs versions 24.4 or newer.
-
- Set =ivy-display-style= to =nil= for a plain minibuffer.
-
-- User Option =ivy-on-del-error-function= ::
- Specifies what to do when ~DEL~ (=ivy-backward-delete-char=) fails.
-
- This is usually the case when there is no text left to delete,
- i.e., when ~DEL~ is typed at the beginning of the minibuffer.
-
- The default behavior is to quit the completion after ~DEL~ -- a
- handy key to invoke after mistakenly triggering a completion.
-
-** Actions
-:PROPERTIES:
-:CUSTOM_ID: actions
-:END:
-*** What are actions?
-:PROPERTIES:
-:CUSTOM_ID: what-are-actions
-:END:
-An action is a function that is called after you select a candidate
-during completion. This function takes a single string argument, which
-is the selected candidate.
-
-- Window context when calling an action ::
- Currently, the action is executed in the minibuffer window
- context. This means e.g. that if you call =insert= the text will
- be inserted into the minibuffer.
-
- If you want to execute the action in the initial window from
- which the completion started, use the =with-ivy-window= wrapper
- macro.
-
- #+begin_src elisp
- (defun ivy-insert-action (x)
- (with-ivy-window
- (insert x)))
- #+end_src
-
-*** How can different actions be called?
-:PROPERTIES:
-:CUSTOM_ID: how-can-different-actions-be-called
-:END:
-- ~C-m~ (=ivy-done=) calls the current action.
-- ~M-o~ (=ivy-dispatching-done=) presents available actions for
- selection, calls it after selection, and then exits.
-- ~C-M-o~ (=ivy-dispatching-call=) presents available actions for
- selection, calls it after selection, and then does not exit.
-
-*** How to modify the actions list?
-:PROPERTIES:
-:CUSTOM_ID: how-to-modify-the-actions-list
-:END:
-Currently, you can append any amount of your own actions to the
-default list of actions. This can be done either for a specific
-command, or for all commands at once.
-
-Usually, the command has only one default action. The convention is to
-use single letters when selecting a command, and the letter ~o~ is
-designated for the default command. This way, ~M-o o~ should be always
-equivalent to ~C-m~.
-
-*** Example - add two actions to each command
-:PROPERTIES:
-:CUSTOM_ID: example---add-two-actions-to-each-command
-:END:
-The first action inserts the current candidate into the Ivy window -
-the window from which =ivy-read= was called.
-
-The second action copies the current candidate to the kill ring.
-
-#+begin_src elisp
-(defun ivy-yank-action (x)
- (kill-new x))
-
-(defun ivy-copy-to-buffer-action (x)
- (with-ivy-window
- (insert x)))
-
-(ivy-set-actions
- t
- '(("i" ivy-copy-to-buffer-action "insert")
- ("y" ivy-yank-action "yank")))
-#+end_src
-
-Then in any completion session, ~M-o y~ invokes =ivy-yank-action=, and
-~M-o i~ invokes =ivy-copy-to-buffer-action=.
-
-**** How to undo adding the two actions
-:PROPERTIES:
-:CUSTOM_ID: how-to-undo-adding-the-two-actions
-:END:
-Since =ivy-set-actions= modifies the internal dictionary with new
-data, set the extra actions list to =nil= by assigning =nil= value to
-the =t= key as follows:
-
-#+begin_src elisp
-(ivy-set-actions t nil)
-#+end_src
-
-**** How to add actions to a specific command
-:PROPERTIES:
-:CUSTOM_ID: how-to-add-actions-to-a-specific-command
-:END:
-Use the command name as the key:
-
-#+begin_src elisp
-(ivy-set-actions
- 'swiper
- '(("i" ivy-copy-to-buffer-action "insert")
- ("y" ivy-yank-action "yank")))
-#+end_src
-
-*** Example - define a new command with several actions
-:PROPERTIES:
-:CUSTOM_ID: example---define-a-new-command-with-several-actions
-:END:
-#+begin_src elisp
-(defun my-action-1 (x)
- (message "action-1: %s" x))
-
-(defun my-action-2 (x)
- (message "action-2: %s" x))
-
-(defun my-action-3 (x)
- (message "action-3: %s" x))
-
-(defun my-command-with-3-actions ()
- (interactive)
- (ivy-read "test: " '("foo" "bar" "baz")
- :action '(1
- ("o" my-action-1 "action 1")
- ("j" my-action-2 "action 2")
- ("k" my-action-3 "action 3"))))
-#+end_src
-
-The number 1 above is the index of the default action. Each
-action has its own string description for easy selection.
-
-**** Test the above function with =ivy-occur=
-:PROPERTIES:
-:CUSTOM_ID: test-the-above-function-with-ivy-occur
-:END:
-To examine each action with each candidate in a key-efficient way, try:
-
-- Call =my-command-with-3-actions=
-- Press ~C-c C-o~ to close the completion window and move to an
- ivy-occur buffer
-- Press ~kkk~ to move to the first candidate, since the point is most
- likely at the end of the buffer
-- Press ~oo~ to call the first action
-- Press ~oj~ and ~ok~ to call the second and the third actions
-- Press ~j~ to move to the next candidate
-- Press ~oo~, ~oj~, ~ok~
-- Press ~j~ to move to the next candidate
-- and so on...
-
-** Packages
-:PROPERTIES:
-:CUSTOM_ID: packages
-:END:
-- =org-mode= ::
- =org-mode= versions 8.3.3 or later obey
- =completing-read-function= (which =ivy-mode= sets). Try refiling
- headings with similar names to appreciate =ivy-mode=.
-- =magit= ::
- Uses ivy by default if Ivy is installed.
-- =find-file-in-project= ::
- Uses ivy by default if Ivy is installed.
-- =projectile= ::
- Projectile requires this setting for ivy completion:
-
- #+begin_src elisp
- (setq projectile-completion-system 'ivy)
- #+end_src
-- =helm-make= ::
- Helm-make requires this setting for ivy completion.
-
- #+begin_src elisp
- (setq helm-make-completion-method 'ivy)
- #+end_src
-
-- automatically integrated packages ::
- Ivy re-uses the following packages if they are installed:
- =avy=, =amx= or =smex=, =flx=, and =wgrep=.
-
-* Commands
-:PROPERTIES:
-:CUSTOM_ID: commands
-:END:
-** File Name Completion
-:PROPERTIES:
-:CUSTOM_ID: file-name-completion
-:END:
-Since file name completion is ubiquitous, Ivy provides extra
-bindings that work here:
-
-
-- ~C-j~ (=ivy-alt-done=) ::
- On a directory, restarts completion from that directory.
-
- On a file or =./=, exit completion with the selected candidate.
-- ~DEL~ (=ivy-backward-delete-char=) ::
- Restart the completion in the parent directory if current input
- is empty.
-- ~//~ (=self-insert-command=) ::
- Switch to the root directory.
-- ~~~ (=self-insert-command=) ::
- Switch to the home directory.
-- ~/~ (=self-insert-command=) ::
- If the current input matches an existing directory name exactly,
- switch the completion to that directory.
-- ~M-r~ (=ivy-toggle-regexp-quote=) ::
- Toggle between input as regexp or not.
-
- Switch to matching literally since file names include =.=, which
- is for matching any char in regexp mode.
-
-- User Option =ivy-extra-directories= ::
- Decide if you want to see =../= and =./= during file name
- completion.
-
- Reason to remove: =../= is the same as ~DEL~.
-
- Reason not to remove: navigate anywhere with only ~C-n~, ~C-p~
- and ~C-j~.
-
- Likewise, =./= can be removed.
-
-- History ::
- File history works the same with ~M-p~, ~M-n~, and ~C-r~, but
- uses a custom code for file name completion that cycles through
- files previously opened. It also works with TRAMP files.
-
-*** Using TRAMP
-:PROPERTIES:
-:CUSTOM_ID: using-tramp
-:END:
-- ~~~ (tilde) ::
- Move to the home directory. Either the local or the remote one, depending
on the
- current directory. The boolean option =ivy-magic-tilde= decides whether
the binding to
- do this is ~~~ or ~~/~.
-
-- ~//~ (double slash) ::
- Move to the root directory. Either the local or the remote one, depending
on the
- current directory. Here, you can also select a TRAMP connection method,
such as =ssh=
- or =scpx=.
-
-- ~/ C-j~ ::
- Move the the local root directory.
-
-- ~~~~ ::
- Move to the local home directory.
-
-
-From any directory, with the empty input, inputting =/ssh:= and pressing
-~C-j~ (or ~RET~, which is the same thing) completes for host and user
-names.
-
-For =/ssh:user@= input, completes the domain name.
-
-~C-i~ works in a similar way to the default completion.
-
-You can also get sudo access for the current directory by inputting
-=/sudo::= ~RET~. Using =/sudo:= (i.e. single colon instead of double) will
-result in a completion session for the desired user.
-
-Multi-hopping is possible, although a bit complex.
-
-- Example : connect to a remote host =cloud= and open a file with =sudo= there
::
- - ~C-x C-f~ =/ssh:cloud|sudo:root:/=.
-
-** Buffer Name Completion
-:PROPERTIES:
-:CUSTOM_ID: buffer-name-completion
-:END:
-- User Option =ivy-use-virtual-buffers= ::
- When non-nil, add =recentf-mode= and bookmarks to
- =ivy-switch-buffer= completion candidates.
-
- Adding this to Emacs init file:
-
- #+begin_src elisp
- (setq ivy-use-virtual-buffers t)
- #+end_src
- will add additional virtual buffers to the buffers list for recent
- files. Selecting such virtual buffers, which are highlighted with
- =ivy-virtual= face, will open the corresponding file.
-
-** Counsel commands
-:PROPERTIES:
-:CUSTOM_ID: counsel-commands
-:END:
-The main advantages of =counsel-= functions over their basic
-equivalents in =ivy-mode= are:
-
-1. Multi-actions and non-exiting actions work.
-2. =ivy-resume= can resume the last completion session.
-3. Customize =ivy-set-actions=, =ivy-re-builders-alist=.
-4. Customize individual keymaps, such as =counsel-describe-map=,
- =counsel-git-grep-map=, or =counsel-find-file-map=, instead of
- customizing =ivy-minibuffer-map= that applies to all completion
- sessions.
-* API
-:PROPERTIES:
-:CUSTOM_ID: api
-:END:
-The main (and only) entry point is the =ivy-read= function. It takes
-two required arguments and many optional arguments that can be passed
-by a key. The optional =:action= argument is highly recommended for
-features such as multi-actions, non-exiting actions, =ivy-occur= and
-=ivy-resume=.
-
-** Required arguments for =ivy-read=
-:PROPERTIES:
-:CUSTOM_ID: required-arguments-for-ivy-read
-:END:
-- =prompt= ::
- A prompt string normally ending in a colon and a space.
- =ivy-count-format= is prepended to it during completion.
-
-- =collection= ::
- Either a list of strings, a function, an alist or a hash table.
-
- If a function, then it has to be compatible with
- =all-completions=.
-
-** Optional arguments for =ivy-read=
-:PROPERTIES:
-:CUSTOM_ID: optional-arguments-for-ivy-read
-:END:
-- =predicate= ::
- Is a function to filter the initial collection. It has to be
- compatible with =all-completions=. Tip: most of the time, it's
- simpler to just apply this filter to the =collection= argument
- itself, e.g. =(cl-remove-if-not predicate collection)=.
-- =require-match= ::
- When set to a non-nil value, input must match one of the
- candidates. Custom input is not accepted.
-- =initial-input= ::
- This string argument is included for compatibility with
- =completing-read=, which inserts it into the minibuffer.
-
- It's recommended to use the =preselect= argument instead of this.
-- =history= ::
- Name of the symbol to store history. See =completing-read=.
-- =preselect= ::
- Determines which one of the candidates to initially select.
-
- When set to an integer value, select the candidate with that
- index value.
-
- When set to any other non-nil value, select the first candidate
- matching this value. Comparison is first done with =equal=.
- If this fails, and when applicable, match =preselect= as a
- regular expression.
-
- Every time the input becomes empty, the item corresponding to
- =preselect= is selected.
-- =keymap= ::
- A keymap to be composed with =ivy-minibuffer-map=. This keymap
- has priority over =ivy-minibuffer-map= and can be modified at any
- later stage.
-- =update-fn= ::
- Is the function called each time the current candidate changes.
- This function takes no arguments and is called in the
- minibuffer's =post-command-hook=. See =swiper= for an example
- usage.
-- =sort= ::
- When non-nil, use =ivy-sort-functions-alist= to sort the
- collection as long as the collection is not larger than
- =ivy-sort-max-size=.
-- =action= ::
- Is the function to call after selection. It takes a string
- argument.
-- =unwind= ::
- Is the function to call before exiting completion. It takes no
- arguments. This function is called even if the completion is
- interrupted with ~C-g~. See =swiper= for an example usage.
-- =re-builder= ::
- Is a function that takes a string and returns a valid regex. See
- =Completion Styles= for details.
-- =matcher= ::
- Is a function that takes a regex string and a list of strings and
- returns a list of strings matching the regex. Any ordinary Emacs
- matching function will suffice, yet finely tuned matching
- functions can be used. See =counsel-find-file= for an example
- usage.
-- =dynamic-collection= ::
- When non-nil, =collection= will be used to dynamically generate
- the candidates each time the input changes, instead of being used
- once statically with =all-completions= to generate a list of
- strings. See =counsel-locate= for an example usage.
-- =caller= ::
- Is a symbol that uniquely identifies the function that called
- =ivy-read=, which may be useful for further customizations.
-** Example - =counsel-describe-function=
-:PROPERTIES:
-:CUSTOM_ID: example---counsel-describe-function
-:END:
-This is a typical example of a function with a non-async collection,
-which is a collection where all the strings in the collection are
-known prior to any input from the user.
-
-Only the first two arguments (along with =action=) are essential - the
-rest of the arguments are for fine-tuning, and could be omitted.
-
-The =action= argument could also be omitted - but then =ivy-read=
-would do nothing except returning the string result, which you could
-later use yourself. However, it's recommended that you use the
-=action= argument.
-
-#+begin_src elisp
-(defun counsel-describe-function ()
- "Forward to `describe-function'."
- (interactive)
- (ivy-read "Describe function: "
- (let (cands)
- (mapatoms
- (lambda (x)
- (when (fboundp x)
- (push (symbol-name x) cands))))
- cands)
- :keymap counsel-describe-map
- :preselect (ivy-thing-at-point)
- :history 'counsel-describe-symbol-history
- :require-match t
- :action (lambda (x)
- (describe-function
- (intern x)))
- :caller 'counsel-describe-function))
-#+end_src
-
-Here are the interesting features of the above function, in the order that
they appear:
-
-- The =prompt= argument is a simple string ending in ": ".
-- The =collection= argument evaluates to a (large) list of strings.
-- The =keymap= argument is for a custom keymap to supplement
=ivy-minibuffer-map=.
-- The =preselect= is provided by =ivy-thing-at-point=, which
- returns a symbol near the point. Ivy then selects the first
- candidate from the collection that matches this symbol. To select
- this pre-selected candidate, a ~RET~ will suffice. No further user
- input is necessary.
-- The =history= argument is for keeping the history of this command
- separate from the common history in =ivy-history=.
-- The =require-match= is set to =t= since it doesn't make sense to
- call =describe-function= on an un-interned symbol.
-- The =action= argument calls =describe-function= on the interned
- selected candidate.
-- The =caller= argument identifies this completion session. This is
- important, since with the collection being a list of strings and not
- a function name, the only other way for =ivy-read= to identify
- "who's calling" and to apply the appropriate customizations is to
- examine =this-command=. But =this-command= would be modified if
- another command called =counsel-describe-function=.
-** Example - =counsel-locate=
-:PROPERTIES:
-:CUSTOM_ID: example---counsel-locate
-:END:
-This is a typical example of a function with an async collection.
-Since the collection function cannot pre-compute all the locatable
-files in memory within reasonable limits (time or memory), it relies
-on user input to filter the universe of possible candidates to a
-manageable size while also continuing to search asynchronously for
-possible candidates. Both the filtering and searching continues with
-each character change of the input with rapid updates to the
-collection presented without idle waiting times. This live update will
-continue as long as there are likely candidates. Eventually updates to
-the minibuffer will stop after user input, filtering, and searching
-have exhausted looking for possible candidates.
-
-Async collections suit long-running shell commands, such as =locate=.
-With each new input, a new process starts while the old process is
-killed. The collection is refreshed anew with each new process.
-Meanwhile the user can provide more input characters (for further
-narrowing) or select a candidate from the visible collection.
-
-#+begin_src elisp
-(defun counsel-locate-function (str)
- (or
- (ivy-more-chars)
- (progn
- (counsel--async-command
- (format "locate %s '%s'"
- (mapconcat #'identity counsel-locate-options " ")
- (counsel--elisp-to-pcre
- (ivy--regex str))))
- '("" "working..."))))
-
-;;;###autoload
-(defun counsel-locate (&optional initial-input)
- "Call the \"locate\" shell command.
-INITIAL-INPUT can be given as the initial minibuffer input."
- (interactive)
- (ivy-read "Locate: " #'counsel-locate-function
- :initial-input initial-input
- :dynamic-collection t
- :history 'counsel-locate-history
- :action (lambda (file)
- (with-ivy-window
- (when file
- (find-file file))))
- :unwind #'counsel-delete-process
- :caller 'counsel-locate))
-#+end_src
-
-Here are the interesting features of the above functions, in the order
-that they appear:
-
-- =counsel-locate-function= takes a string argument and returns a list
- of strings. Note that it's not compatible with =all-completions=,
- but since we're not using that here, might as well use one argument
- instead of three.
-- =ivy-more-chars= is a simple function that returns e.g.
- ='("2 chars more")= asking the user for more input.
-- =counsel--async-command= is a very easy API simplification that
- takes a single string argument suitable for
- =shell-command-to-string=. So you could prototype your function as
- non-async using =shell-command-to-string= and =split-string= to
- produce a collection, then decide that you want async and simply swap in
- =counsel--async-command=.
-- =counsel-locate= is an interactive function with an optional =initial-input=.
-- =#'counsel-locate-function= is passed as the =collection= argument.
-- =dynamic-collection= is set to t, since this is an async collection.
-- =action= argument uses =with-ivy-window= wrapper, since we want to open the
- selected file in the same window from which =counsel-locate= was
- called.
-- =unwind= argument is set to =#'counsel-delete-process=: when we press ~C-g~
- we want to kill the running process created by
- =counsel--async-command=.
-- =caller= argument identifies this command for easier customization.
-** Example - =ivy-read-with-extra-properties=
-:PROPERTIES:
-:CUSTOM_ID: example---ivy-read-with-extra-properties
-:END:
-This is another example to show how to associate additional values to each
-displayed strings.
-
-#+BEGIN_SRC elisp
-(defun find-candidates-function (str pred _)
- (let ((props '(1 2))
- (strs '("foo" "foo2")))
- (cl-mapcar (lambda (s p) (propertize s 'property p))
- strs
- props)))
-
-(defun find-candidates ()
- (interactive)
- (ivy-read "Find symbols: "
- #'find-candidates-function
- :action (lambda (x)
- (message "Value: %s" (get-text-property 0 'property x)
- ))))
-#+END_SRC
-
-Here are the interesting features of the above function:
-
-- =find-candidates-function= builds up a list of strings and associates "foo"
with
- the value 1 and "foo2" with 2.
-- =find-candidates= is an interactive function.
-- =#'find-candidates= is passed as the =collection= argument.
-- =action= gets passed the selected string with the associated value. It
- then retrieves that value and displays it.
-
-* Variable Index
-:PROPERTIES:
-:INDEX: vr
-:CUSTOM_ID: variable-index
-:END:
-
-* Keystroke Index
-:PROPERTIES:
-:CUSTOM_ID: key-index
-:INDEX: ky
-:END:
diff --git a/doc/ivy.texi b/doc/ivy.texi
deleted file mode 100644
index 1b4a3b9..0000000
--- a/doc/ivy.texi
+++ /dev/null
@@ -1,1813 +0,0 @@
-\input texinfo @c -*- texinfo -*-
-@c %**start of header
-@setfilename ivy.info
-@settitle Ivy User Manual
-@documentencoding UTF-8
-@documentlanguage en
-@c %**end of header
-
-@copying
-@ifnottex
-Ivy manual, version 0.12.0
-
-Ivy is an interactive interface for completion in Emacs. Emacs uses
-completion mechanism in a variety of contexts: code, menus, commands,
-variables, functions, etc. Completion entails listing, sorting,
-filtering, previewing, and applying actions on selected items. When
-active, @code{ivy-mode} completes the selection process by narrowing
-available choices while previewing in the minibuffer. Selecting the
-final candidate is either through simple keyboard character inputs or
-through powerful regular expressions.
-@end ifnottex
-
-Copyright (C) 2015-2019 Free Software Foundation, Inc.
-
-@quotation
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3
-or any later version published by the Free Software Foundation;
-with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
-A copy of the license is included in the section entitled "GNU
-Free Documentation License".
-@end quotation
-@end copying
-
-@dircategory Emacs
-@direntry
-* Ivy: (ivy). Using Ivy for completion.
-@end direntry
-
-@finalout
-@titlepage
-@title Ivy User Manual
-@author Oleh Krehel
-@page
-@vskip 0pt plus 1filll
-@insertcopying
-@end titlepage
-
-@contents
-
-@ifnottex
-@node Top
-@top Ivy User Manual
-@end ifnottex
-
-@menu
-* Introduction::
-* Installation::
-* Getting started::
-* Key bindings::
-* Completion Styles::
-* Customization::
-* Commands::
-* API::
-* Variable Index::
-* Keystroke Index::
-
-@detailmenu
---- The Detailed Node Listing ---
-
-Installation
-
-* Installing from Emacs Package Manager::
-* Installing from the Git repository::
-
-Getting started
-
-* Basic customization::
-
-Key bindings
-
-* Global key bindings::
-* Minibuffer key bindings::
-
-Minibuffer key bindings
-
-* Key bindings for navigation::
-* Key bindings for single selection, action, then exit minibuffer: Key
bindings for single selection action then exit minibuffer.
-* Key bindings for multiple selections and actions, keep minibuffer open: Key
bindings for multiple selections and actions keep minibuffer open.
-* Key bindings that alter the minibuffer input::
-* Other key bindings::
-* Hydra in the minibuffer::
-* Saving the current completion session to a buffer::
-
-Completion Styles
-
-* ivy--regex-plus::
-* ivy--regex-ignore-order::
-* ivy--regex-fuzzy::
-
-Customization
-
-* Faces::
-* Defcustoms::
-* Actions::
-* Packages::
-
-Actions
-
-* What are actions?::
-* How can different actions be called?::
-* How to modify the actions list?::
-* Example - add two actions to each command::
-* Example - define a new command with several actions::
-
-Example - add two actions to each command
-
-* How to undo adding the two actions::
-* How to add actions to a specific command::
-
-Example - define a new command with several actions
-
-* Test the above function with @code{ivy-occur}::
-
-Commands
-
-* File Name Completion::
-* Buffer Name Completion::
-* Counsel commands::
-
-File Name Completion
-
-* Using TRAMP::
-
-API
-
-* Required arguments for @code{ivy-read}::
-* Optional arguments for @code{ivy-read}::
-* Example - @code{counsel-describe-function}::
-* Example - @code{counsel-locate}::
-* Example - @code{ivy-read-with-extra-properties}::
-
-@end detailmenu
-@end menu
-
-@node Introduction
-@chapter Introduction
-
-Ivy is for quick and easy selection from a list. When Emacs prompts
-for a string from a list of several possible choices, Ivy springs into
-action to assist in narrowing and picking the right string from a vast
-number of choices.
-
-Ivy strives for minimalism, simplicity, customizability and
-discoverability.
-
-@subsubheading Minimalism
-@indentedblock
-Uncluttered minibuffer is minimalism. Ivy shows the completion
-defaults, the number of matches, and 10 candidate matches below
-the input line. Customize @code{ivy-height} to adjust the number of
-candidate matches displayed in the minibuffer.
-@end indentedblock
-@subsubheading Simplicity
-@indentedblock
-Simplicity is about Ivy's behavior in the minibuffer. It is also
-about the code interface to extend Ivy's functionality. The
-minibuffer area behaves as close to @code{fundamental-mode} as
-possible. @kbd{SPC} inserts a space, for example, instead of being
-bound to the more complex @code{minibuffer-complete-word}. Ivy's code
-uses easy-to-examine global variables; avoids needless
-complications with branch-introducing custom macros.
-@end indentedblock
-@subsubheading Customizability
-@indentedblock
-Customizability is about being able to use different methods and
-interfaces of completion to tailor the selection process. For
-example, adding a custom display function that points to a
-selected candidate with @code{>}, instead of highlighting the selected
-candidate with the @code{ivy-current-match} face (see
-@code{ivy-format-functions-alist}). Or take the customization of actions, say
-after the candidate function is selected. @kbd{RET} uses
-@code{counsel-describe-function} to describe the function, whereas
-@kbd{M-o d} jumps to that function's definition in the code. The
-@kbd{M-o} prefix can be uniformly used with characters like @kbd{d} to
-group similar actions.
-@end indentedblock
-@subsubheading Discoverability
-@indentedblock
-Ivy displays easily discoverable commands through the hydra
-facility. @kbd{C-o} in the minibuffer displays a hydra menu. It
-opens up within an expanded minibuffer area. Each menu item comes
-with short documentation strings and highlighted one-key
-completions. So discovering even seldom used keys is simply a
-matter of @kbd{C-o} in the minibuffer while in the midst of the Ivy
-interaction. This discoverability minimizes exiting Ivy interface
-for documentation look-ups.
-@end indentedblock
-
-@node Installation
-@chapter Installation
-
-Install Ivy automatically through Emacs's package manager, or manually
-from Ivy's development repository.
-
-Emacs 24.3 is the oldest version to run Ivy. Emacs 24.4 is the oldest
-version that runs Ivy with fancy faces display.
-
-@menu
-* Installing from Emacs Package Manager::
-* Installing from the Git repository::
-@end menu
-
-@node Installing from Emacs Package Manager
-@section Installing from Emacs Package Manager
-
-@kbd{M-x} @code{package-install} @kbd{RET} @code{ivy} @kbd{RET}
-
-Ivy is installed as part of @code{ivy} package, which is available from two
-different package archives, GNU ELPA and MELPA. For the latest stable
-version, use the GNU ELPA archives using the above M-x command.
-
-For current hourly builds, use the MELPA archives. In MELPA, Ivy is
-split into three packages: @code{ivy}, @code{swiper} and @code{counsel}; you
can simply
-install @code{counsel} which will bring in the other two as dependencies.
-See the code below for adding MELPA to the list of package archives:
-
-@lisp
-(require 'package)
-(add-to-list 'package-archives
- '("melpa" . "https://melpa.org/packages/"))
-@end lisp
-
-After this do @kbd{M-x} @code{package-refresh-contents} @kbd{RET}, followed by
@kbd{M-x}
-@code{package-install} @kbd{RET} @code{counsel} @kbd{RET}.
-
-For package manager details, see @ref{Packages,,,emacs,}.
-
-@node Installing from the Git repository
-@section Installing from the Git repository
-
-@subsubheading Why install from Git?
-@indentedblock
-@itemize
-@item
-No need to wait for MELPA's hourly builds
-@item
-Easy to revert to previous versions
-@item
-Contribute to Ivy's development; send patches; pull requests
-@end itemize
-@end indentedblock
-
-
-@subsubheading Configuration steps
-@indentedblock
-First clone the Swiper repository with:
-
-@example
-cd ~/git && git clone https://github.com/abo-abo/swiper
-cd swiper && make compile
-@end example
-
-Second, add these lines to the Emacs init file:
-
-@lisp
-(add-to-list 'load-path "~/git/swiper/")
-(require 'ivy)
-@end lisp
-
-Then, update the code with:
-
-@example
-git pull
-make
-@end example
-@end indentedblock
-
-@node Getting started
-@chapter Getting started
-
-First enable Ivy completion everywhere:
-
-@lisp
-(ivy-mode 1)
-@end lisp
-
-Note: @code{ivy-mode} can be toggled on and off with @kbd{M-x} @code{ivy-mode}.
-
-@menu
-* Basic customization::
-@end menu
-
-@node Basic customization
-@section Basic customization
-
-Here are some basic settings particularly useful for new Ivy users:
-
-@lisp
-(setq ivy-use-virtual-buffers t)
-(setq ivy-count-format "(%d/%d) ")
-@end lisp
-
-If you want, you can go without any customizations at all. The above
-settings are the most bang for the buck in terms of customization. So
-users that typically don't like customize a lot are advised to look at
-these settings first.
-
-For more advanced customizations, refer to @code{M-x describe-variable}
-documentation.
-
-@node Key bindings
-@chapter Key bindings
-
-@menu
-* Global key bindings::
-* Minibuffer key bindings::
-@end menu
-
-@node Global key bindings
-@section Global key bindings
-
-Here is a list of commands that are useful to be bound globally, along
-with some sample bindings:
-
-@subsubheading Ivy-based interface to standard commands
-@indentedblock
-@lisp
-(global-set-key (kbd "C-s") 'swiper-isearch)
-(global-set-key (kbd "M-x") 'counsel-M-x)
-(global-set-key (kbd "C-x C-f") 'counsel-find-file)
-(global-set-key (kbd "M-y") 'counsel-yank-pop)
-(global-set-key (kbd "<f1> f") 'counsel-describe-function)
-(global-set-key (kbd "<f1> v") 'counsel-describe-variable)
-(global-set-key (kbd "<f1> l") 'counsel-find-library)
-(global-set-key (kbd "<f2> i") 'counsel-info-lookup-symbol)
-(global-set-key (kbd "<f2> u") 'counsel-unicode-char)
-(global-set-key (kbd "<f2> j") 'counsel-set-variable)
-(global-set-key (kbd "C-x b") 'ivy-switch-buffer)
-(global-set-key (kbd "C-c v") 'ivy-push-view)
-(global-set-key (kbd "C-c V") 'ivy-pop-view)
-@end lisp
-@end indentedblock
-@subsubheading Ivy-based interface to shell and system tools
-@indentedblock
-@lisp
-(global-set-key (kbd "C-c c") 'counsel-compile)
-(global-set-key (kbd "C-c g") 'counsel-git)
-(global-set-key (kbd "C-c j") 'counsel-git-grep)
-(global-set-key (kbd "C-c L") 'counsel-git-log)
-(global-set-key (kbd "C-c k") 'counsel-rg)
-(global-set-key (kbd "C-c m") 'counsel-linux-app)
-(global-set-key (kbd "C-c n") 'counsel-fzf)
-(global-set-key (kbd "C-x l") 'counsel-locate)
-(global-set-key (kbd "C-c J") 'counsel-file-jump)
-(global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
-(global-set-key (kbd "C-c w") 'counsel-wmctrl)
-@end lisp
-@end indentedblock
-@subsubheading Ivy-resume and other commands
-@indentedblock
-@code{ivy-resume} resumes the last Ivy-based completion.
-
-@lisp
-(global-set-key (kbd "C-c C-r") 'ivy-resume)
-(global-set-key (kbd "C-c b") 'counsel-bookmark)
-(global-set-key (kbd "C-c d") 'counsel-descbinds)
-(global-set-key (kbd "C-c g") 'counsel-git)
-(global-set-key (kbd "C-c o") 'counsel-outline)
-(global-set-key (kbd "C-c t") 'counsel-load-theme)
-(global-set-key (kbd "C-c F") 'counsel-org-file)
-@end lisp
-@end indentedblock
-
-You can also enable @code{counsel-mode} to make some global key binding
remapping for you.
-
-@node Minibuffer key bindings
-@section Minibuffer key bindings
-
-@vindex ivy-minibuffer-map
-Ivy includes several minibuffer bindings, which are defined in the
-@code{ivy-minibuffer-map} keymap variable. The most frequently used ones
-are described here.
-
-@code{swiper} or @code{counsel-M-x} add more key bindings through the
@code{keymap}
-argument to @code{ivy-read}. These keys, also active in the minibuffer, are
-described under their respective commands.
-
-A key feature of @code{ivy-minibuffer-map} is its full editing capability
-where the familiar @kbd{C-a}, @kbd{C-f}, @kbd{M-d}, @kbd{M-DEL}, @kbd{M-b},
@kbd{M-w}, @kbd{C-k},
-@kbd{C-y} key bindings work the same as in @code{fundamental-mode}.
-
-@menu
-* Key bindings for navigation::
-* Key bindings for single selection, action, then exit minibuffer: Key
bindings for single selection action then exit minibuffer.
-* Key bindings for multiple selections and actions, keep minibuffer open: Key
bindings for multiple selections and actions keep minibuffer open.
-* Key bindings that alter the minibuffer input::
-* Other key bindings::
-* Hydra in the minibuffer::
-* Saving the current completion session to a buffer::
-@end menu
-
-@node Key bindings for navigation
-@subsection Key bindings for navigation
-
-@itemize
-@item
-@kbd{C-n} (@code{ivy-next-line}) selects the next candidate
-@item
-@kbd{C-p} (@code{ivy-previous-line}) selects the previous candidate
-@item
-@kbd{M-<} (@code{ivy-beginning-of-buffer}) selects the first candidate
-@item
-@kbd{M->} (@code{ivy-end-of-buffer}) selects the last candidate
-@item
-@kbd{C-v} (@code{ivy-scroll-up-command}) scrolls up by @code{ivy-height} lines
-@item
-@kbd{M-v} (@code{ivy-scroll-down-command}) scrolls down by @code{ivy-height}
lines
-@end itemize
-
-
-@defopt ivy-wrap
-Specifies the wrap-around behavior for @kbd{C-n} and @kbd{C-p}. When
-@code{ivy-wrap} is set to @code{t}, @code{ivy-next-line} and
@code{ivy-previous-line}
-will cycle past the last and the first candidates respectively.
-
-Wrap-around behavior is off by default.
-@end defopt
-
-@defopt ivy-height
-Use this option to adjust the minibuffer height, which also
-affects scroll size when using @kbd{C-v} and @kbd{M-v} key bindings.
-
-@code{ivy-height} is 10 lines by default.
-@end defopt
-
-@node Key bindings for single selection action then exit minibuffer
-@subsection Key bindings for single selection, action, then exit minibuffer
-
-Ivy can offer several actions from which to choose which action to
-run. This "calling an action" operates on the selected candidate. For
-example, when viewing a list of files, one action could open it for
-editing, one to view it, another to invoke a special function, and so
-on. Custom actions can be added to this interface. The precise action
-to call on the selected candidate can be delayed until after the
-narrowing is completed. No need to exit the interface if unsure which
-action to run. This delayed flexibility and customization of actions
-extends usability of lists in Emacs.
-
-@subsubheading @kbd{C-m} or @kbd{RET} (@code{ivy-done})
-@vindex ivy-done
-@kindex C-m
-@kindex RET
-@indentedblock
-Calls the default action and then exits the minibuffer.
-@end indentedblock
-@subsubheading @kbd{M-o} (@code{ivy-dispatching-done})
-@vindex ivy-dispatching-done
-@kindex M-o
-@indentedblock
-Presents valid actions from which to choose. When only one action
-is available, there is no difference between @kbd{M-o} and @kbd{C-m}.
-@end indentedblock
-@subsubheading @kbd{C-j} (@code{ivy-alt-done})
-@vindex ivy-alt-done
-@kindex C-j
-@indentedblock
-When completing file names, selects the current directory
-candidate and starts a new completion session there. Otherwise,
-it is the same as @code{ivy-done}.
-@end indentedblock
-@subsubheading @kbd{TAB} (@code{ivy-partial-or-done})
-@vindex ivy-partial-or-done
-@kindex TAB
-@indentedblock
-Attempts partial completion, extending current input as much as
-possible. @kbd{TAB TAB} is the same as @kbd{C-j} (@code{ivy-alt-done}).
-
-Example ERT test:
-
-@lisp
-(should
- (equal (ivy-with
- '(progn
- (ivy-read "Test: " '("can do" "can't, sorry" "other"))
- ivy-text)
- "c <tab>")
- "can"))
-@end lisp
-@end indentedblock
-@subsubheading @kbd{C-M-j} (@code{ivy-immediate-done})
-@vindex ivy-immediate-done
-@kindex C-M-j
-@indentedblock
-Exits with @emph{the current input} instead of @emph{the current candidate}
-(like other commands).
-
-This is useful e.g. when you call @code{find-file} to create a new
-file, but the desired name matches an existing file. In that
-case, using @kbd{C-j} would select that existing file, which isn't
-what you want - use this command instead.
-@end indentedblock
-@subsubheading @kbd{C-'} (@code{ivy-avy})
-@vindex ivy-avy
-@kindex C-'
-@indentedblock
-Uses avy to select one of the candidates on the current candidate
-page. This can often be faster than multiple @kbd{C-n} or @kbd{C-p}
-keystrokes followed by @kbd{C-m}.
-@end indentedblock
-
-@node Key bindings for multiple selections and actions keep minibuffer open
-@subsection Key bindings for multiple selections and actions, keep minibuffer
open
-
-For repeatedly applying multiple actions or acting on multiple
-candidates, Ivy does not close the minibuffer between commands. It
-keeps the minibuffer open for applying subsequent actions.
-
-Adding an extra meta key to the normal key chord invokes the special
-version of the regular commands that enables applying multiple
-actions.
-
-@subsubheading @kbd{C-M-m} (@code{ivy-call})
-@vindex ivy-call
-@kindex C-M-m
-@indentedblock
-Is the non-exiting version of @kbd{C-m} (@code{ivy-done}).
-
-Instead of closing the minibuffer, @kbd{C-M-m} allows selecting
-another candidate or another action. For example, @kbd{C-M-m} on
-functions list invokes @code{describe-function}. When combined with
-@kbd{C-n}, function descriptions can be invoked quickly in
-succession.
-@end indentedblock
-@subsubheading @kbd{C-M-o} (@code{ivy-dispatching-call})
-@vindex ivy-dispatching-call
-@kindex C-M-o
-@indentedblock
-Is the non-exiting version of @kbd{M-o} (@code{ivy-dispatching-done}).
-
-For example, during the @code{counsel-rhythmbox} completion, press
-@kbd{C-M-o e} to en-queue the selected candidate, followed by @kbd{C-n
- C-m} to play the next candidate - the current action reverts to
-the default one after @kbd{C-M-o}.
-@end indentedblock
-@subsubheading @kbd{C-M-n} (@code{ivy-next-line-and-call})
-@vindex ivy-next-line-and-call
-@kindex C-M-n
-@indentedblock
-Combines @kbd{C-n} and @kbd{C-M-m}. Moves to next line and applies an action.
-
-Comes in handy when opening multiple files from
-@code{counsel-find-file}, @code{counsel-git-grep}, @code{counsel-ag},
@code{counsel-rg}, or
-@code{counsel-locate} lists. Just hold @kbd{C-M-n} for rapid-fire default
-action on each successive element of the list.
-@end indentedblock
-@subsubheading @kbd{C-M-p} (@code{ivy-previous-line-and-call})
-@vindex ivy-previous-line-and-call
-@kindex C-M-p
-@indentedblock
-Combines @kbd{C-p} and @kbd{C-M-m}.
-
-Similar to the above except it moves through the list in the
-other direction.
-@end indentedblock
-@subsubheading @code{ivy-resume}
-@vindex ivy-resume
-@indentedblock
-Recalls the state of the completion session just before its last
-exit.
-
-Useful after an accidental @kbd{C-m} (@code{ivy-done}).
-@end indentedblock
-
-@node Key bindings that alter the minibuffer input
-@subsection Key bindings that alter the minibuffer input
-
-@subsubheading @kbd{M-n} (@code{ivy-next-history-element})
-@vindex ivy-next-history-element
-@kindex M-n
-@indentedblock
-Cycles forward through the Ivy command history.
-
-Ivy updates an internal history list after each action. When this
-history list is empty, @kbd{M-n} inserts symbol (or URL) at point
-into the minibuffer.
-@end indentedblock
-@subsubheading @kbd{M-p} (@code{ivy-previous-history-element})
-@vindex ivy-previous-history-element
-@kindex M-p
-@indentedblock
-Cycles forward through the Ivy command history.
-@end indentedblock
-@subsubheading @kbd{M-i} (@code{ivy-insert-current})
-@vindex ivy-insert-current
-@kindex M-i
-@indentedblock
-Inserts the current candidate into the minibuffer.
-
-Useful for copying and renaming files, for example: @kbd{M-i} to
-insert the original file name string, edit it, and then @kbd{C-m} to
-complete the renaming.
-@end indentedblock
-@subsubheading @kbd{M-j} (@code{ivy-yank-word})
-@vindex ivy-yank-word
-@kindex M-j
-@indentedblock
-Inserts the sub-word at point into the minibuffer.
-
-This is similar to @kbd{C-s C-w} with @code{isearch}. Ivy reserves @kbd{C-w}
-for @code{kill-region}. See also @code{ivy-yank-symbol} and
-@code{ivy-yank-char}.
-@end indentedblock
-@subsubheading @kbd{S-SPC} (@code{ivy-restrict-to-matches})
-@vindex ivy-restrict-to-matches
-@kindex S-SPC
-@indentedblock
-Deletes the current input, and resets the candidates list to the
-currently restricted matches.
-
-This is how Ivy provides narrowing in successive tiers.
-@end indentedblock
-@subsubheading @kbd{C-r} (@code{ivy-reverse-i-search})
-@vindex ivy-reverse-i-search
-@kindex C-r
-@indentedblock
-Starts a recursive completion session through the command's
-history.
-
-This works just like @kbd{C-r} at the bash command prompt, where the
-completion candidates are the history items. Upon completion, the
-selected candidate string is inserted into the minibuffer.
-@end indentedblock
-
-@node Other key bindings
-@subsection Other key bindings
-
-@subsubheading @kbd{M-w} (@code{ivy-kill-ring-save})
-@vindex ivy-kill-ring-save
-@kindex M-w
-@indentedblock
-Copies selected candidates to the kill ring.
-
-Copies the region if the region is active.
-@end indentedblock
-
-@node Hydra in the minibuffer
-@subsection Hydra in the minibuffer
-
-@subsubheading @kbd{C-o} (@code{hydra-ivy/body})
-@kindex C-o
-@indentedblock
-Invokes the hydra menu with short key bindings.
-@end indentedblock
-
-When Hydra is active, minibuffer editing is disabled and menus
-display short aliases:
-
-@multitable {aaaaa} {aaaaaaaaa} {aaaaaaaaaaaaaaaaaaaaaaaaa}
-@headitem Short
-@tab Normal
-@tab Command name
-@item @kbd{o}
-@tab @kbd{C-g}
-@tab @code{keyboard-escape-quit}
-@item @kbd{j}
-@tab @kbd{C-n}
-@tab @code{ivy-next-line}
-@item @kbd{k}
-@tab @kbd{C-p}
-@tab @code{ivy-previous-line}
-@item @kbd{h}
-@tab @kbd{M-<}
-@tab @code{ivy-beginning-of-buffer}
-@item @kbd{l}
-@tab @kbd{M->}
-@tab @code{ivy-end-of-buffer}
-@item @kbd{d}
-@tab @kbd{C-m}
-@tab @code{ivy-done}
-@item @kbd{f}
-@tab @kbd{C-j}
-@tab @code{ivy-alt-done}
-@item @kbd{g}
-@tab @kbd{C-M-m}
-@tab @code{ivy-call}
-@item @kbd{u}
-@tab @kbd{C-c C-o}
-@tab @code{ivy-occur}
-@end multitable
-
-Hydra reduces key strokes, for example: @kbd{C-n C-n C-n C-n} is @kbd{C-o
-jjjj} in Hydra.
-
-Hydra menu offers these additional bindings:
-
-@subsubheading @kbd{c} (@code{ivy-toggle-calling})
-@vindex ivy-toggle-calling
-@kindex c
-@indentedblock
-Toggle calling the action after each candidate change. It
-modifies @kbd{j} to @kbd{jg}, @kbd{k} to @kbd{kg} etc.
-@end indentedblock
-@subsubheading @kbd{m} (@code{ivy-rotate-preferred-builders})
-@vindex ivy-rotate-preferred-builders
-@kindex m
-@indentedblock
-Rotate the current regexp matcher.
-@end indentedblock
-@subsubheading @kbd{>} (@code{ivy-minibuffer-grow})
-@vindex ivy-minibuffer-grow
-@kindex >
-@indentedblock
-Increase @code{ivy-height} for the current minibuffer.
-@end indentedblock
-@subsubheading @kbd{<} (@code{ivy-minibuffer-shrink})
-@vindex ivy-minibuffer-shrink
-@kindex <
-@indentedblock
-Decrease @code{ivy-height} for the current minibuffer.
-@end indentedblock
-@subsubheading @kbd{w} (@code{ivy-prev-action})
-@vindex ivy-prev-action
-@kindex w
-@indentedblock
-Select the previous action.
-@end indentedblock
-@subsubheading @kbd{s} (@code{ivy-next-action})
-@vindex ivy-next-action
-@kindex s
-@indentedblock
-Select the next action.
-@end indentedblock
-@subsubheading @kbd{a} (@code{ivy-read-action})
-@vindex ivy-read-action
-@kindex a
-@indentedblock
-Use a menu to select an action.
-@end indentedblock
-@subsubheading @kbd{C} (@code{ivy-toggle-case-fold})
-@vindex ivy-toggle-case-fold
-@kindex C
-@indentedblock
-Toggle case folding (match both upper and lower case
-characters for lower case input).
-@end indentedblock
-
-Hydra menu also offers bindings for marking multiple candidates:
-
-@multitable {aaaaa} {aaaaaaaaaaaaaaaaaaaaa}
-@headitem Key
-@tab Command name
-@item @kbd{m}
-@tab @code{ivy-mark}
-@item @kbd{u}
-@tab @code{ivy-unmark}
-@item @kbd{DEL}
-@tab @code{ivy-unmark-backward}
-@item @kbd{t}
-@tab @code{ivy-toggle-marks}
-@end multitable
-
-The action is called on each marked candidate one by one.
-
-@node Saving the current completion session to a buffer
-@subsection Saving the current completion session to a buffer
-
-@subsubheading @kbd{C-c C-o} (@code{ivy-occur})
-@vindex ivy-occur
-@kindex C-c C-o
-@indentedblock
-Saves the current candidates to a new buffer and exits
-completion.
-@end indentedblock
-
-The new buffer is read-only and has a few useful bindings defined.
-
-@subsubheading @kbd{RET} or @kbd{f} (@code{ivy-occur-press})
-@vindex ivy-occur-press
-@kindex RET
-@kindex f
-@indentedblock
-Call the current action on the selected candidate.
-@end indentedblock
-@subsubheading @kbd{mouse-1} (@code{ivy-occur-click})
-@vindex ivy-occur-click
-@kindex mouse-1
-@indentedblock
-Call the current action on the selected candidate.
-@end indentedblock
-@subsubheading @kbd{j} (@code{next-line})
-@kindex j
-@indentedblock
-Move to next line.
-@end indentedblock
-@subsubheading @kbd{k} (@code{previous-line})
-@kindex k
-@indentedblock
-Move to previous line.
-@end indentedblock
-@subsubheading @kbd{a} (@code{ivy-occur-read-action})
-@vindex ivy-occur-read-action
-@kindex a
-@indentedblock
-Read an action and make it current for this buffer.
-@end indentedblock
-@subsubheading @kbd{o} (@code{ivy-occur-dispatch})
-@vindex ivy-occur-dispatch
-@kindex o
-@indentedblock
-Read an action and call it on the selected candidate.
-@end indentedblock
-@subsubheading @kbd{q} (@code{quit-window})
-@kindex q
-@indentedblock
-Bury the current buffer.
-@end indentedblock
-
-
-Ivy has no limit on the number of active buffers like these.
-
-Ivy takes care of naming buffers uniquely by constructing descriptive
-names. For example: @code{*ivy-occur counsel-describe-variable
-"function$*}.
-
-@node Completion Styles
-@chapter Completion Styles
-
-Ivy's completion functions rely on a regex builder - a function that
-transforms a string input to a string regex. All current candidates
-simply have to match this regex. Each collection can be assigned its
-own regex builder by customizing @code{ivy-re-builders-alist}.
-
-The keys of this alist are collection names, and the values are one of
-the following:
-@itemize
-@item
-@code{ivy--regex}
-@item
-@code{ivy--regex-plus}
-@item
-@code{ivy--regex-ignore-order}
-@item
-@code{ivy--regex-fuzzy}
-@item
-@code{regexp-quote}
-@end itemize
-
-A catch-all key, @code{t}, applies to all collections that don't have their
-own key.
-
-The default is:
-
-@lisp
-(setq ivy-re-builders-alist
- '((t . ivy--regex-plus)))
-@end lisp
-
-This example shows a custom regex builder assigned to file name
-completion:
-
-@lisp
-(setq ivy-re-builders-alist
- '((read-file-name-internal . ivy--regex-fuzzy)
- (t . ivy--regex-plus)))
-@end lisp
-
-Here, @code{read-file-name-internal} is a function that is passed as the
-second argument to @code{completing-read} for file name completion.
-
-The regex builder resolves as follows (in order of priority):
-@enumerate
-@item
-@code{re-builder} argument passed to @code{ivy-read}.
-@item
-@code{collection} argument passed to @code{ivy-read} is a function and has an
-entry on @code{ivy-re-builders-alist}.
-@item
-@code{caller} argument passed to @code{ivy-read} has an entry on
-@code{ivy-re-builders-alist}.
-@item
-@code{this-command} has an entry on @code{ivy-re-builders-alist}.
-@item
-@code{t} has an entry on @code{ivy-re-builders-alist}.
-@item
-@code{ivy--regex}.
-@end enumerate
-
-@menu
-* ivy--regex-plus::
-* ivy--regex-ignore-order::
-* ivy--regex-fuzzy::
-@end menu
-
-@node ivy--regex-plus
-@section ivy--regex-plus
-
-@code{ivy--regex-plus} is Ivy's default completion method.
-
-@code{ivy--regex-plus} matches by splitting the input by spaces and
-rebuilding it into a regex.
-
-As the search string is typed in Ivy's minibuffer, it is transformed
-into valid regex syntax. If the string is @code{"for example"}, it is
-transformed into
-
-@lisp
-"\\(for\\).*\\(example\\)"
-@end lisp
-
-which in regex terminology matches @code{"for"} followed by a wild card and
-then @code{"example"}. Note how Ivy uses the space character to build wild
-cards. To match a literal white space, use an extra space. So to match
-one space type two spaces, to match two spaces type three spaces, and
-so on.
-
-As Ivy transforms typed characters into regex strings, it provides an
-intuitive feedback through font highlights.
-
-Ivy supports regexp negation with @code{"!"}.
-For example, @code{"define key ! ivy quit"} first selects everything
-matching @code{"define.*key"}, then removes everything matching @code{"ivy"},
-and finally removes everything matching @code{"quit"}. What remains is the
-final result set of the negation regexp.
-
-Since Ivy treats minibuffer input as a regexp, the standard regexp
-identifiers work: @code{"^"}, @code{"$"}, @code{"\b"} or @code{"[a-z]"}. The
exceptions
-are spaces, which translate to @code{".*"}, and @code{"!"} that signal the
-beginning of a negation group.
-
-@node ivy--regex-ignore-order
-@section ivy--regex-ignore-order
-
-@code{ivy--regex-ignore-order} ignores the order of regexp tokens when
-searching for matching candidates. For instance, the input
-@code{"for example"} will match @code{"example test for"}.
-
-@node ivy--regex-fuzzy
-@section ivy--regex-fuzzy
-
-@code{ivy--regex-fuzzy} splits each character with a wild card. Searching
-for @code{"for"} returns all @code{"f.*o.*r"} matches, resulting in a large
-number of hits. Yet some searches need these extra hits. Ivy sorts
-such large lists using @code{flx} package's scoring mechanism, if it's
-installed.
-
-@kbd{C-o m} toggles the current regexp builder.
-
-@node Customization
-@chapter Customization
-
-@menu
-* Faces::
-* Defcustoms::
-* Actions::
-* Packages::
-@end menu
-
-@node Faces
-@section Faces
-
-@subsubheading @code{ivy-current-match}
-@vindex ivy-current-match
-@indentedblock
-Highlights the currently selected candidate.
-@end indentedblock
-@subsubheading @code{ivy-minibuffer-match-face-1}
-@vindex ivy-minibuffer-match-face-1
-@indentedblock
-Highlights the background of the match.
-@end indentedblock
-@subsubheading @code{ivy-minibuffer-match-face-2}
-@vindex ivy-minibuffer-match-face-2
-@indentedblock
-Highlights the first (modulo 3) matched group.
-@end indentedblock
-@subsubheading @code{ivy-minibuffer-match-face-3}
-@vindex ivy-minibuffer-match-face-3
-@indentedblock
-Highlights the second (modulo 3) matched group.
-@end indentedblock
-@subsubheading @code{ivy-minibuffer-match-face-4}
-@vindex ivy-minibuffer-match-face-4
-@indentedblock
-Highlights the third (modulo 3) matched group.
-@end indentedblock
-@subsubheading @code{ivy-confirm-face}
-@vindex ivy-confirm-face
-@indentedblock
-Highlights the "(confirm)" part of the prompt.
-
-When @code{confirm-nonexistent-file-or-buffer} set to @code{t}, then
-confirming non-existent files in @code{ivy-mode} requires an
-additional @kbd{RET}.
-
-The confirmation prompt will use this face.
-
-For example:
-
-@lisp
-(setq confirm-nonexistent-file-or-buffer t)
-@end lisp
-
-Then call @code{find-file}, enter "eldorado" and press @kbd{RET} - the
-prompt will be appended with "(confirm)". Press @kbd{RET} once more
-to confirm, or any key to continue the completion.
-@end indentedblock
-@subsubheading @code{ivy-match-required-face}
-@vindex ivy-match-required-face
-@indentedblock
-Highlights the "(match required)" part of the prompt.
-
-When completions have to match available candidates and cannot
-take random input, the "(match required)" prompt signals this
-constraint.
-
-For example, call @code{describe-variable}, enter "waldo" and press
-@kbd{RET} - "(match required)" is prompted.
-Press any key for the prompt to disappear.
-@end indentedblock
-@subsubheading @code{ivy-subdir}
-@vindex ivy-subdir
-@indentedblock
-Highlights directories when completing file names.
-@end indentedblock
-@subsubheading @code{ivy-remote}
-@vindex ivy-remote
-@indentedblock
-Highlights remote files when completing file names.
-@end indentedblock
-@subsubheading @code{ivy-virtual}
-@vindex ivy-virtual
-@indentedblock
-Highlights virtual buffers when completing buffer names.
-
-Virtual buffers correspond to bookmarks and recent files list,
-@code{recentf}.
-
-Enable virtual buffers with:
-
-@lisp
-(setq ivy-use-virtual-buffers t)
-@end lisp
-@end indentedblock
-@subsubheading @code{ivy-modified-buffer}
-@vindex ivy-modified-buffer
-@indentedblock
-Highlights modified buffers when switching buffer.
-@end indentedblock
-@subsubheading @code{ivy-modified-outside-buffer}
-@vindex ivy-modified-outside-buffer
-@indentedblock
-Highlights buffers modified outside Emacs when switching buffer.
-
-This takes precedence over @code{ivy-modified-buffer}.
-@end indentedblock
-
-@node Defcustoms
-@section Defcustoms
-
-@defopt ivy-count-format
-A string that specifies display of number of candidates and
-current candidate, if one exists.
-
-The number of matching candidates by default is shown as a right-
-padded integer value.
-
-To disable showing the number of candidates:
-
-@lisp
-(setq ivy-count-format "")
-@end lisp
-
-To also display the current candidate:
-
-@lisp
-(setq ivy-count-format "(%d/%d) ")
-@end lisp
-
-The @code{format}-style switches this variable uses are described
-in the @code{format} documentation.
-@end defopt
-
-@defopt ivy-display-style
-Specifies highlighting candidates in the minibuffer.
-
-The default setting is @code{'fancy} in Emacs versions 24.4 or newer.
-
-Set @code{ivy-display-style} to @code{nil} for a plain minibuffer.
-@end defopt
-
-@defopt ivy-on-del-error-function
-Specifies what to do when @kbd{DEL} (@code{ivy-backward-delete-char}) fails.
-
-This is usually the case when there is no text left to delete,
-i.e., when @kbd{DEL} is typed at the beginning of the minibuffer.
-
-The default behavior is to quit the completion after @kbd{DEL} -- a
-handy key to invoke after mistakenly triggering a completion.
-@end defopt
-
-@node Actions
-@section Actions
-
-@menu
-* What are actions?::
-* How can different actions be called?::
-* How to modify the actions list?::
-* Example - add two actions to each command::
-* Example - define a new command with several actions::
-@end menu
-
-@node What are actions?
-@subsection What are actions?
-
-An action is a function that is called after you select a candidate
-during completion. This function takes a single string argument, which
-is the selected candidate.
-
-@subsubheading Window context when calling an action
-@indentedblock
-Currently, the action is executed in the minibuffer window
-context. This means e.g. that if you call @code{insert} the text will
-be inserted into the minibuffer.
-
-If you want to execute the action in the initial window from
-which the completion started, use the @code{with-ivy-window} wrapper
-macro.
-
-@lisp
-(defun ivy-insert-action (x)
- (with-ivy-window
- (insert x)))
-@end lisp
-@end indentedblock
-
-@node How can different actions be called?
-@subsection How can different actions be called?
-
-@itemize
-@item
-@kbd{C-m} (@code{ivy-done}) calls the current action.
-@item
-@kbd{M-o} (@code{ivy-dispatching-done}) presents available actions for
-selection, calls it after selection, and then exits.
-@item
-@kbd{C-M-o} (@code{ivy-dispatching-call}) presents available actions for
-selection, calls it after selection, and then does not exit.
-@end itemize
-
-@node How to modify the actions list?
-@subsection How to modify the actions list?
-
-Currently, you can append any amount of your own actions to the
-default list of actions. This can be done either for a specific
-command, or for all commands at once.
-
-Usually, the command has only one default action. The convention is to
-use single letters when selecting a command, and the letter @kbd{o} is
-designated for the default command. This way, @kbd{M-o o} should be always
-equivalent to @kbd{C-m}.
-
-@node Example - add two actions to each command
-@subsection Example - add two actions to each command
-
-The first action inserts the current candidate into the Ivy window -
-the window from which @code{ivy-read} was called.
-
-The second action copies the current candidate to the kill ring.
-
-@lisp
-(defun ivy-yank-action (x)
- (kill-new x))
-
-(defun ivy-copy-to-buffer-action (x)
- (with-ivy-window
- (insert x)))
-
-(ivy-set-actions
- t
- '(("i" ivy-copy-to-buffer-action "insert")
- ("y" ivy-yank-action "yank")))
-@end lisp
-
-Then in any completion session, @kbd{M-o y} invokes @code{ivy-yank-action}, and
-@kbd{M-o i} invokes @code{ivy-copy-to-buffer-action}.
-
-@menu
-* How to undo adding the two actions::
-* How to add actions to a specific command::
-@end menu
-
-@node How to undo adding the two actions
-@subsubsection How to undo adding the two actions
-
-Since @code{ivy-set-actions} modifies the internal dictionary with new
-data, set the extra actions list to @code{nil} by assigning @code{nil} value to
-the @code{t} key as follows:
-
-@lisp
-(ivy-set-actions t nil)
-@end lisp
-
-@node How to add actions to a specific command
-@subsubsection How to add actions to a specific command
-
-Use the command name as the key:
-
-@lisp
-(ivy-set-actions
- 'swiper
- '(("i" ivy-copy-to-buffer-action "insert")
- ("y" ivy-yank-action "yank")))
-@end lisp
-
-@node Example - define a new command with several actions
-@subsection Example - define a new command with several actions
-
-@lisp
-(defun my-action-1 (x)
- (message "action-1: %s" x))
-
-(defun my-action-2 (x)
- (message "action-2: %s" x))
-
-(defun my-action-3 (x)
- (message "action-3: %s" x))
-
-(defun my-command-with-3-actions ()
- (interactive)
- (ivy-read "test: " '("foo" "bar" "baz")
- :action '(1
- ("o" my-action-1 "action 1")
- ("j" my-action-2 "action 2")
- ("k" my-action-3 "action 3"))))
-@end lisp
-
-The number 1 above is the index of the default action. Each
-action has its own string description for easy selection.
-
-@menu
-* Test the above function with @code{ivy-occur}::
-@end menu
-
-@node Test the above function with @code{ivy-occur}
-@subsubsection Test the above function with @code{ivy-occur}
-
-To examine each action with each candidate in a key-efficient way, try:
-
-@itemize
-@item
-Call @code{my-command-with-3-actions}
-@item
-Press @kbd{C-c C-o} to close the completion window and move to an
-ivy-occur buffer
-@item
-Press @kbd{kkk} to move to the first candidate, since the point is most
-likely at the end of the buffer
-@item
-Press @kbd{oo} to call the first action
-@item
-Press @kbd{oj} and @kbd{ok} to call the second and the third actions
-@item
-Press @kbd{j} to move to the next candidate
-@item
-Press @kbd{oo}, @kbd{oj}, @kbd{ok}
-@item
-Press @kbd{j} to move to the next candidate
-@item
-and so on@dots{}
-@end itemize
-
-@node Packages
-@section Packages
-
-@subsubheading @code{org-mode}
-@indentedblock
-@code{org-mode} versions 8.3.3 or later obey
-@code{completing-read-function} (which @code{ivy-mode} sets). Try refiling
-headings with similar names to appreciate @code{ivy-mode}.
-@end indentedblock
-@subsubheading @code{magit}
-@indentedblock
-Uses ivy by default if Ivy is installed.
-@end indentedblock
-@subsubheading @code{find-file-in-project}
-@indentedblock
-Uses ivy by default if Ivy is installed.
-@end indentedblock
-@subsubheading @code{projectile}
-@indentedblock
-Projectile requires this setting for ivy completion:
-
-@lisp
-(setq projectile-completion-system 'ivy)
-@end lisp
-@end indentedblock
-@subsubheading @code{helm-make}
-@indentedblock
-Helm-make requires this setting for ivy completion.
-
-@lisp
-(setq helm-make-completion-method 'ivy)
-@end lisp
-@end indentedblock
-@subsubheading automatically integrated packages
-@indentedblock
-Ivy re-uses the following packages if they are installed:
-@code{avy}, @code{amx} or @code{smex}, @code{flx}, and @code{wgrep}.
-@end indentedblock
-
-@node Commands
-@chapter Commands
-
-@menu
-* File Name Completion::
-* Buffer Name Completion::
-* Counsel commands::
-@end menu
-
-@node File Name Completion
-@section File Name Completion
-
-Since file name completion is ubiquitous, Ivy provides extra
-bindings that work here:
-
-
-@subsubheading @kbd{C-j} (@code{ivy-alt-done})
-@vindex ivy-alt-done
-@kindex C-j
-@indentedblock
-On a directory, restarts completion from that directory.
-
-On a file or @code{./}, exit completion with the selected candidate.
-@end indentedblock
-@subsubheading @kbd{DEL} (@code{ivy-backward-delete-char})
-@vindex ivy-backward-delete-char
-@kindex DEL
-@indentedblock
-Restart the completion in the parent directory if current input
-is empty.
-@end indentedblock
-@subsubheading @kbd{//} (@code{self-insert-command})
-@kindex //
-@indentedblock
-Switch to the root directory.
-@end indentedblock
-@subsubheading @kbd{~} (@code{self-insert-command})
-@kindex ~
-@indentedblock
-Switch to the home directory.
-@end indentedblock
-@subsubheading @kbd{/} (@code{self-insert-command})
-@kindex /
-@indentedblock
-If the current input matches an existing directory name exactly,
-switch the completion to that directory.
-@end indentedblock
-@subsubheading @kbd{M-r} (@code{ivy-toggle-regexp-quote})
-@vindex ivy-toggle-regexp-quote
-@kindex M-r
-@indentedblock
-Toggle between input as regexp or not.
-
-Switch to matching literally since file names include @code{.}, which
-is for matching any char in regexp mode.
-@end indentedblock
-@defopt ivy-extra-directories
-Decide if you want to see @code{../} and @code{./} during file name
-completion.
-
-Reason to remove: @code{../} is the same as @kbd{DEL}.
-
-Reason not to remove: navigate anywhere with only @kbd{C-n}, @kbd{C-p}
-and @kbd{C-j}.
-
-Likewise, @code{./} can be removed.
-@end defopt
-
-@subsubheading History
-@indentedblock
-File history works the same with @kbd{M-p}, @kbd{M-n}, and @kbd{C-r}, but
-uses a custom code for file name completion that cycles through
-files previously opened. It also works with TRAMP files.
-@end indentedblock
-
-@menu
-* Using TRAMP::
-@end menu
-
-@node Using TRAMP
-@subsection Using TRAMP
-
-@subsubheading @kbd{~} (tilde)
-@kindex ~
-@indentedblock
-Move to the home directory. Either the local or the remote one, depending on
the
-current directory. The boolean option @code{ivy-magic-tilde} decides whether
the binding to
-do this is @kbd{~} or @kbd{~/}.
-@end indentedblock
-@subsubheading @kbd{//} (double slash)
-@kindex //
-@indentedblock
-Move to the root directory. Either the local or the remote one, depending on
the
-current directory. Here, you can also select a TRAMP connection method, such
as @code{ssh}
-or @code{scpx}.
-@end indentedblock
-@subsubheading @kbd{/ C-j}
-@kindex / C-j
-@indentedblock
-Move the the local root directory.
-@end indentedblock
-@subsubheading @kbd{~~}
-@kindex ~~
-@indentedblock
-Move to the local home directory.
-@end indentedblock
-
-
-From any directory, with the empty input, inputting @code{/ssh:} and pressing
-@kbd{C-j} (or @kbd{RET}, which is the same thing) completes for host and user
-names.
-
-For @code{/ssh:user@@} input, completes the domain name.
-
-@kbd{C-i} works in a similar way to the default completion.
-
-You can also get sudo access for the current directory by inputting
-@code{/sudo::} @kbd{RET}. Using @code{/sudo:} (i.e. single colon instead of
double) will
-result in a completion session for the desired user.
-
-Multi-hopping is possible, although a bit complex.
-
-@subsubheading Example : connect to a remote host @code{cloud} and open a file
with @code{sudo} there
-@indentedblock
-@itemize
-@item
-@kbd{C-x C-f} @code{/ssh:cloud|sudo:root:/}.
-@end itemize
-@end indentedblock
-
-@node Buffer Name Completion
-@section Buffer Name Completion
-
-@defopt ivy-use-virtual-buffers
-When non-nil, add @code{recentf-mode} and bookmarks to
-@code{ivy-switch-buffer} completion candidates.
-
-Adding this to Emacs init file:
-
-@lisp
-(setq ivy-use-virtual-buffers t)
-@end lisp
-will add additional virtual buffers to the buffers list for recent
-files. Selecting such virtual buffers, which are highlighted with
-@code{ivy-virtual} face, will open the corresponding file.
-@end defopt
-
-@node Counsel commands
-@section Counsel commands
-
-The main advantages of @code{counsel-} functions over their basic
-equivalents in @code{ivy-mode} are:
-
-@enumerate
-@item
-Multi-actions and non-exiting actions work.
-@item
-@code{ivy-resume} can resume the last completion session.
-@item
-Customize @code{ivy-set-actions}, @code{ivy-re-builders-alist}.
-@item
-Customize individual keymaps, such as @code{counsel-describe-map},
-@code{counsel-git-grep-map}, or @code{counsel-find-file-map}, instead of
-customizing @code{ivy-minibuffer-map} that applies to all completion
-sessions.
-@end enumerate
-
-@node API
-@chapter API
-
-The main (and only) entry point is the @code{ivy-read} function. It takes
-two required arguments and many optional arguments that can be passed
-by a key. The optional @code{:action} argument is highly recommended for
-features such as multi-actions, non-exiting actions, @code{ivy-occur} and
-@code{ivy-resume}.
-
-@menu
-* Required arguments for @code{ivy-read}::
-* Optional arguments for @code{ivy-read}::
-* Example - @code{counsel-describe-function}::
-* Example - @code{counsel-locate}::
-* Example - @code{ivy-read-with-extra-properties}::
-@end menu
-
-@node Required arguments for @code{ivy-read}
-@section Required arguments for @code{ivy-read}
-
-@subsubheading @code{prompt}
-@indentedblock
-A prompt string normally ending in a colon and a space.
-@code{ivy-count-format} is prepended to it during completion.
-@end indentedblock
-@subsubheading @code{collection}
-@indentedblock
-Either a list of strings, a function, an alist or a hash table.
-
-If a function, then it has to be compatible with
-@code{all-completions}.
-@end indentedblock
-
-@node Optional arguments for @code{ivy-read}
-@section Optional arguments for @code{ivy-read}
-
-@subsubheading @code{predicate}
-@indentedblock
-Is a function to filter the initial collection. It has to be
-compatible with @code{all-completions}. Tip: most of the time, it's
-simpler to just apply this filter to the @code{collection} argument
-itself, e.g. @code{(cl-remove-if-not predicate collection)}.
-@end indentedblock
-@subsubheading @code{require-match}
-@indentedblock
-When set to a non-nil value, input must match one of the
-candidates. Custom input is not accepted.
-@end indentedblock
-@subsubheading @code{initial-input}
-@indentedblock
-This string argument is included for compatibility with
-@code{completing-read}, which inserts it into the minibuffer.
-
-It's recommended to use the @code{preselect} argument instead of this.
-@end indentedblock
-@subsubheading @code{history}
-@indentedblock
-Name of the symbol to store history. See @code{completing-read}.
-@end indentedblock
-@subsubheading @code{preselect}
-@indentedblock
-Determines which one of the candidates to initially select.
-
-When set to an integer value, select the candidate with that
-index value.
-
-When set to any other non-nil value, select the first candidate
-matching this value. Comparison is first done with @code{equal}.
-If this fails, and when applicable, match @code{preselect} as a
-regular expression.
-
-Every time the input becomes empty, the item corresponding to
-@code{preselect} is selected.
-@end indentedblock
-@subsubheading @code{keymap}
-@indentedblock
-A keymap to be composed with @code{ivy-minibuffer-map}. This keymap
-has priority over @code{ivy-minibuffer-map} and can be modified at any
-later stage.
-@end indentedblock
-@subsubheading @code{update-fn}
-@indentedblock
-Is the function called each time the current candidate changes.
-This function takes no arguments and is called in the
-minibuffer's @code{post-command-hook}. See @code{swiper} for an example
-usage.
-@end indentedblock
-@subsubheading @code{sort}
-@indentedblock
-When non-nil, use @code{ivy-sort-functions-alist} to sort the
-collection as long as the collection is not larger than
-@code{ivy-sort-max-size}.
-@end indentedblock
-@subsubheading @code{action}
-@indentedblock
-Is the function to call after selection. It takes a string
-argument.
-@end indentedblock
-@subsubheading @code{unwind}
-@indentedblock
-Is the function to call before exiting completion. It takes no
-arguments. This function is called even if the completion is
-interrupted with @kbd{C-g}. See @code{swiper} for an example usage.
-@end indentedblock
-@subsubheading @code{re-builder}
-@indentedblock
-Is a function that takes a string and returns a valid regex. See
-@code{Completion Styles} for details.
-@end indentedblock
-@subsubheading @code{matcher}
-@indentedblock
-Is a function that takes a regex string and a list of strings and
-returns a list of strings matching the regex. Any ordinary Emacs
-matching function will suffice, yet finely tuned matching
-functions can be used. See @code{counsel-find-file} for an example
-usage.
-@end indentedblock
-@subsubheading @code{dynamic-collection}
-@indentedblock
-When non-nil, @code{collection} will be used to dynamically generate
-the candidates each time the input changes, instead of being used
-once statically with @code{all-completions} to generate a list of
-strings. See @code{counsel-locate} for an example usage.
-@end indentedblock
-@subsubheading @code{caller}
-@indentedblock
-Is a symbol that uniquely identifies the function that called
-@code{ivy-read}, which may be useful for further customizations.
-@end indentedblock
-
-@node Example - @code{counsel-describe-function}
-@section Example - @code{counsel-describe-function}
-
-This is a typical example of a function with a non-async collection,
-which is a collection where all the strings in the collection are
-known prior to any input from the user.
-
-Only the first two arguments (along with @code{action}) are essential - the
-rest of the arguments are for fine-tuning, and could be omitted.
-
-The @code{action} argument could also be omitted - but then @code{ivy-read}
-would do nothing except returning the string result, which you could
-later use yourself. However, it's recommended that you use the
-@code{action} argument.
-
-@lisp
-(defun counsel-describe-function ()
- "Forward to `describe-function'."
- (interactive)
- (ivy-read "Describe function: "
- (let (cands)
- (mapatoms
- (lambda (x)
- (when (fboundp x)
- (push (symbol-name x) cands))))
- cands)
- :keymap counsel-describe-map
- :preselect (ivy-thing-at-point)
- :history 'counsel-describe-symbol-history
- :require-match t
- :action (lambda (x)
- (describe-function
- (intern x)))
- :caller 'counsel-describe-function))
-@end lisp
-
-Here are the interesting features of the above function, in the order that
they appear:
-
-@itemize
-@item
-The @code{prompt} argument is a simple string ending in ": ".
-@item
-The @code{collection} argument evaluates to a (large) list of strings.
-@item
-The @code{keymap} argument is for a custom keymap to supplement
@code{ivy-minibuffer-map}.
-@item
-The @code{preselect} is provided by @code{ivy-thing-at-point}, which
-returns a symbol near the point. Ivy then selects the first
-candidate from the collection that matches this symbol. To select
-this pre-selected candidate, a @kbd{RET} will suffice. No further user
-input is necessary.
-@item
-The @code{history} argument is for keeping the history of this command
-separate from the common history in @code{ivy-history}.
-@item
-The @code{require-match} is set to @code{t} since it doesn't make sense to
-call @code{describe-function} on an un-interned symbol.
-@item
-The @code{action} argument calls @code{describe-function} on the interned
-selected candidate.
-@item
-The @code{caller} argument identifies this completion session. This is
-important, since with the collection being a list of strings and not
-a function name, the only other way for @code{ivy-read} to identify
-"who's calling" and to apply the appropriate customizations is to
-examine @code{this-command}. But @code{this-command} would be modified if
-another command called @code{counsel-describe-function}.
-@end itemize
-
-@node Example - @code{counsel-locate}
-@section Example - @code{counsel-locate}
-
-This is a typical example of a function with an async collection.
-Since the collection function cannot pre-compute all the locatable
-files in memory within reasonable limits (time or memory), it relies
-on user input to filter the universe of possible candidates to a
-manageable size while also continuing to search asynchronously for
-possible candidates. Both the filtering and searching continues with
-each character change of the input with rapid updates to the
-collection presented without idle waiting times. This live update will
-continue as long as there are likely candidates. Eventually updates to
-the minibuffer will stop after user input, filtering, and searching
-have exhausted looking for possible candidates.
-
-Async collections suit long-running shell commands, such as @code{locate}.
-With each new input, a new process starts while the old process is
-killed. The collection is refreshed anew with each new process.
-Meanwhile the user can provide more input characters (for further
-narrowing) or select a candidate from the visible collection.
-
-@lisp
-(defun counsel-locate-function (str)
- (or
- (ivy-more-chars)
- (progn
- (counsel--async-command
- (format "locate %s '%s'"
- (mapconcat #'identity counsel-locate-options " ")
- (counsel--elisp-to-pcre
- (ivy--regex str))))
- '("" "working..."))))
-
-;;;###autoload
-(defun counsel-locate (&optional initial-input)
- "Call the \"locate\" shell command.
-INITIAL-INPUT can be given as the initial minibuffer input."
- (interactive)
- (ivy-read "Locate: " #'counsel-locate-function
- :initial-input initial-input
- :dynamic-collection t
- :history 'counsel-locate-history
- :action (lambda (file)
- (with-ivy-window
- (when file
- (find-file file))))
- :unwind #'counsel-delete-process
- :caller 'counsel-locate))
-@end lisp
-
-Here are the interesting features of the above functions, in the order
-that they appear:
-
-@itemize
-@item
-@code{counsel-locate-function} takes a string argument and returns a list
-of strings. Note that it's not compatible with @code{all-completions},
-but since we're not using that here, might as well use one argument
-instead of three.
-@item
-@code{ivy-more-chars} is a simple function that returns e.g.
-@code{'("2 chars more")} asking the user for more input.
-@item
-@code{counsel--async-command} is a very easy API simplification that
-takes a single string argument suitable for
-@code{shell-command-to-string}. So you could prototype your function as
-non-async using @code{shell-command-to-string} and @code{split-string} to
-produce a collection, then decide that you want async and simply swap in
-@code{counsel--async-command}.
-@item
-@code{counsel-locate} is an interactive function with an optional
@code{initial-input}.
-@item
-@code{#'counsel-locate-function} is passed as the @code{collection} argument.
-@item
-@code{dynamic-collection} is set to t, since this is an async collection.
-@item
-@code{action} argument uses @code{with-ivy-window} wrapper, since we want to
open the
-selected file in the same window from which @code{counsel-locate} was
-called.
-@item
-@code{unwind} argument is set to @code{#'counsel-delete-process}: when we
press @kbd{C-g}
-we want to kill the running process created by
-@code{counsel--async-command}.
-@item
-@code{caller} argument identifies this command for easier customization.
-@end itemize
-
-@node Example - @code{ivy-read-with-extra-properties}
-@section Example - @code{ivy-read-with-extra-properties}
-
-This is another example to show how to associate additional values to each
-displayed strings.
-
-@lisp
-(defun find-candidates-function (str pred _)
- (let ((props '(1 2))
- (strs '("foo" "foo2")))
- (cl-mapcar (lambda (s p) (propertize s 'property p))
- strs
- props)))
-
-(defun find-candidates ()
- (interactive)
- (ivy-read "Find symbols: "
- #'find-candidates-function
- :action (lambda (x)
- (message "Value: %s" (get-text-property 0 'property x)
- ))))
-@end lisp
-
-Here are the interesting features of the above function:
-
-@itemize
-@item
-@code{find-candidates-function} builds up a list of strings and associates
"foo" with
-the value 1 and "foo2" with 2.
-@item
-@code{find-candidates} is an interactive function.
-@item
-@code{#'find-candidates} is passed as the @code{collection} argument.
-@item
-@code{action} gets passed the selected string with the associated value. It
-then retrieves that value and displays it.
-@end itemize
-
-@node Variable Index
-@unnumbered Variable Index
-
-@printindex vr
-
-@node Keystroke Index
-@unnumbered Keystroke Index
-
-@printindex ky
-
-@bye
\ No newline at end of file
diff --git a/doc/scripts.el b/doc/scripts.el
deleted file mode 100644
index 8c5a513..0000000
--- a/doc/scripts.el
+++ /dev/null
@@ -1,4 +0,0 @@
-(setq org-confirm-babel-evaluate nil)
-(defun org-to-texi (fname)
- (find-file fname)
- (org-texinfo-export-to-texinfo))
diff --git a/elpa.el b/elpa.el
deleted file mode 100644
index e49b8d4..0000000
--- a/elpa.el
+++ /dev/null
@@ -1,6 +0,0 @@
-(setq package-user-dir
- (expand-file-name
- (format "~/.elpa/%s/elpa"
- (concat emacs-version (when (getenv "MELPA_STABLE")
"-stable")))))
-(package-initialize)
-(add-to-list 'load-path default-directory)
diff --git a/ivy-hydra.el b/ivy-hydra.el
deleted file mode 100644
index ede83bd..0000000
--- a/ivy-hydra.el
+++ /dev/null
@@ -1,133 +0,0 @@
-;;; ivy-hydra.el --- Additional key bindings for Ivy -*- lexical-binding: t
-*-
-
-;; Copyright (C) 2015-2019 Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.12.0
-;; Package-Requires: ((emacs "24.1") (ivy "0.12.0") (hydra "0.13.4"))
-;; Keywords: convenience
-
-;; This file is part of GNU Emacs.
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; For a full copy of the GNU General Public License
-;; see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package provides the `hydra-ivy/body' command, which is a
-;; quasi-prefix map, with many useful bindings. These bindings are
-;; shorter than usual, using mostly unprefixed keys.
-
-;;; Code:
-
-(require 'ivy)
-(require 'hydra)
-
-(defun ivy--matcher-desc ()
- "Return description of `ivy--regex-function'."
- (let ((cell (assq ivy--regex-function ivy-preferred-re-builders)))
- (if cell
- (cdr cell)
- "other")))
-
-(defhydra hydra-ivy (:hint nil
- :color pink)
- "
-^ ^ ^ ^ ^ ^ | ^Call^ ^ ^ | ^Cancel^ | ^Options^ | Action _w_/_s_/_a_:
%-14s(ivy-action-name)
-^-^-^-^-^-^-+-^-^---------^-^--+-^-^------+-^-^-------+-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---------------------------
-^ ^ _k_ ^ ^ | _f_ollow occ_U_r | _i_nsert | _c_: calling %-5s(if ivy-calling
\"on\" \"off\") _C_ase-fold: %-10`ivy-case-fold-search
-_h_ ^+^ _l_ | _d_one ^ ^ | _o_ops | _M_: matcher
%-5s(ivy--matcher-desc)^^^^^^^^^^^^ _T_runcate: %-11`truncate-lines
-^ ^ _j_ ^ ^ | _g_o ^ ^ | ^ ^ | _<_/_>_:
shrink/grow^^^^^^^^^^^^^^^^^^^^^^^^^^^^ _D_efinition of this menu
-"
- ;; arrows
- ("h" ivy-beginning-of-buffer)
- ("j" ivy-next-line)
- ("k" ivy-previous-line)
- ("l" ivy-end-of-buffer)
- ;; mark
- ("m" ivy-mark)
- ("u" ivy-unmark)
- ("DEL" ivy-unmark-backward)
- ("t" ivy-toggle-marks)
- ;; actions
- ("o" keyboard-escape-quit :exit t)
- ("r" ivy-dispatching-done-hydra :exit t)
- ("C-g" keyboard-escape-quit :exit t)
- ("i" nil)
- ("C-o" nil)
- ("f" ivy-alt-done :exit nil)
- ("C-j" ivy-alt-done :exit nil)
- ("d" ivy-done :exit t)
- ("g" ivy-call)
- ("C-m" ivy-done :exit t)
- ("c" ivy-toggle-calling)
- ("M" ivy-rotate-preferred-builders)
- (">" ivy-minibuffer-grow)
- ("<" ivy-minibuffer-shrink)
- ("w" ivy-prev-action)
- ("s" ivy-next-action)
- ("a" (let ((ivy-read-action-function #'ivy-read-action-by-key))
- (ivy-read-action)))
- ("T" (setq truncate-lines (not truncate-lines)))
- ("C" ivy-toggle-case-fold)
- ("U" ivy-occur :exit t)
- ("D" (ivy-exit-with-action
- (lambda (_) (find-function 'hydra-ivy/body)))
- :exit t))
-
-(defvar ivy-dispatching-done-columns 2
- "Number of columns to use if the hint does not fit on one line.")
-
-(defvar ivy-dispatching-done-idle nil
- "When non-nil, the hint will be delayed by this many seconds.")
-
-(defvar ivy-dispatching-done-hydra-exit-keys '(("M-o" nil "back")
- ("C-g" nil))
- "Keys that can be used to exit `ivy-dispatching-done-hydra'.")
-
-(defun ivy-dispatching-done-hydra ()
- "Select one of the available actions and call `ivy-done'."
- (interactive)
- (let* ((actions (ivy-state-action ivy-last))
- (extra-actions ivy-dispatching-done-hydra-exit-keys)
- (doc (concat "action: "
- (mapconcat
- (lambda (x) (format "[%s] %s" (nth 0 x) (nth 2 x)))
- (append (cdr actions)
- extra-actions) ", ")))
- (estimated-len (length doc))
- (n-columns (if (> estimated-len (window-width))
- ivy-dispatching-done-columns
- nil))
- (i 0))
- (if (null (ivy--actionp actions))
- (ivy-done)
- (funcall
- (eval
- `(defhydra ivy-read-action (:color teal :columns ,n-columns :idle
,ivy-dispatching-done-idle)
- "action"
- ,@(mapcar (lambda (x)
- (list (nth 0 x)
- `(progn
- (setcar (ivy-state-action ivy-last) ,(cl-incf
i))
- (ivy-done))
- (nth 2 x)))
- (cdr actions))
- ,@extra-actions))))))
-
-(setq ivy-read-action-function (lambda (_) (ivy-dispatching-done-hydra)))
-
-(provide 'ivy-hydra)
-
-;;; ivy-hydra.el ends here
diff --git a/ivy-overlay.el b/ivy-overlay.el
deleted file mode 100644
index 7a77bcf..0000000
--- a/ivy-overlay.el
+++ /dev/null
@@ -1,154 +0,0 @@
-;;; ivy-overlay.el --- Overlay display functions for Ivy -*- lexical-binding:
t -*-
-
-;; Copyright (C) 2016-2019 Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; Keywords: convenience
-
-;; This program is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation, either version 3 of the License, or
-;; (at your option) any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with this program. If not, see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package allows to setup Ivy's completion at point to actually
-;; show the candidates and the input at point, instead of in the
-;; minibuffer.
-
-;;; Code:
-
-(defface ivy-cursor
- '((((class color) (background light))
- :background "black" :foreground "white")
- (((class color) (background dark))
- :background "white" :foreground "black"))
- "Cursor face for inline completion."
- :group 'ivy-faces)
-
-(defvar ivy--old-cursor-type t)
-
-(defvar ivy-overlay-at nil
- "Overlay variable for `ivy-display-function-overlay'.")
-
-(declare-function ivy--truncate-string "ivy")
-
-(defun ivy-left-pad (str width)
- "Return STR, but with each line indented by WIDTH spaces.
-Lines are truncated to the window width."
- (let ((padding (make-string width ?\s)))
- (mapconcat (lambda (x)
- (ivy--truncate-string (concat padding x)
- (1- (+ (window-width)
- (window-hscroll)))))
- (split-string str "\n")
- "\n")))
-
-(defun ivy-overlay-cleanup ()
- "Clean up after `ivy-display-function-overlay'."
- (when (overlayp ivy-overlay-at)
- (delete-overlay ivy-overlay-at)
- (setq ivy-overlay-at nil))
- (unless cursor-type
- (setq cursor-type ivy--old-cursor-type))
- (when (fboundp 'company-abort)
- (company-abort)))
-
-(defvar ivy-height)
-
-(defun ivy-overlay-show-after (str)
- "Display STR in an overlay at point.
-
-First, fill each line of STR with spaces to the current column.
-Then attach the overlay to the character before point."
- (if ivy-overlay-at
- (progn
- (move-overlay ivy-overlay-at (1- (point)) (line-end-position))
- (overlay-put ivy-overlay-at 'invisible nil))
- (let ((available-height (count-lines (point) (window-end nil t))))
- (unless (>= available-height ivy-height)
- (recenter (- (window-height) ivy-height 2))))
- (setq ivy-overlay-at (make-overlay (1- (point)) (line-end-position)))
- ;; Specify face to avoid clashing with other overlays.
- (overlay-put ivy-overlay-at 'face 'default)
- (overlay-put ivy-overlay-at 'priority 9999))
- (overlay-put ivy-overlay-at 'display str)
- (overlay-put ivy-overlay-at 'after-string ""))
-
-(declare-function org-current-level "org")
-(declare-function org-at-heading-p "org")
-(defvar org-indent-indentation-per-level)
-(defvar ivy-height)
-(defvar ivy-last)
-(defvar ivy-text)
-(defvar ivy-completion-beg)
-(declare-function ivy-add-face-text-property "ivy")
-(declare-function ivy--get-window "ivy")
-(declare-function ivy-state-current "ivy")
-(declare-function ivy-state-window "ivy")
-(declare-function ivy--remove-prefix "ivy")
-
-(defun ivy-overlay-impossible-p (_str)
- (or
- (and (eq major-mode 'org-mode)
- (plist-get (text-properties-at (point)) 'src-block))
- (<= (window-height) (+ ivy-height 2))
- (= (point) (point-min))
- (< (- (+ (window-width) (window-hscroll)) (current-column))
- 30)))
-
-(defun ivy-display-function-overlay (str)
- "Called from the minibuffer, display STR in an overlay in Ivy window.
-Hide the minibuffer contents and cursor."
- (if (save-selected-window
- (select-window (ivy-state-window ivy-last))
- (ivy-overlay-impossible-p str))
- (let ((buffer-undo-list t))
- (save-excursion
- (forward-line 1)
- (insert str)))
- (ivy-add-face-text-property (minibuffer-prompt-end) (point-max)
- '(:foreground "white"))
- (setq cursor-type nil)
- (with-selected-window (ivy--get-window ivy-last)
- (when cursor-type
- (setq ivy--old-cursor-type cursor-type))
- (setq cursor-type nil)
- (let ((overlay-str
- (apply
- #'concat
- (buffer-substring (max (point-min) (1- (point))) (point))
- ivy-text
- (and (eolp) " ")
- (buffer-substring (point) (line-end-position))
- (and (> (length str) 0)
- (list "\n"
- (ivy-left-pad
- (ivy--remove-prefix "\n" str)
- (+
- (if (and (eq major-mode 'org-mode)
- (bound-and-true-p org-indent-mode))
- (if (org-at-heading-p)
- (1- (org-current-level))
- (* org-indent-indentation-per-level
(org-current-level)))
- 0)
- (save-excursion
- (when ivy-completion-beg
- (goto-char ivy-completion-beg))
- (current-column)))))))))
- (let ((cursor-offset (1+ (length ivy-text))))
- (ivy-add-face-text-property cursor-offset (1+ cursor-offset)
- 'ivy-cursor overlay-str t))
- (ivy-overlay-show-after overlay-str)))))
-
-(provide 'ivy-overlay)
-
-;;; ivy-overlay.el ends here
diff --git a/ivy-test.el b/ivy-test.el
deleted file mode 100644
index c15cf2f..0000000
--- a/ivy-test.el
+++ /dev/null
@@ -1,1437 +0,0 @@
-;;; ivy-test.el --- tests for ivy -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2019 Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel
-
-;; This file is part of GNU Emacs.
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; For a full copy of the GNU General Public License
-;; see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This packages provides the tests for `ert'. They can be executed
-;; from the command line as well by calling "make test".
-
-;;; Code:
-
-(defvar require-features nil)
-
-(defadvice require (before ivy-tests-require-hook (feature &rest _) activate)
- "Record the requires into `require-features'."
- (push feature require-features))
-
-(require 'ert)
-(require 'colir)
-
-;; Useful for #'ivy-read-remap. It must arrive before (require 'ivy).
-(define-key global-map (kbd "<S-right>") #'end-of-buffer)
-
-(require 'ivy)
-(require 'counsel)
-
-(message "%s" (emacs-version))
-
-(ert-deftest ivy--lazy-load-ffap--ffap-url-p ()
- (should (not (memq 'ffap require-features)))
- (should (not (fboundp 'ffap-url-p)))
- (should (string= (ivy-ffap-url-p "https://foo.org")
- "https://foo.org"))
- (should (memq 'ffap require-features))
- (should (fboundp 'ffap-url-p)))
-
-(defvar ivy-expr nil
- "Holds a test expression to evaluate with `ivy-eval'.")
-
-(defvar ivy-result nil
- "Holds the eval result of `ivy-expr' by `ivy-eval'.")
-
-(defvar ivy-eval-dir nil
- "Hold the `default-directory' value to be used by `ivy-eval'.
-Since `execute-kbd-macro' doesn't pick up a let-bound `default-directory'.")
-
-(defun ivy-eval ()
- "Evaluate `ivy-expr'."
- (interactive)
- (let ((default-directory (or ivy-eval-dir default-directory)))
- (setq ivy-result (eval ivy-expr))))
-
-(global-set-key (kbd "C-c e") 'ivy-eval)
-
-(defvar ivy-test-inhibit-message t)
-
-(cl-defun ivy-with (expr keys &key dir)
- "Evaluate EXPR followed by KEYS."
- (let ((ivy-expr expr)
- (inhibit-message ivy-test-inhibit-message)
- (buf (current-buffer)))
- (save-window-excursion
- (unwind-protect
- (progn
- (when dir
- (setq dir (expand-file-name dir (counsel-locate-git-root))))
- (setq ivy-eval-dir dir)
- (execute-kbd-macro
- (vconcat (kbd "C-c e")
- (kbd keys))))
- (switch-to-buffer buf)))
- ivy-result))
-
-(defun command-execute-setting-this-command (cmd &rest args)
- "Like `command-execute' but sets `this-command' first."
- (setq this-command cmd)
- (apply #'command-execute cmd args))
-
-(defadvice symbol-function (around no-void-function activate)
- "Suppress void-function errors.
-
-This advice makes `symbol-function' return nil when called on a
-symbol with no function rather than throwing a void-function
-error. On Emacs 24.4 and above, this has no effect, because
-`symbol-function' already does this, but on 24.3 and earlier, it
-will bring the behavior in line with the newer Emacsen."
- (condition-case nil
- ad-do-it
- (void-function nil)))
-
-(ert-deftest ivy-partial-1 ()
- (should (equal
- (ivy-with '(ivy-read "test: " '("case" "Case"))
- "ca TAB C-m")
- "case"))
- (should (equal
- (ivy-with '(ivy-read "test: " '("case" "Case"))
- "Ca TAB C-m")
- "Case")))
-
-(ert-deftest ivy-read ()
- (should (equal
- (ivy-with '(ivy-read "pattern: " '("blue" "yellow"))
- "C-m")
- "blue"))
- (should (equal
- (ivy-with '(ivy-read "pattern: " '("blue" "yellow"))
- "y C-m")
- "yellow"))
- (should (equal
- (ivy-with '(ivy-read "pattern: " '("blue" "yellow"))
- "y DEL b C-m")
- "blue"))
- (should (equal
- (ivy-with '(ivy-read "pattern: " '("blue" "yellow"))
- "z C-m")
- "z"))
- (should (equal
- (ivy-with '(ivy-read "pattern: " '("blue" "yellow"))
- "y <backspace> C-m")
- "blue"))
- (should (equal
- (ivy-with '(let ((ivy-re-builders-alist '((t . ivy--regex-fuzzy))))
- (ivy-read "pattern: " '("package-list-packages"
"something-else")))
- "plp C-m")
- "package-list-packages"))
- (should (equal
- (ivy-with '(ivy-read "test" '("aaab" "aaac"))
- "a C-n <tab> C-m")
- "aaac"))
- (should (equal-including-properties
- (ivy-with '(ivy-read "test" '(("foo" . "bar")))
- "C-m")
- "foo"))
- (should (equal
- (ivy-with '(ivy-read "test" '(("foo" . "bar")))
- "asdf C-m")
- "asdf"))
- (should (equal
- (ivy-with
- '(with-output-to-string
- (ivy-read "test" '(("foo" . "bar"))
- :action (lambda (x) (prin1 x))))
- "f C-m")
- "(\"foo\" . \"bar\")"))
- (should (equal
- (ivy-with
- '(with-output-to-string
- (ivy-read "test" '(("foo" . "bar"))
- :action (lambda (x) (prin1 x))))
- "asdf C-m")
- "\"asdf\""))
- (should (equal
- (ivy-with '(ivy-read "pattern: " '("can do" "can" "can't do"))
- "can C-m")
- "can"))
- (should (equal
- (ivy-with '(ivy-read "pattern: "
- '("ignore" "build" "build-1" "build-2") :preselect
"build")
- "b C-m")
- "build"))
- (should (equal (ivy-with
- '(ivy-read "x: " '("one" "two" ("three" . "four")))
- "th C-m")
- "three")))
-
-(ert-deftest ivy-read-sort-alist ()
- (should (equal (ivy-with '(let ((coll '(("b" . "1") ("a" . "2"))))
- (ivy-read "test:" coll
- :sort t)
- coll)
- "C-m")
- '(("b" . "1") ("a" . "2")))))
-
-(ert-deftest ivy-read-remap ()
- (should (equal
- (ivy-with '(ivy-read "pattern: " '("blue" "yellow" "red"))
- "<S-right> C-m")
- "red")))
-
-(ert-deftest swiper--re-builder ()
- (setq swiper--width 4)
- (should (string= (swiper--re-builder "^")
- "."))
- (should (string= (swiper--re-builder "^a")
- "^ ?\\(a\\)"))
- (should (string= (swiper--re-builder "^a b")
- "^ \\(a\\).*?\\(b\\)"))
- (should
- (string-match-p
- "\\`\\\\_<.*\\\\_>\\'"
- (swiper--re-builder "\\_<iv\\_>"))))
-
-(ert-deftest swiper--re-builder-char-fold ()
- :expected-result (if (>= emacs-major-version 25)
- :passed
- :failed)
- (let ((search-default-mode 'char-fold-to-regexp))
- (should (string= (swiper--re-builder "f b")
-
"\\(\\(?:ḟ\\|[fᶠḟⓕf𝐟𝑓𝒇𝒻𝓯𝔣𝕗𝖋𝖿𝗳𝘧𝙛𝚏]\\)\\).*?\\(\\(?:b[̣̱̇]\\|[bᵇḃḅḇⓑb𝐛𝑏𝒃𝒷𝓫𝔟𝕓𝖇𝖻𝗯𝘣𝙗𝚋]\\)\\)"))
- (should (= ivy--subexps 2))))
-
-(ert-deftest ivy--split ()
- (should (equal (ivy--split "King of the who?")
- '("King" "of" "the" "who?")))
- (should (equal (ivy--split "The Britons.")
- '("The Britons.")))
- (should (equal (ivy--split "Who are the Britons?")
- '("Who are" "the Britons?")))
- (should (equal (ivy--split "We're all Britons and I am your king.")
- '("We're all Britons"
- "and I am"
- "your king.")))
- (should (equal (ivy--split "^[^ ]") '("^[^ ]")))
- (should (equal (ivy--split "^[^ ] bar") '("^[^ ]" "bar")))
- (should (equal (ivy--split "defun [^ ]+") '("defun" "[^ ]+"))))
-
-(ert-deftest ivy--regex ()
- (should (equal (ivy--regex
- "defun [^ ]+")
- "\\(defun\\).*?\\([^ ]+\\)"))
- (should (equal (ivy--regex
- "\\(?:interactive\\|swiper\\) \\(?:list\\|symbol\\)")
-
"\\(\\(?:interactive\\|swiper\\)\\).*?\\(\\(?:list\\|symbol\\)\\)"))
- (should (equal (ivy--regex
- "foo[")
- "foo\\["))
- (should (equal (ivy--regex
- ".org")
- "\\.org"))
- (should (equal (ivy--regex "foo\\") "foo"))
- (should (equal (ivy--regex "foo\\|") "foo")))
-
-(ert-deftest ivy--split-negation ()
- (should (equal (ivy--split-negation "") ()))
- (should (equal (ivy--split-negation "not") '("not")))
- (should (equal (ivy--split-negation "!not") '("" "not")))
- (should (equal (ivy--split-negation "not!") '("not")))
- (should (equal (ivy--split-negation "!not!") '("" "not")))
- (should (equal (ivy--split-negation "not!not!not") '("not" "not")))
- (should (equal (ivy--split-negation "not!not\\!not") '("not" "not!not")))
- (should (equal (ivy--split-negation "\\!not!not\\!not") '("!not" "not!not")))
- (should (equal (ivy--split-negation "\\!not!notnot\\!") '("!not"
"notnot!"))))
-
-(ert-deftest ivy--split-spaces ()
- (should (equal (ivy--split-spaces "") ()))
- (should (equal (ivy--split-spaces " ") ()))
- (should (equal (ivy--split-spaces " ") ()))
-
- (should (equal (ivy--split-spaces "a ") '("a")))
- (should (equal (ivy--split-spaces " a") '("a")))
- (should (equal (ivy--split-spaces " a ") '("a")))
- (should (equal (ivy--split-spaces "a ") '("a")))
- (should (equal (ivy--split-spaces " a") '("a")))
- (should (equal (ivy--split-spaces " a ") '("a")))
-
- (should (equal (ivy--split-spaces "\\ ") '(" ")))
- (should (equal (ivy--split-spaces "\\ ") '(" ")))
- (should (equal (ivy--split-spaces " \\ ") '(" ")))
- (should (equal (ivy--split-spaces "\\ \\ ") '(" ")))
- (should (equal (ivy--split-spaces "a\\ ") '("a ")))
- (should (equal (ivy--split-spaces "\\ a") '(" a")))
- (should (equal (ivy--split-spaces "\\ a\\ ") '(" a ")))
-
- (should (equal (ivy--split-spaces "a b") '("a" "b")))
- (should (equal (ivy--split-spaces "a\\ b") '("a b")))
- (should (equal (ivy--split-spaces " a b\\ ") '("a" "b ")))
- (should (equal (ivy--split-spaces "\\ a b ") '(" " "a" "b")))
- (should (equal (ivy--split-spaces " a\\ \\ b ") '("a " " b")))
-
- (should (equal (ivy--split-spaces "foo[") '("foo\\[")))
- (should (equal (ivy--split-spaces "foo[a]") '("foo[a]")))
- (should (equal (ivy--split-spaces "foo[ ]") '("foo\\[" "]"))))
-
-(ert-deftest ivy--regex-plus ()
- (should (equal (ivy--regex-plus "add path\\!") "\\(add\\).*?\\(path!\\)")))
-
-(ert-deftest ivy-partial-2 ()
- (when (fboundp 'read--expression)
- (should
- (equal
- (ivy-with '(read--expression "Eval: "
- "'s-c-t-st")
- "<tab> C-m")
- '(quote shell-command-to-string)))))
-
-(ert-deftest ivy--regex-fuzzy ()
- (should (string= (ivy--regex-fuzzy "tmux")
- "\\(t\\)[^m\n]*\\(m\\)[^u\n]*\\(u\\)[^x\n]*\\(x\\)"))
- (should (string= (ivy--regex-fuzzy ".tmux")
-
"\\(\\.\\)[^t\n]*\\(t\\)[^m\n]*\\(m\\)[^u\n]*\\(u\\)[^x\n]*\\(x\\)"))
- (should (string= (ivy--regex-fuzzy "^tmux")
- "^\\(t\\)[^m\n]*\\(m\\)[^u\n]*\\(u\\)[^x\n]*\\(x\\)"))
- (should (string= (ivy--regex-fuzzy "^tmux$")
- "^\\(t\\)[^m\n]*\\(m\\)[^u\n]*\\(u\\)[^x\n]*\\(x\\)$"))
- (should (string= (ivy--regex-fuzzy "")
- ""))
- (should (string= (ivy--regex-fuzzy "^")
- "^"))
- (should (string= (ivy--regex-fuzzy "$")
- "$"))
- (should (equal (ivy--regex-fuzzy "abc\\|")
- "\\(a\\)[^b\n]*\\(b\\)[^c\n]*\\(c\\)")))
-
-(ert-deftest ivy--regex-ignore-order ()
- (should (equal (ivy--regex-ignore-order "tmux")
- '(("tmux" . t))))
- (should (equal (ivy--regex-ignore-order "^tmux")
- '(("^tmux" . t))))
- (should (equal (ivy--regex-ignore-order "^tmux$")
- '(("^tmux$" . t))))
- (should (equal (ivy--regex-ignore-order "")
- ""))
- (should (equal (ivy--regex-ignore-order "^")
- '(("^" . t))))
- (should (equal (ivy--regex-ignore-order "$")
- '(("$" . t))))
- (should (equal (ivy--regex-ignore-order "one two")
- '(("one" . t) ("two" . t))))
- (should (equal (ivy--regex-ignore-order "one two !three")
- '(("one" . t) ("two" . t) ("three"))))
- (should (equal (ivy--regex-ignore-order "one two !three four")
- '(("one" . t) ("two" . t) ("three") ("four"))))
- (should (equal (ivy--regex-ignore-order "!three four")
- '(("three") ("four"))))
- ;; Support escaping ! and spaces.
- (should (equal (ivy--regex-ignore-order "one\\ two")
- '(("one two" . t))))
- (should (equal (ivy--regex-ignore-order "one\\!two")
- '(("one!two" . t))))
- ;; Don't crash on multiple !.
- (ivy--regex-ignore-order "! ! !")
- ;; Escape invalid regexps.
- (should (equal (ivy--regex-ignore-order "foo[ bar[xy]")
- '(("foo\\[" . t) ("bar[xy]" . t))))
- (should (equal (ivy--regex-ignore-order "foo\\|")
- '(("foo" . t)))))
-
-(ert-deftest ivy--format ()
- (should (string= (let ((ivy--index 10)
- (ivy-format-functions-alist
- '((t . (lambda (x) (mapconcat #'identity x "\n")))))
- (cands '("NAME"
- "SYNOPSIS"
- "DESCRIPTION"
- "FUNCTION LETTERS"
- "SWITCHES"
- "DIAGNOSTICS"
- "EXAMPLE 1"
- "EXAMPLE 2"
- "EXAMPLE 3"
- "SEE ALSO"
- "AUTHOR")))
- (ivy--format cands))
- #("\nDESCRIPTION\nFUNCTION
LETTERS\nSWITCHES\nDIAGNOSTICS\nEXAMPLE 1\nEXAMPLE 2\nEXAMPLE 3\nSEE
ALSO\nAUTHOR"
- 0 90 (read-only nil)
- 90 96 (face ivy-current-match read-only nil)))))
-
-(ert-deftest ivy--filter ()
- (setq ivy-last (make-ivy-state))
- (should (equal (ivy--filter "the" '("foo" "the" "The"))
- '("the" "The")))
- (should (equal (ivy--filter "The" '("foo" "the" "The"))
- '("The"))))
-
-(ert-deftest counsel--elisp-to-pcre ()
- (should (equal (counsel--elisp-to-pcre
- (ivy--regex "foo bar"))
- "(foo).*?(bar)"))
- (should (equal (counsel--elisp-to-pcre
- (ivy--regex "(foo bar)"))
- "(\\(foo).*?(bar\\))"))
- (should (equal (counsel--elisp-to-pcre
- (ivy--regex "{foo bar}"))
- "({foo).*?(bar})"))
- (should (equal (counsel--elisp-to-pcre "\\{foo bar\\}")
- "{foo bar}"))
- (should (equal (counsel--elisp-to-pcre "\\(foo\\|bar\\)\\|baz")
- "(foo|bar)|baz"))
- (should (equal (counsel--elisp-to-pcre
- '(("foo") ("bar" . t) ("baz" . t)))
- "bar.*baz"))
- (should (equal (counsel--elisp-to-pcre
- '(("foo\\|bar" . t) ("blah\\|bloop") ("blick" . t)
("\\(baz\\)\\|quux" . t)))
- "(?:foo|bar).*blick.*(?:(baz)|quux)"))
- (should (equal (counsel--elisp-to-pcre
- '(("ivy" . t) ("-")) t)
- "^(?=.*ivy)(?!.*-)"))
- (should (equal (counsel--elisp-to-pcre
- '(("foo" . t)) t)
- "foo"))
- (should (equal (counsel--elisp-to-pcre
- '(("foo")) t)
- "^(?!.*foo)")))
-
-(defmacro ivy--string-buffer (text &rest body)
- "Test helper that wraps TEXT in a temp buffer while running BODY."
- `(with-temp-buffer
- (insert ,text)
- ,@body))
-
-(ert-deftest counsel-url-expand ()
- "Test ffap expansion using `counsel-url-expansions-alist'."
- ;; no expansions defined
- (let (counsel-url-expansions-alist)
- (should (eq (counsel-url-expand) nil)))
- (let ((counsel-url-expansions-alist
- '(("^foo$" . "https://foo.com/%s")
- ("^issue\\([0-9]+\\)" . (lambda (word)
- (concat "https://foo.com/issues/"
- (match-string 1 word)))))))
- ;; no match
- (should (equal (ivy--string-buffer
- "foobar"
- (counsel-url-expand)) nil))
- ;; string expansion
- (should (equal (ivy--string-buffer
- "foo"
- (counsel-url-expand)) "https://foo.com/foo"))
- ;; function expansion
- (should (equal (ivy--string-buffer
- "issue123"
- (counsel-url-expand)) "https://foo.com/issues/123"))))
-
-(ert-deftest colir-color-parse ()
- (should (equal (colir-color-parse "#ab1234")
- ;; (color-name-to-rgb "#ab1234")
- '(0.6705882352941176
- 0.07058823529411765
- 0.20392156862745098))))
-
-(ert-deftest colir-blend-face-background ()
- ;; Note: should be `equal-including-properties', but it doesn't work as I
like
- ;; `equal' doesn't test text properties
- (should (equal
- (let ((str #("One" 0 3 (face (:foreground "#badfad")))))
- (ivy--add-face str 'ivy-current-match)
- str)
- #("One" 0 3 (face (ivy-current-match :foreground "#badfad")))))
- (should (equal
- (let ((str #("Desktop" 0 7 (face ((foreground-color . "#badfad")
bold)))))
- (colir-blend-face-background 0 (length str) 'ivy-current-match
str)
- str)
- #("Desktop" 0 7 (face (ivy-current-match (foreground-color .
"#8ac6f2") bold))))))
-
-
-;;* prefix arg tests
-;;** tests with no prefix
-(ert-deftest ivy-no-prefix-arg ()
- "Tests with no prefix arg."
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-m")
- nil))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-j")
- nil))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-M-j")
- nil))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-M-m")
- nil))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-M-n")
- nil))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-M-p")
- nil))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "M-o o")
- nil))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "TAB TAB")
- nil)))
-
-;;** tests with one prefix
-(ert-deftest ivy-one-prefix-arg ()
- "Tests with no prefix arg."
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-u C-m")
- '(4)))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-u C-j")
- '(4)))
- ;; C-M-j does not pass a prefix on.
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-u C-M-j")
- nil))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-u C-M-m")
- '(4)))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-u C-M-n")
- '(4)))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-u C-M-p")
- '(4)))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-u M-o o")
- '(4)))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action
- '(1 ("o" (lambda (x)
- (setq res ivy-current-prefix-arg)))
- ("p" (lambda (x)
- (setq res ivy-current-prefix-arg)))))
- res)
- "C-u M-o p")
- '(4)))
- ;; TAB TAB does not pass prefix arg
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "TAB TAB")
- nil)))
-
-
-(ert-deftest ivy-numeric-prefix-arg ()
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "M-1 M-2 M-3 C-m")
- 123))
- (should (equal
- (ivy-with
- '(let (res)
- (ivy-read "pattern: " '("blue" "yellow")
- :action (lambda (x)
- (setq res ivy-current-prefix-arg)))
- res)
- "C-u 123 C-m")
- 123)))
-
-(ert-deftest ivy-re-match ()
- (should (ivy-re-match '(("counsel" . t)) "(defun counsel"))
- (should (ivy-re-match '(("defun" . t) ("counsel" . t)) "(defun counsel"))
- (should (ivy-re-match '(("counsel" . t) ("defun" . t)) "(defun counsel"))
- (should (not (ivy-re-match '(("counsel" . nil) ("defun" . t)) "(defun
counsel")))
- (should (not (ivy-re-match '(("defun" . t) ("counsel" . nil)) "(defun
counsel"))))
-
-(ert-deftest ivy-read-preselect ()
- (should (equal
- (ivy-with
- '(ivy-read "test: "
- (list "abc" "default" "def")
- :preselect 1)
- "RET")
- "default"))
- (should (equal
- (ivy-with
- '(ivy-read "test: "
- (list "abc" "default" "def")
- :preselect "defa")
- "RET")
- "default")))
-
-(ert-deftest ivy-read-prompt ()
- (setq prompt "pattern: ")
- (setq collection '("blue" "yellow"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt nil))
- (ivy-read prompt collection))
- "bl C-m")
- "blue"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt nil))
- (ivy-read prompt collection))
- "bl C-p C-m")
- "blue"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt nil))
- (ivy-read prompt collection))
- "bl C-j")
- "blue"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt nil))
- (ivy-read prompt collection))
- "bl C-p C-j")
- "blue"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt nil))
- (ivy-read prompt collection))
- "bl C-M-j")
- "bl"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt nil))
- (ivy-read prompt collection))
- "bl C-p C-M-j")
- "bl"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt t))
- (ivy-read prompt collection))
- "bl C-m")
- "blue"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt t))
- (ivy-read prompt collection))
- "bl C-p C-m")
- "bl"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt t))
- (ivy-read prompt collection))
- "bl C-j")
- "blue"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt t))
- (ivy-read prompt collection))
- "bl C-p C-j")
- "bl"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt t))
- (ivy-read prompt collection))
- "bl C-M-j")
- "bl"))
- (should (equal
- (ivy-with
- '(let ((ivy-use-selectable-prompt t))
- (ivy-read prompt collection))
- "bl C-p C-M-j")
- "bl")))
-
-(defmacro ivy-with-r (expr &rest keys)
- `(with-output-to-string
- (save-window-excursion
- (switch-to-buffer standard-output t)
- ,expr
- (ivy-mode)
- (let ((inhibit-message ivy-test-inhibit-message))
- (execute-kbd-macro
- ,(apply #'vconcat (mapcar #'kbd keys)))))))
-
-(ert-deftest ivy-completion-in-region ()
- (should (string=
- (ivy-with-r
- (progn
- (emacs-lisp-mode)
- (insert " emacs-lisp-mode-h"))
- "C-M-i")
- " emacs-lisp-mode-hook"))
- (should (string=
- (ivy-with-r
- (progn
- (emacs-lisp-mode)
- (insert "(nconc"))
- "C-M-i")
- "(nconc")))
-
-(ert-deftest ivy-completing-read-def-handling ()
- ;; DEF in COLLECTION
- (should
- (equal "b"
- (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil
nil "b")
- "RET")))
- ;; Also make sure that choosing a non-default item works
- (should
- (equal "c"
- (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil
nil "b")
- "c RET")))
- ;; DEF not in COLLECTION
- (should
- (equal "d"
- (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil
nil "d")
- "RET")))
- (should
- (equal "c"
- (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil
nil "d")
- "c RET")))
- ;; DEF list, some in COLLECTION
- (should
- (equal "e"
- (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil
nil '("e" "b"))
- "RET")))
- (should
- (equal "c"
- (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil
nil '("e" "b"))
- "c RET")))
- ;; DEF nil
- (should
- (equal "a"
- (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil
nil nil)
- "RET")))
- (should
- (equal "c"
- (ivy-with '(ivy-completing-read "Pick: " '("a" "b" "c") nil t nil
nil nil)
- "c RET")))
- ;; DEF list, empty input (no text collection), non-text default, same object
- (let ((def '([a b])))
- (should
- (eq (car def)
- (ivy-with
- (eval `'(ivy-completing-read "Pick: " nil nil 'require-match nil nil
',def))
- "RET"))))
- ;; DEF nil, and called via `ivy-completing-read-with-empty-string-def'
- (should
- (equal ""
- (ivy-with '(ivy-completing-read-with-empty-string-def
- "Pick: " '("a" "b" "c") nil t nil nil nil)
- "RET")))
- (should
- (equal "c"
- (ivy-with '(ivy-completing-read-with-empty-string-def
- "Pick: " '("a" "b" "c") nil t nil nil nil)
- "c RET"))))
-
-(ert-deftest ivy-completing-read-handlers ()
- (cl-letf* ((ivy-mode-reset-arg (if ivy-mode 1 0))
- ;; Let-bind this so changes are reset after test
- (ivy-completing-read-handlers-alist
- '((test-command-default-handler . completing-read-default)
- (test-command-recursive-handler .
ivy-completing-read-with-empty-string-def)))
- ;; Temporarily define several identical commands
- ((symbol-function 'test-command-no-handler)
- (lambda (arg)
- "Read and arg and return it"
- (interactive
- (list
- (completing-read "Pick: " '("a" "b" "c") nil t nil nil nil)))
- arg))
- ((symbol-function 'test-command-default-handler)
- (symbol-function 'test-command-no-handler))
- ((symbol-function 'test-command-recursive-handler)
- (symbol-function 'test-command-no-handler)))
- (unwind-protect
- (progn
- ;; Activate ivy-mode
- (ivy-mode 1)
- ;; No handler
- (should
- (equal "a"
- (ivy-with
- '(command-execute-setting-this-command
- 'test-command-no-handler)
- "RET")))
- (should
- (equal "c"
- (ivy-with
- '(command-execute-setting-this-command
- 'test-command-no-handler)
- "c RET")))
- ;; Handler = `completing-read-default'; make sure ivy-read
- ;; is never called
- (cl-letf (((symbol-function 'ivy-read)
- (lambda (&rest args) (error "`ivy-read' should not be
called"))))
-
- (should
- (equal ""
- (ivy-with
- '(command-execute-setting-this-command
- 'test-command-default-handler)
- "RET")))
- (should
- (equal "c"
- (ivy-with
- '(command-execute-setting-this-command
- 'test-command-default-handler)
- "c RET"))))
- ;; Handler = `ivy-completing-read-with-empty-string-def';
- ;; make sure infinite recursion does not occur
- (should
- (equal ""
- (ivy-with
- '(command-execute-setting-this-command
- 'test-command-recursive-handler)
- "RET")))
- (should
- (equal "c"
- (ivy-with
- '(command-execute-setting-this-command
- 'test-command-recursive-handler)
- "c RET"))))
- (ivy-mode ivy-mode-reset-arg))))
-
-(ert-deftest ivy-completion-common-length ()
- (should (= 2
- (ivy-completion-common-length
- #("test/"
- 0 2 (face completions-common-part)
- 2 3 (face (completions-first-difference))))))
- (should (= 5
- (ivy-completion-common-length
- #("Math/E"
- 0 5 (face (completions-common-part))
- 5 6 (face (completions-first-difference))))))
- (should (= 3
- (ivy-completion-common-length
- #("vec"
- 0 3 (face (completions-common-part)))))))
-
-(ert-deftest ivy--sort-function ()
- "Test `ivy--sort-function' behavior."
- ;; No enabled collections
- (dolist (alist '(() ((t)) ((t nil)) ((a)) ((a nil))))
- (let ((ivy-sort-functions-alist alist))
- (dolist (coll '(a b))
- (should (not (ivy--sort-function coll))))))
- (dolist (fn (list #'identity (lambda ()) '(lambda ())))
- ;; No fallback
- (dolist (alist `(((a . ,fn))
- ((a ,fn))))
- (let ((ivy-sort-functions-alist alist))
- (should (eq (ivy--sort-function 'a) fn))
- (should (not (ivy--sort-function 'b)))))
- ;; Only fallback
- (dolist (alist `(((t . ,fn))
- ((t ,fn))))
- (let ((ivy-sort-functions-alist alist))
- (dolist (coll '(a b))
- (should (eq (ivy--sort-function coll) fn)))))
- ;; Fallback with disabled collection
- (dolist (alist `(((a) (t . ,fn))
- ((a) (t ,fn))))
- (let ((ivy-sort-functions-alist alist))
- (should (not (ivy--sort-function 'a)))
- (should (eq (ivy--sort-function 'b) fn)))))
- ;; Fallback with enabled collection
- (let* ((fn0 #'identity)
- (fn1 (lambda ()))
- (ivy-sort-functions-alist `((a ,fn0) (b) (t ,fn1))))
- (should (eq (ivy--sort-function 'a) fn0))
- (should (not (ivy--sort-function 'b)))
- (should (eq (ivy--sort-function 'c) fn1))))
-
-(ert-deftest ivy-read-directory-name ()
- (ivy-mode 1)
- (should
- (equal (expand-file-name "/tmp/")
- (ivy-with
- '(read-directory-name "cd: " "/tmp")
- "RET")))
- (should
- (equal (expand-file-name "/tmp")
- (ivy-with
- '(read-directory-name "cd: ")
- "C-M-j"
- :dir "/tmp")))
- (should
- (equal (expand-file-name "/tmp/")
- (ivy-with
- '(read-directory-name "cd: ")
- "tmp C-j C-M-j"
- :dir "/")))
- (should
- (equal (expand-file-name "/")
- (ivy-with
- '(read-directory-name "cd: ")
- "DEL C-M-j"
- :dir "/tmp"))))
-
-(ert-deftest ivy-counsel-read-directory-name ()
- (should
- (equal (expand-file-name "/tmp/")
- (ivy-with
- '(counsel-read-directory-name "cd: ")
- "RET"
- :dir "/tmp/"))))
-
-(ert-deftest ivy-partial-files ()
- (when (file-exists-p "/tmp/ivy-partial-test")
- (delete-directory "/tmp/ivy-partial-test" t))
- (mkdir "/tmp/ivy-partial-test/test1" t)
- (mkdir "/tmp/ivy-partial-test/test2")
- (define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial)
- (should
- (equal
- (save-window-excursion
- (condition-case nil
- (ivy-with
- '(let ((default-directory "/tmp/ivy-partial-test/"))
- (counsel-find-file))
- "t TAB TAB TAB C-g")
- (quit ivy--old-cands)))
- '("test1/" "test2/")))
- (define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial-or-done)
- (delete-directory "/tmp/ivy-partial-test" t))
-
-(defun ivy-with-temp-buffer (expr keys)
- (let ((temp-buffer (generate-new-buffer " *temp*")))
- (save-window-excursion
- (unwind-protect
- (progn
- (switch-to-buffer temp-buffer)
- (ivy-with expr keys)
- (list (point)
- (buffer-string)))
- (and (buffer-name temp-buffer)
- (kill-buffer temp-buffer))))))
-
-(ert-deftest counsel-yank-pop ()
- (should (equal
- (let ((kill-ring '("foo")))
- (ivy-with-temp-buffer '(counsel-yank-pop) "C-m"))
- '(4 "foo")))
- (should (equal
- (let ((kill-ring '("foo"))
- (counsel-yank-pop-after-point t))
- (ivy-with-temp-buffer '(counsel-yank-pop) "C-m"))
- '(1 "foo"))))
-
-(ert-deftest ivy-read-file-name-in-buffer-visiting-file ()
- "Test `ivy-immediate-done' command in `read-file-name' without any editing in
-a buffer visiting a file."
- (let ((ivy-mode-reset-arg (if ivy-mode 1 0)))
- (ivy-mode 1)
- (should
- (equal (ivy-with
- '(let ((insert-default-directory t))
- (with-temp-buffer
- (set-visited-file-name "~/dummy-dir/dummy-file")
- (read-file-name "Load file: " nil nil 'lambda)))
- ;; No editing, just command ivy-immediate-done
- "C-M-j")
- "~/dummy-dir/dummy-file"))
- (should
- (equal (ivy-state-current ivy-last) "~/dummy-dir/dummy-file"))
- (ivy-mode ivy-mode-reset-arg)))
-
-(ert-deftest ivy-read-file-name-make-directory ()
- (ivy-mode 1)
- (should
- (equal
- (ivy-with
- '(read-file-name "Make directory: " default-directory default-directory
- nil nil)
- "C-M-j"
- :dir "/tmp/non-existant-dir/")
- (expand-file-name "/tmp/non-existant-dir/"))))
-
-(ert-deftest ivy-starts-with-dotslash ()
- (should (ivy--starts-with-dotslash "./test1"))
- (should (ivy--starts-with-dotslash ".\\test2"))
- (should (not (ivy--starts-with-dotslash "test3")))
- (should (not (ivy--starts-with-dotslash "t/est4")))
- (should (not (ivy--starts-with-dotslash "t\\est5")))
- (should (not (ivy--starts-with-dotslash "tes./t6"))))
-
-(ert-deftest counsel--normalize-grep-match ()
- (with-temp-buffer
- (let ((match-data-orig
- (progn
- (insert "abcd\nefgh")
- (goto-char (point-min))
- (re-search-forward "\\(ab\\)\\(cd\\)")
- (match-data)))
- input expected out)
- (dolist (test '(("./FILENAME:1234:32: TEXT MORETEXT" .
- "./FILENAME:1234: TEXT MORETEXT")
- ("FILENAME:1234: TEXT MORETEXT" .
- "./FILENAME:1234: TEXT MORETEXT")
- ))
- (setq input (car test))
- (setq expected (cdr test))
- (setq out (counsel--normalize-grep-match input))
- (should (equal out expected))
- (should (equal match-data-orig (match-data)))
- (setq out (counsel--normalize-grep-match out))
- (should (equal out expected))
- (should (equal match-data-orig (match-data)))))))
-
-(ert-deftest counsel--grep-regex ()
- ;; negative lookahead: lines with "ivy", without "-"
- (should
- (string=
- (let ((counsel--regex-look-around t)
- (ivy--regex-function 'ivy--regex-plus))
- (counsel--grep-regex "ivy ! -"))
- "^(?=.*ivy)(?!.*-)"))
- (should
- (string=
- (let ((counsel--regex-look-around t)
- (ivy--regex-function 'ivy--regex-fuzzy))
- (counsel--grep-regex "ivy"))
- "(i)[^v\n]*(v)[^y\n]*(y)")))
-
-(defmacro ivy-with-text (text &rest body)
- (let ((old-bindings
- (delq nil (mapcar
- (lambda (x)
- (when (and (listp x)
- (eq (car x) 'global-set-key))
- (let ((key (eval (cadr x))))
- (list key (lookup-key global-map key)))))
- body))))
- `(let ((temp-buffer (get-buffer-create " *temp*")))
- (save-window-excursion
- (unwind-protect
- (progn
- (switch-to-buffer temp-buffer)
- (erase-buffer)
- (insert ,text)
- (search-backward "|")
- (delete-char 1)
- (setq current-prefix-arg nil)
- (let ((inhibit-message ivy-test-inhibit-message))
- ,@(mapcar (lambda (x)
- (if (and (listp x)
- (stringp (car x)))
- `(execute-kbd-macro
- (vconcat ,@(mapcar #'kbd x)))
- x))
- body))
- (insert "|")
- (buffer-substring-no-properties
- (point-min)
- (point-max)))
- (dolist (old-binding ',old-bindings)
- (apply #'global-set-key old-binding))
- (and (buffer-name temp-buffer)
- (kill-buffer temp-buffer)))))))
-
-(ert-deftest swiper-thing-at-point ()
- (should
- (string=
- (ivy-with-text
- "let\n|let\nlet"
- (global-set-key (kbd "C-s") #'swiper-thing-at-point)
- ("C-s" "RET"))
- "let\nlet|\nlet"))
- (should
- (string=
- (ivy-with-text
- "foo\nlet\nbar\n|let\nlet"
- (global-set-key (kbd "C-s") #'swiper-thing-at-point)
- ("C-s" "RET"))
- "foo\nlet\nbar\nlet|\nlet")))
-
-(ert-deftest swiper-isearch ()
- (should
- (string=
- (ivy-with-text
- "abc\na|sdf123 def\ndem"
- (global-set-key (kbd "C-s") #'isearch-forward-regexp)
- ("C-s" "de" "" "RET"))
- "abc\nasd|f123 def\ndem"))
- (should
- (string=
- (ivy-with-text
- "abc\na|sdf123 def\ndem"
- (global-set-key (kbd "C-s") #'swiper-isearch)
- ("C-s" "de" "" "RET"))
- "abc\nasd|f123 def\ndem"))
- (should
- (string=
- (ivy-with-text
- "|(defun foo)\nasdf\n(defvar bar)"
- (global-set-key (kbd "C-s") #'isearch-forward-regexp)
- ("C-s" "defun\\|defvar" "RET"))
- "(defun| foo)\nasdf\n(defvar bar)"))
- (should
- (string=
- (ivy-with-text
- "|(defun foo)\nasdf\n(defvar bar)"
- (global-set-key (kbd "C-s") #'swiper-isearch)
- ("C-s" "defun\\|defvar" "RET"))
- "(defun| foo)\nasdf\n(defvar bar)"))
- (should
- (string=
- (ivy-with-text
- "|(defun foo)\nasdf\n(defvar bar)"
- (global-set-key (kbd "C-s") #'swiper-isearch)
- ("C-s" "defun\\|defvar" "C-n RET"))
- "(defun foo)\nasdf\n(defvar| bar)")))
-
-(ert-deftest swiper-isearch-backward ()
- (should
- (string=
- (ivy-with-text
- "abc\nasdf123 def\ndem|"
- (global-set-key (kbd "C-r") #'isearch-backward-regexp)
- ("C-r" "de" "" "RET"))
- "abc\nasdf123 def\n|dem"))
- (should
- (string=
- (ivy-with-text
- "abc\nasdf123 def\ndem|"
- (global-set-key (kbd "C-r") #'swiper-isearch-backward)
- ("C-r" "de" "" "RET"))
- "abc\nasdf123 def\n|dem"))
- (should
- (string=
- (ivy-with-text
- "(defun foo)\nasdf\n(defvar bar)|"
- (global-set-key (kbd "C-r") #'isearch-backward-regexp)
- ("C-r" "defun\\|defvar" "RET"))
- "(defun foo)\nasdf\n(|defvar bar)"))
- (should
- (string=
- (ivy-with-text
- "(defun foo)\nasdf\n(defvar bar)|"
- (global-set-key (kbd "C-r") #'swiper-isearch-backward)
- ("C-r" "defun\\|defvar" "RET"))
- "(defun foo)\nasdf\n(|defvar bar)"))
- (should
- (string=
- (ivy-with-text
- "(defun foo)\nasdf\n(|defun bar)"
- (global-set-key (kbd "C-r") #'isearch-backward)
- ("C-r" "defun" "RET"))
- "(|defun foo)\nasdf\n(defun bar)"))
- (should
- (string=
- (ivy-with-text
- "(defun foo)\nasdf\n(|defun bar)"
- (global-set-key (kbd "C-r") #'swiper-isearch-backward)
- ("C-r" "defun" "RET"))
- "(|defun foo)\nasdf\n(defun bar)"))
- (should
- (string=
- (ivy-with-text
- "(defun foo)\nasdf\n(de|fun bar)"
- (global-set-key (kbd "C-r") #'swiper-isearch-backward)
- ("C-r" "def" "RET"))
- "(|defun foo)\nasdf\n(defun bar)"))
- (should
- (string=
- (ivy-with-text
- "(defun foo)\nasdf\n(de|fun bar)"
- (global-set-key (kbd "C-r") #'swiper-isearch-backward)
- ("C-r" "def?" "RET"))
- "(defun foo)\nasdf\n(|defun bar)")))
-
-(ert-deftest swiper-isearch-backward-backspace ()
- (should
- (string=
- (ivy-with-text
- "(while (when |))"
- (global-set-key (kbd "C-r") #'swiper-isearch-backward)
- ("C-r" "whi" "" "RET"))
- "(while (|when ))"))
- (should
- (string=
- (ivy-with-text
- "(while (when |))"
- (global-set-key (kbd "C-r") #'isearch-backward-regexp)
- ("C-r" "whi" "" "RET"))
- "(while (|when ))")))
-
-(ert-deftest swiper-isearch-case-fold ()
- (should
- (string=
- (ivy-with-text
- "|Foo\nfoo\nFOO\n"
- (global-set-key (kbd "C-s") #'swiper-isearch)
- ("C-s" "foo" "C-n RET"))
- "Foo\nfoo|\nFOO\n"))
- (should
- (string=
- (let ((ivy-case-fold-search-default 'auto))
- (ivy-with-text
- "|Foo\nfoo\nFOO\n"
- (global-set-key (kbd "C-s") #'swiper-isearch)
- ("C-s" "Foo" "C-n RET")))
- "Foo|\nfoo\nFOO\n"))
- (should
- (string=
- (let ((ivy-case-fold-search-default t))
- (ivy-with-text
- "|Foo\nfoo\nFOO\n"
- (global-set-key (kbd "C-s") #'swiper-isearch)
- ("C-s" "Foo" "C-n RET")))
- "Foo\nfoo|\nFOO\n")))
-
-(ert-deftest ivy-swiper-wgrep ()
- :expected-result (if (and (= emacs-major-version 24)
- (<= emacs-minor-version 3))
- ;; `wgrep' requires at least 24.5
- :failed
- :passed)
- (dolist (search-cmd '(swiper swiper-isearch))
- (should
- (string=
- (let ((default-directory "/tmp/"))
- (ivy-with-text
- "|a one\na two\na three"
- (global-set-key (kbd "C-s") search-cmd)
- ("C-s" "a" "C-c C-o" "C-x C-q" "C-e" "1" "C-n" "2" "C-n" "C-e" "3")))
- "-*- mode:grep; default-directory: \"/tmp/\" -*-
-
-
-3 candidates:
-./ *temp*:1:a one1
-./ *temp*:2:a two2
-./ *temp*:3:a three3|
-"))))
-
-(ert-deftest swiper--isearch-format ()
- (setq swiper--isearch-start-point 0)
- (with-temp-buffer
- (insert
- "line0\nline1\nline line\nline line\nline5")
- (let* ((input "li")
- (cands (swiper--isearch-function input))
- (len (length cands)))
- (should (equal cands '(3 9 15 20 25 30 35)))
- (dotimes (index len)
- (should (string= (substring-no-properties
- (swiper--isearch-format
- index len
- cands
- input
- (nth index cands)
- (current-buffer)))
- "line0\nline1\nline line\nline line\nline5"))))))
-
-(ert-deftest ivy-use-selectable-prompt ()
- (let ((ivy-use-selectable-prompt t)
- (completing-read-function #'ivy-completing-read))
- (should (string= (ivy-with '(ivy-read "prompt: " '("foo" "bar")
- :require-match t)
- "C-p C-m")
- "foo"))
- (should (string= (ivy-with '(ivy-read "prompt: " '("" "foo" "bar")
- :require-match t)
- "C-p C-m")
- ""))
- (should (string= (ivy-with '(completing-read "Position: " '(("") ("t")
("b")) nil t)
- "C-p C-m")
- ""))))
-
-(ert-deftest ivy--minibuffer-index-bounds ()
- (should (equal (ivy--minibuffer-index-bounds 0 1 10) '(0 1 0)))
- (should (equal (ivy--minibuffer-index-bounds 0 10 10) '(0 9 0)))
- (should (equal (ivy--minibuffer-index-bounds 0 11 10) '(0 9 0)))
- (should (equal (ivy--minibuffer-index-bounds 1 11 10) '(0 9 1)))
- (should (equal (ivy--minibuffer-index-bounds 5 11 10) '(0 9 5)))
- (should (equal (ivy--minibuffer-index-bounds 6 11 10) '(1 10 5)))
- (should (equal (ivy--minibuffer-index-bounds 7 11 10) '(2 11 5)))
- (should (equal (ivy--minibuffer-index-bounds 8 11 10) '(2 11 6)))
- (should (equal (ivy--minibuffer-index-bounds 10 11 10) '(2 11 8)))
- (should (equal (ivy--minibuffer-index-bounds 1 3 10) '(0 3 1))))
-
-(ert-deftest counsel-find-file-with-dollars ()
- (should (string=
- (file-relative-name
- (ivy-with '(counsel-find-file) "fo C-m"
- :dir "tests/find-file/files-with-dollar/"))
- "tests/find-file/files-with-dollar/foo$")))
-
-(ert-deftest counsel-find-file-with-dotfiles ()
- (should (string=
- (file-relative-name
- (ivy-with '(counsel-find-file) "f C-m"
- :dir "tests/find-file/dotfiles/"))
- "tests/find-file/dotfiles/foo/"))
- (should (string=
- (file-relative-name
- (ivy-with '(counsel-find-file) "foob C-m"
- :dir "tests/find-file/dotfiles/"))
- "tests/find-file/dotfiles/.foobar1")))
-
-(ert-deftest counsel-find-file-with-spaces ()
- (let ((ivy-extra-directories nil))
- (should (string=
- (file-relative-name
- (ivy-with '(counsel-find-file) "TAB TAB TAB TAB"
- :dir "tests/find-file/directories-with-spaces/"))
- "tests/find-file/directories-with-spaces/bar baz i/file1"))
- (should (string=
- (file-relative-name
- (ivy-with '(counsel-find-file) "C-n TAB TAB TAB TAB"
- :dir "tests/find-file/directories-with-spaces/"))
- "tests/find-file/directories-with-spaces/bar baz ii/file2"))
- (should (string=
- (file-relative-name
- (ivy-with '(counsel-find-file) "TAB C-n TAB TAB TAB TAB"
- :dir "tests/find-file/directories-with-spaces/"))
- "tests/find-file/directories-with-spaces/bar baz ii/file2"))))
-
-(ert-deftest ivy-avy ()
- (when (require 'avy nil t)
- (let ((enable-recursive-minibuffers t)
- (read-numbers '(ivy-read "test: " (mapcar #'number-to-string
(number-sequence 1 100)))))
- (should (string= (ivy-with read-numbers "C-' a") "1"))
- (should (string= (ivy-with read-numbers "C-v C-' d") "7")))))
-
-(ert-deftest ivy--yank-handle-case-fold ()
- (should (string=
- (let ((ivy-text ""))
- (ivy--yank-handle-case-fold "FirstName"))
- "FirstName"))
- (should (string=
- (let ((ivy-text "f"))
- (ivy--yank-handle-case-fold "irstName"))
- "irstname")))
-
-(ert-deftest ivy--handle-directory ()
- (should (string= (ivy--handle-directory "/") "/"))
- (should (string= (let ((ivy--directory "/tmp/"))
- (ivy--handle-directory "/sudo::"))
- "/sudo::/tmp/")))
-
-(defun ivy-test-run-tests ()
- (let ((test-sets
- '(
- ;; this test must run first as other tests might force a load
- ivy--lazy-load-ffap--ffap-url-p
- ;; run the rest of the tests
- (not ivy--lazy-load-ffap--ffap-url-p)))
- (unexpected 0))
- (dolist (test-set test-sets)
- (cl-incf
- unexpected
- (ert-stats-completed-unexpected
- (ert-run-tests-batch test-set))))
- (kill-emacs (if (zerop unexpected) 0 1))))
-
-(provide 'ivy-test)
-
-;;; ivy-test.el ends here
diff --git a/ivy.el b/ivy.el
deleted file mode 100644
index c125779..0000000
--- a/ivy.el
+++ /dev/null
@@ -1,5056 +0,0 @@
-;;; ivy.el --- Incremental Vertical completYon -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2019 Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.12.0
-;; Package-Requires: ((emacs "24.1"))
-;; Keywords: matching
-
-;; This file is part of GNU Emacs.
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; For a full copy of the GNU General Public License
-;; see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package provides `ivy-read' as an alternative to
-;; `completing-read' and similar functions.
-;;
-;; There's no intricate code to determine the best candidate.
-;; Instead, the user can navigate to it with `ivy-next-line' and
-;; `ivy-previous-line'.
-;;
-;; The matching is done by splitting the input text by spaces and
-;; re-building it into a regex.
-;; So "for example" is transformed into "\\(for\\).*\\(example\\)".
-
-;;; Code:
-
-(require 'cl-lib)
-(require 'ivy-overlay)
-(require 'colir)
-(require 'ring)
-
-;;* Customization
-(defgroup ivy nil
- "Incremental vertical completion."
- :group 'convenience)
-
-(defgroup ivy-faces nil
- "Font-lock faces for `ivy'."
- :group 'ivy
- :group 'faces)
-
-(defface ivy-current-match
- '((((class color) (background light))
- :background "#1a4b77" :foreground "white")
- (((class color) (background dark))
- :background "#65a7e2" :foreground "black"))
- "Face used by Ivy for highlighting the current match.")
-
-(defface ivy-minibuffer-match-highlight
- '((t :inherit highlight))
- "Face used by Ivy for highlighting the match under the cursor.")
-
-(defface ivy-minibuffer-match-face-1
- '((((class color) (background light))
- :background "#d3d3d3")
- (((class color) (background dark))
- :background "#555555"))
- "The background face for `ivy' minibuffer matches.")
-
-(defface ivy-minibuffer-match-face-2
- '((((class color) (background light))
- :background "#e99ce8" :weight bold)
- (((class color) (background dark))
- :background "#777777" :weight bold))
- "Face for `ivy' minibuffer matches numbered 1 modulo 3.")
-
-(defface ivy-minibuffer-match-face-3
- '((((class color) (background light))
- :background "#bbbbff" :weight bold)
- (((class color) (background dark))
- :background "#7777ff" :weight bold))
- "Face for `ivy' minibuffer matches numbered 2 modulo 3.")
-
-(defface ivy-minibuffer-match-face-4
- '((((class color) (background light))
- :background "#ffbbff" :weight bold)
- (((class color) (background dark))
- :background "#8a498a" :weight bold))
- "Face for `ivy' minibuffer matches numbered 3 modulo 3.")
-
-(defface ivy-confirm-face
- '((t :foreground "ForestGreen" :inherit minibuffer-prompt))
- "Face used by Ivy for a confirmation prompt.")
-
-(defface ivy-match-required-face
- '((t :foreground "red" :inherit minibuffer-prompt))
- "Face used by Ivy for a match required prompt.")
-
-(defface ivy-subdir
- '((t :inherit dired-directory))
- "Face used by Ivy for highlighting subdirs in the alternatives.")
-
-(defface ivy-org
- '((t :inherit org-level-4))
- "Face used by Ivy for highlighting Org buffers in the alternatives.")
-
-(defface ivy-modified-buffer
- '((t :inherit default))
- "Face used by Ivy for highlighting modified file visiting buffers.")
-
-(defface ivy-modified-outside-buffer
- '((t :inherit default))
- "Face used by Ivy for highlighting file visiting buffers modified outside
Emacs.")
-
-(defface ivy-remote
- '((((class color) (background light))
- :foreground "#110099")
- (((class color) (background dark))
- :foreground "#7B6BFF"))
- "Face used by Ivy for highlighting remotes in the alternatives.")
-
-(defface ivy-virtual
- '((t :inherit font-lock-builtin-face))
- "Face used by Ivy for matching virtual buffer names.")
-
-(defface ivy-action
- '((t :inherit font-lock-builtin-face))
- "Face used by Ivy for displaying keys in `ivy-read-action'.")
-
-(defface ivy-highlight-face
- '((t :inherit highlight))
- "Face used by Ivy to highlight certain candidates.")
-
-(defface ivy-prompt-match
- '((t :inherit ivy-current-match))
- "Face used by Ivy for highlighting the selected prompt line.")
-
-(defface ivy-separator
- '((t :inherit font-lock-doc-face))
- "Face for multiline source separator.")
-
-(defface ivy-grep-info
- '((t :inherit compilation-info))
- "Face for highlighting grep information such as file names.")
-
-(defface ivy-grep-line-number
- '((t :inherit compilation-line-number))
- "Face for displaying line numbers in grep messages.")
-
-(defface ivy-completions-annotations
- '((t :inherit completions-annotations))
- "Face for displaying completion annotations.")
-
-(defface ivy-yanked-word
- '((t :inherit highlight))
- "Face used to highlight yanked word.")
-
-;; Set default customization `:group' to `ivy' for the rest of the file.
-(setcdr (assoc load-file-name custom-current-group-alist) 'ivy)
-
-(defcustom ivy-height 10
- "Number of lines for the minibuffer window.
-
-See also `ivy-height-alist'."
- :type 'integer)
-
-(defcustom ivy-count-format "%-4d "
- "The style to use for displaying the current candidate count for `ivy-read'.
-Set this to \"\" to suppress the count visibility.
-Set this to \"(%d/%d) \" to display both the index and the count."
- :type '(choice
- (const :tag "Count disabled" "")
- (const :tag "Count matches" "%-4d ")
- (const :tag "Count matches and show current match" "(%d/%d) ")
- string))
-
-(defcustom ivy-pre-prompt-function nil
- "When non-nil, add strings before the `ivy-read' prompt."
- :type '(choice
- (const :tag "Do nothing" nil)
- (function :tag "Custom function")))
-
-(defcustom ivy-add-newline-after-prompt nil
- "When non-nil, add a newline after the `ivy-read' prompt."
- :type 'boolean)
-
-(defcustom ivy-wrap nil
- "When non-nil, wrap around after the first and the last candidate."
- :type 'boolean)
-
-(defcustom ivy-display-style (and (fboundp 'add-face-text-property) 'fancy)
- "The style for formatting the minibuffer.
-
-By default, the matched strings are copied as is.
-
-The fancy display style highlights matching parts of the regexp,
-a behavior similar to `swiper'.
-
-This setting depends on `add-face-text-property' - a C function
-available since Emacs 24.4. Fancy style will render poorly in
-earlier versions of Emacs."
- :type '(choice
- (const :tag "Plain" nil)
- (const :tag "Fancy" fancy)))
-
-(defcustom ivy-on-del-error-function #'abort-recursive-edit
- "Function to call when deletion fails during completion.
-The usual reason for `ivy-backward-delete-char' to fail is when
-there is no text left to delete, i.e., when it is called at the
-beginning of the minibuffer.
-The default setting provides a quick exit from completion."
- :type '(choice
- (const :tag "Exit completion" abort-recursive-edit)
- (const :tag "Do nothing" ignore)
- (function :tag "Custom function")))
-
-(defcustom ivy-extra-directories '("../" "./")
- "Add this to the front of the list when completing file names.
-Only \"./\" and \"../\" apply here. They appear in reverse order."
- :type '(repeat :tag "Dirs"
- (choice
- (const :tag "Parent Directory" "../")
- (const :tag "Current Directory" "./"))))
-
-(defcustom ivy-use-virtual-buffers nil
- "When non-nil, add recent files and/or bookmarks to `ivy-switch-buffer'.
-The value `recentf' includes only recent files to the virtual
-buffers list, whereas the value `bookmarks' does the same for
-bookmarks. Any other non-nil value includes both."
- :type '(choice
- (const :tag "Don't use virtual buffers" nil)
- (const :tag "Recent files" recentf)
- (const :tag "Bookmarks" bookmarks)
- (const :tag "All virtual buffers" t)))
-
-(defvar ivy--display-function nil
- "The display-function is used in current.")
-
-(defvar ivy-display-functions-props
- '((ivy-display-function-overlay :cleanup ivy-overlay-cleanup))
- "Map Ivy display functions to their property lists.
-Examples of properties include associated `:cleanup' functions.")
-
-(defcustom ivy-display-functions-alist
- '((ivy-completion-in-region . ivy-display-function-overlay)
- (t . nil))
- "An alist for customizing where to display the candidates.
-
-Each key is a caller symbol. When the value is nil (the default),
-the candidates are shown in the minibuffer. Otherwise, the value
-is a function which takes a string argument comprising the
-current matching candidates and displays it somewhere.
-
-See also `https://github.com/abo-abo/swiper/wiki/ivy-display-function'."
- :type '(alist
- :key-type symbol
- :value-type (choice
- (const :tag "Minibuffer" nil)
- (const :tag "LV" ivy-display-function-lv)
- (const :tag "Popup" ivy-display-function-popup)
- (const :tag "Overlay" ivy-display-function-overlay)
- (function :tag "Custom function"))))
-
-(defvar ivy-completing-read-dynamic-collection nil
- "Run `ivy-completing-read' with `:dynamic-collection t`.")
-
-(defcustom ivy-completing-read-handlers-alist
- '((tmm-menubar . completing-read-default)
- (tmm-shortcut . completing-read-default)
- (bbdb-create . ivy-completing-read-with-empty-string-def)
- (auto-insert . ivy-completing-read-with-empty-string-def)
- (Info-on-current-buffer . ivy-completing-read-with-empty-string-def)
- (Info-follow-reference . ivy-completing-read-with-empty-string-def)
- (Info-menu . ivy-completing-read-with-empty-string-def)
- (Info-index . ivy-completing-read-with-empty-string-def)
- (Info-virtual-index . ivy-completing-read-with-empty-string-def)
- (info-display-manual . ivy-completing-read-with-empty-string-def))
- "An alist of handlers to replace `completing-read' in `ivy-mode'."
- :type '(alist :key-type symbol :value-type function))
-
-(defcustom ivy-height-alist nil
- "An alist to customize `ivy-height'.
-
-It is a list of (CALLER . HEIGHT). CALLER is a caller of
-`ivy-read' and HEIGHT is the number of lines displayed.
-HEIGHT can also be a function that returns the number of lines."
- :type '(alist
- :key-type function
- :value-type (choice integer function)))
-
-(defvar ivy-completing-read-ignore-handlers-depth -1
- "Used to avoid infinite recursion.
-
-If `(minibuffer-depth)' equals this, `ivy-completing-read' will
-act as if `ivy-completing-read-handlers-alist' is empty.")
-
-(defvar ivy-highlight-grep-commands nil
- "List of grep-like commands.")
-
-(defvar ivy--actions-list nil
- "A list of extra actions per command.")
-
-(defun ivy-set-actions (cmd actions)
- "Set CMD extra exit points to ACTIONS."
- (setq ivy--actions-list
- (plist-put ivy--actions-list cmd actions)))
-
-(defun ivy-add-actions (cmd actions)
- "Add extra exit points ACTIONS to CMD.
-Existing exit points of CMD are overwritten by those in
-ACTIONS that have the same key."
- (setq ivy--actions-list
- (plist-put ivy--actions-list cmd
- (cl-delete-duplicates
- (append (plist-get ivy--actions-list cmd) actions)
- :key #'car :test #'equal))))
-
-(defun ivy--compute-extra-actions (action caller)
- "Add extra actions to ACTION based on CALLER."
- (let ((extra-actions (cl-delete-duplicates
- (append (plist-get ivy--actions-list t)
- (plist-get ivy--actions-list this-command)
- (plist-get ivy--actions-list caller))
- :key #'car :test #'equal)))
- (if extra-actions
- (cond ((functionp action)
- `(1
- ("o" ,action "default")
- ,@extra-actions))
- ((null action)
- `(1
- ("o" identity "default")
- ,@extra-actions))
- (t
- (delete-dups (append action extra-actions))))
- action)))
-
-(defvar ivy--prompts-list nil)
-
-(defun ivy-set-prompt (caller prompt-fn)
- "Associate CALLER with PROMPT-FN.
-PROMPT-FN is a function of no arguments that returns a prompt string."
- (setq ivy--prompts-list
- (plist-put ivy--prompts-list caller prompt-fn)))
-
-(defvar ivy--display-transformers-list nil
- "A list of str->str transformers per command.")
-
-(defun ivy-set-display-transformer (cmd transformer)
- "Set CMD a displayed candidate TRANSFORMER.
-
-It's a lambda that takes a string one of the candidates in the
-collection and returns a string for display, the same candidate
-plus some extra information.
-
-This lambda is called only on the `ivy-height' candidates that
-are about to be displayed, not on the whole collection."
- (setq ivy--display-transformers-list
- (plist-put ivy--display-transformers-list cmd transformer)))
-
-(defvar ivy--sources-list nil
- "A list of extra sources per command.")
-
-(defun ivy-set-sources (cmd sources)
- "Attach to CMD a list of extra SOURCES.
-
-Each static source is a function that takes no argument and
-returns a list of strings.
-
-The (original-source) determines the position of the original
-dynamic source.
-
-Extra dynamic sources aren't supported yet.
-
-Example:
-
- (defun small-recentf ()
- (cl-subseq recentf-list 0 20))
-
- (ivy-set-sources
- 'counsel-locate
- '((small-recentf)
- (original-source)))"
- (setq ivy--sources-list
- (plist-put ivy--sources-list cmd sources)))
-
-(defun ivy--compute-extra-candidates (caller)
- (let ((extra-sources (or (plist-get ivy--sources-list caller)
- '((original-source))))
- (result nil))
- (dolist (source extra-sources)
- (cond ((equal source '(original-source))
- (push source result))
- ((null (cdr source))
- (push (list (car source) (funcall (car source))) result))))
- result))
-
-(defvar ivy-current-prefix-arg nil
- "Prefix arg to pass to actions.
-This is a global variable that is set by ivy functions for use in
-action functions.")
-
-;;* Keymap
-(require 'delsel)
-(defvar ivy-minibuffer-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-m") 'ivy-done)
- (define-key map [down-mouse-1] 'ignore)
- (define-key map [mouse-1] 'ivy-mouse-done)
- (define-key map [mouse-3] 'ivy-mouse-dispatching-done)
- (define-key map (kbd "C-M-m") 'ivy-call)
- (define-key map (kbd "C-j") 'ivy-alt-done)
- (define-key map (kbd "C-M-j") 'ivy-immediate-done)
- (define-key map (kbd "TAB") 'ivy-partial-or-done)
- (define-key map [remap next-line] 'ivy-next-line)
- (define-key map [remap previous-line] 'ivy-previous-line)
- (define-key map (kbd "C-s") 'ivy-next-line-or-history)
- (define-key map (kbd "C-r") 'ivy-reverse-i-search)
- (define-key map (kbd "SPC") 'self-insert-command)
- (define-key map [remap delete-backward-char] 'ivy-backward-delete-char)
- (define-key map [remap backward-delete-char-untabify]
'ivy-backward-delete-char)
- (define-key map [remap backward-kill-word] 'ivy-backward-kill-word)
- (define-key map [remap delete-char] 'ivy-delete-char)
- (define-key map [remap forward-char] 'ivy-forward-char)
- (define-key map (kbd "<right>") 'ivy-forward-char)
- (define-key map [remap kill-word] 'ivy-kill-word)
- (define-key map [remap beginning-of-buffer] 'ivy-beginning-of-buffer)
- (define-key map [remap end-of-buffer] 'ivy-end-of-buffer)
- (define-key map (kbd "M-n") 'ivy-next-history-element)
- (define-key map (kbd "M-p") 'ivy-previous-history-element)
- (define-key map (kbd "C-g") 'minibuffer-keyboard-quit)
- (define-key map [remap scroll-up-command] 'ivy-scroll-up-command)
- (define-key map [remap scroll-down-command] 'ivy-scroll-down-command)
- (define-key map (kbd "<next>") 'ivy-scroll-up-command)
- (define-key map (kbd "<prior>") 'ivy-scroll-down-command)
- (define-key map (kbd "C-v") 'ivy-scroll-up-command)
- (define-key map (kbd "M-v") 'ivy-scroll-down-command)
- (define-key map (kbd "C-M-n") 'ivy-next-line-and-call)
- (define-key map (kbd "C-M-p") 'ivy-previous-line-and-call)
- (define-key map (kbd "M-r") 'ivy-toggle-regexp-quote)
- (define-key map (kbd "M-j") 'ivy-yank-word)
- (define-key map (kbd "M-i") 'ivy-insert-current)
- (define-key map (kbd "C-M-y") 'ivy-insert-current-full)
- (define-key map (kbd "C-o") 'hydra-ivy/body)
- (define-key map (kbd "M-o") 'ivy-dispatching-done)
- (define-key map (kbd "C-M-o") 'ivy-dispatching-call)
- (define-key map [remap kill-line] 'ivy-kill-line)
- (define-key map [remap kill-whole-line] 'ivy-kill-whole-line)
- (define-key map (kbd "S-SPC") 'ivy-restrict-to-matches)
- (define-key map [remap kill-ring-save] 'ivy-kill-ring-save)
- (define-key map (kbd "C-'") 'ivy-avy)
- (define-key map (kbd "C-M-a") 'ivy-read-action)
- (define-key map (kbd "C-c C-o") 'ivy-occur)
- (define-key map (kbd "C-c C-a") 'ivy-toggle-ignore)
- (define-key map (kbd "C-c C-s") 'ivy-rotate-sort)
- (define-key map [remap describe-mode] 'ivy-help)
- (define-key map "$" 'ivy-magic-read-file-env)
- map)
- "Keymap used in the minibuffer.")
-(autoload 'hydra-ivy/body "ivy-hydra" "" t)
-
-(defvar ivy-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map [remap switch-to-buffer]
- 'ivy-switch-buffer)
- (define-key map [remap switch-to-buffer-other-window]
- 'ivy-switch-buffer-other-window)
- map)
- "Keymap for `ivy-mode'.")
-
-;;* Globals
-(cl-defstruct ivy-state
- prompt collection
- predicate require-match initial-input
- history preselect keymap update-fn sort
- ;; The frame in which `ivy-read' was called
- frame
- ;; The window in which `ivy-read' was called
- window
- ;; The buffer in which `ivy-read' was called
- buffer
- ;; The value of `ivy-text' to be used by `ivy-occur'
- text
- action
- unwind
- re-builder
- matcher
- ;; When this is non-nil, call it for each input change to get new candidates
- dynamic-collection
- ;; A lambda that transforms candidates only for display
- display-transformer-fn
- directory
- caller
- current
- def
- ignore
- multi-action
- extra-props)
-
-(defvar ivy-last (make-ivy-state)
- "The last parameters passed to `ivy-read'.
-
-This should eventually become a stack so that you could use
-`ivy-read' recursively.")
-
-(defvar ivy-recursive-last nil)
-
-(defvar ivy-recursive-restore t
- "When non-nil, restore the above state when exiting the minibuffer.
-This variable is let-bound to nil by functions that take care of
-the restoring themselves.")
-
-(defsubst ivy-set-action (action)
- "Set the current `ivy-last' field to ACTION."
- (setf (ivy-state-action ivy-last) action))
-
-(defvar inhibit-message)
-
-(defun ivy-thing-at-point ()
- "Return a string that corresponds to the current thing at point."
- (substring-no-properties
- (cond
- ((use-region-p)
- (let* ((beg (region-beginning))
- (end (region-end))
- (eol (save-excursion (goto-char beg) (line-end-position))))
- (buffer-substring-no-properties beg (min end eol))))
- ((thing-at-point 'url))
- ((and (eq (ivy-state-collection ivy-last) #'read-file-name-internal)
- (let ((inhibit-message t))
- (run-hook-with-args-until-success
'file-name-at-point-functions))))
- ((let ((s (thing-at-point 'symbol)))
- (and (stringp s)
- (if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
- (match-string 1 s)
- s))))
- ((looking-at "(+\\(\\(?:\\sw\\|\\s_\\)+\\)\\_>")
- (match-string-no-properties 1))
- (t
- ""))))
-
-(defvar ivy-history nil
- "History list of candidates entered in the minibuffer.
-
-Maximum length of the history list is determined by the value
-of `history-length'.")
-
-(defvar ivy--directory nil
- "Current directory when completing file names.")
-
-(defvar ivy--length 0
- "Store the amount of viable candidates.")
-
-(defvar ivy-text ""
- "Store the user's string as it is typed in.")
-
-(defvar ivy--index 0
- "Store the index of the current candidate.")
-
-(defvar ivy--window-index 0
- "Store the index of the current candidate in the minibuffer window.
-
-This means it's between 0 and `ivy-height'.")
-
-(defvar ivy-exit nil
- "Store `done' if the completion was successfully selected.
-Otherwise, store nil.")
-
-(defvar ivy--all-candidates nil
- "Store the candidates passed to `ivy-read'.")
-
-(defvar ivy--extra-candidates '((original-source))
- "Store candidates added by the extra sources.
-
-This is an internal-use alist. Each key is a function name, or
-original-source (which represents where the current dynamic
-candidates should go).
-
-Each value is an evaluation of the function, in case of static
-sources. These values will subsequently be filtered on `ivy-text'.
-
-This variable is set by `ivy-read' and used by `ivy--set-candidates'.")
-
-(defcustom ivy-use-ignore-default t
- "The default policy for user-configured candidate filtering."
- :type '(choice
- (const :tag "Ignore ignored always" always)
- (const :tag "Ignore ignored when others exist" t)
- (const :tag "Don't ignore" nil)))
-
-(defvar ivy-use-ignore t
- "Store policy for user-configured candidate filtering.
-This may be changed dynamically by `ivy-toggle-ignore'.
-Use `ivy-use-ignore-default' for a permanent configuration.")
-
-(defvar ivy--default nil
- "Default initial input.")
-
-(defvar ivy--prompt nil
- "Store the format-style prompt.
-When non-nil, it should contain at least one %d.")
-
-(defvar ivy--prompt-extra ""
- "Temporary modifications to the prompt.")
-
-(defvar ivy--old-re nil
- "Store the old regexp.
-Either a string or a list for `ivy-re-match'.")
-
-(defvar ivy--old-cands nil
- "Store the candidates matched by `ivy--old-re'.")
-
-(defvar ivy--regex-function 'ivy--regex
- "Current function for building a regex.")
-
-(defvar ivy--highlight-function 'ivy--highlight-default
- "Current function for formatting the candidates.")
-
-(defvar ivy--subexps 0
- "Number of groups in the current `ivy--regex'.")
-
-(defvar ivy--full-length nil
- "The total amount of candidates when :dynamic-collection is non-nil.")
-
-(defvar ivy--old-text ""
- "Store old `ivy-text' for dynamic completion.")
-
-(defvar ivy--trying-to-resume-dynamic-collection nil
- "Non-nil if resuming from a dynamic collection.
-When non-nil, ivy will wait until the first chunk of asynchronous
-candidates has been received before selecting the last
-preselected candidate.")
-
-(defun ivy--set-index-dynamic-collection ()
- (when ivy--trying-to-resume-dynamic-collection
- (let ((preselect-index
- (ivy--preselect-index (ivy-state-preselect ivy-last)
ivy--all-candidates)))
- (when preselect-index
- (ivy-set-index preselect-index)))
- (setq ivy--trying-to-resume-dynamic-collection nil)))
-
-(defcustom ivy-case-fold-search-default
- (if search-upper-case
- 'auto
- case-fold-search)
- "The default value for `case-fold-search' in Ivy operations.
-The special value `auto' means case folding is performed so long
-as the entire input string comprises lower-case characters. This
-corresponds to the default behaviour of most Emacs search
-functionality, e.g. as seen in `isearch'."
- :link '(info-link "(emacs)Lax Search")
- :type '(choice
- (const :tag "Auto" auto)
- (const :tag "Always" t)
- (const :tag "Never" nil)))
-
-(defvar ivy-case-fold-search ivy-case-fold-search-default
- "Store the current overriding `case-fold-search'.")
-
-(defvar ivy-more-chars-alist
- '((t . 3))
- "Map commands to their minimum required input length.
-That is the number of characters prompted for before fetching
-candidates. The special key t is used as a fallback.")
-
-(defun ivy-more-chars ()
- "Return two fake candidates prompting for at least N input.
-N is obtained from `ivy-more-chars-alist'."
- (let ((diff (- (ivy-alist-setting ivy-more-chars-alist)
- (length ivy-text))))
- (when (> diff 0)
- (list "" (format "%d chars more" diff)))))
-
-(defun ivy--case-fold-p (string)
- "Return nil if STRING should be matched case-sensitively."
- (if (eq ivy-case-fold-search 'auto)
- (string= string (downcase string))
- ivy-case-fold-search))
-
-(defun ivy--case-fold-string= (s1 s2)
- "Like `string=', but obeys `case-fold-search'."
- (eq t (compare-strings s1 nil nil s2 nil nil case-fold-search)))
-
-(eval-and-compile
- (unless (fboundp 'defvar-local)
- (defmacro defvar-local (var val &optional docstring)
- "Define VAR as a buffer-local variable with default value VAL."
- (declare (debug defvar) (doc-string 3))
- (list 'progn (list 'defvar var val docstring)
- (list 'make-variable-buffer-local (list 'quote var)))))
- (unless (fboundp 'setq-local)
- (defmacro setq-local (var val)
- "Set variable VAR to value VAL in current buffer."
- (list 'set (list 'make-local-variable (list 'quote var)) val))))
-
-(defmacro ivy-quit-and-run (&rest body)
- "Quit the minibuffer and run BODY afterwards."
- (declare (indent 0))
- `(progn
- (put 'quit 'error-message "")
- (run-at-time nil nil
- (lambda ()
- (put 'quit 'error-message "Quit")
- (with-demoted-errors "Error: %S"
- ,@body)))
- (abort-recursive-edit)))
-
-(defun ivy-exit-with-action (action)
- "Quit the minibuffer and call ACTION afterwards."
- (ivy-set-action
- `(lambda (x)
- (funcall ',action x)
- (ivy-set-action ',(ivy-state-action ivy-last))))
- (setq ivy-exit 'done)
- (exit-minibuffer))
-
-(defmacro with-ivy-window (&rest body)
- "Execute BODY in the window from which `ivy-read' was called."
- (declare (indent 0)
- (debug t))
- `(with-selected-window (ivy--get-window ivy-last)
- ,@body))
-
-(defun ivy--done (text)
- "Insert TEXT and exit minibuffer."
- (if (member (ivy-state-prompt ivy-last) '("Create directory: " "Make
directory: "))
- (ivy-immediate-done)
- (if (stringp text)
- (insert
- (setf (ivy-state-current ivy-last)
- (if (and ivy--directory
- (not (eq (ivy-state-history ivy-last)
'grep-files-history)))
- (expand-file-name text ivy--directory)
- text))))
- (setq ivy-exit 'done)
- (exit-minibuffer)))
-
-(defcustom ivy-use-selectable-prompt nil
- "When non-nil, make the prompt line selectable like a candidate.
-
-The prompt line can be selected by calling `ivy-previous-line' when the first
-regular candidate is selected. Both actions `ivy-done' and `ivy-alt-done',
-when called on a selected prompt, are forwarded to `ivy-immediate-done', which
-results to the same as calling `ivy-immediate-done' explicitly when a regular
-candidate is selected.
-
-Note that if `ivy-wrap' is set to t, calling `ivy-previous-line' when the
-prompt is selected wraps around to the last candidate, while calling
-`ivy-next-line' on the last candidate wraps around to the first
-candidate, not the prompt."
- :type 'boolean)
-
-(defvar ivy--use-selectable-prompt nil
- "Store the effective `ivy-use-selectable-prompt' for current session.")
-
-(defun ivy--prompt-selectable-p ()
- "Return t if the prompt line is selectable."
- (and ivy-use-selectable-prompt
- (or (memq (ivy-state-require-match ivy-last)
- '(nil confirm confirm-after-completion))
- ;; :require-match is t, but "" is in the collection
- (let ((coll (ivy-state-collection ivy-last)))
- (and (listp coll)
- (if (consp (car coll))
- (member '("") coll)
- (member "" coll)))))))
-
-(defun ivy--prompt-selected-p ()
- "Return t if the prompt line is selected."
- (and ivy--use-selectable-prompt
- (= ivy--index -1)))
-
-;;* Commands
-(defun ivy-done ()
- "Exit the minibuffer with the selected candidate."
- (interactive)
- (if (ivy--prompt-selected-p)
- (ivy-immediate-done)
- (setq ivy-current-prefix-arg current-prefix-arg)
- (delete-minibuffer-contents)
- (cond ((or (> ivy--length 0)
- ;; the action from `ivy-dispatching-done' may not need a
- ;; candidate at all
- (eq this-command 'ivy-dispatching-done))
- (ivy--done (ivy-state-current ivy-last)))
- ((memq (ivy-state-collection ivy-last)
- '(read-file-name-internal internal-complete-buffer))
- (if (or (not (eq confirm-nonexistent-file-or-buffer t))
- (equal " (confirm)" ivy--prompt-extra))
- (ivy--done ivy-text)
- (setq ivy--prompt-extra " (confirm)")
- (insert ivy-text)
- (ivy--exhibit)))
- ((memq (ivy-state-require-match ivy-last)
- '(nil confirm confirm-after-completion))
- (ivy--done ivy-text))
- (t
- (setq ivy--prompt-extra " (match required)")
- (insert ivy-text)
- (ivy--exhibit)))))
-
-(defvar ivy-mouse-1-tooltip
- "Exit the minibuffer with the selected candidate."
- "The doc visible in the tooltip for mouse-1 binding in the minibuffer")
-(defvar ivy-mouse-3-tooltip
- "Display alternative actions."
- "The doc visible in the tooltip for mouse-3 binding in the minibuffer")
-
-(defun ivy-mouse-offset (event)
- "Compute the offset between the candidate at point and the selected one."
- (if event
- (let* ((line-number-at-point
- (max 2
- (line-number-at-pos (posn-point (event-start event)))))
-
- (line-number-candidate ;; convert to 0 based index
- (- line-number-at-point 2))
- (offset
- (- line-number-candidate
- ivy--window-index)))
- offset)
- nil))
-
-(defun ivy-mouse-done (event)
- (interactive "@e")
- (let ((offset (ivy-mouse-offset event)))
- (when offset
- (ivy-next-line offset)
- (ivy--exhibit)
- (ivy-alt-done))))
-
-(defun ivy-mouse-dispatching-done (event)
- (interactive "@e")
- (let ((offset (ivy-mouse-offset event)))
- (when offset
- (ivy-next-line offset)
- (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.")
-
-(defun ivy-read-action-format-default (actions)
- "Create a docstring from ACTIONS.
-
-ACTIONS is a list. Each list item is a list of 3 items:
-key (a string), cmd and doc (a string)."
- (format "%s\n%s\n"
- (if (eq this-command 'ivy-read-action)
- "Select action: "
- (ivy-state-current ivy-last))
- (mapconcat
- (lambda (x)
- (format "%s: %s"
- (propertize
- (car x)
- 'face 'ivy-action)
- (nth 2 x)))
- actions
- "\n")))
-
-(defcustom ivy-read-action-function #'ivy-read-action-by-key
- "Function used to read an action."
- :type '(radio
- (function-item ivy-read-action-by-key)
- (function-item ivy-read-action-ivy)
- (function-item ivy-read-action-hydra)))
-
-(defun ivy-read-action ()
- "Change the action to one of the available ones.
-
-Return nil for `minibuffer-keyboard-quit' or wrong key during the
-selection, non-nil otherwise."
- (interactive)
- (let ((actions (ivy-state-action ivy-last)))
- (if (not (ivy--actionp actions))
- t
- (funcall ivy-read-action-function actions))))
-
-(defun ivy-read-action-by-key (actions)
- (let* ((hint (funcall ivy-read-action-format-function (cdr actions)))
- (resize-mini-windows t)
- (key "")
- action-idx)
- (while (and (setq action-idx (cl-position-if
- (lambda (x)
- (string-prefix-p key (car x)))
- (cdr actions)))
- (not (string= key (car (nth action-idx (cdr actions))))))
- (setq key (concat key (string (read-key hint)))))
- (ivy-shrink-after-dispatching)
- (cond ((member key '("" ""))
- nil)
- ((null action-idx)
- (message "%s is not bound" key)
- nil)
- (t
- (message "")
- (setcar actions (1+ action-idx))
- (ivy-set-action actions)))))
-
-(defun ivy-read-action-ivy (actions)
- "Select an action from ACTIONS using Ivy."
- (let ((enable-recursive-minibuffers t))
- (if (and (> (minibuffer-depth) 1)
- (eq (ivy-state-caller ivy-last) 'ivy-read-action-ivy))
- (minibuffer-keyboard-quit)
- (ivy-read (format "action (%s): " (ivy-state-current ivy-last))
- (cl-mapcar
- (lambda (a i) (cons (format "[%s] %s" (nth 0 a) (nth 2 a)) i))
- (cdr actions) (number-sequence 1 (length (cdr actions))))
- :action (lambda (a)
- (setcar actions (cdr a))
- (ivy-set-action actions))
- :caller 'ivy-read-action-ivy))))
-
-(defun ivy-shrink-after-dispatching ()
- "Shrink the window after dispatching when action list is too large."
- (window-resize nil (- ivy-height (window-height))))
-
-(defun ivy-dispatching-done ()
- "Select one of the available actions and call `ivy-done'."
- (interactive)
- (when (ivy-read-action)
- (ivy-done))
- (ivy-shrink-after-dispatching))
-
-(defun ivy-dispatching-call ()
- "Select one of the available actions and call `ivy-call'."
- (interactive)
- (setq ivy-current-prefix-arg current-prefix-arg)
- (let ((actions (copy-sequence (ivy-state-action ivy-last))))
- (unwind-protect
- (when (ivy-read-action)
- (ivy-call))
- (ivy-set-action actions)))
- (ivy-shrink-after-dispatching))
-
-(defun ivy-build-tramp-name (x)
- "Reconstruct X into a path.
-Is is a cons cell, related to `tramp-get-completion-function'."
- (let ((user (car x))
- (domain (cadr x)))
- (if user
- (concat user "@" domain)
- domain)))
-
-(declare-function Info-find-node "info")
-(declare-function Info-read-node-name-1 "info")
-(declare-function tramp-get-completion-function "tramp")
-
-(defun ivy-alt-done (&optional arg)
- "Exit the minibuffer with the selected candidate.
-When ARG is t, exit with current text, ignoring the candidates.
-When the current candidate during file name completion is a
-directory, continue completion from within that directory instead
-of exiting. This function is otherwise like `ivy-done'."
- (interactive "P")
- (setq ivy-current-prefix-arg current-prefix-arg)
- (cond ((or arg
- (ivy--prompt-selected-p))
- (ivy-immediate-done))
- (ivy--directory
- (ivy--directory-done))
- ((eq (ivy-state-collection ivy-last) #'Info-read-node-name-1)
- (if (member (ivy-state-current ivy-last) '("(./)" "(../)"))
- (ivy-quit-and-run
- (ivy-read "Go to file: " #'read-file-name-internal
- :action (lambda (x)
- (Info-find-node
- (expand-file-name x ivy--directory)
- "Top"))))
- (ivy-done)))
- (t
- (ivy-done))))
-
-(defvar ivy-auto-select-single-candidate nil
- "When non-nil, auto-select the candidate if it is the only one.
-When t, it is the same as if the user were prompted and selected the candidate
-by calling the default action. This variable has no use unless the collection
-contains a single candidate.")
-
-(defun ivy--directory-enter ()
- (let (dir)
- (when (and
- (> ivy--length 0)
- (not (string= (ivy-state-current ivy-last) "./"))
- (setq dir (ivy-expand-file-if-directory (ivy-state-current
ivy-last))))
- (ivy--cd dir)
- (ivy--exhibit))))
-
-(defun ivy--handle-directory (input)
- "Detect the next directory based on special values of INPUT."
- (cond ((string= input "/")
- "/")
- ((string= input "/sudo::")
- (concat input ivy--directory))))
-
-(defun ivy--directory-done ()
- "Handle exit from the minibuffer when completing file names."
- (let ((dir (ivy--handle-directory ivy-text)))
- (cond
- (dir
- (let ((inhibit-message t))
- (ivy--cd dir)))
- ((ivy--directory-enter))
- ((unless (string= ivy-text "")
- (let ((file (expand-file-name
- (if (> ivy--length 0) (ivy-state-current ivy-last)
ivy-text)
- ivy--directory)))
- (when (ignore-errors (file-exists-p file))
- (if (file-directory-p file)
- (ivy--cd (file-name-as-directory file))
- (ivy-done))
- ivy-text))))
- ((or (and (equal ivy--directory "/")
- (string-match-p "\\`[^/]+:.*:.*\\'" ivy-text))
- (string-match-p "\\`/[^/]+:.*:.*\\'" ivy-text))
- (ivy-done))
- ((or (and (equal ivy--directory "/")
- (cond ((string-match
- "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
- ivy-text)
- (setq ivy-text (ivy-state-current ivy-last)))
- ((string-match
- "\\`\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
- (ivy-state-current ivy-last))
- (setq ivy-text (ivy-state-current ivy-last)))))
- (string-match
- "\\`/\\([^/]+?\\):\\(?:\\(.*\\)@\\)?\\(.*\\)\\'"
- ivy-text))
- (let ((method (match-string 1 ivy-text))
- (user (match-string 2 ivy-text))
- (rest (match-string 3 ivy-text))
- res)
- (dolist (x (tramp-get-completion-function method))
- (setq res (append res (funcall (car x) (cadr x)))))
- (setq res (delq nil res))
- (when user
- (dolist (x res)
- (setcar x user)))
- (setq res (delete-dups res))
- (let* ((old-ivy-last ivy-last)
- (enable-recursive-minibuffers t)
- (host (let ((ivy-auto-select-single-candidate nil))
- (ivy-read "user@host: "
- (mapcar #'ivy-build-tramp-name res)
- :initial-input rest))))
- (setq ivy-last old-ivy-last)
- (when host
- (setq ivy--directory "/")
- (ivy--cd (concat "/" method ":" host ":"))))))
- (t
- (ivy-done)))))
-
-(defun ivy-expand-file-if-directory (file-name)
- "Expand FILE-NAME as directory.
-When this directory doesn't exist, return nil."
- (when (stringp file-name)
- (let ((full-name
- ;; Ignore host name must not match method "ssh"
- (ignore-errors
- (file-name-as-directory
- (expand-file-name file-name ivy--directory)))))
- (when (and full-name (file-directory-p full-name))
- full-name))))
-
-(defcustom ivy-tab-space nil
- "When non-nil, `ivy-partial-or-done' should insert a space."
- :type 'boolean)
-
-(defun ivy-partial-or-done ()
- "Complete the minibuffer text as much as possible.
-If the text hasn't changed as a result, forward to `ivy-alt-done'."
- (interactive)
- (cond
- ((and completion-cycle-threshold (< (length ivy--all-candidates)
completion-cycle-threshold))
- (let ((ivy-wrap t))
- (ivy-next-line)))
- ((and (eq (ivy-state-collection ivy-last) #'read-file-name-internal)
- (or (and (equal ivy--directory "/")
- (string-match-p "\\`[^/]+:.*\\'" ivy-text))
- (= (string-to-char ivy-text) ?/)))
- (let ((default-directory ivy--directory)
- dir)
- (minibuffer-complete)
- (setq ivy-text (ivy--input))
- (when (setq dir (ivy-expand-file-if-directory ivy-text))
- (ivy--cd dir))))
- (t
- (or (ivy-partial)
- (when (or (eq this-command last-command)
- (eq ivy--length 1))
- (ivy-alt-done))))))
-
-(defun ivy--remove-prefix (prefix string)
- "Compatibility shim for `string-remove-prefix'."
- (if (string-prefix-p prefix string)
- (substring string (length prefix))
- string))
-
-(defun ivy--partial-cd-for-single-directory ()
- (when (and
- (eq (ivy-state-collection ivy-last) #'read-file-name-internal)
- (= 1 (length
- (ivy--re-filter
- (funcall ivy--regex-function ivy-text) ivy--all-candidates)))
- (let ((default-directory ivy--directory))
- (file-directory-p (ivy-state-current ivy-last))))
- (ivy--directory-done)))
-
-(defun ivy-partial ()
- "Complete the minibuffer text as much as possible."
- (interactive)
- (let* ((parts (or (ivy--split-spaces ivy-text) (list "")))
- (tail (last parts))
- (postfix (car tail))
- (case-fold-search (ivy--case-fold-p ivy-text))
- (completion-ignore-case case-fold-search)
- (new (try-completion (ivy--remove-prefix "^" postfix)
- (if (ivy-state-dynamic-collection ivy-last)
- ivy--all-candidates
- (mapcar (lambda (str)
- (let ((i (string-match-p postfix
str)))
- (and i (substring str i))))
- ivy--old-cands)))))
- (cond ((eq new t) nil)
- ((string= new ivy-text) nil)
- ((string= (car tail) (car (ivy--split-spaces new))) nil)
- (new
- (delete-region (minibuffer-prompt-end) (point-max))
- (setcar tail
- (if (= (string-to-char postfix) ?^)
- (concat "^" new)
- new))
- (insert
- (setq ivy-text
- (concat
- (mapconcat #'identity parts " ")
- (and ivy-tab-space (not (= (length ivy--old-cands) 1)) "
"))))
- (ivy--partial-cd-for-single-directory)
- t))))
-
-(defvar ivy-completion-beg nil
- "Completion bounds start.")
-
-(defvar ivy-completion-end nil
- "Completion bounds end.")
-
-(defun ivy-immediate-done ()
- "Exit the minibuffer with current input instead of current candidate."
- (interactive)
- (delete-minibuffer-contents)
- (setf (ivy-state-current ivy-last)
- (cond ((or (not ivy--directory)
- (eq (ivy-state-history ivy-last) 'grep-files-history))
- ivy-text)
- ((and (string= ivy-text "")
- (eq (ivy-state-collection ivy-last)
- #'read-file-name-internal))
- (if (ivy-state-def ivy-last)
- (if (and
- (file-exists-p (ivy-state-def ivy-last))
- (/= (length ivy--directory)
- (1+ (length (expand-file-name (ivy-state-def
ivy-last))))))
- ivy--directory
- (copy-sequence (ivy-state-def ivy-last)))
- ivy--directory))
- (t
- (expand-file-name ivy-text ivy--directory))))
- (insert (ivy-state-current ivy-last))
- (setq ivy-completion-beg ivy-completion-end)
- (setq ivy-exit 'done)
- (exit-minibuffer))
-
-;;;###autoload
-(defun ivy-resume ()
- "Resume the last completion session."
- (interactive)
- (if (null (ivy-state-action ivy-last))
- (user-error "The last session isn't compatible with `ivy-resume'")
- (when (memq (ivy-state-caller ivy-last)
- '(swiper swiper-isearch swiper-backward
swiper-isearch-backward))
- (switch-to-buffer (ivy-state-buffer ivy-last)))
- (with-current-buffer (ivy-state-buffer ivy-last)
- (let ((default-directory (ivy-state-directory ivy-last))
- (ivy-use-ignore-default (ivy-state-ignore ivy-last)))
- (ivy-read
- (ivy-state-prompt ivy-last)
- (ivy-state-collection ivy-last)
- :predicate (ivy-state-predicate ivy-last)
- :require-match (ivy-state-require-match ivy-last)
- :initial-input ivy-text
- :history (ivy-state-history ivy-last)
- :preselect (ivy-state-current ivy-last)
- :keymap (ivy-state-keymap ivy-last)
- :update-fn (ivy-state-update-fn ivy-last)
- :sort (ivy-state-sort ivy-last)
- :action (ivy-state-action ivy-last)
- :unwind (ivy-state-unwind ivy-last)
- :re-builder (ivy-state-re-builder ivy-last)
- :matcher (ivy-state-matcher ivy-last)
- :dynamic-collection (ivy-state-dynamic-collection ivy-last)
- :extra-props (ivy-state-extra-props ivy-last)
- :caller (ivy-state-caller ivy-last))))))
-
-(defvar-local ivy-calling nil
- "When non-nil, call the current action when `ivy--index' changes.")
-
-(defun ivy-set-index (index)
- "Set `ivy--index' to INDEX."
- (setq ivy--index index)
- (when ivy-calling
- (ivy--exhibit)
- (ivy-call)))
-
-(defun ivy-beginning-of-buffer ()
- "Select the first completion candidate."
- (interactive)
- (ivy-set-index 0))
-
-(defun ivy-end-of-buffer ()
- "Select the last completion candidate."
- (interactive)
- (ivy-set-index (1- ivy--length)))
-
-(defun ivy-scroll-up-command ()
- "Scroll the candidates upward by the minibuffer height."
- (interactive)
- (ivy-set-index (min (1- (+ ivy--index ivy-height))
- (1- ivy--length))))
-
-(defun ivy-scroll-down-command ()
- "Scroll the candidates downward by the minibuffer height."
- (interactive)
- (ivy-set-index (max (1+ (- ivy--index ivy-height))
- 0)))
-
-(defun ivy-minibuffer-grow ()
- "Grow the minibuffer window by 1 line."
- (interactive)
- (setq-local max-mini-window-height
- (cl-incf ivy-height)))
-
-(defun ivy-minibuffer-shrink ()
- "Shrink the minibuffer window by 1 line."
- (interactive)
- (when (> ivy-height 2)
- (setq-local max-mini-window-height
- (cl-decf ivy-height))
- (window-resize nil -1)))
-
-(defun ivy-next-line (&optional arg)
- "Move cursor vertically down ARG candidates."
- (interactive "p")
- (setq arg (or arg 1))
- (let ((index (+ ivy--index arg)))
- (if (> index (1- ivy--length))
- (if ivy-wrap
- (ivy-beginning-of-buffer)
- (ivy-set-index (1- ivy--length)))
- (ivy-set-index index))))
-
-(defun ivy-next-line-or-history (&optional arg)
- "Move cursor vertically down ARG candidates.
-If the input is empty, select the previous history element instead."
- (interactive "p")
- (if (string= ivy-text "")
- (ivy-previous-history-element 1)
- (ivy-next-line arg)))
-
-(defun ivy-previous-line (&optional arg)
- "Move cursor vertically up ARG candidates."
- (interactive "p")
- (setq arg (or arg 1))
- (let ((index (- ivy--index arg))
- (min-index (if ivy--use-selectable-prompt -1 0)))
- (if (< index min-index)
- (if ivy-wrap
- (ivy-end-of-buffer)
- (ivy-set-index min-index))
- (ivy-set-index index))))
-
-(defun ivy-previous-line-or-history (arg)
- "Move cursor vertically up ARG candidates.
-If the input is empty, select the previous history element instead."
- (interactive "p")
- (when (string= ivy-text "")
- (ivy-previous-history-element 1))
- (ivy-previous-line arg))
-
-(defun ivy-toggle-calling ()
- "Flip `ivy-calling'."
- (interactive)
- (when (setq ivy-calling (not ivy-calling))
- (ivy-call)))
-
-(defun ivy-toggle-ignore ()
- "Toggle user-configured candidate filtering."
- (interactive)
- (setq ivy-use-ignore
- (if ivy-use-ignore
- nil
- (or ivy-use-ignore-default t)))
- (setf (ivy-state-ignore ivy-last) ivy-use-ignore)
- ;; invalidate cache
- (setq ivy--old-cands nil))
-
-(defun ivy--get-action (state)
- "Get the action function from STATE."
- (let ((action (ivy-state-action state)))
- (when action
- (if (functionp action)
- action
- (cadr (nth (car action) action))))))
-
-(defun ivy--get-window (state)
- "Get the window from STATE."
- (if (ivy-state-p state)
- (let ((window (ivy-state-window state)))
- (if (window-live-p window)
- window
- (next-window)))
- (selected-window)))
-
-(defun ivy--actionp (x)
- "Return non-nil when X is a list of actions."
- (and (consp x) (not (memq (car x) '(closure lambda)))))
-
-(defcustom ivy-action-wrap nil
- "When non-nil, `ivy-next-action' and `ivy-prev-action' wrap."
- :type 'boolean)
-
-(defun ivy-next-action ()
- "When the current action is a list, scroll it forwards."
- (interactive)
- (let ((action (ivy-state-action ivy-last)))
- (when (ivy--actionp action)
- (let ((len (1- (length action)))
- (idx (car action)))
- (if (>= idx len)
- (when ivy-action-wrap
- (setf (car action) 1))
- (cl-incf (car action)))))))
-
-(defun ivy-prev-action ()
- "When the current action is a list, scroll it backwards."
- (interactive)
- (let ((action (ivy-state-action ivy-last)))
- (when (ivy--actionp action)
- (if (<= (car action) 1)
- (when ivy-action-wrap
- (setf (car action) (1- (length action))))
- (cl-decf (car action))))))
-
-(defun ivy-action-name ()
- "Return the name associated with the current action."
- (let ((action (ivy-state-action ivy-last)))
- (if (ivy--actionp action)
- (format "[%d/%d] %s"
- (car action)
- (1- (length action))
- (nth 2 (nth (car action) action)))
- "[1/1] default")))
-
-(defvar ivy-inhibit-action nil
- "When non-nil, `ivy-call' does nothing.
-
-Example use:
-
- (let* ((ivy-inhibit-action t)
- (str (ivy-switch-buffer)))
- ;; do whatever with str - the corresponding buffer will not be opened
- )")
-
-(defun ivy-recursive-restore ()
- "Restore the above state when exiting the minibuffer.
-See variable `ivy-recursive-restore' for further information."
- (when (and ivy-recursive-last
- ivy-recursive-restore
- (not (eq ivy-last ivy-recursive-last)))
- (ivy--reset-state (setq ivy-last ivy-recursive-last))))
-
-(defvar ivy-marked-candidates nil
- "List of marked candidates.
-Use `ivy-mark' to populate this.
-
-When this list is non-nil at the end of the session, the action
-will be called for each element of this list.")
-
-(defvar ivy-mark-prefix ">"
- "Prefix used by `ivy-mark'.")
-
-(defun ivy-call ()
- "Call the current action without exiting completion."
- (interactive)
- ;; Testing with `ivy-with' seems to call `ivy-call' again,
- ;; in which case `this-command' is nil; so check for this.
- (unless (memq this-command '(nil
- ivy-done
- ivy-alt-done
- ivy-dispatching-done))
- (setq ivy-current-prefix-arg current-prefix-arg))
- (let ((action
- (if (functionp ivy-inhibit-action)
- ivy-inhibit-action
- (and (not ivy-inhibit-action)
- (ivy--get-action ivy-last)))))
- (when action
- (let* ((collection (ivy-state-collection ivy-last))
- (current (ivy-state-current ivy-last))
- (x (cond
- ;; Alist type.
- ((and (consp (car-safe collection))
- ;; Previously, the cdr of the selected
- ;; candidate would be returned. Now, the
- ;; whole candidate is returned.
- (let ((idx (get-text-property 0 'idx current)))
- (if idx
- (nth idx collection)
- (assoc current collection)))))
- (ivy--directory
- (expand-file-name current ivy--directory))
- ((equal current "")
- ivy-text)
- (t
- current))))
- (if (eq action #'identity)
- (prog1 x
- (ivy-recursive-restore))
- (select-window (ivy--get-window ivy-last))
- (set-buffer (ivy-state-buffer ivy-last))
- (prog1 (unwind-protect
- (if ivy-marked-candidates
- (let ((prefix-len (length ivy-mark-prefix)))
- (setq ivy-marked-candidates
- (mapcar (lambda (s) (substring s prefix-len))
- ivy-marked-candidates))
- (if (ivy-state-multi-action ivy-last)
- (funcall
- (ivy-state-multi-action ivy-last)
- ivy-marked-candidates)
- (dolist (c ivy-marked-candidates)
- (let ((default-directory (ivy-state-directory
ivy-last)))
- (funcall action c)))))
- (funcall action x))
- (ivy-recursive-restore))
- (unless (or (eq ivy-exit 'done)
- (minibuffer-window-active-p (selected-window))
- (null (active-minibuffer-window)))
- (select-window (active-minibuffer-window)))))))))
-
-(defun ivy-call-and-recenter ()
- "Call action and recenter window according to the selected candidate."
- (interactive)
- (ivy-call)
- (with-ivy-window
- (recenter-top-bottom)))
-
-(defun ivy-next-line-and-call (&optional arg)
- "Move cursor vertically down ARG candidates.
-Call the permanent action if possible."
- (interactive "p")
- (ivy-next-line arg)
- (ivy--exhibit)
- (ivy-call))
-
-(defun ivy-previous-line-and-call (&optional arg)
- "Move cursor vertically up ARG candidates.
-Call the permanent action if possible."
- (interactive "p")
- (ivy-previous-line arg)
- (ivy--exhibit)
- (ivy-call))
-
-(defun ivy-previous-history-element (arg)
- "Forward to `previous-history-element' with ARG."
- (interactive "p")
- (previous-history-element arg)
- (ivy--cd-maybe)
- (move-end-of-line 1)
- (ivy--maybe-scroll-history))
-
-(defun ivy--insert-symbol-boundaries ()
- (undo-boundary)
- (beginning-of-line)
- (insert "\\_<")
- (end-of-line)
- (insert "\\_>"))
-
-(defun ivy-next-history-element (arg)
- "Forward to `next-history-element' with ARG."
- (interactive "p")
- (if (and (= minibuffer-history-position 0)
- (equal ivy-text ""))
- (progn
- (when minibuffer-default
- (setq ivy--default (car minibuffer-default)))
- (insert ivy--default)
- (when (and (with-ivy-window (derived-mode-p 'prog-mode))
- (eq (ivy-state-caller ivy-last) 'swiper)
- (not (file-exists-p ivy--default))
- (not (ivy-ffap-url-p ivy--default))
- (not (ivy-state-dynamic-collection ivy-last))
- (> (point) (minibuffer-prompt-end)))
- (ivy--insert-symbol-boundaries)))
- (next-history-element arg))
- (ivy--cd-maybe)
- (move-end-of-line 1)
- (ivy--maybe-scroll-history))
-
-(defvar ivy-ffap-url-functions nil
- "List of functions that check if the point is on a URL.")
-
-(defun ivy--cd-maybe ()
- "Check if the current input points to a different directory.
-If so, move to that directory, while keeping only the file name."
- (when ivy--directory
- (let ((input (ivy--input))
- url)
- (if (setq url (or (ivy-ffap-url-p input)
- (with-ivy-window
- (cl-reduce
- (lambda (a b)
- (or a (funcall b)))
- ivy-ffap-url-functions
- :initial-value nil))))
- (ivy-exit-with-action
- (lambda (_)
- (ivy-ffap-url-fetcher url)))
- (setq input (expand-file-name input))
- (let ((file (file-name-nondirectory input))
- (dir (expand-file-name (file-name-directory input))))
- (if (string= dir ivy--directory)
- (progn
- (delete-minibuffer-contents)
- (insert file))
- (ivy--cd dir)
- (insert file)))))))
-
-(defun ivy--maybe-scroll-history ()
- "If the selected history element has an index, scroll there."
- (let ((idx (ignore-errors
- (get-text-property
- (minibuffer-prompt-end)
- 'ivy-index))))
- (when idx
- (ivy--exhibit)
- (ivy-set-index idx))))
-
-(declare-function tramp-get-completion-methods "tramp")
-
-(defun ivy--cd (dir)
- "When completing file names, move to directory DIR."
- (if (null ivy--directory)
- (error "Unexpected")
- (setq ivy--old-cands nil)
- (setq ivy--old-re nil)
- (ivy-set-index 0)
- (setq ivy--all-candidates
- (append
- (ivy--sorted-files (setq ivy--directory dir))
- (when (and (string= dir "/") (featurep 'tramp))
- (sort
- (mapcar
- (lambda (s) (substring s 1))
- (tramp-get-completion-methods ""))
- #'string<))))
- (setq ivy-text "")
- (setf (ivy-state-directory ivy-last) dir)
- (delete-minibuffer-contents)))
-
-(defun ivy--parent-dir (filename)
- "Return parent directory of absolute FILENAME."
- (file-name-directory (directory-file-name filename)))
-
-(defun ivy-backward-delete-char ()
- "Forward to `delete-backward-char'.
-Call `ivy-on-del-error-function' if an error occurs, usually when
-there is no more text to delete at the beginning of the
-minibuffer."
- (interactive)
- (if (and ivy--directory (= (minibuffer-prompt-end) (point)))
- (progn
- (ivy--cd (ivy--parent-dir (expand-file-name ivy--directory)))
- (ivy--exhibit))
- (setq prefix-arg current-prefix-arg)
- (condition-case nil
- (call-interactively #'delete-backward-char)
- (error
- (when ivy-on-del-error-function
- (funcall ivy-on-del-error-function))))))
-
-(defun ivy-delete-char (arg)
- "Forward to `delete-char' ARG."
- (interactive "p")
- (unless (eolp)
- (delete-char arg)))
-
-(defun ivy-forward-char (arg)
- "Forward to `forward-char' ARG."
- (interactive "p")
- (unless (eolp)
- (forward-char arg)))
-
-(defun ivy-kill-word (arg)
- "Forward to `kill-word' ARG."
- (interactive "p")
- (unless (eolp)
- (kill-word arg)))
-
-(defun ivy-kill-line ()
- "Forward to `kill-line'."
- (interactive)
- (if (eolp)
- (kill-region (minibuffer-prompt-end) (point))
- (kill-line)))
-
-(defun ivy-kill-whole-line ()
- "Forward to `kill-whole-line'."
- (interactive)
- (kill-region (minibuffer-prompt-end) (line-end-position)))
-
-(defun ivy-backward-kill-word ()
- "Forward to `backward-kill-word'."
- (interactive)
- (if (and ivy--directory (= (minibuffer-prompt-end) (point)))
- (progn
- (ivy--cd (ivy--parent-dir (expand-file-name ivy--directory)))
- (ivy--exhibit))
- (ignore-errors
- (let ((pt (point)))
- (forward-word -1)
- (delete-region (point) pt)))))
-
-(defvar ivy--regexp-quote #'regexp-quote
- "Store the regexp quoting state.")
-
-(defun ivy-toggle-regexp-quote ()
- "Toggle the regexp quoting."
- (interactive)
- (setq ivy--old-re nil)
- (cl-rotatef ivy--regex-function ivy--regexp-quote))
-
-(defvar avy-all-windows)
-(defvar avy-action)
-(defvar avy-keys)
-(defvar avy-keys-alist)
-(defvar avy-style)
-(defvar avy-styles-alist)
-(declare-function avy-process "ext:avy")
-(declare-function avy--style-fn "ext:avy")
-
-(defcustom ivy-format-functions-alist
- '((t . ivy-format-function-default))
- "An alist of functions that transform the list of candidates into a string.
-This string is inserted into the minibuffer."
- :type '(alist
- :key-type symbol
- :value-type
- (choice
- (const :tag "Default" ivy-format-function-default)
- (const :tag "Arrow prefix" ivy-format-function-arrow)
- (const :tag "Full line" ivy-format-function-line)
- (function :tag "Custom function"))))
-
-(eval-after-load 'avy
- '(add-to-list 'avy-styles-alist '(ivy-avy . pre)))
-
-(defun ivy--avy-candidates ()
- (let (candidates)
- (save-excursion
- (save-restriction
- (narrow-to-region
- (window-start)
- (window-end))
- (goto-char (point-min))
- (forward-line)
- (while (< (point) (point-max))
- (push
- (cons (point)
- (selected-window))
- candidates)
- (forward-line))))
- (nreverse candidates)))
-
-(defun ivy--avy-action (pt)
- (when (number-or-marker-p pt)
- (let ((bnd (ivy--minibuffer-index-bounds
- ivy--index ivy--length ivy-height)))
- (ivy--done
- (substring-no-properties
- (nth (+ (car bnd) (- (line-number-at-pos pt) 2)) ivy--old-cands))))))
-
-(defun ivy--avy-handler-function (char)
- (let (cmd)
- (cond ((memq char '(27 ?\C-g))
- ;; exit silently
- (throw 'done 'abort))
- ((memq (setq cmd (lookup-key ivy-minibuffer-map (vector char)))
- '(ivy-scroll-up-command
- ivy-scroll-down-command))
- (funcall cmd)
- (ivy--exhibit)
- (throw 'done 'exit))
- ;; ignore wrong key
- (t
- (throw 'done 'restart)))))
-
-(defvar avy-handler-function)
-
-(defun ivy-avy ()
- "Jump to one of the current ivy candidates."
- (interactive)
- (unless (require 'avy nil 'noerror)
- (error "Package avy isn't installed"))
- (let* ((avy-all-windows nil)
- (avy-keys (or (cdr (assq 'ivy-avy avy-keys-alist))
- avy-keys))
- (avy-style (or (cdr (assq 'ivy-avy avy-styles-alist))
- avy-style))
- (avy-action #'identity)
- (avy-handler-function #'ivy--avy-handler-function)
- res)
- (while (eq (setq res (avy-process (ivy--avy-candidates))) t))
- (when res
- (ivy--avy-action res))))
-
-(defun ivy-sort-file-function-default (x y)
- "Compare two files X and Y.
-Prioritize directories."
- (if (get-text-property 0 'dirp x)
- (if (get-text-property 0 'dirp y)
- (string< (directory-file-name x) (directory-file-name y))
- t)
- (if (get-text-property 0 'dirp y)
- nil
- (string< x y))))
-
-(defun ivy-string< (x y)
- "Like `string<', but operate on CARs when given cons cells."
- (string< (if (consp x) (car x) x)
- (if (consp y) (car y) y)))
-
-(define-obsolete-function-alias 'ivy-sort-file-function-using-ido
- 'ido-file-extension-lessp "<2019-10-12 Sat>")
-
-(defcustom ivy-sort-functions-alist
- '((t . ivy-string<))
- "An alist of sorting functions for each collection function.
-Interactive functions that call completion fit in here as well.
-
-Nil means no sorting, which is useful to turn off the sorting for
-functions that have candidates in the natural buffer order, like
-`org-refile' or `Man-goto-section'.
-
-A list can be used to associate multiple sorting functions with a
-collection. The car of the list is the current sort
-function. This list can be rotated with `ivy-rotate-sort'.
-
-The entry associated with t is used for all fall-through cases.
-
-See also `ivy-sort-max-size'."
- :type
- '(alist
- :key-type (choice
- (const :tag "Fall-through" t)
- (symbol :tag "Collection"))
- :value-type (choice
- (const :tag "Plain sort" string-lessp)
- (const :tag "File sort" ivy-sort-file-function-default)
- (const :tag "File sort using Ido" ido-file-extension-lessp)
- (const :tag "No sort" nil)
- (function :tag "Custom function")
- (repeat (function :tag "Custom function")))))
-
-(defun ivy--sort-function (collection)
- "Retrieve sort function for COLLECTION from `ivy-sort-functions-alist'."
- (let ((entry (cdr (or (assq collection ivy-sort-functions-alist)
- (assq (ivy-state-caller ivy-last)
ivy-sort-functions-alist)
- (assq t ivy-sort-functions-alist)))))
- (and (or (functionp entry)
- (functionp (setq entry (car-safe entry))))
- entry)))
-
-(defun ivy-rotate-sort ()
- "Rotate through sorting functions available for current collection.
-This only has an effect if multiple sorting functions are
-specified for the current collection in
-`ivy-sort-functions-alist'."
- (interactive)
- (let ((cell (or (assq (ivy-state-collection ivy-last)
ivy-sort-functions-alist)
- (assq (ivy-state-caller ivy-last)
ivy-sort-functions-alist))))
- (when (consp (cdr cell))
- (setcdr cell (nconc (cddr cell) (list (cadr cell))))
- (ivy--reset-state ivy-last))))
-
-(defvar ivy-index-functions-alist
- '((t . ivy-recompute-index-zero))
- "An alist of index recomputing functions for each collection function.
-When the input changes, the appropriate function returns an
-integer - the index of the matched candidate that should be
-selected.")
-
-(defvar ivy-re-builders-alist
- '((t . ivy--regex-plus))
- "An alist of regex building functions for each collection function.
-
-Each key is (in order of priority):
-1. The actual collection function, e.g. `read-file-name-internal'.
-2. The symbol passed by :caller into `ivy-read'.
-3. `this-command'.
-4. t.
-
-Each value is a function that should take a string and return a
-valid regex or a regex sequence (see below).
-
-Possible choices: `ivy--regex', `regexp-quote',
-`ivy--regex-plus', `ivy--regex-fuzzy', `ivy--regex-ignore-order'.
-
-If a function returns a list, it should format like this:
-'((\"matching-regexp\" . t) (\"non-matching-regexp\") ...).
-
-The matches will be filtered in a sequence, you can mix the
-regexps that should match and that should not match as you
-like.")
-
-(defvar ivy-highlight-functions-alist
- '((ivy--regex-ignore-order . ivy--highlight-ignore-order)
- (ivy--regex-fuzzy . ivy--highlight-fuzzy)
- (ivy--regex-plus . ivy--highlight-default))
- "An alist of highlighting functions for each regex builder function.")
-
-(defcustom ivy-initial-inputs-alist
- '((org-refile . "^")
- (org-agenda-refile . "^")
- (org-capture-refile . "^")
- (Man-completion-table . "^")
- (woman . "^"))
- "An alist associating commands with their initial input.
-
-Each cdr is either a string or a function called in the context
-of a call to `ivy-read'."
- :type '(alist
- :key-type (symbol)
- :value-type (choice (string) (function))))
-
-(defcustom ivy-hooks-alist nil
- "An alist associating commands to setup functions.
-Examples: `toggle-input-method', (lambda () (insert \"^\")), etc.
-May supersede `ivy-initial-inputs-alist'."
- :type '(alist :key-type symbol :value-type function))
-
-(defvar ivy--occurs-list nil
- "A list of custom occur generators per command.")
-
-(defun ivy-set-occur (cmd occur)
- "Assign CMD a custom OCCUR function."
- (setq ivy--occurs-list
- (plist-put ivy--occurs-list cmd occur)))
-
-(defcustom ivy-update-fns-alist nil
- "An alist associating commands to their :update-fn values."
- :type '(alist
- :key-type symbol
- :value-type
- (radio
- (const :tag "Off" nil)
- (const :tag "Call action on change" auto))))
-
-(defvar ivy-unwind-fns-alist nil
- "An alist associating commands to their :unwind values.")
-
-(defun ivy--alist-set (alist-sym key val)
- (let ((cell (assoc key (symbol-value alist-sym))))
- (if cell
- (setcdr cell val)
- (set alist-sym (cons (cons key val)
- (symbol-value alist-sym))))))
-
-(declare-function counsel-set-async-exit-code "counsel")
-
-(cl-defun ivy-configure (caller
- &key
- initial-input
- height
- occur
- update-fn
- unwind-fn
- index-fn
- sort-fn
- format-fn
- display-transformer-fn
- more-chars
- grep-p
- exit-codes)
- "Configure `ivy-read' params for CALLER."
- (declare (indent 1))
- (when initial-input
- (ivy--alist-set 'ivy-initial-inputs-alist caller initial-input))
- (when height
- (ivy--alist-set 'ivy-height-alist caller height))
- (when occur
- (ivy-set-occur caller occur))
- (when update-fn
- (ivy--alist-set 'ivy-update-fns-alist caller update-fn))
- (when unwind-fn
- (ivy--alist-set 'ivy-unwind-fns-alist caller unwind-fn))
- (when index-fn
- (ivy--alist-set 'ivy-index-functions-alist caller index-fn))
- (when sort-fn
- (ivy--alist-set 'ivy-sort-functions-alist caller sort-fn))
- (when format-fn
- (ivy--alist-set 'ivy-format-functions-alist caller format-fn))
- (when display-transformer-fn
- (ivy-set-display-transformer caller display-transformer-fn))
- (when more-chars
- (ivy--alist-set 'ivy-more-chars-alist caller more-chars))
- (when grep-p
- (cl-pushnew caller ivy-highlight-grep-commands))
- (when exit-codes
- (let (code msg)
- (while (and (setq code (pop exit-codes))
- (setq msg (pop exit-codes)))
- (counsel-set-async-exit-code caller code msg)))))
-
-(defcustom ivy-sort-max-size 30000
- "Sorting won't be done for collections larger than this."
- :type 'integer)
-
-(defalias 'ivy--dirname-p
- (if (fboundp 'directory-name-p)
- #'directory-name-p
- (lambda (name)
- "Return non-nil if NAME ends with a directory separator."
- (string-match-p "/\\'" name))))
-
-(defun ivy--sorted-files (dir)
- "Return the list of files in DIR.
-Directories come first."
- (let* ((default-directory dir)
- (seq (condition-case nil
- (mapcar (lambda (s) (replace-regexp-in-string "\\$\\$" "$"
s))
- (all-completions "" #'read-file-name-internal
- (ivy-state-predicate ivy-last)))
- (error
- (directory-files dir))))
- sort-fn)
- (setq seq (delete "./" (delete "../" seq)))
- (when (eq (setq sort-fn (ivy--sort-function #'read-file-name-internal))
- #'ivy-sort-file-function-default)
- (setq seq (mapcar (lambda (x)
- (propertize x 'dirp (ivy--dirname-p x)))
- seq)))
- (when sort-fn
- (setq seq (sort seq sort-fn)))
- (dolist (dir ivy-extra-directories)
- (push dir seq))
- (if (string= dir "/")
- (cl-remove-if (lambda (s) (string-match ":$" s)) (delete "../" seq))
- seq)))
-
-(defun ivy-alist-setting (alist &optional key)
- "Return the value associated with KEY in ALIST, using `assq'.
-KEY defaults to the last caller of `ivy-read'; if no entry is
-found, it falls back to the key t."
- (cdr (or (let ((caller (or key (ivy-state-caller ivy-last))))
- (and caller (assq caller alist)))
- (assq t alist))))
-
-(defun ivy--height (caller)
- (let ((v (or (ivy-alist-setting ivy-height-alist caller)
- ivy-height)))
- (if (integerp v)
- v
- (if (functionp v)
- (funcall v caller)
- (error "Unexpected value: %S" v)))))
-
-(defun ivy--remove-props (str &rest props)
- "Return STR with text PROPS destructively removed."
- (ignore-errors
- (remove-list-of-text-properties 0 (length str) props str))
- str)
-
-;;** Entry Point
-;;;###autoload
-(cl-defun ivy-read (prompt collection
- &key
- predicate require-match initial-input
- history preselect def keymap update-fn sort
- action multi-action
- unwind re-builder matcher
- dynamic-collection
- extra-props
- caller)
- "Read a string in the minibuffer, with completion.
-
-PROMPT is a string, normally ending in a colon and a space.
-`ivy-count-format' is prepended to PROMPT during completion.
-
-COLLECTION is either a list of strings, a function, an alist, or
-a hash table, supplied for `minibuffer-completion-table'.
-
-PREDICATE is applied to filter out the COLLECTION immediately.
-This argument is for compatibility with `completing-read'.
-
-When REQUIRE-MATCH is non-nil, only members of COLLECTION can be
-selected.
-
-If INITIAL-INPUT is non-nil, then insert that input in the
-minibuffer initially.
-
-HISTORY is a name of a variable to hold the completion session
-history.
-
-KEYMAP is composed with `ivy-minibuffer-map'.
-
-PRESELECT, when non-nil, determines which one of the candidates
-matching INITIAL-INPUT to select initially. An integer stands
-for the position of the desired candidate in the collection,
-counting from zero. Otherwise, use the first occurrence of
-PRESELECT in the collection. Comparison is first done with
-`equal'. If that fails, and when applicable, match PRESELECT as
-a regular expression.
-
-DEF is for compatibility with `completing-read'.
-
-UPDATE-FN is called each time the candidate list is re-displayed.
-
-When SORT is non-nil, `ivy-sort-functions-alist' determines how
-to sort candidates before displaying them.
-
-ACTION is a function to call after selecting a candidate.
-It takes one argument, the selected candidate. If COLLECTION is
-an alist, the argument is a cons cell, otherwise it's a string.
-
-MULTI-ACTION, when non-nil, is called instead of ACTION when
-there are marked candidates. It takes the list of candidates as
-its only argument. When it's nil, ACTION is called on each marked
-candidate.
-
-UNWIND is a function of no arguments to call before exiting.
-
-RE-BUILDER is a function transforming input text into a regex
-pattern.
-
-MATCHER is a function which can override how candidates are
-filtered based on user input. It takes a regex pattern and a
-list of candidates, and returns the list of matching candidates.
-
-DYNAMIC-COLLECTION is a boolean specifying whether the list of
-candidates is updated after each input by calling COLLECTION.
-
-EXTRA-PROPS can be used to store collection-specific
-session-specific data.
-
-CALLER is a symbol to uniquely identify the caller to `ivy-read'.
-It is used, along with COLLECTION, to determine which
-customizations apply to the current completion session."
- ;; get un-stuck from an existing `read-key' overriding minibuffer keys
- (when (equal overriding-local-map '(keymap))
- (keyboard-quit))
- (setq caller (or caller this-command))
- (let* ((ivy-recursive-last (and (active-minibuffer-window) ivy-last))
- (ivy--display-function
- (when (or ivy-recursive-last
- (not (window-minibuffer-p)))
- (ivy-alist-setting ivy-display-functions-alist caller)))
- result)
- (setq update-fn (or update-fn (ivy-alist-setting ivy-update-fns-alist
caller)))
- (setq unwind (or unwind (ivy-alist-setting ivy-unwind-fns-alist caller)))
- (setq ivy-last
- (make-ivy-state
- :prompt prompt
- :collection collection
- :predicate predicate
- :require-match require-match
- :initial-input initial-input
- :history history
- :preselect preselect
- :keymap keymap
- :update-fn (if (eq update-fn 'auto)
- (lambda ()
- (with-ivy-window
- (funcall
- (ivy--get-action ivy-last)
- (if (consp (car-safe (ivy-state-collection
ivy-last)))
- (assoc (ivy-state-current ivy-last)
- (ivy-state-collection ivy-last))
- (ivy-state-current ivy-last)))))
- update-fn)
- :sort sort
- :action (ivy--compute-extra-actions action caller)
- :multi-action multi-action
- :frame (selected-frame)
- :window (selected-window)
- :buffer (current-buffer)
- :unwind unwind
- :re-builder re-builder
- :matcher matcher
- :dynamic-collection dynamic-collection
- :display-transformer-fn (plist-get ivy--display-transformers-list
caller)
- :directory default-directory
- :extra-props extra-props
- :caller caller
- :def def))
- (ivy--reset-state ivy-last)
- (unwind-protect
- (minibuffer-with-setup-hook
- #'ivy--minibuffer-setup
- (let* ((hist (or history 'ivy-history))
- (minibuffer-completion-table collection)
- (minibuffer-completion-predicate predicate)
- (ivy-height (ivy--height caller))
- (resize-mini-windows (unless (display-graphic-p)
- 'grow-only)))
- (if (and ivy-auto-select-single-candidate
- ivy--all-candidates
- (null (cdr ivy--all-candidates)))
- (progn
- (setf (ivy-state-current ivy-last)
- (car ivy--all-candidates))
- (setq ivy-exit 'done))
- (read-from-minibuffer
- prompt
- (ivy-state-initial-input ivy-last)
- (make-composed-keymap keymap ivy-minibuffer-map)
- nil
- hist))
- (when (eq ivy-exit 'done)
- (let ((item (if ivy--directory
- (ivy-state-current ivy-last)
- ivy-text)))
- (unless (equal item "")
- (set hist (cons (propertize item 'ivy-index ivy--index)
- (delete item
- (cdr (symbol-value hist))))))))
- (setq result (ivy-state-current ivy-last))))
- (ivy--cleanup))
- (ivy-call)
- (ivy--remove-props (ivy-state-current ivy-last) 'idx)
- result))
-
-(defun ivy--cleanup ()
- ;; Fixes a bug in ESS, #1660
- (put 'post-command-hook 'permanent-local nil)
- (remove-hook 'post-command-hook #'ivy--queue-exhibit)
- (let ((cleanup (ivy--display-function-prop :cleanup))
- (unwind (ivy-state-unwind ivy-last)))
- (when (functionp cleanup)
- (funcall cleanup))
- (when unwind
- (funcall unwind)))
- (ivy--pulse-cleanup)
- (unless (eq ivy-exit 'done)
- (ivy-recursive-restore)))
-
-(defun ivy--display-function-prop (prop)
- "Return PROP associated with current `ivy--display-function'."
- (plist-get (cdr (assq ivy--display-function
- ivy-display-functions-props))
- prop))
-
-(defvar Info-complete-menu-buffer)
-
-(defun ivy--reset-state (state)
- "Reset the ivy to STATE.
-This is useful for recursive `ivy-read'."
- (setq ivy-marked-candidates nil)
- (unless (equal (selected-frame) (ivy-state-frame state))
- (select-window (active-minibuffer-window)))
- (let* ((prompt (or (ivy-state-prompt state) ""))
- (collection (ivy-state-collection state))
- (predicate (ivy-state-predicate state))
- (history (ivy-state-history state))
- (preselect (ivy-state-preselect state))
- (re-builder (ivy-state-re-builder state))
- (dynamic-collection (ivy-state-dynamic-collection state))
- (require-match (ivy-state-require-match state))
- (caller (or (ivy-state-caller state) this-command))
- (sort (or (ivy-state-sort state) (assoc caller
ivy-sort-functions-alist)))
- (initial-input
- (or (ivy-state-initial-input state)
- (let ((init (cdr (assq caller ivy-initial-inputs-alist))))
- (cond ((functionp init)
- (funcall init))
- (t
- init)))))
- (def (ivy-state-def state)))
- (setq ivy--extra-candidates (ivy--compute-extra-candidates caller))
- (setq ivy--directory nil)
- (setq ivy-case-fold-search ivy-case-fold-search-default)
- (setq ivy--regex-function
- (or re-builder
- (and (functionp collection)
- (cdr (assq collection ivy-re-builders-alist)))
- (ivy-alist-setting ivy-re-builders-alist)
- #'ivy--regex))
- (setq ivy--subexps 0)
- (setq ivy--regexp-quote #'regexp-quote)
- (setq ivy--old-text "")
- (setq ivy--full-length nil)
- (setq ivy-text "")
- (setq ivy--index 0)
- (setq ivy-calling nil)
- (setq ivy-use-ignore ivy-use-ignore-default)
- (setf (ivy-state-ignore state) ivy-use-ignore)
- (setq ivy--highlight-function
- (or (cdr (assq ivy--regex-function ivy-highlight-functions-alist))
- #'ivy--highlight-default))
- (let (coll sort-fn)
- (cond ((eq collection #'Info-read-node-name-1)
- (setq coll
- (if (equal (bound-and-true-p Info-current-file) "dir")
- (mapcar (lambda (x) (format "(%s)" x))
- (delete-dups
- (all-completions "(" collection predicate)))
- (all-completions "" collection predicate))))
- ((eq collection #'read-file-name-internal)
- (require 'tramp)
- (when (and (equal def initial-input)
- (member "./" ivy-extra-directories))
- (setq def nil))
- (setq ivy--directory default-directory)
- (when (and initial-input
- (not (equal initial-input "")))
- (cond ((file-directory-p initial-input)
- (when (equal (file-name-nondirectory initial-input) "")
- (setf (ivy-state-preselect state) (setq preselect nil))
- (setq def nil))
- (setq ivy--directory (file-name-as-directory
initial-input))
- (setq initial-input nil)
- (when preselect
- (let ((preselect-directory
- (file-name-directory preselect)))
- (when (and preselect-directory
- (not (equal
- (expand-file-name
- preselect-directory)
- (expand-file-name ivy--directory))))
- (setf (ivy-state-preselect state)
- (setq preselect nil))))))
- ((ignore-errors
- (file-exists-p (file-name-directory initial-input)))
- (setq ivy--directory (file-name-directory initial-input))
- (setf (ivy-state-preselect state)
- (file-name-nondirectory initial-input)))))
- (require 'dired)
- (when preselect
- (let ((preselect-directory (ivy--parent-dir preselect)))
- (when (and preselect-directory
- (not (string= preselect-directory
- default-directory)))
- (setq ivy--directory preselect-directory))
- (setq preselect (file-relative-name preselect
- preselect-directory))
- (setf (ivy-state-preselect state) preselect)))
- (setq sort nil)
- (setq coll (ivy--sorted-files ivy--directory))
- (when initial-input
- (unless (or require-match
- (equal initial-input default-directory)
- (equal initial-input ""))
- (setq coll (cons initial-input coll)))
- (when (or (not (ivy-state-action ivy-last))
- (equal (ivy--get-action ivy-last) 'identity))
- (setq initial-input nil))))
- ((eq collection #'internal-complete-buffer)
- (setq prompt
- (replace-regexp-in-string "RET to end" "C-M-j to end"
prompt))
- (setq coll (ivy--buffer-list
- ""
- (and ivy-use-virtual-buffers
- (member caller '(ivy-switch-buffer
- ivy-switch-buffer-other-window
- counsel-switch-buffer)))
- predicate)))
- (dynamic-collection
- (setq coll (funcall collection (or initial-input ""))))
- ((consp (car-safe collection))
- (setq collection (cl-remove-if-not predicate collection))
- (when (and sort (setq sort-fn (ivy--sort-function caller)))
- (setq collection (sort (copy-sequence collection) sort-fn))
- (setq sort nil))
- (setf (ivy-state-collection ivy-last) collection)
- (setq coll (let ((i -1))
- (mapcar (lambda (x)
- (propertize x 'idx (cl-incf i)))
- (all-completions "" collection)))))
- ((or (functionp collection)
- (byte-code-function-p collection)
- (vectorp collection)
- (hash-table-p collection)
- (and (listp collection) (symbolp (car collection))))
- (let ((Info-complete-menu-buffer
- ;; FIXME: This is a temporary workaround for issue #1803.
- (or (bound-and-true-p Info-complete-menu-buffer)
- (ivy-state-buffer state))))
- (setq coll (all-completions "" collection predicate))))
- (t
- (setq coll (all-completions "" collection predicate))))
- (unless (ivy-state-dynamic-collection ivy-last)
- (setq coll (delete "" coll)))
- (when def
- (cond ((stringp (car-safe def))
- (setq coll (cl-union def coll :test #'equal)))
- ((and (stringp def) (not (member def coll)))
- (push def coll))))
- (when (and sort
- (or (functionp collection)
- (not (eq history 'org-refile-history)))
- (setq sort-fn (ivy--sort-function
- (if (functionp collection) collection caller)))
- (null (nthcdr ivy-sort-max-size coll)))
- (setq coll (sort (copy-sequence coll) sort-fn)))
- (setq coll (ivy--set-candidates coll))
- (setq ivy--old-re nil)
- (setq ivy--old-cands nil)
- (when initial-input
- ;; Needed for anchor to work
- (setq ivy--old-cands coll)
- (setq ivy--old-cands (ivy--filter initial-input coll)))
- (unless (setq ivy--trying-to-resume-dynamic-collection
- (and preselect dynamic-collection))
- (when (integerp preselect)
- (setq ivy--old-re "")
- (ivy-set-index preselect)))
- (setq ivy--all-candidates coll)
- (unless (integerp preselect)
- (ivy-set-index (or
- (and dynamic-collection
- ivy--index)
- (and preselect
- (ivy--preselect-index
- preselect
- (if initial-input
- ivy--old-cands
- coll)))
- 0))))
- (setq ivy-exit nil)
- (setq ivy--default
- (if (region-active-p)
- (buffer-substring (region-beginning) (region-end))
- (ivy-thing-at-point)))
- (setq ivy--prompt (ivy-add-prompt-count (ivy--quote-format-string prompt)))
- (setq ivy--use-selectable-prompt (ivy--prompt-selectable-p))
- (setf (ivy-state-initial-input ivy-last) initial-input)))
-
-(defun ivy-add-prompt-count (prompt)
- "Add count information to PROMPT."
- (cond ((null ivy-count-format)
- (error
- "`ivy-count-format' can't be nil. Set it to \"\" instead"))
- ((string-match "%d.*\\(%d\\)" ivy-count-format)
- (let* ((w (1+ (floor (log (max 1 (length ivy--all-candidates)) 10))))
- (s (replace-match (format "%%-%dd" w) t t ivy-count-format 1)))
- (string-match "%d" s)
- (concat (replace-match (format "%%%dd" w) t t s)
- prompt)))
- ((string-match-p "%.*d" ivy-count-format)
- (concat ivy-count-format prompt))
- (ivy--directory
- prompt)
- (t
- prompt)))
-
-(defun ivy--quote-format-string (str)
- "Make STR suitable for `format' with no extra arguments."
- (replace-regexp-in-string "%" "%%" str t t))
-
-;;;###autoload
-(defun ivy-completing-read (prompt collection
- &optional predicate require-match initial-input
- history def inherit-input-method)
- "Read a string in the minibuffer, with completion.
-
-This interface conforms to `completing-read' and can be used for
-`completing-read-function'.
-
-PROMPT is a string that normally ends in a colon and a space.
-COLLECTION is either a list of strings, an alist, an obarray, or a hash table.
-PREDICATE limits completion to a subset of COLLECTION.
-REQUIRE-MATCH is a boolean value. See `completing-read'.
-INITIAL-INPUT is a string inserted into the minibuffer initially.
-HISTORY is a list of previously selected inputs.
-DEF is the default value.
-INHERIT-INPUT-METHOD is currently ignored."
- (let ((handler
- (and (< ivy-completing-read-ignore-handlers-depth (minibuffer-depth))
- (assq this-command ivy-completing-read-handlers-alist))))
- (if handler
- (let ((completion-in-region-function #'completion--in-region)
- (ivy-completing-read-ignore-handlers-depth (1+
(minibuffer-depth))))
- (funcall (cdr handler)
- prompt collection
- predicate require-match
- initial-input history
- def inherit-input-method))
- ;; See the doc of `completing-read'.
- (when (consp history)
- (when (numberp (cdr history))
- (setq initial-input (nth (1- (cdr history))
- (symbol-value (car history)))))
- (setq history (car history)))
- (when (consp def)
- (setq def (car def)))
- (let ((str (ivy-read
- prompt collection
- :predicate predicate
- :require-match (and collection require-match)
- :initial-input (cond ((consp initial-input)
- (car initial-input))
- ((and (stringp initial-input)
- (not (eq collection
#'read-file-name-internal))
- (string-match-p "\\+"
initial-input))
- (replace-regexp-in-string
- "\\+" "\\\\+" initial-input))
- (t
- initial-input))
- :preselect def
- :def def
- :history history
- :keymap nil
- :dynamic-collection ivy-completing-read-dynamic-collection
- :caller (if (and collection (symbolp collection))
- collection
- this-command))))
- (if (string= str "")
- ;; For `completing-read' compat, return the first element of
- ;; DEFAULT, if it is a list; "", if DEFAULT is nil; or DEFAULT.
- (or def "")
- str)))))
-
-(defun ivy-completing-read-with-empty-string-def
- (prompt collection
- &optional predicate require-match initial-input
- history def inherit-input-method)
- "Same as `ivy-completing-read' but with different handling of DEF.
-
-Specifically, if DEF is nil, it is treated the same as if DEF was
-the empty string. This mimics the behavior of
-`completing-read-default'. This function can therefore be used in
-place of `ivy-completing-read' for commands that rely on this
-behavior."
- (ivy-completing-read
- prompt collection predicate require-match initial-input
- history (or def "") inherit-input-method))
-
-(declare-function mc/all-fake-cursors "ext:multiple-cursors-core")
-
-(defun ivy-completion-in-region-action (str)
- "Insert STR, erasing the previous one.
-The previous string is between `ivy-completion-beg' and `ivy-completion-end'."
- (when (consp str)
- (setq str (cdr str)))
- (when (stringp str)
- (let ((fake-cursors (and (require 'multiple-cursors-core nil t)
- (mc/all-fake-cursors)))
- (pt (point))
- (beg ivy-completion-beg)
- (end ivy-completion-end))
- (when beg
- (delete-region beg end))
- (setq ivy-completion-beg (point))
- (insert (substring-no-properties str))
- (completion--done str 'exact)
- (setq ivy-completion-end (point))
- (save-excursion
- (dolist (cursor fake-cursors)
- (goto-char (overlay-start cursor))
- (delete-region (+ (point) (- beg pt))
- (+ (point) (- end pt)))
- (insert (substring-no-properties str))
- ;; manually move the fake cursor
- (move-overlay cursor (point) (1+ (point)))
- (set-marker (overlay-get cursor 'point) (point))
- (set-marker (overlay-get cursor 'mark) (point)))))))
-
-(defun ivy-completion-common-length (str)
- "Return the amount of characters that match in STR.
-
-`completion-all-completions' computes this and returns the result
-via text properties.
-
-The first non-matching part is propertized:
-- either with: (face (completions-first-difference))
-- or: (font-lock-face completions-first-difference)."
- (let ((char-property-alias-alist '((face font-lock-face)))
- (i (1- (length str))))
- (catch 'done
- (while (>= i 0)
- (when (equal (get-text-property i 'face str)
- '(completions-first-difference))
- (throw 'done i))
- (cl-decf i))
- (throw 'done (length str)))))
-
-(defun ivy-completion-in-region (start end collection &optional predicate)
- "An Ivy function suitable for `completion-in-region-function'.
-The function completes the text between START and END using COLLECTION.
-PREDICATE (a function called with no arguments) says when to exit.
-See `completion-in-region' for further information."
- (let* ((enable-recursive-minibuffers t)
- (str (buffer-substring-no-properties start end))
- (completion-ignore-case (ivy--case-fold-p str))
- (comps
- (completion-all-completions str collection predicate (- end start))))
- (cond ((null comps)
- (message "No matches"))
- ((progn
- (nconc comps nil)
- (and (null (cdr comps))
- (string= str (car comps))))
- (message "Sole match"))
- (t
- (when (eq collection 'crm--collection-fn)
- (setq comps (delete-dups comps)))
- (let* ((len (ivy-completion-common-length (car comps)))
- (initial (cond ((= len 0)
- "")
- ((let ((str-len (length str)))
- (when (> len str-len)
- (setq len str-len)
- str)))
- (t
- (substring str (- len))))))
- (setq ivy--old-re nil)
- (unless (ivy--filter initial comps)
- (setq initial nil))
- (delete-region (- end len) end)
- (setq ivy-completion-beg (- end len))
- (setq ivy-completion-end ivy-completion-beg)
- (if (null (cdr comps))
- (progn
- (unless (minibuffer-window-active-p (selected-window))
- (setf (ivy-state-window ivy-last) (selected-window)))
- (ivy-completion-in-region-action
- (substring-no-properties (car comps))))
- (dolist (s comps)
- ;; Remove face `completions-first-difference'.
- (ivy--remove-props s 'face))
- (ivy-read (format "(%s): " str) comps
- ;; Predicate was already applied by
- ;; `completion-all-completions'.
- :predicate nil
- :initial-input initial
- :action #'ivy-completion-in-region-action
- :unwind (lambda ()
- (unless (eq ivy-exit 'done)
- (goto-char ivy-completion-beg)
- (when initial
- (insert initial))))
- :caller 'ivy-completion-in-region)
- t))))))
-
-(defun ivy-completion-in-region-prompt ()
- "Prompt function for `ivy-completion-in-region'.
-See `ivy-set-prompt'."
- (and (window-minibuffer-p (ivy-state-window ivy-last))
- (ivy-add-prompt-count (ivy-state-prompt ivy-last))))
-
-(ivy-set-prompt #'ivy-completion-in-region #'ivy-completion-in-region-prompt)
-
-(defcustom ivy-do-completion-in-region t
- "When non-nil `ivy-mode' will set `completion-in-region-function'."
- :type 'boolean)
-
-;;;###autoload
-(define-minor-mode ivy-mode
- "Toggle Ivy mode on or off.
-Turn Ivy mode on if ARG is positive, off otherwise.
-Turning on Ivy mode sets `completing-read-function' to
-`ivy-completing-read'.
-
-Global bindings:
-\\{ivy-mode-map}
-
-Minibuffer bindings:
-\\{ivy-minibuffer-map}"
- :group 'ivy
- :global t
- :keymap ivy-mode-map
- :lighter " ivy"
- (if ivy-mode
- (progn
- (setq completing-read-function 'ivy-completing-read)
- (when ivy-do-completion-in-region
- (setq completion-in-region-function 'ivy-completion-in-region)))
- (setq completing-read-function 'completing-read-default)
- (setq completion-in-region-function 'completion--in-region)))
-
-(defun ivy--preselect-index (preselect candidates)
- "Return the index of PRESELECT in CANDIDATES."
- (cond ((integerp preselect)
- (if (integerp (car candidates))
- (cl-position preselect candidates)
- preselect))
- ((cl-position preselect candidates :test #'equal))
- ((ivy--regex-p preselect)
- (cl-position preselect candidates :test #'string-match-p))))
-
-;;* Implementation
-;;** Regex
-(defun ivy-re-match (re-seq str)
- "Return non-nil if RE-SEQ is matched by STR.
-
-RE-SEQ is a list of (RE . MATCH-P).
-
-RE is a regular expression.
-
-MATCH-P is t when RE should match STR and nil when RE should not
-match STR.
-
-Each element of RE-SEQ must match for the function to return true.
-
-This concept is used to generalize regular expressions for
-`ivy--regex-plus' and `ivy--regex-ignore-order'."
- (let ((res t)
- re)
- (while (and res (setq re (pop re-seq)))
- (setq res
- (if (cdr re)
- (string-match-p (car re) str)
- (not (string-match-p (car re) str)))))
- res))
-
-(defvar ivy--regex-hash
- (make-hash-table :test #'equal)
- "Store pre-computed regex.")
-
-(defun ivy--split (str)
- "Split STR into list of substrings bounded by spaces.
-Single spaces act as splitting points. Consecutive spaces
-\"quote\" their preceding spaces, i.e., guard them from being
-split. This allows the literal interpretation of N spaces by
-inputting N+1 spaces. Any substring not constituting a valid
-regexp is passed to `regexp-quote'."
- (let ((len (length str))
- start0
- (start1 0)
- res s
- match-len)
- (while (and (string-match " +" str start1)
- (< start1 len))
- (if (and (> (match-beginning 0) 2)
- (string= "[^" (substring
- str
- (- (match-beginning 0) 2)
- (match-beginning 0))))
- (progn
- (setq start0 start1)
- (setq start1 (match-end 0)))
- (setq match-len (- (match-end 0) (match-beginning 0)))
- (if (= match-len 1)
- (progn
- (when start0
- (setq start1 start0)
- (setq start0 nil))
- (push (substring str start1 (match-beginning 0)) res)
- (setq start1 (match-end 0)))
- (setq str (replace-match
- (make-string (1- match-len) ?\ )
- nil nil str))
- (setq start0 (or start0 start1))
- (setq start1 (1- (match-end 0))))))
- (if start0
- (push (substring str start0) res)
- (setq s (substring str start1))
- (unless (= (length s) 0)
- (push s res)))
- (mapcar #'ivy--regex-or-literal (nreverse res))))
-
-(defun ivy--trim-trailing-re (regex)
- "Trim incomplete REGEX.
-If REGEX ends with \\|, trim it, since then it matches an empty string."
- (if (string-match "\\`\\(.*\\)[\\]|\\'" regex)
- (match-string 1 regex)
- regex))
-
-(defun ivy--regex (str &optional greedy)
- "Re-build regex pattern from STR in case it has a space.
-When GREEDY is non-nil, join words in a greedy way."
- (let ((hashed (unless greedy
- (gethash str ivy--regex-hash))))
- (if hashed
- (progn
- (setq ivy--subexps (car hashed))
- (cdr hashed))
- (when (string-match-p "\\(?:[^\\]\\|^\\)\\\\\\'" str)
- (setq str (substring str 0 -1)))
- (setq str (ivy--trim-trailing-re str))
- (cdr (puthash str
- (let ((subs (ivy--split str)))
- (if (= (length subs) 1)
- (cons
- (setq ivy--subexps 0)
- (if (string-match-p "\\`\\.[^.]" (car subs))
- (concat "\\." (substring (car subs) 1))
- (car subs)))
- (cons
- (setq ivy--subexps (length subs))
- (mapconcat
- (lambda (x)
- (if (string-match-p "\\`\\\\([^?].*\\\\)\\'" x)
- x
- (format "\\(%s\\)" x)))
- subs
- (if greedy ".*" ".*?")))))
- ivy--regex-hash)))))
-
-(defun ivy--regex-p (object)
- "Return OBJECT if it is a valid regular expression, else nil."
- (ignore-errors (string-match-p object "") object))
-
-(defun ivy--regex-or-literal (str)
- "If STR isn't a legal regexp, escape it."
- (or (ivy--regex-p str) (regexp-quote str)))
-
-(defun ivy--split-negation (str)
- "Split STR into text before and after ! delimiter.
-Do not split if the delimiter is escaped as \\!.
-
-Assumes there is at most one un-escaped delimiter and discards
-text after delimiter if it is empty. Modifies match data."
- (unless (string= str "")
- (let ((delim "\\(?:\\`\\|[^\\]\\)\\(!\\)"))
- (mapcar (lambda (split)
- ;; Store "\!" as "!".
- (replace-regexp-in-string "\\\\!" "!" split t t))
- (if (string-match delim str)
- ;; Ignore everything past first un-escaped ! rather than
- ;; crashing. We can't warn or error because the minibuffer
is
- ;; already active.
- (let* ((i (match-beginning 1))
- (j (and (string-match delim str (1+ i))
- (match-beginning 1)))
- (neg (substring str (1+ i) j)))
- (cons (substring str 0 i)
- (and (not (string= neg ""))
- (list neg))))
- (list str))))))
-
-(defun ivy--split-spaces (str)
- "Split STR on spaces, unless they're preceded by \\.
-No un-escaped spaces are left in the output. Any substring not
-constituting a valid regexp is passed to `regexp-quote'."
- (when str
- (let ((i 0) ; End of last search.
- (j 0) ; End of last delimiter.
- parts)
- (while (string-match "\\(\\\\ \\)\\| +" str i)
- (setq i (match-end 0))
- (if (not (match-beginning 1))
- ;; Un-escaped space(s).
- (let ((delim (match-beginning 0)))
- (when (< j delim)
- (push (substring str j delim) parts))
- (setq j i))
- ;; Store "\ " as " ".
- (setq str (replace-match " " t t str 1))
- (setq i (1- i))))
- (when (< j (length str))
- (push (substring str j) parts))
- (mapcar #'ivy--regex-or-literal (nreverse parts)))))
-
-(defun ivy--regex-ignore-order (str)
- "Re-build regex from STR by splitting at spaces and using ! for negation.
-
-Examples:
-foo -> matches \"foo\"
-foo bar -> matches if both \"foo\" and \"bar\" match (any order)
-foo !bar -> matches if \"foo\" matches and \"bar\" does not match
-foo !bar baz -> matches if \"foo\" matches and neither \"bar\" nor \"baz\"
match
-foo[a-z] -> matches \"foo[a-z]\"
-
-Escaping examples:
-foo\\!bar -> matches \"foo!bar\"
-foo\\ bar -> matches \"foo bar\"
-
-Returns a list suitable for `ivy-re-match'."
- (setq str (ivy--trim-trailing-re str))
- (let* (regex-parts
- (raw-parts (ivy--split-negation str)))
- (dolist (part (ivy--split-spaces (car raw-parts)))
- (push (cons part t) regex-parts))
- (when (cdr raw-parts)
- (dolist (part (ivy--split-spaces (cadr raw-parts)))
- (push (cons part nil) regex-parts)))
- (if regex-parts (nreverse regex-parts)
- "")))
-
-(defun ivy--regex-plus (str)
- "Build a regex sequence from STR.
-Spaces are wild card characters, everything before \"!\" should
-match. Everything after \"!\" should not match."
- (let ((parts (ivy--split-negation str)))
- (cl-case (length parts)
- (0
- "")
- (1
- (if (= (aref str 0) ?!)
- (list (cons "" t)
- (list (ivy--regex (car parts))))
- (ivy--regex (car parts))))
- (2
- (cons
- (cons (ivy--regex (car parts)) t)
- (mapcar #'list (split-string (cadr parts) " " t))))
- (t (error "Unexpected: use only one !")))))
-
-(defun ivy--regex-fuzzy (str)
- "Build a regex sequence from STR.
-Insert .* between each char."
- (setq str (ivy--trim-trailing-re str))
- (if (string-match "\\`\\(\\^?\\)\\(.*?\\)\\(\\$?\\)\\'" str)
- (prog1
- (concat (match-string 1 str)
- (let ((lst (string-to-list (match-string 2 str))))
- (apply #'concat
- (cl-mapcar
- #'concat
- (cons "" (cdr (mapcar (lambda (c) (format
"[^%c\n]*" c))
- lst)))
- (mapcar (lambda (x) (format "\\(%s\\)"
(regexp-quote (char-to-string x))))
- lst))))
- (match-string 3 str))
- (setq ivy--subexps (length (match-string 2 str))))
- str))
-
-(defcustom ivy-fixed-height-minibuffer nil
- "When non nil, fix the height of the minibuffer during ivy completion.
-This effectively sets the minimum height at this level to `ivy-height' and
-tries to ensure that it does not change depending on the number of candidates."
- :type 'boolean)
-
-;;** Rest
-(defcustom ivy-truncate-lines t
- "Minibuffer setting for `truncate-lines'."
- :type 'boolean)
-
-(defun ivy--minibuffer-setup ()
- "Setup ivy completion in the minibuffer."
- (setq-local mwheel-scroll-up-function 'ivy-next-line)
- (setq-local mwheel-scroll-down-function 'ivy-previous-line)
- (setq-local completion-show-inline-help nil)
- (setq-local line-spacing nil)
- (setq-local minibuffer-default-add-function
- (lambda ()
- (list ivy--default)))
- (setq-local inhibit-field-text-motion nil)
- (setq truncate-lines ivy-truncate-lines)
- (setq-local max-mini-window-height ivy-height)
- (let ((height (cond ((and ivy-fixed-height-minibuffer
- (not (eq (ivy-state-caller ivy-last)
- #'ivy-completion-in-region)))
- (+ ivy-height (if ivy-add-newline-after-prompt 1 0)))
- (ivy-add-newline-after-prompt 2))))
- (when height
- (set-window-text-height nil height)))
- (add-hook 'post-command-hook #'ivy--queue-exhibit nil t)
- (let ((hook (ivy-alist-setting ivy-hooks-alist)))
- (when (functionp hook)
- (funcall hook))))
-
-(defun ivy--input ()
- "Return the current minibuffer input."
- ;; assume one-line minibuffer input
- (save-excursion
- (goto-char (minibuffer-prompt-end))
- (let ((inhibit-field-text-motion t))
- (buffer-substring-no-properties
- (point)
- (line-end-position)))))
-
-(defun ivy--minibuffer-cleanup ()
- "Delete the displayed completion candidates."
- (save-excursion
- (goto-char (minibuffer-prompt-end))
- (delete-region (line-end-position) (point-max))))
-
-(defun ivy-cleanup-string (str)
- "Destructively remove unwanted text properties from STR."
- (ivy--remove-props str 'field))
-
-(defvar ivy-set-prompt-text-properties-function
- #'ivy-set-prompt-text-properties-default
- "Function to set the text properties of the default ivy prompt.
-Called with two arguments, PROMPT and PROPS, where PROMPT is the
-string to be propertized and PROPS is a plist of default text
-properties that may be applied to PROMPT. The function should
-return the propertized PROMPT, which may be modified in-place.")
-
-(defun ivy-set-prompt-text-properties-default (prompt props)
- "Propertize (confirm) and (match required) parts of PROMPT.
-PROPS is a plist of default text properties to apply to these
-parts beyond their respective faces `ivy-confirm-face' and
-`ivy-match-required-face'."
- (dolist (pair '(("confirm" . ivy-confirm-face)
- ("match required" . ivy-match-required-face)))
- (let ((i (string-match-p (car pair) prompt)))
- (when i
- (add-text-properties i (+ i (length (car pair)))
- `(face ,(cdr pair) ,@props)
- prompt))))
- prompt)
-
-(defun ivy-prompt ()
- "Return the current prompt."
- (let* ((caller (ivy-state-caller ivy-last))
- (fn (plist-get ivy--prompts-list caller)))
- (if fn
- (condition-case err
- (funcall fn)
- (wrong-number-of-arguments
- (lwarn 'ivy :error "%s
- Prompt function set via `ivy-set-prompt' for caller `%s'
- should take no arguments."
- (error-message-string err)
- caller)
- ;; Old behavior.
- (funcall fn (ivy-state-prompt ivy-last))))
- ivy--prompt)))
-
-(defun ivy--insert-prompt ()
- "Update the prompt according to `ivy--prompt'."
- (when (setq ivy--prompt (ivy-prompt))
- (unless (memq this-command '(ivy-done ivy-alt-done ivy-partial-or-done
- counsel-find-symbol))
- (setq ivy--prompt-extra ""))
- (let (head tail)
- (if (string-match "\\(.*?\\)\\(:? ?\\)\\'" ivy--prompt)
- (progn
- (setq head (match-string 1 ivy--prompt))
- (setq tail (match-string 2 ivy--prompt)))
- (setq head ivy--prompt)
- (setq tail ""))
- (let ((inhibit-read-only t)
- (std-props '(front-sticky t rear-nonsticky t field t read-only t))
- (n-str
- (concat
- (if (and (bound-and-true-p minibuffer-depth-indicate-mode)
- (> (minibuffer-depth) 1))
- (format "[%d] " (minibuffer-depth))
- "")
- (concat
- (if (string-match "%d.*%d" ivy-count-format)
- (format head
- (1+ ivy--index)
- (or (and (ivy-state-dynamic-collection ivy-last)
- ivy--full-length)
- ivy--length))
- (format head
- (or (and (ivy-state-dynamic-collection ivy-last)
- ivy--full-length)
- ivy--length)))
- ivy--prompt-extra
- tail)))
- (d-str (if ivy--directory
- (abbreviate-file-name ivy--directory)
- "")))
- (save-excursion
- (goto-char (point-min))
- (delete-region (point-min) (minibuffer-prompt-end))
- (let ((len-n (length n-str))
- (len-d (length d-str))
- (ww (window-width)))
- (setq n-str
- (cond ((> (+ len-n len-d) ww)
- (concat n-str "\n" d-str "\n"))
- ((> (+ len-n len-d (length ivy-text)) ww)
- (concat n-str d-str "\n"))
- (t
- (concat n-str d-str)))))
- (when ivy-pre-prompt-function
- (setq n-str (concat (funcall ivy-pre-prompt-function) n-str)))
- (when ivy-add-newline-after-prompt
- (setq n-str (concat n-str "\n")))
- (let ((regex (format "\\([^\n]\\{%d\\}\\)[^\n]" (window-width))))
- (while (string-match regex n-str)
- (setq n-str (replace-match
- (concat (match-string 1 n-str) "\n")
- nil t n-str 1))))
- (set-text-properties 0 (length n-str)
- `(face minibuffer-prompt ,@std-props)
- n-str)
- (setq n-str (funcall ivy-set-prompt-text-properties-function
- n-str std-props))
- (insert n-str))
- ;; Mark prompt as selected if the user moves there or it is the only
- ;; option left. Since the user input stays put, we have to manually
- ;; remove the face as well.
- (when ivy--use-selectable-prompt
- (if (= ivy--index -1)
- (ivy-add-face-text-property
- (minibuffer-prompt-end) (line-end-position) 'ivy-prompt-match)
- (remove-list-of-text-properties
- (minibuffer-prompt-end) (line-end-position) '(face))))
- ;; get out of the prompt area
- (constrain-to-field nil (point-max))))))
-
-(defun ivy--sort-maybe (collection)
- "Sort COLLECTION if needed."
- (let ((sort (ivy-state-sort ivy-last)))
- (if (and sort
- (or (functionp sort)
- (functionp (setq sort (ivy--sort-function
- (ivy-state-collection ivy-last))))))
- (sort (copy-sequence collection) sort)
- collection)))
-
-(defcustom ivy-magic-slash-non-match-action
'ivy-magic-slash-non-match-cd-selected
- "Action to take when a slash is added to the end of a non existing directory.
-Possible choices are 'ivy-magic-slash-non-match-cd-selected,
-'ivy-magic-slash-non-match-create, or nil"
- :type '(choice
- (const :tag "Use currently selected directory"
- ivy-magic-slash-non-match-cd-selected)
- (const :tag "Create and use new directory"
- ivy-magic-slash-non-match-create)
- (const :tag "Do nothing"
- nil)))
-
-(defun ivy--create-and-cd (dir)
- "When completing file names, create directory DIR and move there."
- (make-directory dir)
- (ivy--cd dir))
-
-(defun ivy--magic-file-doubleslash-directory ()
- "Return an appropriate directory for when two slashes are entered."
- (let (remote)
- (cond
- ;; Windows
- ((string-match "\\`[[:alpha:]]:/" ivy--directory)
- (match-string 0 ivy--directory))
- ;; Remote root if on remote
- ((setq remote (file-remote-p ivy--directory))
- (concat remote "/"))
- ;; Local root
- (t
- "/"))))
-
-(defun ivy--magic-file-slash ()
- "Handle slash when completing file names."
- (when (or (and (eq this-command #'self-insert-command)
- (eolp))
- (eq this-command #'ivy-partial-or-done))
- (let ((canonical (expand-file-name ivy-text ivy--directory))
- (magic (not (string= ivy-text "/"))))
- (cond ((member ivy-text ivy--all-candidates)
- (ivy--cd canonical))
- ((string-match-p "//\\'" ivy-text)
- (ivy--cd
- (ivy--magic-file-doubleslash-directory)))
- ((string-match-p "\\`/ssh:" ivy-text)
- (ivy--cd (file-name-directory ivy-text)))
- ((string-match "[[:alpha:]]:/\\'" ivy-text)
- (let ((drive-root (match-string 0 ivy-text)))
- (when (file-exists-p drive-root)
- (ivy--cd drive-root))))
- ((and magic (file-directory-p canonical))
- (ivy--cd canonical))
- ((let ((default-directory ivy--directory))
- (and (or (> ivy--index 0)
- (= ivy--length 1)
- magic)
- (not (ivy--prompt-selected-p))
- (not (equal (ivy-state-current ivy-last) ""))
- (file-directory-p (ivy-state-current ivy-last))
- (or (eq ivy-magic-slash-non-match-action
- 'ivy-magic-slash-non-match-cd-selected)
- (eq this-command #'ivy-partial-or-done))))
- (ivy--cd
- (expand-file-name (ivy-state-current ivy-last) ivy--directory)))
- ((and (eq ivy-magic-slash-non-match-action
- 'ivy-magic-slash-non-match-create)
- magic)
- (ivy--create-and-cd canonical))))))
-
-(defun ivy-magic-read-file-env ()
- "If reading filename, jump to environment variable location."
- (interactive)
- (if (and ivy--directory
- (equal ivy-text ""))
- (let* ((cands (cl-loop for pair in process-environment
- for (var val) = (split-string pair "=" t)
- if (and val (not (equal "" val)))
- if (file-exists-p
- (if (file-name-absolute-p val)
- val
- (setq val
- (expand-file-name val ivy--directory))))
- collect (cons var val)))
- (enable-recursive-minibuffers t)
- (x (ivy-read "Env: " cands))
- (path (cdr (assoc x cands))))
- (insert (if (file-accessible-directory-p path)
- (file-name-as-directory path)
- path))
- (ivy--cd-maybe))
- (insert last-input-event)))
-
-(defun ivy-make-magic-action (caller key)
- "Return a command that does the equivalent of `ivy-read-action' and KEY.
-This happens only when the input is empty.
-The intention is to bind the result to keys that are typically
-bound to `self-insert-command'."
- (let* ((alist (assoc key
- (plist-get
- ivy--actions-list
- caller)))
- (doc (format "%s (`%S')"
- (nth 2 alist)
- (nth 1 alist))))
- `(lambda (&optional arg)
- ,doc
- (interactive "p")
- (if (string= "" ivy-text)
- (execute-kbd-macro
- (kbd ,(concat "M-o " key)))
- (self-insert-command arg)))))
-
-(defcustom ivy-magic-tilde t
- "When non-nil, ~ will move home when selecting files.
-Otherwise, ~/ will move home."
- :type 'boolean)
-
-(defcustom ivy-dynamic-exhibit-delay-ms 0
- "Delay in ms before dynamic collections are refreshed"
- :type 'integer)
-
-(defvar ivy--exhibit-timer nil)
-
-(defun ivy--queue-exhibit ()
- "Insert Ivy completions display, possibly after a timeout for
-dynamic collections.
-Should be run via minibuffer `post-command-hook'."
- (if (and (> ivy-dynamic-exhibit-delay-ms 0)
- (ivy-state-dynamic-collection ivy-last))
- (progn
- (when ivy--exhibit-timer (cancel-timer ivy--exhibit-timer))
- (setq ivy--exhibit-timer
- (run-with-timer
- (/ ivy-dynamic-exhibit-delay-ms 1000.0)
- nil
- 'ivy--exhibit)))
- (ivy--exhibit)))
-
-(defun ivy--magic-tilde-directory (dir)
- "Return an appropriate home for DIR for when ~ or ~/ are entered."
- (expand-file-name
- (let (remote)
- (if (and (setq remote (file-remote-p dir))
- (let ((local (file-local-name dir)))
- (not (or (string= "/root/" local)
- (string-match-p "/home/\\([^/]+\\)/\\'" local)))))
- (concat remote "~/")
- "~/"))))
-
-(defun ivy-update-candidates (cands)
- (ivy--insert-minibuffer
- (ivy--format
- (setq ivy--all-candidates cands))))
-
-(defun ivy--exhibit ()
- "Insert Ivy completions display.
-Should be run via minibuffer `post-command-hook'."
- (when (memq 'ivy--queue-exhibit post-command-hook)
- (let ((inhibit-field-text-motion nil))
- (constrain-to-field nil (point-max)))
- (setq ivy-text (ivy--input))
- (if (ivy-state-dynamic-collection ivy-last)
- ;; while-no-input would cause annoying
- ;; "Waiting for process to die...done" message interruptions
- (let ((inhibit-message t)
- coll in-progress)
- (unless (equal ivy--old-text ivy-text)
- (while-no-input
- (setq coll (funcall (ivy-state-collection ivy-last) ivy-text))
- (when (eq coll 0)
- (setq coll nil)
- (setq ivy--old-re nil)
- (setq in-progress t))
- (setq ivy--all-candidates (ivy--sort-maybe coll))
- (setq ivy--old-text ivy-text)))
- (when (eq ivy--all-candidates 0)
- (setq ivy--all-candidates nil)
- (setq ivy--old-re nil)
- (setq in-progress t))
- (when (or ivy--all-candidates
- (and (not (get-process " *counsel*"))
- (not in-progress)))
- (ivy--set-index-dynamic-collection)
- (ivy--insert-minibuffer
- (ivy--format ivy--all-candidates))))
- (cond (ivy--directory
- (cond ((or (string= "~/" ivy-text)
- (and (string= "~" ivy-text)
- ivy-magic-tilde))
- (ivy--cd (ivy--magic-tilde-directory ivy--directory)))
- ((string-match "/\\'" ivy-text)
- (ivy--magic-file-slash))))
- ((eq (ivy-state-collection ivy-last) #'internal-complete-buffer)
- (when (or (and (string-match "\\` " ivy-text)
- (not (string-match "\\` " ivy--old-text)))
- (and (string-match "\\` " ivy--old-text)
- (not (string-match "\\` " ivy-text))))
- (setq ivy--all-candidates
- (if (= (string-to-char ivy-text) ?\s)
- (ivy--buffer-list " ")
- (ivy--buffer-list "" ivy-use-virtual-buffers)))
- (setq ivy--old-re nil))))
- (ivy--insert-minibuffer
- (with-current-buffer (ivy-state-buffer ivy-last)
- (ivy--format
- (ivy--filter ivy-text ivy--all-candidates))))
- (setq ivy--old-text ivy-text))))
-
-(defun ivy-display-function-fallback (str)
- (let ((buffer-undo-list t))
- (save-excursion
- (forward-line 1)
- (insert str))))
-
-(defun ivy--insert-minibuffer (text)
- "Insert TEXT into minibuffer with appropriate cleanup."
- (let ((resize-mini-windows nil)
- (update-fn (ivy-state-update-fn ivy-last))
- (old-mark (marker-position (mark-marker)))
- (win (active-minibuffer-window))
- deactivate-mark)
- (when win
- (with-selected-window win
- (ivy--minibuffer-cleanup)
- (when update-fn
- (funcall update-fn))
- (ivy--insert-prompt)
- ;; Do nothing if while-no-input was aborted.
- (when (stringp text)
- (if ivy--display-function
- (funcall ivy--display-function text)
- (ivy-display-function-fallback text)))
- (ivy--resize-minibuffer-to-fit)
- ;; prevent region growing due to text remove/add
- (when (region-active-p)
- (set-mark old-mark))))))
-
-(defun ivy--resize-minibuffer-to-fit ()
- "Resize the minibuffer window size to fit the text in the minibuffer."
- (unless (frame-root-window-p (minibuffer-window))
- (with-selected-window (minibuffer-window)
- (if (fboundp 'window-text-pixel-size)
- (let ((text-height (cdr (window-text-pixel-size)))
- (body-height (window-body-height nil t)))
- (when (> text-height body-height)
- ;; Note: the size increment needs to be at least
- ;; frame-char-height, otherwise resizing won't do
- ;; anything.
- (let ((delta (max (- text-height body-height)
- (frame-char-height))))
- (window-resize nil delta nil t t))))
- (let ((text-height (count-screen-lines))
- (body-height (window-body-height)))
- (when (> text-height body-height)
- (window-resize nil (- text-height body-height) nil t)))))))
-
-(defun ivy--add-face (str face)
- "Propertize STR with FACE."
- (let ((len (length str)))
- (condition-case nil
- (progn
- (colir-blend-face-background 0 len face str)
- (let ((foreground (face-foreground face)))
- (when foreground
- (ivy-add-face-text-property
- 0 len (list :foreground foreground) str))))
- (error
- (ignore-errors
- (font-lock-append-text-property 0 len 'face face str)))))
- str)
-
-(declare-function flx-make-string-cache "ext:flx")
-(declare-function flx-score "ext:flx")
-
-(defvar ivy--flx-cache nil)
-
-(eval-after-load 'flx
- '(setq ivy--flx-cache (flx-make-string-cache)))
-
-(defun ivy-toggle-case-fold ()
- "Toggle `case-fold-search' for Ivy operations.
-
-Instead of modifying `case-fold-search' directly, this command
-toggles `ivy-case-fold-search', which can take on more values
-than the former, between nil and either `auto' or t. See
-`ivy-case-fold-search-default' for the meaning of these values.
-
-In any Ivy completion session, the case folding starts with
-`ivy-case-fold-search-default'."
- (interactive)
- (setq ivy-case-fold-search
- (and (not ivy-case-fold-search)
- (or ivy-case-fold-search-default 'auto)))
- ;; Reset cache so that the candidate list updates.
- (setq ivy--old-re nil))
-
-(defun ivy--re-filter (re candidates &optional mkpred)
- "Return all RE matching CANDIDATES.
-RE is a list of cons cells, with a regexp car and a boolean cdr.
-When the cdr is t, the car must match.
-Otherwise, the car must not match."
- (if (equal re "")
- candidates
- (ignore-errors
- (dolist (re (if (stringp re) (list (cons re t)) re))
- (let* ((re-str (car re))
- (pred
- (if mkpred
- (funcall mkpred re-str)
- (lambda (x) (string-match-p re-str x)))))
- (setq candidates
- (cl-remove nil candidates
- (if (cdr re) :if-not :if)
- pred))))
- candidates)))
-
-(defun ivy--filter (name candidates)
- "Return all items that match NAME in CANDIDATES.
-CANDIDATES are assumed to be static."
- (let ((re (funcall ivy--regex-function name)))
- (if (and
- ivy--old-re
- ivy--old-cands
- (equal re ivy--old-re))
- ;; quick caching for "C-n", "C-p" etc.
- ivy--old-cands
- (let* ((re-str (ivy-re-to-str re))
- (matcher (ivy-state-matcher ivy-last))
- (case-fold-search (ivy--case-fold-p name))
- (cands (cond
- ((and ivy--old-re
- (stringp re)
- (stringp ivy--old-re)
- (not (string-match-p "\\\\" ivy--old-re))
- (not (equal ivy--old-re ""))
- (memq (cl-search
- (if (string-match-p "\\\\)\\'" ivy--old-re)
- (substring ivy--old-re 0 -2)
- ivy--old-re)
- re)
- '(0 2))
- ivy--old-cands
- (ivy--re-filter re ivy--old-cands)))
- (matcher
- (funcall matcher re candidates))
- (t
- (ivy--re-filter re candidates)))))
- (if (memq (cdr (assq (ivy-state-caller ivy-last)
- ivy-index-functions-alist))
- '(ivy-recompute-index-swiper
- ivy-recompute-index-swiper-async
- ivy-recompute-index-swiper-async-backward
- ivy-recompute-index-swiper-backward))
- (progn
- (ivy--recompute-index name re-str cands)
- (setq ivy--old-cands (ivy--sort name cands)))
- (setq ivy--old-cands (ivy--sort name cands))
- (ivy--recompute-index name re-str ivy--old-cands))
- (setq ivy--old-re re)
- ivy--old-cands))))
-
-(defun ivy--set-candidates (x)
- "Update `ivy--all-candidates' with X."
- (let (res)
- (dolist (source ivy--extra-candidates)
- (if (equal source '(original-source))
- (if (null res)
- (setq res x)
- (setq res (append x res)))
- (setq ivy--old-re nil)
- (setq res (append
- (ivy--filter ivy-text (cadr source))
- res))))
- (setq ivy--all-candidates res)))
-
-(defun ivy--shorter-matches-first (_name cands)
- "Sort CANDS according to their length."
- (if (< (length cands) ivy-sort-max-size)
- (cl-sort
- (copy-sequence cands)
- (lambda (s1 s2)
- (< (length s1) (length s2))))
- cands))
-
-(defcustom ivy-sort-matches-functions-alist
- '((t . nil)
- (ivy-completion-in-region . ivy--shorter-matches-first)
- (ivy-switch-buffer . ivy-sort-function-buffer))
- "An alist of functions for sorting matching candidates.
-
-Unlike `ivy-sort-functions-alist', which is used to sort the
-whole collection only once, this alist of functions are used to
-sort only matching candidates after each change in input.
-
-The alist KEY is either a collection function or t to match
-previously unmatched collection functions.
-
-The alist VAL is a sorting function with the signature of
-`ivy--prefix-sort'."
- :type '(alist
- :key-type (choice
- (const :tag "Fall-through" t)
- (symbol :tag "Collection"))
- :value-type
- (choice
- (const :tag "Don't sort" nil)
- (const :tag "Put prefix matches ahead" ivy--prefix-sort)
- (function :tag "Custom sort function"))))
-
-(defun ivy--sort-files-by-date (_name candidates)
- "Re-sort CANDIDATES according to file modification date."
- (let ((default-directory ivy--directory))
- (sort (copy-sequence candidates) #'file-newer-than-file-p)))
-
-(defvar ivy--flx-featurep (require 'flx nil 'noerror))
-
-(defun ivy--sort (name candidates)
- "Re-sort candidates by NAME.
-All CANDIDATES are assumed to match NAME."
- (let (fun)
- (cond ((setq fun (ivy-alist-setting ivy-sort-matches-functions-alist))
- (funcall fun name candidates))
- ((and ivy--flx-featurep
- (eq ivy--regex-function 'ivy--regex-fuzzy))
- (ivy--flx-sort name candidates))
- (t
- candidates))))
-
-(defun ivy--prefix-sort (name candidates)
- "Re-sort candidates by NAME.
-All CANDIDATES are assumed to match NAME.
-Prefix matches to NAME are put ahead of the list."
- (if (or (string= name "")
- (= (aref name 0) ?^))
- candidates
- (let ((re-prefix (concat "\\`" (funcall ivy--regex-function name)))
- res-prefix
- res-noprefix)
- (dolist (s candidates)
- (if (string-match-p re-prefix s)
- (push s res-prefix)
- (push s res-noprefix)))
- (nconc
- (nreverse res-prefix)
- (nreverse res-noprefix)))))
-
-(defvar ivy--virtual-buffers nil
- "Store the virtual buffers alist.")
-
-(defun ivy-re-to-str (re)
- "Transform RE to a string.
-
-Functions like `ivy--regex-ignore-order' return a cons list.
-This function extracts a string from the cons list."
- (if (consp re) (caar re) re))
-
-(defun ivy-sort-function-buffer (name candidates)
- "Re-sort candidates by NAME.
-CANDIDATES is a list of buffer names each containing NAME.
-Sort open buffers before virtual buffers, and prefix matches
-before substring matches."
- (if (or (string= name "")
- (= (aref name 0) ?^))
- candidates
- (let* ((base-re (ivy-re-to-str (funcall ivy--regex-function name)))
- (re-star-prefix (concat "\\`\\*" base-re))
- (re-prefix (concat "\\`" base-re))
- res-prefix
- res-noprefix
- res-virtual-prefix
- res-virtual-noprefix)
- (dolist (s candidates)
- (cond
- ((and (assoc s ivy--virtual-buffers)
- (or (string-match-p re-star-prefix s)
- (string-match-p re-prefix s)))
- (push s res-virtual-prefix))
- ((assoc s ivy--virtual-buffers)
- (push s res-virtual-noprefix))
- ((or (string-match-p re-star-prefix s)
- (string-match-p re-prefix s))
- (push s res-prefix))
- (t
- (push s res-noprefix))))
- (nconc
- (nreverse res-prefix)
- (nreverse res-noprefix)
- (nreverse res-virtual-prefix)
- (nreverse res-virtual-noprefix)))))
-
-(defvar ivy-flx-limit 200
- "Used to conditionally turn off flx sorting.
-
-When the amount of matching candidates exceeds this limit, then
-no sorting is done.")
-
-(defvar ivy--recompute-index-inhibit nil
- "When non-nil, `ivy--recompute-index' is a no-op.")
-
-(defun ivy--recompute-index (name re-str cands)
- "Recompute index of selected candidate matching NAME.
-RE-STR is the regexp, CANDS are the current candidates."
- (let ((caller (ivy-state-caller ivy-last))
- (func (or (ivy-alist-setting ivy-index-functions-alist)
- #'ivy-recompute-index-zero))
- (case-fold-search (ivy--case-fold-p name))
- (preselect (ivy-state-preselect ivy-last))
- (current (ivy-state-current ivy-last))
- (empty (string= name "")))
- (unless (or (memq this-command '(ivy-resume ivy-partial-or-done))
- ivy--recompute-index-inhibit)
- (ivy-set-index
- (if (or (string= name "")
- (and (> (length cands) 10000) (eq func
#'ivy-recompute-index-zero)))
- 0
- (or
- (cl-position (ivy--remove-prefix "^" name)
- cands
- :test #'ivy--case-fold-string=)
- (and ivy--directory
- (cl-position (concat re-str "/")
- cands
- :test #'ivy--case-fold-string=))
- (and (eq caller 'ivy-switch-buffer)
- (not empty)
- 0)
- (and (not empty)
- (not (eq caller 'swiper))
- (not (and ivy--flx-featurep
- (eq ivy--regex-function 'ivy--regex-fuzzy)
- ;; Limit to configured number of candidates
- (null (nthcdr ivy-flx-limit cands))))
- ;; If there was a preselected candidate, don't try to
- ;; keep it selected even if the regexp still matches it.
- ;; See issue #1563. See also `ivy--preselect-index',
- ;; which this logic roughly mirrors.
- (not (or
- (and (integerp preselect)
- (= ivy--index preselect))
- (equal current preselect)
- (and (ivy--regex-p preselect)
- (stringp current)
- (string-match-p preselect current))))
- ivy--old-cands
- (cl-position current cands :test #'equal))
- (funcall func re-str cands)))))
- (when (or empty (string= name "^"))
- (ivy-set-index
- (or (ivy--preselect-index preselect cands)
- ivy--index)))))
-
-(defun ivy-recompute-index-swiper (_re-str cands)
- "Recompute index of selected candidate when using `swiper'.
-CANDS are the current candidates."
- (condition-case nil
- (let ((tail (nthcdr ivy--index ivy--old-cands))
- idx)
- (if (and tail ivy--old-cands (not (equal "^" ivy--old-re)))
- (progn
- (while (and tail (null idx))
- ;; Compare with eq to handle equal duplicates in cands
- (setq idx (cl-position (pop tail) cands)))
- (or
- idx
- (1- (length cands))))
- (if ivy--old-cands
- ivy--index
- ;; already in ivy-state-buffer
- (let ((n (line-number-at-pos))
- (res 0)
- (i 0))
- (dolist (c cands)
- (when (eq n (get-text-property 0 'swiper-line-number c))
- (setq res i))
- (cl-incf i))
- res))))
- (error 0)))
-
-(defun ivy-recompute-index-swiper-backward (re-str cands)
- "Recompute index of selected candidate when using `swiper-backward'.
-CANDS are the current candidates."
- (let ((idx (ivy-recompute-index-swiper re-str cands)))
- (if (or (= idx -1)
- (<= (get-text-property 0 'swiper-line-number (nth idx cands))
- (line-number-at-pos)))
- idx
- (- idx 1))))
-
-(defun ivy-recompute-index-swiper-async (_re-str cands)
- "Recompute index of selected candidate when using `swiper' asynchronously.
-CANDS are the current candidates."
- (if (null ivy--old-cands)
- (let ((ln (with-ivy-window
- (line-number-at-pos))))
- (or
- ;; closest to current line going forwards
- (cl-position-if (lambda (x)
- (>= (string-to-number x) ln))
- cands)
- ;; closest to current line going backwards
- (1- (length cands))))
- (let ((tail (nthcdr ivy--index ivy--old-cands))
- idx)
- (if (and tail ivy--old-cands (not (equal "^" ivy--old-re)))
- (progn
- (while (and tail (null idx))
- ;; Compare with `equal', since the collection is re-created
- ;; each time with `split-string'
- (setq idx (cl-position (pop tail) cands :test #'equal)))
- (or idx 0))
- ivy--index))))
-
-(defun ivy-recompute-index-swiper-async-backward (re-str cands)
- "Recompute index of selected candidate when using `swiper-backward'
-asynchronously. CANDS are the current candidates."
- (if (= (length cands) 0)
- 0
- (let ((idx (ivy-recompute-index-swiper-async re-str cands)))
- (if
- (<= (string-to-number (nth idx cands))
- (with-ivy-window (line-number-at-pos)))
- idx
- (- idx 1)))))
-
-(defun ivy-recompute-index-zero (_re-str _cands)
- "Recompute index of selected candidate.
-This function serves as a fallback when nothing else is available."
- 0)
-
-(defcustom ivy-minibuffer-faces
- '(ivy-minibuffer-match-face-1
- ivy-minibuffer-match-face-2
- ivy-minibuffer-match-face-3
- ivy-minibuffer-match-face-4)
- "List of `ivy' faces for minibuffer group matches."
- :type '(repeat :tag "Faces"
- (choice
- (const ivy-minibuffer-match-face-1)
- (const ivy-minibuffer-match-face-2)
- (const ivy-minibuffer-match-face-3)
- (const ivy-minibuffer-match-face-4)
- (face :tag "Other face"))))
-
-(defun ivy--minibuffer-face (n)
- "Return Nth face from `ivy-minibuffer-faces'.
-N wraps around, but skips the first element of the list."
- (let ((tail (cdr ivy-minibuffer-faces)))
- (nth (mod (+ n 2) (length tail)) tail)))
-
-(defun ivy--flx-propertize (x)
- "X is (cons (flx-score STR ...) STR)."
- (let ((str (copy-sequence (cdr x)))
- (i 0)
- (last-j -2))
- (dolist (j (cdar x))
- (unless (eq j (1+ last-j))
- (cl-incf i))
- (setq last-j j)
- (ivy-add-face-text-property j (1+ j) (ivy--minibuffer-face i) str))
- str))
-
-(defun ivy--flx-sort (name cands)
- "Sort according to closeness to string NAME the string list CANDS."
- (condition-case nil
- (let* ((bolp (= (string-to-char name) ?^))
- ;; An optimized regex for fuzzy matching
- ;; "abc" → "^[^a]*a[^b]*b[^c]*c"
- (fuzzy-regex (concat "\\`"
- (and bolp (regexp-quote (substring name 1
2)))
- (mapconcat
- (lambda (x)
- (setq x (char-to-string x))
- (concat "[^" x "]*" (regexp-quote x)))
- (if bolp (substring name 2) name)
- "")))
- ;; Strip off the leading "^" for flx matching
- (flx-name (if bolp (substring name 1) name))
- cands-left
- cands-to-sort)
-
- ;; Filter out non-matching candidates
- (dolist (cand cands)
- (when (string-match-p fuzzy-regex cand)
- (push cand cands-left)))
-
- ;; pre-sort the candidates by length before partitioning
- (setq cands-left (cl-sort cands-left #'< :key #'length))
-
- ;; partition the candidates into sorted and unsorted groups
- (dotimes (_ (min (length cands-left) ivy-flx-limit))
- (push (pop cands-left) cands-to-sort))
-
- (nconc
- ;; Compute all of the flx scores in one pass and sort
- (mapcar #'car
- (sort (mapcar
- (lambda (cand)
- (cons cand
- (car (flx-score cand flx-name
ivy--flx-cache))))
- cands-to-sort)
- (lambda (c1 c2)
- ;; Break ties by length
- (if (/= (cdr c1) (cdr c2))
- (> (cdr c1)
- (cdr c2))
- (< (length (car c1))
- (length (car c2)))))))
-
- ;; Add the unsorted candidates
- cands-left))
- (error cands)))
-
-(defun ivy--truncate-string (str width)
- "Truncate STR to WIDTH."
- (truncate-string-to-width str width nil nil t))
-
-(defun ivy--format-function-generic (selected-fn other-fn cands separator)
- "Transform candidates into a string for minibuffer.
-SELECTED-FN is called for the selected candidate, OTHER-FN for the others.
-Both functions take one string argument each. CANDS is a list of candidates
-and SEPARATOR is used to join them."
- (let ((i -1))
- (mapconcat
- (lambda (str)
- (let ((curr (eq (cl-incf i) ivy--window-index)))
- (if curr
- (funcall selected-fn str)
- (funcall other-fn str))))
- cands
- separator)))
-
-(defun ivy-format-function-default (cands)
- "Transform CANDS into a string for minibuffer."
- (ivy--format-function-generic
- (lambda (str)
- (ivy--add-face str 'ivy-current-match))
- #'identity
- cands
- "\n"))
-
-(defun ivy-format-function-arrow (cands)
- "Transform CANDS into a string for minibuffer."
- (ivy--format-function-generic
- (lambda (str)
- (concat "> " (ivy--add-face str 'ivy-current-match)))
- (lambda (str)
- (concat " " str))
- cands
- "\n"))
-
-(defun ivy-format-function-line (cands)
- "Transform CANDS into a string for minibuffer."
- (ivy--format-function-generic
- (lambda (str)
- (ivy--add-face (concat str "\n") 'ivy-current-match))
- (lambda (str)
- (concat str "\n"))
- cands
- ""))
-
-(defalias 'ivy-add-face-text-property
- (if (fboundp 'add-face-text-property)
- (lambda (start end face &optional object append)
- (add-face-text-property start end face append object))
- (lambda (start end face &optional object append)
- (funcall (if append
- #'font-lock-append-text-property
- #'font-lock-prepend-text-property)
- start end 'face face object)))
- "Compatibility shim for `add-face-text-property'.
-Fall back on `font-lock-prepend-text-property' in Emacs versions
-prior to 24.4 (`font-lock-append-text-property' when APPEND is
-non-nil).
-Note: The usual last two arguments are flipped for convenience.")
-
-(defun ivy--highlight-ignore-order (str)
- "Highlight STR, using the ignore-order method."
- (when (consp ivy--old-re)
- (let ((i 1))
- (dolist (re ivy--old-re)
- (when (string-match (car re) str)
- (ivy-add-face-text-property
- (match-beginning 0) (match-end 0)
- (ivy--minibuffer-face i)
- str))
- (cl-incf i))))
- str)
-
-(defun ivy--highlight-fuzzy (str)
- "Highlight STR, using the fuzzy method."
- (if (and ivy--flx-featurep
- (eq (ivy-alist-setting ivy-re-builders-alist) 'ivy--regex-fuzzy))
- (let ((flx-name (ivy--remove-prefix "^" ivy-text)))
- (ivy--flx-propertize
- (cons (flx-score str flx-name ivy--flx-cache) str)))
- (ivy--highlight-default str)))
-
-(defun ivy--highlight-default (str)
- "Highlight STR, using the default method."
- (unless ivy--old-re
- (setq ivy--old-re (funcall ivy--regex-function ivy-text)))
- (let ((regexps
- (if (listp ivy--old-re)
- (mapcar #'car (cl-remove-if-not #'cdr ivy--old-re))
- (list ivy--old-re)))
- start)
- (dolist (re regexps)
- (ignore-errors
- (while (and (string-match re str start)
- (> (- (match-end 0) (match-beginning 0)) 0))
- (setq start (match-end 0))
- (let ((i 0)
- (n 0)
- prev)
- (while (<= i ivy--subexps)
- (let ((beg (match-beginning i))
- (end (match-end i)))
- (when (and beg end)
- (unless (and prev (= prev beg))
- (cl-incf n))
- (let ((face
- (cond ((zerop ivy--subexps)
- (cadr ivy-minibuffer-faces))
- ((zerop i)
- (car ivy-minibuffer-faces))
- (t
- (ivy--minibuffer-face n)))))
- (ivy-add-face-text-property beg end face str))
- (unless (zerop i)
- (setq prev end))))
- (cl-incf i)))))))
- str)
-
-(defun ivy--format-minibuffer-line (str)
- "Format line STR for use in minibuffer."
- (let* ((str (ivy-cleanup-string (copy-sequence str)))
- (str (if (eq ivy-display-style 'fancy)
- (if (memq (ivy-state-caller ivy-last)
- ivy-highlight-grep-commands)
- (let* ((start (if (string-match
"\\`[^:]+:\\(?:[^:]+:\\)?" str)
- (match-end 0) 0))
- (file (substring str 0 start))
- (match (substring str start)))
- (concat file (funcall ivy--highlight-function match)))
- (funcall ivy--highlight-function str))
- str))
- (olen (length str))
- (annot (plist-get completion-extra-properties :annotation-function)))
- (add-text-properties
- 0 olen
- '(mouse-face
- ivy-minibuffer-match-highlight
- help-echo
- (format
- (if tooltip-mode
- "mouse-1: %s\nmouse-3: %s"
- "mouse-1: %s mouse-3: %s")
- ivy-mouse-1-tooltip ivy-mouse-3-tooltip))
- str)
- (when annot
- (setq str (concat str (funcall annot str)))
- (ivy-add-face-text-property
- olen (length str) 'ivy-completions-annotations str))
- str))
-
-(defun ivy-read-file-transformer (str)
- "Transform candidate STR when reading files."
- (if (ivy--dirname-p str)
- (propertize str 'face 'ivy-subdir)
- str))
-
-(defun ivy--minibuffer-index-bounds (idx len wnd-len)
- (let* ((half-height (/ wnd-len 2))
- (start (max 0
- (min (- idx half-height)
- (- len (1- wnd-len)))))
- (end (min (+ start (1- wnd-len)) len)))
- (list start end (- idx start))))
-
-(defun ivy--format (cands)
- "Return a string for CANDS suitable for display in the minibuffer.
-CANDS is a list of candidates that :display-transformer can turn into strings."
- (setq ivy--length (length cands))
- (when (>= ivy--index ivy--length)
- (ivy-set-index (max (1- ivy--length) 0)))
- (if (null cands)
- (setf (ivy-state-current ivy-last) "")
- (let ((cur (nth ivy--index cands)))
- (setf (ivy-state-current ivy-last) (if (stringp cur)
- (copy-sequence cur)
- cur)))
- (let* ((bnd (ivy--minibuffer-index-bounds
- ivy--index ivy--length ivy-height))
- (wnd-cands (cl-subseq cands (car bnd) (cadr bnd)))
- (case-fold-search (ivy--case-fold-p ivy-text))
- transformer-fn)
- (setq ivy--window-index (nth 2 bnd))
- (when (setq transformer-fn (ivy-state-display-transformer-fn ivy-last))
- (with-ivy-window
- (with-current-buffer (ivy-state-buffer ivy-last)
- (setq wnd-cands (mapcar transformer-fn wnd-cands)))))
- (ivy--wnd-cands-to-str wnd-cands))))
-
-(defun ivy--wnd-cands-to-str (wnd-cands)
- (let ((str (concat "\n"
- (funcall (ivy-alist-setting ivy-format-functions-alist)
- (condition-case nil
- (mapcar
- #'ivy--format-minibuffer-line
- wnd-cands)
- (error wnd-cands))))))
- (put-text-property 0 (length str) 'read-only nil str)
- str))
-
-(defvar recentf-list)
-(defvar bookmark-alist)
-
-(defcustom ivy-virtual-abbreviate 'name
- "The mode of abbreviation for virtual buffer names."
- :type '(choice
- (const :tag "Only name" name)
- (const :tag "Abbreviated path" abbreviate)
- (const :tag "Full path" full)
- ;; eventually, uniquify
- ))
-(declare-function bookmark-maybe-load-default-file "bookmark")
-(declare-function bookmark-get-filename "bookmark")
-
-(defun ivy--virtual-buffers ()
- "Adapted from `ido-add-virtual-buffers-to-list'."
- (require 'bookmark)
- (unless recentf-mode
- (recentf-mode 1))
- (bookmark-maybe-load-default-file)
- (let* ((vb-bkm (delete " - no file -"
- (delq nil (mapcar #'bookmark-get-filename
- bookmark-alist))))
- (vb-list (cond ((eq ivy-use-virtual-buffers 'recentf)
- recentf-list)
- ((eq ivy-use-virtual-buffers 'bookmarks)
- vb-bkm)
- (ivy-use-virtual-buffers
- (append recentf-list vb-bkm))
- (t nil)))
- virtual-buffers)
- (dolist (head vb-list)
- (let* ((file-name (if (stringp head)
- head
- (cdr head)))
- (name (cond ((eq ivy-virtual-abbreviate 'name)
- (file-name-nondirectory file-name))
- ((eq ivy-virtual-abbreviate 'abbreviate)
- (abbreviate-file-name file-name))
- (t
- (expand-file-name file-name)))))
- (when (equal name "")
- (setq name
- (if (consp head)
- (car head)
- (file-name-nondirectory (directory-file-name file-name)))))
- (unless (or (equal name "")
- (get-file-buffer file-name)
- (assoc name virtual-buffers))
- (push (cons (copy-sequence name) file-name) virtual-buffers))))
- (when virtual-buffers
- (dolist (comp virtual-buffers)
- (put-text-property 0 (length (car comp))
- 'face 'ivy-virtual
- (car comp)))
- (setq ivy--virtual-buffers (nreverse virtual-buffers))
- (mapcar #'car ivy--virtual-buffers))))
-
-(defcustom ivy-ignore-buffers '("\\` ")
- "List of regexps or functions matching buffer names to ignore."
- :type '(repeat (choice regexp function)))
-
-(defvar ivy-switch-buffer-faces-alist '((dired-mode . ivy-subdir)
- (org-mode . ivy-org))
- "Store face customizations for `ivy-switch-buffer'.
-Each KEY is `major-mode', each VALUE is a face name.")
-
-(defun ivy--buffer-list (str &optional virtual predicate)
- "Return the buffers that match STR.
-If VIRTUAL is non-nil, add virtual buffers.
-If optional argument PREDICATE is non-nil, use it to test each
-possible match. See `all-completions' for further information."
- (delete-dups
- (nconc
- (mapcar
- (lambda (x)
- (let* ((buf (get-buffer x))
- (dir (buffer-local-value 'default-directory buf))
- (face (if (and dir
- (ignore-errors
- (file-remote-p (abbreviate-file-name dir))))
- 'ivy-remote
- (cdr (assq (buffer-local-value 'major-mode buf)
- ivy-switch-buffer-faces-alist)))))
- (if face
- (propertize x 'face face)
- x)))
- (all-completions str #'internal-complete-buffer predicate))
- (and virtual
- (ivy--virtual-buffers)))))
-
-(defvar ivy-views (and nil
- `(("ivy + *scratch* {}"
- (vert
- (file ,(expand-file-name "ivy.el"))
- (buffer "*scratch*")))
- ("swiper + *scratch* {}"
- (horz
- (file ,(expand-file-name "swiper.el"))
- (buffer "*scratch*")))))
- "Store window configurations selectable by `ivy-switch-buffer'.
-
-The default value is given as an example.
-
-Each element is a list of (NAME TREE). NAME is a string, it's
-recommended to end it with a distinctive snippet e.g. \"{}\" so
-that it's easy to distinguish the window configurations.
-
-TREE is a nested list with the following valid cars:
-- vert: split the window vertically
-- horz: split the window horizontally
-- file: open the specified file
-- buffer: open the specified buffer
-
-TREE can be nested multiple times to have multiple window splits.")
-
-(defun ivy-default-view-name ()
- "Return default name for new view."
- (let* ((default-view-name
- (concat "{} "
- (mapconcat #'identity
- (sort
- (mapcar (lambda (w)
- (let* ((b (window-buffer w))
- (f (buffer-file-name b)))
- (if f
- (file-name-nondirectory f)
- (buffer-name b))))
- (window-list))
- #'string-lessp)
- " ")))
- (view-name-re (concat "\\`"
- (regexp-quote default-view-name)
- " \\([0-9]+\\)"))
- old-view)
- (cond ((setq old-view
- (cl-find-if
- (lambda (x)
- (string-match view-name-re (car x)))
- ivy-views))
- (format "%s %d"
- default-view-name
- (1+ (string-to-number
- (match-string 1 (car old-view))))))
- ((assoc default-view-name ivy-views)
- (concat default-view-name " 1"))
- (t
- default-view-name))))
-
-(defun ivy-push-view (&optional arg)
- "Push the current window tree on `ivy-views'.
-
-When ARG is non-nil, replace a selected item on `ivy-views'.
-
-Currently, the split configuration (i.e. horizontal or vertical)
-and point positions are saved, but the split positions aren't.
-Use `ivy-pop-view' to delete any item from `ivy-views'."
- (interactive "P")
- (let* ((view (cl-labels
- ((ft (tr)
- (if (consp tr)
- (if (eq (car tr) t)
- (cons 'vert
- (mapcar #'ft (cddr tr)))
- (cons 'horz
- (mapcar #'ft (cddr tr))))
- (with-current-buffer (window-buffer tr)
- (cond (buffer-file-name
- (list 'file buffer-file-name (point)))
- ((eq major-mode 'dired-mode)
- (list 'file default-directory (point)))
- (t
- (list 'buffer (buffer-name) (point))))))))
- (ft (car (window-tree)))))
- (view-name
- (if arg
- (ivy-read "Update view: " ivy-views)
- (ivy-read "Name view: " nil
- :initial-input (ivy-default-view-name)))))
- (when view-name
- (let ((x (assoc view-name ivy-views)))
- (if x
- (setcdr x (list view))
- (push (list view-name view) ivy-views))))))
-
-(defun ivy-pop-view-action (view)
- "Delete VIEW from `ivy-views'."
- (setq ivy-views (delete view ivy-views))
- (setq ivy--all-candidates
- (delete (car view) ivy--all-candidates))
- (setq ivy--old-cands nil))
-
-(defun ivy-pop-view ()
- "Delete a view to delete from `ivy-views'."
- (interactive)
- (ivy-read "Pop view: " ivy-views
- :preselect (caar ivy-views)
- :action #'ivy-pop-view-action
- :caller 'ivy-pop-view))
-
-(defun ivy-source-views ()
- "Return the name of the views saved in `ivy-views'."
- (mapcar #'car ivy-views))
-
-(ivy-set-sources
- 'ivy-switch-buffer
- '((original-source)
- (ivy-source-views)))
-
-(defun ivy-set-view-recur (view)
- "Set VIEW recursively."
- (cond ((eq (car view) 'vert)
- (let* ((wnd1 (selected-window))
- (wnd2 (split-window-vertically))
- (views (cdr view))
- (v (pop views))
- (temp-wnd))
- (with-selected-window wnd1
- (ivy-set-view-recur v))
- (while (setq v (pop views))
- (with-selected-window wnd2
- (when views
- (setq temp-wnd (split-window-vertically)))
- (ivy-set-view-recur v)
- (when views
- (setq wnd2 temp-wnd))))))
- ((eq (car view) 'horz)
- (let* ((wnd1 (selected-window))
- (wnd2 (split-window-horizontally))
- (views (cdr view))
- (v (pop views))
- (temp-wnd))
- (with-selected-window wnd1
- (ivy-set-view-recur v))
- (while (setq v (pop views))
- (with-selected-window wnd2
- (when views
- (setq temp-wnd (split-window-horizontally)))
- (ivy-set-view-recur v)
- (when views
- (setq wnd2 temp-wnd))))))
- ((eq (car view) 'file)
- (let* ((name (nth 1 view))
- (virtual (assoc name ivy--virtual-buffers))
- buffer)
- (cond ((setq buffer (get-buffer name))
- (switch-to-buffer buffer nil 'force-same-window))
- (virtual
- (find-file (cdr virtual)))
- ((file-exists-p name)
- (find-file name))))
- (when (and (> (length view) 2)
- (numberp (nth 2 view)))
- (goto-char (nth 2 view))))
- ((eq (car view) 'buffer)
- (switch-to-buffer (nth 1 view))
- (when (and (> (length view) 2)
- (numberp (nth 2 view)))
- (goto-char (nth 2 view))))
- ((eq (car view) 'sexp)
- (eval (nth 1 view)))))
-
-(defun ivy--switch-buffer-action (buffer)
- "Switch to BUFFER.
-BUFFER may be a string or nil."
- (if (zerop (length buffer))
- (switch-to-buffer
- ivy-text nil 'force-same-window)
- (let ((virtual (assoc buffer ivy--virtual-buffers))
- (view (assoc buffer ivy-views)))
- (cond ((and virtual
- (not (get-buffer buffer)))
- (find-file (cdr virtual)))
- (view
- (delete-other-windows)
- (let (
- ;; silence "Directory has changed on disk"
- (inhibit-message t))
- (ivy-set-view-recur (cadr view))))
- (t
- (switch-to-buffer
- buffer nil 'force-same-window))))))
-
-(defun ivy--switch-buffer-other-window-action (buffer)
- "Switch to BUFFER in other window.
-BUFFER may be a string or nil."
- (if (zerop (length buffer))
- (switch-to-buffer-other-window ivy-text)
- (let ((virtual (assoc buffer ivy--virtual-buffers)))
- (if (and virtual
- (not (get-buffer buffer)))
- (find-file-other-window (cdr virtual))
- (switch-to-buffer-other-window buffer)))))
-
-(defun ivy--rename-buffer-action (buffer)
- "Rename BUFFER."
- (let ((new-name (read-string "Rename buffer (to new name): ")))
- (with-current-buffer buffer
- (rename-buffer new-name))))
-
-(defun ivy--find-file-action (buffer)
- "Find file from BUFFER's directory."
- (let* ((virtual (assoc buffer ivy--virtual-buffers))
- (default-directory (if virtual
- (file-name-directory (cdr virtual))
- (buffer-local-value 'default-directory
- (or (get-buffer buffer)
- (current-buffer))))))
- (call-interactively (if (functionp 'counsel-find-file)
- #'counsel-find-file
- #'find-file))))
-
-(defun ivy--kill-buffer-or-virtual (buffer)
- (if (get-buffer buffer)
- (kill-buffer buffer)
- (setq recentf-list (delete
- (cdr (assoc buffer ivy--virtual-buffers))
- recentf-list))))
-
-(defun ivy--kill-current-candidate ()
- (setf (ivy-state-preselect ivy-last) ivy--index)
- (setq ivy--old-re nil)
- (setq ivy--all-candidates (delete (ivy-state-current ivy-last)
ivy--all-candidates))
- (let ((ivy--recompute-index-inhibit t))
- (ivy--exhibit)))
-
-(defun ivy--kill-buffer-action (buffer)
- "Kill BUFFER."
- (ivy--kill-buffer-or-virtual buffer)
- (unless (buffer-live-p (ivy-state-buffer ivy-last))
- (setf (ivy-state-buffer ivy-last)
- (with-ivy-window (current-buffer))))
- (ivy--kill-current-candidate))
-
-(defvar ivy-switch-buffer-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-k") 'ivy-switch-buffer-kill)
- map))
-
-(defun ivy-switch-buffer-kill ()
- "When at end-of-line, kill the current buffer in `ivy-switch-buffer'.
-Otherwise, forward to `ivy-kill-line'."
- (interactive)
- (if (not (eolp))
- (ivy-kill-line)
- (ivy--kill-buffer-action
- (ivy-state-current ivy-last))))
-
-(ivy-set-actions
- 'ivy-switch-buffer
- '(("f"
- ivy--find-file-action
- "find file")
- ("j"
- ivy--switch-buffer-other-window-action
- "other window")
- ("k"
- ivy--kill-buffer-action
- "kill")
- ("r"
- ivy--rename-buffer-action
- "rename")))
-
-(ivy-set-actions
- t
- `(("i" ,(lambda (x) (insert (if (stringp x) x (car x)))) "insert")
- ("w" ,(lambda (x) (kill-new (if (stringp x) x (car x)))) "copy")))
-
-(defun ivy--switch-buffer-matcher (regexp candidates)
- "Return REGEXP matching CANDIDATES.
-Skip buffers that match `ivy-ignore-buffers'."
- (let ((res (ivy--re-filter regexp candidates)))
- (if (or (null ivy-use-ignore)
- (null ivy-ignore-buffers))
- res
- (or (cl-remove-if
- (lambda (buf)
- (cl-find-if
- (lambda (f-or-r)
- (if (functionp f-or-r)
- (funcall f-or-r buf)
- (string-match-p f-or-r buf)))
- ivy-ignore-buffers))
- res)
- (and (eq ivy-use-ignore t)
- res)))))
-
-(defun ivy-append-face (str face)
- "Append to STR the property FACE."
- (setq str (copy-sequence str))
- (ivy-add-face-text-property 0 (length str) face str t)
- str)
-
-(defun ivy-switch-buffer-transformer (str)
- "Transform candidate STR when switching buffers."
- (let ((b (get-buffer str)))
- (if (and b (buffer-file-name b))
- (cond
- ((and (not (ignore-errors (file-remote-p (buffer-file-name b))))
- (not (verify-visited-file-modtime b)))
- (ivy-append-face str 'ivy-modified-outside-buffer))
- ((buffer-modified-p b)
- (ivy-append-face str 'ivy-modified-buffer))
- (t str))
- str)))
-
-(defun ivy-switch-buffer-occur (cands)
- "Occur function for `ivy-switch-buffer' using `ibuffer'.
-CANDS are the candidates to be displayed."
- (unless cands
- (setq cands (all-completions ivy-text #'internal-complete-buffer)))
- (ibuffer
- nil (buffer-name)
- `((or ,@(cl-mapcan
- (lambda (cand)
- (unless (eq (get-text-property 0 'face cand) 'ivy-virtual)
- `((name . ,(format "\\_<%s\\_>" (regexp-quote cand))))))
- cands)))))
-
-;;;###autoload
-(defun ivy-switch-buffer ()
- "Switch to another buffer."
- (interactive)
- (ivy-read "Switch to buffer: " #'internal-complete-buffer
- :keymap ivy-switch-buffer-map
- :preselect (buffer-name (other-buffer (current-buffer)))
- :action #'ivy--switch-buffer-action
- :matcher #'ivy--switch-buffer-matcher
- :caller 'ivy-switch-buffer))
-
-(ivy-configure 'ivy-switch-buffer
- :occur #'ivy-switch-buffer-occur
- :display-transformer-fn #'ivy-switch-buffer-transformer)
-
-;;;###autoload
-(defun ivy-switch-view ()
- "Switch to one of the window views stored by `ivy-push-view'."
- (interactive)
- (let ((ivy-initial-inputs-alist
- '((ivy-switch-buffer . "{}"))))
- (ivy-switch-buffer)))
-
-;;;###autoload
-(defun ivy-switch-buffer-other-window ()
- "Switch to another buffer in another window."
- (interactive)
- (ivy-read "Switch to buffer in other window: " #'internal-complete-buffer
- :matcher #'ivy--switch-buffer-matcher
- :preselect (buffer-name (other-buffer (current-buffer)))
- :action #'ivy--switch-buffer-other-window-action
- :keymap ivy-switch-buffer-map
- :caller 'ivy-switch-buffer-other-window))
-
-(ivy-configure 'ivy-switch-buffer-other-window
- :occur #'ivy-switch-buffer-occur)
-
-(defun ivy--yank-handle-case-fold (text)
- (if (and (> (length ivy-text) 0)
- (string= (downcase ivy-text) ivy-text))
- (downcase text)
- text))
-
-(defun ivy--yank-by (fn &rest args)
- "Pull buffer text from current line into search string.
-The region to extract is determined by the respective values of
-point before and after applying FN to ARGS."
- (let (text)
- (with-ivy-window
- (let ((beg (point))
- (bol (line-beginning-position))
- (eol (line-end-position))
- end)
- (unwind-protect
- (progn (apply fn args)
- (setq end (goto-char (max bol (min (point) eol))))
- (setq text (buffer-substring-no-properties beg end))
- (ivy--pulse-region beg end))
- (unless text
- (goto-char beg)))))
- (when text
- (insert (replace-regexp-in-string
- " +" " "
- (ivy--yank-handle-case-fold text)
- t t)))))
-
-(defun ivy-yank-word (&optional arg)
- "Pull next word from buffer into search string.
-If optional ARG is non-nil, pull in the next ARG
-words (previous if ARG is negative)."
- (interactive "p")
- (ivy--yank-by #'forward-word arg))
-
-(defun ivy-yank-symbol (&optional arg)
- "Pull next symbol from buffer into search string.
-If optional ARG is non-nil, pull in the next ARG
-symbols (previous if ARG is negative)."
- (interactive "p")
- ;; Emacs < 24.4 compatibility
- (unless (fboundp 'forward-symbol)
- (require 'thingatpt))
- (ivy--yank-by #'forward-symbol (or arg 1)))
-
-(defun ivy-yank-char (&optional arg)
- "Pull next character from buffer into search string.
-If optional ARG is non-nil, pull in the next ARG
-characters (previous if ARG is negative)."
- (interactive "p")
- (ivy--yank-by #'forward-char arg))
-
-(defvar ivy--pulse-overlay nil
- "Overlay used to highlight yanked word.")
-
-(defvar ivy--pulse-timer nil
- "Timer used to dispose of `ivy--pulse-overlay'.")
-
-(defcustom ivy-pulse-delay 0.5
- "Number of seconds to display `ivy-yanked-word' highlight.
-When nil, disable highlighting."
- :type '(choice
- (number :tag "Delay in seconds")
- (const :tag "Disable" nil)))
-
-(defun ivy--pulse-region (start end)
- "Temporarily highlight text between START and END.
-The \"pulse\" duration is determined by `ivy-pulse-delay'."
- (when ivy-pulse-delay
- (if ivy--pulse-overlay
- (let ((ostart (overlay-start ivy--pulse-overlay))
- (oend (overlay-end ivy--pulse-overlay)))
- (when (< end start)
- (cl-rotatef start end))
- ;; Extend the existing overlay's region to include START..END,
- ;; but only if the two regions are contiguous.
- (move-overlay ivy--pulse-overlay
- (if (= start oend) ostart start)
- (if (= end ostart) oend end)))
- (setq ivy--pulse-overlay (make-overlay start end))
- (overlay-put ivy--pulse-overlay 'face 'ivy-yanked-word))
- (when ivy--pulse-timer
- (cancel-timer ivy--pulse-timer))
- (setq ivy--pulse-timer
- (run-at-time ivy-pulse-delay nil #'ivy--pulse-cleanup))))
-
-(defun ivy--pulse-cleanup ()
- "Cancel `ivy--pulse-timer' and delete `ivy--pulse-overlay'."
- (when ivy--pulse-timer
- (cancel-timer ivy--pulse-timer)
- (setq ivy--pulse-timer nil))
- (when ivy--pulse-overlay
- (delete-overlay ivy--pulse-overlay)
- (setq ivy--pulse-overlay nil)))
-
-(defun ivy-kill-ring-save ()
- "Store the current candidates into the kill ring.
-If the region is active, forward to `kill-ring-save' instead."
- (interactive)
- (if (region-active-p)
- (call-interactively 'kill-ring-save)
- (kill-new
- (mapconcat
- #'identity
- ivy--old-cands
- "\n"))))
-
-(defun ivy-insert-current ()
- "Make the current candidate into current input.
-Don't finish completion."
- (interactive)
- (delete-minibuffer-contents)
- (let ((end (and ivy--directory
- (ivy--dirname-p (ivy-state-current ivy-last))
- -1)))
- (insert (substring-no-properties
- (ivy-state-current ivy-last) 0 end))))
-
-(defun ivy-insert-current-full ()
- "Insert the full Yank the current directory into the minibuffer."
- (interactive)
- (insert ivy--directory))
-
-(defcustom ivy-preferred-re-builders
- '((ivy--regex-plus . "ivy")
- (ivy--regex-ignore-order . "order")
- (ivy--regex-fuzzy . "fuzzy"))
- "Alist of preferred re-builders with display names.
-This list can be rotated with `ivy-rotate-preferred-builders'."
- :type '(alist :key-type function :value-type string))
-
-(defun ivy-rotate-preferred-builders ()
- "Switch to the next re builder in `ivy-preferred-re-builders'."
- (interactive)
- (when ivy-preferred-re-builders
- (setq ivy--old-re nil)
- (setq ivy--regex-function
- (let ((cell (assq ivy--regex-function ivy-preferred-re-builders)))
- (car (or (cadr (memq cell ivy-preferred-re-builders))
- (car ivy-preferred-re-builders)))))))
-
-(defun ivy-toggle-fuzzy ()
- "Toggle the re builder between `ivy--regex-fuzzy' and `ivy--regex-plus'."
- (interactive)
- (setq ivy--old-re nil)
- (if (eq ivy--regex-function 'ivy--regex-fuzzy)
- (setq ivy--regex-function 'ivy--regex-plus)
- (setq ivy--regex-function 'ivy--regex-fuzzy)))
-
-(defvar ivy--reverse-i-search-symbol nil
- "Store the history symbol.")
-
-(defun ivy-reverse-i-search-kill ()
- "Remove the current item from history"
- (interactive)
- (if (not (eolp))
- (ivy-kill-line)
- (let ((current (ivy-state-current ivy-last)))
- (if (symbolp ivy--reverse-i-search-symbol)
- (set
- ivy--reverse-i-search-symbol
- (delete current (symbol-value ivy--reverse-i-search-symbol)))
- (ring-remove
- ivy--reverse-i-search-symbol
- (ring-member ivy--reverse-i-search-symbol (ivy-state-current
ivy-last)))))
- (ivy--kill-current-candidate)))
-
-(defvar ivy-reverse-i-search-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "C-k") 'ivy-reverse-i-search-kill)
- map))
-
-(defun ivy-history-contents (history)
- "Copy contents of HISTORY.
-A copy is necessary so that we don't clobber any string attributes.
-Also set `ivy--reverse-i-search-symbol' to HISTORY."
- (setq ivy--reverse-i-search-symbol history)
- (cond ((symbolp history)
- (delete-dups
- (copy-sequence (symbol-value history))))
- ((ring-p history)
- (delete-dups
- (when (> (ring-size history) 0)
- (ring-elements history))))
- ((sequencep history)
- (delete-dups
- (copy-sequence history)))
- (t
- (error "Expected a symbol, ring, or sequence: %S" history))))
-
-(defun ivy-reverse-i-search ()
- "Enter a recursive `ivy-read' session using the current history.
-The selected history element will be inserted into the minibuffer.
-\\<ivy-reverse-i-search-map>
-You can also delete an element from history with
\\[ivy-reverse-i-search-kill]."
- (interactive)
- (cond
- ((= (minibuffer-depth) 0)
- (user-error
- "This command is intended to be called with \"C-r\" from `ivy-read'."))
- ;; don't recur
- ((and (> (minibuffer-depth) 1)
- (eq (ivy-state-caller ivy-last) 'ivy-reverse-i-search)))
- (t
- (let ((enable-recursive-minibuffers t)
- (old-last ivy-last))
- (ivy-read "Reverse-i-search: "
- (ivy-history-contents (ivy-state-history ivy-last))
- :keymap ivy-reverse-i-search-map
- :action (lambda (x)
- (ivy--reset-state
- (setq ivy-last old-last))
- (delete-minibuffer-contents)
- (insert (substring-no-properties x))
- (ivy--cd-maybe))
- :caller 'ivy-reverse-i-search)))))
-
-(defun ivy-restrict-to-matches ()
- "Restrict candidates to current input and erase input."
- (interactive)
- (delete-minibuffer-contents)
- (if (ivy-state-dynamic-collection ivy-last)
- (progn
- (setf (ivy-state-dynamic-collection ivy-last) nil)
- (setf (ivy-state-collection ivy-last)
- (setq ivy--all-candidates ivy--old-cands)))
- (setq ivy--all-candidates
- (ivy--filter ivy-text ivy--all-candidates))))
-
-;;* Occur
-(defvar-local ivy-occur-last nil
- "Buffer-local value of `ivy-last'.
-Can't re-use `ivy-last' because using e.g. `swiper' in the same
-buffer would modify `ivy-last'.")
-
-(defvar ivy-occur-mode-map
- (let ((map (make-sparse-keymap)))
- (define-key map [mouse-1] 'ivy-occur-click)
- (define-key map (kbd "RET") 'ivy-occur-press-and-switch)
- (define-key map (kbd "j") 'ivy-occur-next-line)
- (define-key map (kbd "k") 'ivy-occur-previous-line)
- (define-key map (kbd "h") 'backward-char)
- (define-key map (kbd "l") 'forward-char)
- (define-key map (kbd "f") 'ivy-occur-press)
- (define-key map (kbd "g") 'ivy-occur-revert-buffer)
- (define-key map (kbd "a") 'ivy-occur-read-action)
- (define-key map (kbd "o") 'ivy-occur-dispatch)
- (define-key map (kbd "c") 'ivy-occur-toggle-calling)
- (define-key map (kbd "q") 'quit-window)
- (define-key map (kbd "R") 'read-only-mode)
- (define-key map (kbd "C-d") 'ivy-occur-delete-candidate)
- map)
- "Keymap for Ivy Occur mode.")
-
-(defun ivy-occur-toggle-calling ()
- "Toggle `ivy-calling'."
- (interactive)
- (if (setq ivy-calling (not ivy-calling))
- (progn
- (setq mode-name "Ivy-Occur [calling]")
- (ivy-occur-press))
- (setq mode-name "Ivy-Occur"))
- (force-mode-line-update))
-
-(defun ivy--find-occur-buffer ()
- (let ((cb (current-buffer)))
- (cl-find-if
- (lambda (b)
- (with-current-buffer b
- (and (eq major-mode 'ivy-occur-grep-mode)
- (equal cb (ivy-state-buffer ivy-occur-last)))))
- (buffer-list))))
-
-(defun ivy--select-occur-buffer ()
- (let* ((ob (ivy--find-occur-buffer))
- (ow (cl-find-if (lambda (w) (equal ob (window-buffer w)))
- (window-list))))
- (if ow
- (select-window ow)
- (pop-to-buffer ob))))
-
-(defun ivy-occur-next-line (&optional arg)
- "Move the cursor down ARG lines.
-When `ivy-calling' isn't nil, call `ivy-occur-press'."
- (interactive "p")
- (let ((offset (cond ((derived-mode-p 'ivy-occur-grep-mode) 5)
- ((derived-mode-p 'ivy-occur-mode) 2))))
- (if offset
- (progn
- (if (< (line-number-at-pos) offset)
- (progn
- (goto-char (point-min))
- (forward-line (1- offset)))
- (forward-line arg)
- (when (eolp)
- (forward-line -1)))
- (when ivy-calling
- (ivy-occur-press)))
- (ivy--select-occur-buffer)
- (ivy-occur-next-line arg)
- (ivy-occur-press-and-switch))))
-
-(defun ivy-occur-previous-line (&optional arg)
- "Move the cursor up ARG lines.
-When `ivy-calling' isn't nil, call `ivy-occur-press'."
- (interactive "p")
- (let ((offset (cond ((derived-mode-p 'ivy-occur-grep-mode) 5)
- ((derived-mode-p 'ivy-occur-mode) 2))))
- (if offset
- (progn
- (forward-line (- arg))
- (when (< (line-number-at-pos) offset)
- (goto-char (point-min))
- (forward-line (1- offset)))
- (when ivy-calling
- (ivy-occur-press)))
- (ivy--select-occur-buffer)
- (ivy-occur-previous-line arg)
- (ivy-occur-press-and-switch))))
-
-(defun ivy-occur-next-error (n &optional reset)
- "A `next-error-function' for `ivy-occur-mode'."
- (interactive "p")
- (when reset
- (goto-char (point-min)))
- (setq n (or n 1))
- (let ((ivy-calling t))
- (cond ((< n 0) (ivy-occur-previous-line (- n)))
- (t (ivy-occur-next-line n)))))
-
-(define-derived-mode ivy-occur-mode fundamental-mode "Ivy-Occur"
- "Major mode for output from \\[ivy-occur].
-
-\\{ivy-occur-mode-map}"
- (setq-local view-read-only nil))
-
-(defvar ivy-occur-grep-mode-map
- (let ((map (copy-keymap ivy-occur-mode-map)))
- (define-key map (kbd "C-x C-q") 'ivy-wgrep-change-to-wgrep-mode)
- (define-key map "w" 'ivy-wgrep-change-to-wgrep-mode)
- map)
- "Keymap for Ivy Occur Grep mode.")
-
-(defun ivy-occur-delete-candidate ()
- (interactive)
- (let ((inhibit-read-only t))
- (delete-region (line-beginning-position)
- (1+ (line-end-position)))))
-
-(define-derived-mode ivy-occur-grep-mode grep-mode "Ivy-Occur"
- "Major mode for output from \\[ivy-occur].
-
-\\{ivy-occur-grep-mode-map}"
- (setq-local view-read-only nil)
- (when (fboundp 'wgrep-setup)
- (wgrep-setup)))
-
-(defun ivy--starts-with-dotslash (str)
- (string-match-p "\\`\\.[/\\]" str))
-
-(defun ivy--occur-insert-lines (cands)
- "Insert CANDS into `ivy-occur' buffer."
- (font-lock-mode -1)
- (dolist (cand cands)
- (setq cand
- (if (string-match "\\`\\(.*:[0-9]+:\\)\\(.*\\)\\'" cand)
- (let ((file-and-line (match-string 1 cand))
- (grep-line (match-string 2 cand)))
- (concat
- (propertize file-and-line 'face 'ivy-grep-info)
- (ivy--highlight-fuzzy grep-line)))
- (ivy--highlight-fuzzy (copy-sequence cand))))
- (add-text-properties
- 0 (length cand)
- '(mouse-face
- highlight
- help-echo "mouse-1: call ivy-action")
- cand)
- (insert (if (string-match-p "\\`.[/\\]" cand) "" " ")
- cand ?\n)))
-
-(defun ivy--occur-default (cands)
- "Insert CANDS into the current occur buffer."
- (unless cands
- (let ((coll (ivy-state-collection ivy-last)))
- (when (arrayp coll)
- (setq coll (all-completions "" coll (ivy-state-predicate ivy-last))))
- (setq cands (ivy--filter (ivy-state-text ivy-last) coll))))
- (ivy-occur-mode)
- (insert (format "%d candidates:\n" (length cands)))
- (ivy--occur-insert-lines cands)
- (read-only-mode))
-
-(defun ivy-occur ()
- "Stop completion and put the current candidates into a new buffer.
-
-The new buffer remembers current action(s).
-
-While in the *ivy-occur* buffer, selecting a candidate with RET or
-a mouse click will call the appropriate action for that candidate.
-
-There is no limit on the number of *ivy-occur* buffers."
- (interactive)
- (if (not (window-minibuffer-p))
- (user-error "No completion session is active")
- (let* ((caller (ivy-state-caller ivy-last))
- (occur-fn (or (plist-get ivy--occurs-list caller)
- #'ivy--occur-default))
- (buffer
- (generate-new-buffer
- (format "*ivy-occur%s \"%s\"*"
- (if caller
- (concat " " (prin1-to-string caller))
- "")
- ivy-text))))
- (with-current-buffer buffer
- (funcall occur-fn ivy--old-cands)
- (setf (ivy-state-text ivy-last) ivy-text)
- (setq ivy-occur-last ivy-last))
- (ivy-exit-with-action
- (lambda (_)
- (pop-to-buffer buffer)
- (setq next-error-last-buffer buffer)
- (setq-local next-error-function #'ivy-occur-next-error))))))
-
-(defun ivy-occur-revert-buffer ()
- "Refresh the buffer making it up-to date with the collection.
-
-Currently only works for `swiper'. In that specific case, the
-*ivy-occur* buffer becomes nearly useless as the original buffer
-is updated, since the line numbers no longer match.
-
-Calling this function is as if you called `ivy-occur' on the
-updated original buffer."
- (interactive)
- (let ((caller (ivy-state-caller ivy-occur-last))
- (ivy-last ivy-occur-last))
- (let ((inhibit-read-only t)
- (line (line-number-at-pos)))
- (erase-buffer)
- (funcall (or (plist-get ivy--occurs-list caller)
- #'ivy--occur-default) nil)
- (goto-char (point-min))
- (forward-line (1- line)))
- (setq ivy-occur-last ivy-last)))
-
-(declare-function wgrep-change-to-wgrep-mode "ext:wgrep")
-
-(defun ivy-wgrep-change-to-wgrep-mode ()
- "Forward to `wgrep-change-to-wgrep-mode'."
- (interactive)
- (if (require 'wgrep nil 'noerror)
- (wgrep-change-to-wgrep-mode)
- (error "Package wgrep isn't installed")))
-
-(defun ivy-occur-read-action ()
- "Select one of the available actions as the current one."
- (interactive)
- (let ((ivy-last ivy-occur-last))
- (ivy-read-action)))
-
-(defun ivy-occur-dispatch ()
- "Call one of the available actions on the current item."
- (interactive)
- (let* ((state-action (ivy-state-action ivy-occur-last))
- (actions (if (symbolp state-action)
- state-action
- (copy-sequence state-action))))
- (unwind-protect
- (progn
- (ivy-occur-read-action)
- (ivy-occur-press))
- (setf (ivy-state-action ivy-occur-last) actions))))
-
-(defun ivy-occur-click (event)
- "Execute action for the current candidate.
-EVENT gives the mouse position."
- (interactive "e")
- (let ((window (posn-window (event-end event)))
- (pos (posn-point (event-end event))))
- (with-current-buffer (window-buffer window)
- (goto-char pos)
- (ivy-occur-press))))
-
-(declare-function swiper--cleanup "swiper")
-(declare-function swiper--add-overlays "swiper")
-(defvar ivy-occur-timer nil)
-
-(defun ivy--occur-press-update-window ()
- (cond
- ((memq (ivy-state-caller ivy-occur-last)
- (append '(swiper swiper-isearch) ivy-highlight-grep-commands))
- (let ((window (ivy-state-window ivy-occur-last))
- (buffer (ivy-state-buffer ivy-occur-last)))
- (when (buffer-live-p buffer)
- (cond ((or (not (window-live-p window))
- (equal window (selected-window)))
- (save-selected-window
- (setf (ivy-state-window ivy-occur-last)
- (display-buffer buffer))))
- ((not (equal (window-buffer window) buffer))
- (with-selected-window window
- (switch-to-buffer buffer)))))))
-
- ((memq (ivy-state-caller ivy-occur-last)
- '(counsel-describe-function counsel-describe-variable))
- (setf (ivy-state-window ivy-occur-last)
- (selected-window))
- (selected-window))))
-
-(defun ivy--occur-press-buffer ()
- (let ((buffer (ivy-state-buffer ivy-last)))
- (if (buffer-live-p buffer)
- buffer
- (current-buffer))))
-
-(defun ivy-occur-press ()
- "Execute action for the current candidate."
- (interactive)
- (ivy--occur-press-update-window)
- (when (save-excursion
- (beginning-of-line)
- (looking-at "\\(?:./\\| \\)\\(.*\\)$"))
- (let* ((ivy-last ivy-occur-last)
- (ivy-text (ivy-state-text ivy-last))
- (str (buffer-substring
- (match-beginning 1)
- (match-end 1)))
- (offset (or (get-text-property 0 'offset str) 0))
- (coll (ivy-state-collection ivy-last))
- (action (ivy--get-action ivy-last))
- (ivy-exit 'done))
- (with-ivy-window
- (with-current-buffer (ivy--occur-press-buffer)
- (save-restriction
- (widen)
- (funcall action
- (if (and (consp coll)
- (consp (car coll)))
- (assoc str coll)
- (substring str offset)))))
- (if (memq (ivy-state-caller ivy-last)
- (append '(swiper swiper-isearch)
ivy-highlight-grep-commands))
- (with-current-buffer (window-buffer (selected-window))
- (swiper--cleanup)
- (swiper--add-overlays
- (ivy--regex ivy-text)
- (line-beginning-position)
- (line-end-position)
- (selected-window))
- (when (timerp ivy-occur-timer)
- (cancel-timer ivy-occur-timer))
- (setq ivy-occur-timer
- (run-at-time 1.0 nil 'swiper--cleanup))))))))
-
-(defun ivy-occur-press-and-switch ()
- "Execute action for the current candidate and switch window."
- (interactive)
- (ivy-occur-press)
- (select-window (ivy--get-window ivy-occur-last)))
-
-(defun ivy--marked-p ()
- (member (ivy-state-current ivy-last) ivy-marked-candidates))
-
-(defun ivy--unmark (cand)
- (setcar (member cand ivy--all-candidates)
- (setcar (member cand ivy--old-cands)
- (substring cand (length ivy-mark-prefix))))
- (setq ivy-marked-candidates
- (delete cand ivy-marked-candidates)))
-
-(defun ivy--mark (cand)
- (let ((marked-cand (concat ivy-mark-prefix cand)))
- (setcar (member cand ivy--all-candidates)
- (setcar (member cand ivy--old-cands) marked-cand))
- (setq ivy-marked-candidates
- (append ivy-marked-candidates (list marked-cand)))))
-
-(defun ivy-mark ()
- "Mark the selected candidate and move to the next one.
-
-In `ivy-call', :action will be called in turn for all marked
-candidates.
-
-However, if :multi-action was supplied to `ivy-read', then it
-will be called with `ivy-marked-candidates'. This way, it can
-make decisions based on the whole marked list."
- (interactive)
- (unless (ivy--marked-p)
- (ivy--mark (ivy-state-current ivy-last)))
- (ivy-next-line))
-
-(defun ivy-unmark ()
- "Unmark the selected candidate and move to the next one."
- (interactive)
- (when (ivy--marked-p)
- (ivy--unmark (ivy-state-current ivy-last)))
- (ivy-next-line))
-
-(defun ivy-unmark-backward ()
- "Move to the previous candidate and unmark it."
- (interactive)
- (ivy-previous-line)
- (ivy--exhibit)
- (when (ivy--marked-p)
- (ivy--unmark (ivy-state-current ivy-last))))
-
-(defun ivy-toggle-marks ()
- "Toggle mark for all narrowed candidates."
- (interactive)
- (dolist (cand ivy--old-cands)
- (if (member cand ivy-marked-candidates)
- (ivy--unmark cand)
- (ivy--mark cand))))
-
-(defconst ivy-help-file (let ((default-directory
- (if load-file-name
- (file-name-directory load-file-name)
- default-directory)))
- (if (file-exists-p "ivy-help.org")
- (expand-file-name "ivy-help.org")
- (if (file-exists-p "doc/ivy-help.org")
- (expand-file-name "doc/ivy-help.org"))))
- "The file for `ivy-help'.")
-
-(defvar org-hide-emphasis-markers)
-
-(defun ivy-help ()
- "Help for `ivy'."
- (interactive)
- (let ((buf (get-buffer "*Ivy Help*")))
- (unless buf
- (setq buf (get-buffer-create "*Ivy Help*"))
- (with-current-buffer buf
- (insert-file-contents ivy-help-file)
- (org-mode)
- (setq-local org-hide-emphasis-markers t)
- (view-mode)
- (goto-char (point-min))
- (let ((inhibit-message t))
- (org-cycle '(64)))))
- (if (eq this-command 'ivy-help)
- (switch-to-buffer buf)
- (with-ivy-window
- (pop-to-buffer buf)))
- (view-mode)
- (goto-char (point-min))))
-
-(declare-function ffap-url-p "ffap")
-(defvar ffap-url-fetcher)
-
-(defun ivy-ffap-url-p (string)
- "Forward to `ffap-url-p'."
- (require 'ffap)
- (ffap-url-p string))
-
-(defun ivy-ffap-url-fetcher (url)
- "Calls `ffap-url-fetcher'."
- (require 'ffap)
- (funcall ffap-url-fetcher url))
-
-(ivy-configure 'read-file-name-internal
- :sort-fn #'ivy-sort-file-function-default
- :display-transformer-fn #'ivy-read-file-transformer)
-
-(ivy-configure 'internal-complete-buffer
- :display-transformer-fn #'ivy-switch-buffer-transformer)
-
-(provide 'ivy)
-
-;;; ivy.el ends here
diff --git a/swiper.el b/swiper.el
deleted file mode 100644
index 654dc31..0000000
--- a/swiper.el
+++ /dev/null
@@ -1,1673 +0,0 @@
-;;; swiper.el --- Isearch with an overview. Oh, man! -*- lexical-binding: t -*-
-
-;; Copyright (C) 2015-2018 Free Software Foundation, Inc.
-
-;; Author: Oleh Krehel <ohwoeowho@gmail.com>
-;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.12.0
-;; Package-Requires: ((emacs "24.1") (ivy "0.12.0"))
-;; Keywords: matching
-
-;; This file is part of GNU Emacs.
-
-;; This file is free software; you can redistribute it and/or modify
-;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; This program is distributed in the hope that it will be useful,
-;; but WITHOUT ANY WARRANTY; without even the implied warranty of
-;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-;; GNU General Public License for more details.
-
-;; For a full copy of the GNU General Public License
-;; see <https://www.gnu.org/licenses/>.
-
-;;; Commentary:
-
-;; This package gives an overview of the current regex search
-;; candidates. The search regex can be split into groups with a
-;; space. Each group is highlighted with a different face.
-;;
-;; It can double as a quick `regex-builder', although only single
-;; lines will be matched.
-
-;;; Code:
-
-(require 'ivy)
-
-(defgroup swiper nil
- "`isearch' with an overview."
- :group 'matching
- :prefix "swiper-")
-
-(defface swiper-match-face-1
- '((t (:inherit lazy-highlight)))
- "The background face for `swiper' matches."
- :group 'ivy-faces)
-
-(defface swiper-match-face-2
- '((t (:inherit isearch)))
- "Face for `swiper' matches modulo 1."
- :group 'ivy-faces)
-
-(defface swiper-match-face-3
- '((t (:inherit match)))
- "Face for `swiper' matches modulo 2."
- :group 'ivy-faces)
-
-(defface swiper-match-face-4
- '((t (:inherit isearch-fail)))
- "Face for `swiper' matches modulo 3."
- :group 'ivy-faces)
-
-(defface swiper-background-match-face-1
- '((t (:inherit swiper-match-face-1)))
- "The background face for non-current `swiper' matches."
- :group 'ivy-faces)
-
-(defface swiper-background-match-face-2
- '((t (:inherit swiper-match-face-2)))
- "Face for non-current `swiper' matches modulo 1."
- :group 'ivy-faces)
-
-(defface swiper-background-match-face-3
- '((t (:inherit swiper-match-face-3)))
- "Face for non-current `swiper' matches modulo 2."
- :group 'ivy-faces)
-
-(defface swiper-background-match-face-4
- '((t (:inherit swiper-match-face-4)))
- "Face for non-current `swiper' matches modulo 3."
- :group 'ivy-faces)
-
-(defface swiper-line-face
- '((t (:inherit highlight)))
- "Face for current `swiper' line."
- :group 'ivy-faces)
-
-(defcustom swiper-faces '(swiper-match-face-1
- swiper-match-face-2
- swiper-match-face-3
- swiper-match-face-4)
- "List of `swiper' faces for group matches."
- :group 'ivy-faces
- :type '(repeat face))
-
-(defvar swiper-background-faces
- '(swiper-background-match-face-1
- swiper-background-match-face-2
- swiper-background-match-face-3
- swiper-background-match-face-4)
- "Like `swiper-faces', but used for all matches except the current one.")
-
-(defun swiper--recompute-background-faces ()
- (let ((faces '(swiper-background-match-face-1
- swiper-background-match-face-2
- swiper-background-match-face-3
- swiper-background-match-face-4))
- (colir-compose-method #'colir-compose-soft-light))
- (cl-mapc (lambda (f1 f2)
- (let ((bg (face-background f1)))
- (when bg
- (set-face-background
- f2
- (colir-blend
- (colir-color-parse bg)
- (colir-color-parse "#ffffff"))))))
- swiper-faces
- faces)))
-(swiper--recompute-background-faces)
-
-(defcustom swiper-min-highlight 2
- "Only highlight matches for regexps at least this long."
- :type 'integer)
-
-(defcustom swiper-include-line-number-in-search nil
- "Include line number in text of search candidates."
- :type 'boolean
- :group 'swiper)
-
-(defcustom swiper-goto-start-of-match nil
- "When non-nil, go to the start of the match, not its end.
-Treated as non-nil when searching backwards."
- :type 'boolean
- :group 'swiper)
-
-(defvar swiper-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "M-q") 'swiper-query-replace)
- (define-key map (kbd "C-l") 'swiper-recenter-top-bottom)
- (define-key map (kbd "C-'") 'swiper-avy)
- (define-key map (kbd "C-7") 'swiper-mc)
- (define-key map (kbd "C-c C-f") 'swiper-toggle-face-matching)
- map)
- "Keymap for swiper.")
-
-(defvar swiper--query-replace-overlays nil)
-
-(defun swiper--query-replace-updatefn ()
- (let ((lisp (ignore-errors (nth 2 (query-replace-compile-replacement
ivy-text t)))))
- (dolist (ov swiper--query-replace-overlays)
- (when lisp
- (dolist (x (overlay-get ov 'matches))
- (setq lisp (cl-subst (cadr x) (car x) lisp :test #'equal)))
- (setq lisp (ignore-errors (eval lisp))))
- (overlay-put
- ov 'after-string
- (propertize
- (if (stringp lisp)
- lisp
- ivy-text)
- 'face 'error)))))
-
-(defun swiper--query-replace-cleanup ()
- (while swiper--query-replace-overlays
- (delete-overlay (pop swiper--query-replace-overlays))))
-
-(defun swiper--query-replace-setup ()
- (with-ivy-window
- (let ((end (window-end (selected-window) t))
- (re (ivy--regex ivy-text)))
- (save-excursion
- (beginning-of-line)
- (while (and (re-search-forward re end t)
- (not (eobp)))
- (let ((ov (make-overlay (1- (match-end 0)) (match-end 0)))
- (md (match-data)))
- (overlay-put
- ov 'matches
- (mapcar
- (lambda (x)
- (list `(match-string ,x) (match-string x)))
- (number-sequence 0 (1- (/ (length md) 2)))))
- (push ov swiper--query-replace-overlays))
- (unless (> (match-end 0) (match-beginning 0))
- (forward-char)))))))
-
-(defun swiper-query-replace ()
- "Start `query-replace' with string to replace from last search string."
- (interactive)
- (cond ((null (window-minibuffer-p))
- (user-error "Should only be called in the minibuffer through
`swiper-map'"))
- ((string= "" ivy-text)
- (user-error "Empty input"))
- (t
- (swiper--query-replace-setup)
- (unwind-protect
- (let* ((enable-recursive-minibuffers t)
- (from (ivy--regex ivy-text))
- (default
- (format "\\,(concat %s)"
- (if (<= ivy--subexps 1)
- "\\&"
- (mapconcat (lambda (i) (format "\\%d" i))
- (number-sequence 1 ivy--subexps)
- " \" \" "))))
- (to
- (query-replace-compile-replacement
- (ivy-read
- (format "Query replace %s with: " from) nil
- :def default
- :caller 'swiper-query-replace)
- t)))
- (swiper--cleanup)
- (ivy-exit-with-action
- (lambda (_)
- (with-ivy-window
- (move-beginning-of-line 1)
- (let ((inhibit-read-only t))
- (perform-replace from to
- t t nil))))))
- (swiper--query-replace-cleanup)))))
-
-(ivy-configure 'swiper-query-replace
- :update-fn #'swiper--query-replace-updatefn)
-
-(defvar inhibit-message)
-
-(defun swiper-all-query-replace ()
- "Start `query-replace' with string to replace from last search string."
- (interactive)
- (if (null (window-minibuffer-p))
- (user-error
- "Should only be called in the minibuffer through `swiper-all-map'")
- (let* ((enable-recursive-minibuffers t)
- (from (ivy--regex ivy-text))
- (to (query-replace-read-to from "Query replace" t)))
- (swiper--cleanup)
- (ivy-exit-with-action
- (lambda (_)
- (let ((wnd-conf (current-window-configuration))
- (inhibit-message t))
- (unwind-protect
- (dolist (cand ivy--old-cands)
- (let ((buffer (get-text-property 0 'buffer cand)))
- (switch-to-buffer buffer)
- (goto-char (point-min))
- (perform-replace from to t t nil)))
- (set-window-configuration wnd-conf))))))))
-
-(defvar avy-all-windows)
-(defvar avy-style)
-(defvar avy-keys)
-(declare-function avy--overlay-post "ext:avy")
-(declare-function avy-action-goto "ext:avy")
-(declare-function avy-candidate-beg "ext:avy")
-(declare-function avy--done "ext:avy")
-(declare-function avy--make-backgrounds "ext:avy")
-(declare-function avy-window-list "ext:avy")
-(declare-function avy-read "ext:avy")
-(declare-function avy-read-de-bruijn "ext:avy")
-(declare-function avy-tree "ext:avy")
-(declare-function avy-push-mark "ext:avy")
-(declare-function avy--remove-leading-chars "ext:avy")
-
-(defun swiper--avy-candidates ()
- (let* (
- ;; We'll have overlapping overlays, so we sort all the
- ;; overlays in the visible region by their start, and then
- ;; throw out non-Swiper overlays or overlapping Swiper
- ;; overlays.
- (visible-overlays (cl-sort (with-ivy-window
- (overlays-in (window-start)
- (window-end)))
- #'< :key #'overlay-start))
- (min-overlay-start 0)
- (overlays-for-avy
- (cl-remove-if-not
- (lambda (ov)
- (when (and (>= (overlay-start ov)
- min-overlay-start)
- (memq (overlay-get ov 'face)
- (append swiper-faces swiper-background-faces)))
- (setq min-overlay-start (overlay-start ov))))
- visible-overlays))
- (offset (if (eq (ivy-state-caller ivy-last) 'swiper) 1 0)))
- (nconc
- (mapcar (lambda (ov)
- (cons (overlay-start ov)
- (overlay-get ov 'window)))
- overlays-for-avy)
- (save-excursion
- (save-restriction
- (narrow-to-region (window-start) (window-end))
- (goto-char (point-min))
- (forward-line)
- (let ((win (selected-window))
- cands)
- (while (not (eobp))
- (push (cons (+ (point) offset) win)
- cands)
- (forward-line))
- cands))))))
-
-(defun swiper--avy-candidate ()
- (let ((candidates (swiper--avy-candidates))
- (avy-all-windows nil))
- (unwind-protect
- (prog2
- (avy--make-backgrounds
- (append (avy-window-list)
- (list (ivy-state-window ivy-last))))
- (if (eq avy-style 'de-bruijn)
- (avy-read-de-bruijn candidates avy-keys)
- (avy-read (avy-tree candidates avy-keys)
- #'avy--overlay-post
- #'avy--remove-leading-chars))
- (avy-push-mark))
- (avy--done))))
-
-(defun swiper--avy-goto (candidate)
- (cond ((let ((win (cdr-safe candidate)))
- (and win (window-minibuffer-p win)))
- (let ((nlines (count-lines (point-min) (point-max))))
- (ivy-set-index
- (+ (car (ivy--minibuffer-index-bounds
- ivy--index ivy--length ivy-height))
- (line-number-at-pos (car candidate))
- (if (or (= nlines (1+ ivy-height))
- (< ivy--length ivy-height))
- 0
- (- ivy-height nlines))
- -2)))
- (ivy--exhibit)
- (ivy-done)
- (ivy-call))
- ((or (consp candidate)
- (number-or-marker-p candidate))
- (ivy-quit-and-run
- (avy-action-goto (avy-candidate-beg candidate))))))
-
-;;;###autoload
-(defun swiper-avy ()
- "Jump to one of the current swiper candidates."
- (interactive)
- (unless (require 'avy nil 'noerror)
- (error "Package avy isn't installed"))
- (cl-case (length ivy-text)
- (0
- (user-error "Need at least one char of input"))
- (1
- (let ((swiper-min-highlight 1))
- (swiper--update-input-ivy))))
- (swiper--avy-goto (swiper--avy-candidate)))
-
-(declare-function mc/create-fake-cursor-at-point "ext:multiple-cursors-core")
-(declare-function multiple-cursors-mode "ext:multiple-cursors-core")
-
-(defun swiper-mc ()
- "Create a fake cursor for each `swiper' candidate.
-Make sure `swiper-mc' is on `mc/cmds-to-run-once' list."
- (interactive)
- (unless (require 'multiple-cursors nil t)
- (error "Multiple-cursors isn't installed"))
- (unless (window-minibuffer-p)
- (error "Call me only from `swiper'"))
- (let ((cands (nreverse ivy--old-cands))
- (action (ivy--get-action ivy-last)))
- (unless (string= ivy-text "")
- (ivy-exit-with-action
- (lambda (_)
- (let (cand)
- (while (setq cand (pop cands))
- (funcall action cand)
- (when cands
- (mc/create-fake-cursor-at-point))))
- (multiple-cursors-mode 1))))))
-
-(defvar swiper--current-window-start nil
- "Store `window-start' to restore it later.
-This prevents a \"jumping\" behavior which occurs when variables
-such as `scroll-conservatively' are set to a high value.")
-
-(defun swiper-recenter-top-bottom (&optional arg)
- "Call (`recenter-top-bottom' ARG)."
- (interactive "P")
- (with-ivy-window
- (recenter-top-bottom arg)
- (setq swiper--current-window-start (window-start))))
-
-(defvar swiper-font-lock-exclude
- '(Man-mode
- adoc-mode
- bbdb-mode
- bongo-library-mode
- bongo-mode
- bongo-playlist-mode
- bookmark-bmenu-mode
- circe-channel-mode
- circe-query-mode
- circe-server-mode
- deadgrep-mode
- debbugs-gnu-mode
- dired-mode
- elfeed-search-mode
- elfeed-show-mode
- emms-playlist-mode
- emms-stream-mode
- erc-mode
- eshell-mode
- eww-mode
- forth-block-mode
- forth-mode
- fundamental-mode
- gnus-article-mode
- gnus-group-mode
- gnus-summary-mode
- help-mode
- helpful-mode
- jabber-chat-mode
- magit-popup-mode
- matrix-client-mode
- matrix-client-room-list-mode
- mu4e-headers-mode
- mu4e-view-mode
- nix-mode
- notmuch-search-mode
- notmuch-tree-mode
- occur-edit-mode
- occur-mode
- org-agenda-mode
- package-menu-mode
- rcirc-mode
- sauron-mode
- treemacs-mode
- twittering-mode
- vc-dir-mode
- w3m-mode
- woman-mode
- xref--xref-buffer-mode)
- "List of major-modes that are incompatible with `font-lock-ensure'.")
-
-(defun swiper-font-lock-ensure-p ()
- "Return non-nil if we should `font-lock-ensure'."
- (or (derived-mode-p 'magit-mode)
- (bound-and-true-p magit-blame-mode)
- (memq major-mode swiper-font-lock-exclude)
- (not (derived-mode-p 'prog-mode))))
-
-(defun swiper-font-lock-ensure ()
- "Ensure the entire buffer is highlighted."
- (unless (swiper-font-lock-ensure-p)
- (unless (or (> (buffer-size) 100000) (null font-lock-mode))
- (if (fboundp 'font-lock-ensure)
- (font-lock-ensure)
- (with-no-warnings (font-lock-fontify-buffer))))))
-
-(defvar swiper--format-spec ""
- "Store the current candidates format spec.")
-
-(defvar swiper--width nil
- "Store the number of digits needed for the longest line number.")
-
-(defvar swiper-use-visual-line nil
- "When non-nil, use `line-move' instead of `forward-line'.")
-
-(defvar dired-isearch-filenames)
-(declare-function dired-move-to-filename "dired")
-
-(defun swiper--line ()
- (let* ((beg (cond ((and (eq major-mode 'dired-mode)
- (bound-and-true-p dired-isearch-filenames))
- (dired-move-to-filename)
- (point))
- (swiper-use-visual-line
- (save-excursion
- (beginning-of-visual-line)
- (point)))
- (t
- (point))))
- (end (if swiper-use-visual-line
- (save-excursion
- (end-of-visual-line)
- (point))
- (line-end-position))))
-
- (concat
- " "
- (buffer-substring beg end))))
-
-(declare-function outline-show-all "outline")
-
-(defvar swiper-use-visual-line-p
- (lambda (n-lines)
- (and visual-line-mode
- ;; super-slow otherwise
- (< (buffer-size) 20000)
- (< n-lines 400)))
- "A predicate that decides whether `line-move' or `forward-line' is used.
-Note that `line-move' can be very slow.")
-
-(defun swiper--candidates (&optional numbers-width)
- "Return a list of this buffer lines.
-
-NUMBERS-WIDTH, when specified, is used for width spec of line
-numbers; replaces calculating the width from buffer line count."
- (let* ((inhibit-field-text-motion t)
- (n-lines (count-lines (point-min) (point-max))))
- (if (funcall swiper-use-visual-line-p n-lines)
- (progn
- (when (eq major-mode 'org-mode)
- (require 'outline)
- (if (fboundp 'outline-show-all)
- (outline-show-all)
- (with-no-warnings
- (show-all))))
- (setq swiper-use-visual-line t))
- (setq swiper-use-visual-line nil))
- (unless (zerop n-lines)
- (setq swiper--width (or numbers-width
- (1+ (floor (log n-lines 10)))))
- (setq swiper--format-spec
- (format "%%-%dd " swiper--width))
- (let ((line-number 1)
- (advancer (if swiper-use-visual-line
- (lambda (arg) (line-move arg t))
- #'forward-line))
- candidates)
- (save-excursion
- (goto-char (point-min))
- (swiper-font-lock-ensure)
- (while (< (point) (point-max))
- (when (swiper-match-usable-p)
- (let ((str (swiper--line)))
- (setq str (ivy-cleanup-string str))
- (let ((line-number-str
- (format swiper--format-spec line-number)))
- (if swiper-include-line-number-in-search
- (setq str (concat line-number-str str))
- (put-text-property
- 0 1 'display line-number-str str))
- (put-text-property
- 0 1 'swiper-line-number line-number str))
- (push str candidates)))
- (funcall advancer 1)
- (cl-incf line-number))
- (nreverse candidates))))))
-
-(defvar swiper--opoint 1
- "The point when `swiper' starts.")
-
-;;;###autoload
-(defun swiper-backward (&optional initial-input)
- "`isearch-backward' with an overview.
-When non-nil, INITIAL-INPUT is the initial search pattern."
- (interactive)
- (let ((ivy-index-functions-alist
- '((swiper . ivy-recompute-index-swiper-backward))))
- (swiper initial-input)))
-
-;;;###autoload
-(defun swiper-thing-at-point ()
- "`swiper' with `ivy-thing-at-point'."
- (interactive)
- (let ((thing (ivy-thing-at-point)))
- (when (use-region-p)
- (deactivate-mark))
- (swiper thing)))
-
-;;;###autoload
-(defun swiper-all-thing-at-point ()
- "`swiper-all' with `ivy-thing-at-point'."
- (interactive)
- (let ((thing (ivy-thing-at-point)))
- (when (use-region-p)
- (deactivate-mark))
- (swiper-all thing)))
-
-(defun swiper--extract-matches (regex cands)
- "Extract captured REGEX groups from CANDS."
- (let (res)
- (dolist (cand cands)
- (setq cand (substring cand 1))
- (when (string-match regex cand)
- (push (mapconcat (lambda (n) (match-string-no-properties n cand))
- (number-sequence
- 1
- (/ (- (length (match-data)) 2) 2))
- " ")
- res)))
- (nreverse res)))
-
-(defun swiper--occur-cands (fname cands)
- (when cands
- (with-current-buffer (ivy-state-buffer ivy-last)
- (when (eq (ivy-state-caller ivy-last) 'swiper-isearch)
- (setq cands (mapcar #'swiper--line-at-point cands)))
- (let* ((pt-min (point-min))
- (line-delta
- (save-restriction
- (widen)
- (1- (line-number-at-pos pt-min))))
- (lines
- (if (eq (ivy-state-caller ivy-last) 'swiper-isearch)
- (swiper--isearch-occur-cands cands)
- (mapcar (lambda (s)
- (let ((n (get-text-property 0 'swiper-line-number
s)))
- (setq s (substring s 1))
- (add-text-properties 0 1 (list 'swiper-line-number
n) s)
- (cons n s)))
- cands)))
- (offset (+ (length fname) 2)))
- (mapcar (lambda (x)
- (let ((nn (number-to-string
- (+ (car x) line-delta))))
- (remove-text-properties 0 1 '(display) (cdr x))
- (put-text-property 0 (length nn) 'face
'ivy-grep-line-number nn)
- (put-text-property 0 1 'offset (+ offset (length nn))
fname)
- (format "%s:%s:%s" fname nn (cdr x))))
- lines)))))
-
-(defun swiper--isearch-occur-cands (cands)
- (let* ((last-pt (get-text-property 0 'point (car cands)))
- (line (1+ (line-number-at-pos last-pt)))
- res pt)
- (dolist (cand cands)
- (setq pt (get-text-property 0 'point cand))
- (cl-incf line (1- (count-lines last-pt pt)))
- (push (cons line cand) res)
- (setq last-pt pt))
- (nreverse res)))
-
-(defun swiper--occur-insert-lines (cands)
- (let ((inhibit-read-only t))
- ;; Need precise number of header lines for `wgrep' to work.
- (insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n"
- default-directory))
- (insert (format "%d candidates:\n" (length cands)))
- (ivy--occur-insert-lines cands)
- (goto-char (point-min))
- (forward-line 4)))
-
-(defun swiper--occur-buffer ()
- (let ((buffer (ivy-state-buffer ivy-last)))
- (unless (buffer-live-p buffer)
- (setq buffer
- (setf (ivy-state-buffer ivy-last)
- (find-file-noselect
- (plist-get (ivy-state-extra-props ivy-last) :fname))))
- (save-selected-window
- (pop-to-buffer buffer))
- (setf (ivy-state-window ivy-last) (selected-window)))
- buffer))
-
-(defun swiper-occur (&optional cands)
- "Generate a custom occur buffer for `swiper'.
-When capture groups are present in the input, print them instead of lines."
- (let* ((buffer (swiper--occur-buffer))
- (fname (propertize
- (with-ivy-window
- (if (buffer-file-name buffer)
- (file-name-nondirectory
- (buffer-file-name buffer))
- (buffer-name buffer)))
- 'face
- 'ivy-grep-info))
- (ivy-text (progn (string-match "\"\\(.*\\)\"" (buffer-name))
- (match-string 1 (buffer-name))))
- (re (mapconcat #'identity (ivy--split ivy-text) ".*?"))
- (cands
- (swiper--occur-cands
- fname
- (or cands
- (save-window-excursion
- (setq ivy--old-re nil)
- (switch-to-buffer buffer)
- (if (eq (ivy-state-caller ivy-last) 'swiper)
- (let ((ivy--regex-function 'swiper--re-builder))
- (ivy--filter re (swiper--candidates)))
- (swiper-isearch-function ivy-text)))))))
- (if (string-match-p "\\\\(" re)
- (insert
- (mapconcat #'identity
- (swiper--extract-matches
- re (with-current-buffer buffer
- (swiper--candidates)))
- "\n"))
- (unless (eq major-mode 'ivy-occur-grep-mode)
- (ivy-occur-grep-mode)
- (font-lock-mode -1))
- (swiper--occur-insert-lines
- (mapcar (lambda (cand) (concat "./" cand)) cands)))))
-
-(declare-function evil-set-jump "ext:evil-jumps")
-
-(defvar swiper--current-line nil)
-(defvar swiper--current-match-start nil)
-(defvar swiper--point-min nil)
-(defvar swiper--point-max nil)
-(defvar swiper--reveal-mode nil)
-
-(defun swiper--init ()
- "Perform initialization common to both completion methods."
- (setq swiper--current-line nil)
- (setq swiper--current-match-start nil)
- (setq swiper--current-window-start nil)
- (setq swiper--opoint (point))
- (setq swiper--point-min (point-min))
- (setq swiper--point-max (point-max))
- (when (setq swiper--reveal-mode
- (bound-and-true-p reveal-mode))
- (reveal-mode -1))
- (lazy-highlight-cleanup t)
- (setq isearch-opened-overlays nil)
- (when (bound-and-true-p evil-mode)
- (evil-set-jump)))
-
-(declare-function char-fold-to-regexp "char-fold")
-
-(defun swiper--re-builder (str)
- "Transform STR into a swiper regex.
-This is the regex used in the minibuffer where candidates have
-line numbers. For the buffer, use `ivy--regex' instead."
- (let* ((re-builder (ivy-alist-setting ivy-re-builders-alist))
- (re (cond
- ((equal str "")
- "")
- ((equal str "^")
- (setq ivy--subexps 0)
- ".")
- ((= (aref str 0) ?^)
- (let* ((re (funcall re-builder (substring str 1)))
- (re (if (listp re)
- (mapconcat (lambda (x)
- (format "\\(%s\\)" (car x)))
- (cl-remove-if-not #'cdr re)
- ".*?")
- re)))
- (cond
- ((string= re "$")
- "^$")
- ((zerop ivy--subexps)
- (prog1 (format "^ ?\\(%s\\)" re)
- (setq ivy--subexps 1)))
- (t
- (format "^ %s" re)))))
- ((eq (bound-and-true-p search-default-mode)
'char-fold-to-regexp)
- (if (string-match "\\`\\\\_<\\(.+\\)\\\\_>\\'" str)
- (concat
- "\\_<"
- (char-fold-to-regexp (match-string 1 str))
- "\\_>")
- (let ((subs (ivy--split str)))
- (setq ivy--subexps (length subs))
- (mapconcat
- (lambda (s) (format "\\(%s\\)" (char-fold-to-regexp s)))
- subs
- ".*?"))))
- (t
- (funcall re-builder str)))))
- re))
-
-(defvar swiper-history nil
- "History for `swiper'.")
-
-(defvar swiper-invocation-face nil
- "The face at the point of invocation of `swiper'.")
-
-(defcustom swiper-stay-on-quit nil
- "When non-nil don't go back to search start on abort."
- :type 'boolean)
-
-;;;###autoload
-(defun swiper (&optional initial-input)
- "`isearch-forward' with an overview.
-When non-nil, INITIAL-INPUT is the initial search pattern."
- (interactive)
- (let ((candidates (swiper--candidates)))
- (swiper--init)
- (setq swiper-invocation-face
- (plist-get (text-properties-at (point)) 'face))
- (let ((preselect
- (if (or swiper-use-visual-line (null search-invisible))
- (count-screen-lines
- (point-min)
- (save-excursion (beginning-of-visual-line) (point)))
- (1- (line-number-at-pos))))
- (minibuffer-allow-text-properties t)
- res)
- (unwind-protect
- (and
- (setq res
- (ivy-read
- "Swiper: "
- candidates
- :initial-input initial-input
- :keymap swiper-map
- :preselect
- (if initial-input
- (cl-position-if
- (lambda (x)
- (= (1+ preselect) (get-text-property 0
'swiper-line-number x)))
- (progn
- (setq ivy--old-re nil)
- (ivy--filter initial-input candidates)))
- preselect)
- :require-match t
- :action #'swiper--action
- :re-builder #'swiper--re-builder
- :history 'swiper-history
- :extra-props (list :fname (buffer-file-name))
- :caller 'swiper))
- (point))
- (unless (or res swiper-stay-on-quit)
- (goto-char swiper--opoint))
- (unless (or res (string= ivy-text ""))
- (cl-pushnew ivy-text swiper-history))
- (setq swiper--current-window-start nil)
- (when swiper--reveal-mode
- (reveal-mode 1))))))
-
-(ivy-configure 'swiper
- :occur #'swiper-occur
- :update-fn #'swiper--update-input-ivy
- :unwind-fn #'swiper--cleanup
- :index-fn #'ivy-recompute-index-swiper)
-
-(defun swiper-toggle-face-matching ()
- "Toggle matching only the candidates with `swiper-invocation-face'."
- (interactive)
- (setf (ivy-state-matcher ivy-last)
- (if (ivy-state-matcher ivy-last)
- nil
- #'swiper--face-matcher))
- (setq ivy--old-re nil))
-
-(defun swiper--face-matcher (regexp candidates)
- "Return REGEXP matching CANDIDATES.
-Matched candidates should have `swiper-invocation-face'."
- (cl-remove-if-not
- (lambda (x)
- (and (string-match regexp x)
- (let* ((s (match-string 0 x))
- (n (length s))
- (i 0))
- (while (and (< i n)
- (text-property-any
- i (1+ i)
- 'face swiper-invocation-face
- s))
- (cl-incf i))
- (= i n))))
- candidates))
-
-(defun swiper--ensure-visible ()
- "Remove overlays hiding point."
- (let ((overlays (overlays-at (1- (point))))
- ov expose)
- (while (setq ov (pop overlays))
- (if (and (invisible-p (overlay-get ov 'invisible))
- (setq expose (overlay-get ov 'isearch-open-invisible)))
- (funcall expose ov)))))
-
-(defvar swiper--overlays nil
- "Store overlays.")
-
-(defvar swiper--isearch-highlight-timer nil
- "This timer used by `swiper--delayed-add-overlays'.")
-
-(defun swiper--cleanup ()
- "Clean up the overlays."
- (while swiper--overlays
- (delete-overlay (pop swiper--overlays)))
- ;; force cleanup unless it's :unwind
- (lazy-highlight-cleanup
- (if (eq ivy-exit 'done) lazy-highlight-cleanup t))
- (when (timerp swiper--isearch-highlight-timer)
- (cancel-timer swiper--isearch-highlight-timer)
- (setq swiper--isearch-highlight-timer nil)))
-
-(defun swiper--add-cursor-overlay (wnd)
- (let* ((special (or (eolp) (looking-at "\t")))
- (ov (make-overlay (point) (if special (point) (1+ (point))))))
- (if special
- (overlay-put ov 'after-string (propertize " " 'face 'ivy-cursor))
- (overlay-put ov 'face 'ivy-cursor))
- (overlay-put ov 'window wnd)
- (overlay-put ov 'priority 2)
- (push ov swiper--overlays)))
-
-(defun swiper--add-line-overlay (wnd)
- (let ((beg (if visual-line-mode
- (save-excursion
- (beginning-of-visual-line)
- (point))
- (line-beginning-position)))
- (end (if visual-line-mode
- (save-excursion
- (end-of-visual-line)
- (point))
- (1+ (line-end-position)))))
- (push (swiper--make-overlay beg end 'swiper-line-face wnd 0)
- swiper--overlays)))
-
-(defun swiper--make-overlay (beg end face wnd priority)
- "Create an overlay bound by BEG and END.
-FACE, WND and PRIORITY are properties corresponding to
-the face, window and priority of the overlay."
- (let ((overlay (make-overlay beg end)))
- (overlay-put overlay 'face face)
- (overlay-put overlay 'window wnd)
- (overlay-put overlay 'priority priority)
- overlay))
-
-(defun swiper--recenter-p ()
- (or (display-graphic-p)
- (not recenter-redisplay)))
-
-(defun swiper--positive-regexps (str)
- (let ((regexp-or-regexps
- (funcall ivy--regex-function str)))
- (if (listp regexp-or-regexps)
- (mapcar #'car (cl-remove-if-not #'cdr regexp-or-regexps))
- (list regexp-or-regexps))))
-
-(defun swiper--update-input-ivy ()
- "Called when `ivy' input is updated."
- (with-ivy-window
- (swiper--cleanup)
- (when (> (length (ivy-state-current ivy-last)) 0)
- (let ((regexps (swiper--positive-regexps ivy-text))
- (re-idx -1)
- (case-fold-search (ivy--case-fold-p ivy-text)))
- (dolist (re regexps)
- (setq re-idx (1+ re-idx))
- (let* ((re (replace-regexp-in-string
- " " "\t"
- re))
- (num (get-text-property 0 'swiper-line-number
(ivy-state-current ivy-last))))
- (unless (memq this-command '(ivy-yank-word
- ivy-yank-symbol
- ivy-yank-char
- scroll-other-window))
- (when (cl-plusp num)
- (unless (if swiper--current-line
- (eq swiper--current-line num)
- (eq (line-number-at-pos) num))
- (goto-char swiper--point-min)
- (if swiper-use-visual-line
- (line-move (1- num))
- (forward-line (1- num))))
- (if (and (equal ivy-text "")
- (>= swiper--opoint (line-beginning-position))
- (<= swiper--opoint (line-end-position)))
- (goto-char swiper--opoint)
- (if (eq swiper--current-line num)
- (when swiper--current-match-start
- (goto-char swiper--current-match-start))
- (setq swiper--current-line num))
- (when (re-search-forward re (line-end-position) t)
- (setq swiper--current-match-start (match-beginning 0))))
- (isearch-range-invisible (line-beginning-position)
- (line-end-position))
- (swiper--maybe-recenter)))
- (swiper--add-overlays
- re
- (max
- (if (swiper--recenter-p)
- (window-start)
- (line-beginning-position (- (window-height))))
- swiper--point-min)
- (min
- (if (swiper--recenter-p)
- (window-end (selected-window) t)
- (line-end-position (window-height)))
- swiper--point-max)
- nil
- re-idx)))))))
-
-(defun swiper--add-overlays (re &optional beg end wnd re-idx)
- "Add overlays for RE regexp in visible part of the current buffer.
-BEG and END, when specified, are the point bounds.
-WND, when specified is the window."
- (setq wnd (or wnd (ivy-state-window ivy-last)))
- (swiper--add-line-overlay wnd)
- (let* ((pt (point))
- (wh (window-height))
- (beg (or beg (save-excursion
- (forward-line (- wh))
- (point))))
- (end (or end (save-excursion
- (forward-line wh)
- (point))))
- (case-fold-search (ivy--case-fold-p re)))
- (when (>= (length re) swiper-min-highlight)
- (save-excursion
- (goto-char beg)
- ;; RE can become an invalid regexp
- (while (and (ignore-errors (re-search-forward re end t))
- (> (- (match-end 0) (match-beginning 0)) 0))
- ;; Don't highlight a match if it spans multiple
- ;; lines. `count-lines' returns 1 if the match is within a
- ;; single line, even if it includes the newline, and 2 or
- ;; greater otherwise. We hope that the inclusion of the
- ;; newline will not ever be a problem in practice.
- (when (< (count-lines (match-beginning 0) (match-end 0)) 2)
- (let* ((faces (if (= (match-end 0) pt)
- swiper-faces
- swiper-background-faces))
- (adder-fn (lambda (beg end face priority)
- (push (swiper--make-overlay beg end face wnd
priority)
- isearch-lazy-highlight-overlays))))
- (unless (and (consp ivy--old-re)
- (null
- (save-match-data
- (ivy--re-filter ivy--old-re
- (list
- (buffer-substring-no-properties
- (line-beginning-position)
- (line-end-position)))))))
- (swiper--add-properties faces adder-fn re-idx)))))))))
-
-(defun swiper--add-properties (faces adder-fn &optional re-idx)
- (let ((mb (match-beginning 0))
- (me (match-end 0)))
- (unless (> (- me mb) 2017)
- (funcall adder-fn
- mb me
- (if (zerop ivy--subexps)
- (nth (1+ (mod (or re-idx 0) (1- (length faces)))) faces)
- (car faces))
- 0)))
- (let ((i 1)
- (j 0))
- (while (<= (cl-incf j) ivy--subexps)
- (let ((bm (match-beginning j))
- (em (match-end j)))
- (when (and (integerp em)
- (integerp bm))
- (while (and (< j ivy--subexps)
- (integerp (match-beginning (+ j 1)))
- (= em (match-beginning (+ j 1))))
- (setq em (match-end (cl-incf j))))
- (funcall adder-fn
- bm em
- (nth (1+ (mod (+ i 2) (1- (length faces))))
- faces)
- i)
- (cl-incf i))))))
-
-(defcustom swiper-action-recenter nil
- "When non-nil, recenter after exiting `swiper'."
- :type 'boolean)
-(defvar evil-search-module)
-(defvar evil-ex-search-pattern)
-(defvar evil-ex-search-persistent-highlight)
-(defvar evil-ex-search-direction)
-(declare-function evil-ex-search-activate-highlight "evil-ex")
-
-(defun swiper--maybe-recenter ()
- (cond (swiper-action-recenter
- (recenter))
- ((swiper--recenter-p)
- (when swiper--current-window-start
- (set-window-start (selected-window) swiper--current-window-start))
- (when (or
- (< (point) (window-start))
- (> (point) (window-end (ivy-state-window ivy-last) t)))
- (recenter))))
- (setq swiper--current-window-start (window-start)))
-
-(defun swiper--action (x)
- "Goto line X."
- (let ((ln (1- (get-text-property 0 'swiper-line-number x)))
- (re (ivy--regex ivy-text))
- (case-fold-search (ivy--case-fold-p ivy-text)))
- (if (null x)
- (user-error "No candidates")
- (with-ivy-window
- (unless (equal (current-buffer)
- (ivy-state-buffer ivy-last))
- (switch-to-buffer (ivy-state-buffer ivy-last)))
- (goto-char
- (if (buffer-narrowed-p)
- swiper--point-min
- (point-min)))
- (funcall (if swiper-use-visual-line
- #'line-move
- #'forward-line)
- ln)
- (when (and (re-search-forward re (line-end-position) t)
swiper-goto-start-of-match)
- (goto-char (match-beginning 0)))
- (swiper--ensure-visible)
- (swiper--maybe-recenter)
- (when (/= (point) swiper--opoint)
- (unless (and transient-mark-mode mark-active)
- (when (eq ivy-exit 'done)
- (push-mark swiper--opoint t)
- (message "Mark saved where search started"))))
- (add-to-history
- 'regexp-search-ring
- re
- regexp-search-ring-max)
- ;; integration with evil-mode's search
- (when (bound-and-true-p evil-mode)
- (when (eq evil-search-module 'isearch)
- (setq isearch-string ivy-text))
- (when (eq evil-search-module 'evil-search)
- (add-to-history 'evil-ex-search-history re)
- (setq evil-ex-search-pattern (list re t t))
- (setq evil-ex-search-direction 'forward)
- (when evil-ex-search-persistent-highlight
- (evil-ex-search-activate-highlight evil-ex-search-pattern))))))))
-
-(defun swiper-from-isearch ()
- "Invoke `swiper' from isearch."
- (interactive)
- (let ((query (if isearch-regexp
- isearch-string
- (regexp-quote isearch-string))))
- (isearch-exit)
- (swiper query)))
-
-(defvar swiper-multi-buffers nil
- "Store the current list of buffers.")
-
-(defvar swiper-multi-candidates nil
- "Store the list of candidates for `swiper-multi'.")
-
-(defun swiper-multi-prompt ()
- "Return prompt for `swiper-multi'."
- (format "Buffers (%s): "
- (mapconcat #'identity swiper-multi-buffers ", ")))
-
-(defvar swiper-window-width 80)
-
-(defun swiper-multi ()
- "Select one or more buffers.
-Run `swiper' for those buffers."
- (interactive)
- (setq swiper-multi-buffers nil)
- (let ((ivy-use-virtual-buffers nil))
- (ivy-read (swiper-multi-prompt)
- #'internal-complete-buffer
- :action #'swiper-multi-action-1))
- (let ((swiper-window-width (- (- (frame-width) (if (display-graphic-p) 0 1))
4)))
- (ivy-read "Swiper: " swiper-multi-candidates
- :action #'swiper-multi-action-2
- :caller 'swiper-multi)))
-
-(ivy-configure 'swiper-multi
- :unwind-fn #'swiper--cleanup
- :index-fn #'ivy-recompute-index-swiper
- :format-fn #'swiper--all-format-function)
-
-(defun swiper-multi-action-1 (x)
- "Add X to list of selected buffers `swiper-multi-buffers'.
-If X is already part of the list, remove it instead. Quit the selection if
-X is selected by either `ivy-done', `ivy-alt-done' or `ivy-immediate-done',
-otherwise continue prompting for buffers."
- (if (member x swiper-multi-buffers)
- (progn
- (setq swiper-multi-buffers (delete x swiper-multi-buffers)))
- (unless (equal x "")
- (setq swiper-multi-buffers (append swiper-multi-buffers (list x)))))
- (let ((prompt (swiper-multi-prompt)))
- (setf (ivy-state-prompt ivy-last) prompt)
- (setq ivy--prompt (concat "%-4d " prompt)))
- (cond ((memq this-command '(ivy-done
- ivy-alt-done
- ivy-immediate-done))
- (setq swiper-multi-candidates
- (swiper--multi-candidates
- (mapcar #'get-buffer swiper-multi-buffers))))
- ((eq this-command 'ivy-call)
- (with-selected-window (active-minibuffer-window)
- (delete-minibuffer-contents)))))
-
-(defun swiper-multi-action-2 (x)
- "Move to candidate X from `swiper-multi'."
- (when (> (length x) 0)
- (let ((buffer-name (get-text-property 0 'buffer x)))
- (when buffer-name
- (with-ivy-window
- (switch-to-buffer buffer-name)
- (goto-char (point-min))
- (forward-line (1- (get-text-property 0 'swiper-line-number x)))
- (re-search-forward
- (ivy--regex ivy-text)
- (line-end-position) t)
- (isearch-range-invisible (line-beginning-position)
- (line-end-position))
- (unless (eq ivy-exit 'done)
- (swiper--cleanup)
- (swiper--add-overlays (ivy--regex ivy-text))))))))
-
-(defun swiper-all-buffer-p (buffer)
- "Return non-nil if BUFFER should be considered by `swiper-all'."
- (let ((mode (buffer-local-value 'major-mode (get-buffer buffer))))
- (cond
- ;; Ignore TAGS buffers, they tend to add duplicate results.
- ((eq mode #'tags-table-mode) nil)
- ;; Always consider dired buffers, even though they're not backed
- ;; by a file.
- ((eq mode #'dired-mode) t)
- ;; Always consider stash buffers too, as they may have
- ;; interesting content not present in any buffers. We don't #'
- ;; quote to satisfy the byte-compiler.
- ((eq mode 'magit-stash-mode) t)
- ;; Email buffers have no file, but are useful to search
- ((eq mode 'gnus-article-mode) t)
- ;; Otherwise, only consider the file if it's backed by a file.
- (t (buffer-file-name buffer)))))
-
-;;* `swiper-all'
-(defun swiper-all-function (str)
- "Search in all open buffers for STR."
- (or
- (ivy-more-chars)
- (let* ((buffers (cl-remove-if-not #'swiper-all-buffer-p (buffer-list)))
- (re-full (funcall ivy--regex-function str))
- re re-tail
- cands match
- (case-fold-search (ivy--case-fold-p str)))
- (setq re (ivy-re-to-str re-full))
- (when (consp re-full)
- (setq re-tail (cdr re-full)))
- (dolist (buffer buffers)
- (with-current-buffer buffer
- (save-excursion
- (goto-char (point-min))
- (while (re-search-forward re nil t)
- (setq match (if (memq major-mode '(org-mode dired-mode))
- (buffer-substring-no-properties
- (line-beginning-position)
- (line-end-position))
- (buffer-substring
- (line-beginning-position)
- (line-end-position))))
- (put-text-property
- 0 1 'buffer
- (buffer-name)
- match)
- (put-text-property 0 1 'point (point) match)
- (when (or (null re-tail) (ivy-re-match re-tail match))
- (push match cands))))))
- (setq ivy--old-re re-full)
- (if (null cands)
- (list "")
- (setq ivy--old-cands (nreverse cands))))))
-
-(defun swiper--all-format-function (cands)
- "Format CANDS for `swiper-all'.
-See `ivy-format-functions-alist' for further information."
- (let* ((ww swiper-window-width)
- (col2 1)
- (cands-with-buffer
- (mapcar (lambda (s)
- (let ((buffer (get-text-property 0 'buffer s)))
- (setq col2 (max col2 (length buffer)))
- (cons s buffer))) cands))
- (col1 (- ww 4 col2)))
- (setq cands
- (mapcar (lambda (x)
- (if (cdr x)
- (let ((s (ivy--truncate-string (car x) col1)))
- (concat
- s
- (make-string
- (max 0
- (- ww (string-width s) (length (cdr x))))
- ?\ )
- (cdr x)))
- (car x)))
- cands-with-buffer))
- (ivy--format-function-generic
- (lambda (str)
- (ivy--add-face str 'ivy-current-match))
- (lambda (str)
- str)
- cands
- "\n")))
-
-(defvar swiper-all-map
- (let ((map (make-sparse-keymap)))
- (define-key map (kbd "M-q") 'swiper-all-query-replace)
- map)
- "Keymap for `swiper-all'.")
-
-;;;###autoload
-(defun swiper-all (&optional initial-input)
- "Run `swiper' for all open buffers."
- (interactive)
- (let ((swiper-window-width (- (frame-width) (if (display-graphic-p) 0 1))))
- (ivy-read "swiper-all: " 'swiper-all-function
- :action #'swiper-all-action
- :dynamic-collection t
- :keymap swiper-all-map
- :initial-input initial-input
- :caller 'swiper-all)))
-
-(ivy-configure 'swiper-all
- :update-fn 'auto
- :unwind-fn #'swiper--cleanup
- :format-fn #'swiper--all-format-function)
-
-(defun swiper-all-action (x)
- "Move to candidate X from `swiper-all'."
- (when (> (length x) 0)
- (let ((buffer-name (get-text-property 0 'buffer x)))
- (when buffer-name
- (with-ivy-window
- (switch-to-buffer buffer-name)
- (goto-char (get-text-property 0 'point x))
- (isearch-range-invisible (line-beginning-position)
- (line-end-position))
- (unless (eq ivy-exit 'done)
- (swiper--cleanup)
- (swiper--add-overlays (ivy--regex ivy-text))))))))
-
-(defun swiper--multi-candidates (buffers)
- "Extract candidates from BUFFERS."
- (let ((res nil))
- (dolist (buf buffers)
- (with-current-buffer buf
- (setq res
- (nconc
- (mapcar
- (lambda (s) (put-text-property 0 1 'buffer (buffer-name) s) s)
- (swiper--candidates 4))
- res))))
- res))
-
-;;* `swiper-isearch'
-(defun swiper-isearch-function (str)
- "Collect STR matches in the current buffer for `swiper-isearch'."
- (with-ivy-window
- (swiper--isearch-function str)))
-
-(defun swiper-match-usable-p ()
- (or search-invisible
- (not (cl-find-if
- (lambda (ov)
- (invisible-p (overlay-get ov 'invisible)))
- (overlays-at (point))))))
-
-(defvar swiper--isearch-backward nil)
-(defvar swiper--isearch-start-point nil)
-
-(defun swiper--isearch-function-1 (re backward)
- (unless (string= re ".")
- (let (cands)
- (save-excursion
- (goto-char (if backward (point-max) (point-min)))
- (while (and (funcall (if backward #'re-search-backward
#'re-search-forward) re nil t)
- (not (if backward (bobp) (eobp))))
- (when (swiper-match-usable-p)
- (let ((pos (if (or backward swiper-goto-start-of-match)
- (match-beginning 0)
- (point))))
- (push pos cands)))
- (when (= (match-beginning 0) (match-end 0))
- (if backward
- (backward-char)
- (forward-char)))))
- (if backward
- cands
- (nreverse cands)))))
-
-(defun swiper--isearch-next-item (re cands)
- (if swiper--isearch-backward
- (or
- (cl-position-if
- (lambda (x)
- (and
- (< x swiper--isearch-start-point)
- (eq 0 (string-match-p
- re
- (buffer-substring-no-properties
- x swiper--isearch-start-point)))))
- cands
- :from-end t)
- 0)
- (or
- (cl-position-if
- (lambda (x) (> x swiper--isearch-start-point))
- cands)
- 0)))
-
-(defun swiper--isearch-filter-ignore-order (re-full cands)
- (let (filtered-cands)
- (dolist (re-cons re-full cands)
- (save-excursion
- (dolist (cand cands)
- (goto-char cand)
- (beginning-of-line)
- (unless (if (re-search-forward (car re-cons) (line-end-position) t)
- (not (cdr re-cons))
- (cdr re-cons))
- (push cand filtered-cands))))
- (setq cands (nreverse filtered-cands))
- (setq filtered-cands nil))))
-
-(defun swiper--isearch-function (str)
- (let ((re-full (funcall ivy--regex-function str)))
- (unless (equal re-full "")
- (let* ((case-fold-search (ivy--case-fold-p str))
- (re
- (if (stringp re-full)
- re-full
- (mapconcat
- #'ivy--regex-or-literal
- (delq nil (mapcar (lambda (x) (and (cdr x) (car x))) re-full))
- "\\|")))
- (cands (swiper--isearch-function-1 re swiper--isearch-backward)))
- (when (consp re-full)
- (setq cands (swiper--isearch-filter-ignore-order re-full cands)))
- (setq ivy--old-re re)
- (ivy-set-index (swiper--isearch-next-item re cands))
- (setq ivy--old-cands cands)))))
-
-(defcustom swiper-isearch-highlight-delay '(2 0.2)
- "When `ivy-text' is too short, delay showing the overlay.
-
-The default value will delay showing the overlay by 0.2 seconds
-if `ivy-text' is shorter than 2 characters.
-
-The aim is to reduce the visual clutter, since it's very rare
-that we search only for one character."
- :type '(list
- (integer :tag "Text length")
- (float :tag "Delay in seconds")))
-
-(defun swiper--delayed-add-overlays ()
- (if (and swiper-isearch-highlight-delay
- (< (length ivy-text) (car swiper-isearch-highlight-delay)))
- (setq swiper--isearch-highlight-timer
- (run-with-idle-timer
- (cadr swiper-isearch-highlight-delay) nil
- (lambda ()
- (with-ivy-window
- (swiper--add-overlays (ivy--regex ivy-text))))))
- (dolist (re (swiper--positive-regexps ivy-text))
- (swiper--add-overlays re))))
-
-(defun swiper-isearch-action (x)
- "Move to X for `swiper-isearch'."
- (if (or (numberp x)
- (and (> (length x) 0)
- (setq x (get-text-property 0 'point x))))
- (with-ivy-window
- (goto-char x)
- (when (and (or (eq this-command 'ivy-previous-line-or-history)
- (and (eq this-command 'ivy-done)
- (eq last-command 'ivy-previous-line-or-history)))
- (looking-back ivy--old-re (line-beginning-position)))
- (goto-char (match-beginning 0)))
- (isearch-range-invisible (point) (1+ (point)))
- (swiper--maybe-recenter)
- (unless (eq ivy-exit 'done)
- (swiper--cleanup)
- (swiper--delayed-add-overlays)
- (swiper--add-cursor-overlay
- (ivy-state-window ivy-last))))
- (swiper--cleanup)))
-
-(defun swiper-action-copy (_x)
- "Copy line at point and go back."
- (kill-new
- (buffer-substring-no-properties
- (line-beginning-position) (line-end-position)))
- (goto-char swiper--opoint))
-
-(ivy-add-actions 'swiper-isearch '(("w" swiper-action-copy "copy")))
-(ivy-add-actions 'swiper '(("w" swiper-action-copy "copy")))
-
-(defun swiper-isearch-thing-at-point ()
- "Insert `symbol-at-point' into the minibuffer of `swiper-isearch'.
-When not running `swiper-isearch' already, start it."
- (interactive)
- (if (window-minibuffer-p)
- (let (bnd str regionp)
- (with-ivy-window
- (setq bnd
- (if (setq regionp (region-active-p))
- (prog1 (cons (region-beginning) (region-end))
- (deactivate-mark))
- (bounds-of-thing-at-point 'symbol)))
- (setq str (buffer-substring-no-properties (car bnd) (cdr bnd))))
- (insert str)
- (unless regionp
- (ivy--insert-symbol-boundaries)))
- (let (thing)
- (if (use-region-p)
- (progn
- (setq thing (buffer-substring-no-properties
- (region-beginning) (region-end)))
- (goto-char (region-beginning))
- (deactivate-mark))
- (let ((bnd (bounds-of-thing-at-point 'symbol)))
- (when bnd
- (goto-char (car bnd)))
- (setq thing (ivy-thing-at-point))))
- (swiper-isearch thing))))
-
-(defvar swiper-isearch-map
- (let ((map (make-sparse-keymap)))
- (set-keymap-parent map swiper-map)
- (define-key map (kbd "M-n") 'swiper-isearch-thing-at-point)
- map)
- "Keymap for `swiper-isearch'.")
-
-(defun swiper--isearch-same-line-p (s1 s2)
- "Check if S1 and S2 are equal and on the same line."
- (and (equal s1 s2)
- (<= (count-lines
- (get-text-property 0 'point s2)
- (get-text-property 0 'point s1))
- 1)))
-
-(defun swiper-isearch-format-function (cands)
- (if (numberp (car-safe cands))
- (if (string= ivy--old-re "^$")
- ""
- (swiper--isearch-format
- ivy--index ivy--length ivy--old-cands
- ivy--old-re
- (ivy-state-current ivy-last)
- (ivy-state-buffer ivy-last)))
- (ivy-format-function-default cands)))
-
-(defun swiper--line-at-point (pt)
- (save-excursion
- (goto-char pt)
- (let ((s (buffer-substring
- (line-beginning-position)
- (line-end-position))))
- (put-text-property 0 1 'point pt s)
- (ivy-cleanup-string s))))
-
-(defun swiper--isearch-highlight (str &optional current)
- (let ((start 0)
- (i 0))
- (while (string-match ivy--old-re str start)
- (setq start (match-end 0))
- (swiper--add-properties
- (if (eq current i)
- swiper-faces
- swiper-background-faces)
- (lambda (beg end face _priority)
- (ivy-add-face-text-property
- beg end face str)))
- (cl-incf i))
- str))
-
-(defun swiper--isearch-format (index length cands regex current buffer)
- (let* ((half-height (/ ivy-height 2))
- (i (1- index))
- (j 0)
- (len 0)
- res s)
- (with-current-buffer buffer
- (while (and (>= i 0)
- (swiper--isearch-same-line-p
- (swiper--line-at-point (nth i cands))
- (swiper--line-at-point current)))
- (cl-decf i)
- (cl-incf j))
- (while (and (>= i 0)
- (< len half-height))
- (setq s (swiper--line-at-point (nth i cands)))
- (unless (swiper--isearch-same-line-p s (car res))
- (push (swiper--isearch-highlight s) res)
- (cl-incf len))
- (cl-decf i))
- (setq res (nreverse res))
- (let ((current-str
- (swiper--line-at-point current))
- (start 0))
- (dotimes (_ (1+ j))
- (string-match regex current-str start)
- (setq start (match-end 0)))
- (swiper--isearch-highlight current-str j)
- (font-lock-append-text-property
- 0 (length current-str)
- 'face 'swiper-line-face current-str)
- (push current-str res))
- (cl-incf len)
- (setq i (1+ index))
- (while (and (< i length)
- (swiper--isearch-same-line-p
- (swiper--line-at-point (nth i cands))
- (swiper--line-at-point current)))
- (cl-incf i))
- (while (and (< i length)
- (< len ivy-height))
- (setq s (swiper--line-at-point (nth i cands)))
- (unless (swiper--isearch-same-line-p s (car res))
- (push (swiper--isearch-highlight s) res)
- (cl-incf len))
- (cl-incf i))
- (mapconcat #'identity (nreverse res) "\n"))))
-
-;;;###autoload
-(defun swiper-isearch (&optional initial-input)
- "A `swiper' that's not line-based."
- (interactive)
- (swiper--init)
- (setq swiper--isearch-start-point (point))
- (swiper-font-lock-ensure)
- (let ((ivy-fixed-height-minibuffer t)
- (cursor-in-non-selected-windows nil)
- (swiper-min-highlight 1)
- res)
- (unwind-protect
- (and
- (setq res
- (ivy-read
- "Swiper: "
- #'swiper-isearch-function
- :initial-input initial-input
- :keymap swiper-isearch-map
- :dynamic-collection t
- :require-match t
- :action #'swiper-isearch-action
- :re-builder #'swiper--re-builder
- :history 'swiper-history
- :extra-props (list :fname (buffer-file-name))
- :caller 'swiper-isearch))
- (point))
- (unless (or res swiper-stay-on-quit)
- (goto-char swiper--opoint))
- (isearch-clean-overlays)
- (swiper--ensure-visible)
- (unless (or res (string= ivy-text ""))
- (cl-pushnew ivy-text swiper-history)))))
-
-(ivy-configure 'swiper-isearch
- :occur #'swiper-occur
- :update-fn 'auto
- :unwind-fn #'swiper--cleanup
- :format-fn #'swiper-isearch-format-function)
-
-;;;###autoload
-(defun swiper-isearch-backward (&optional initial-input)
- "Like `swiper-isearch' but the first result is before the point."
- (interactive)
- (let ((swiper--isearch-backward t))
- (swiper-isearch initial-input)))
-
-(defun swiper-isearch-toggle ()
- "Two-way toggle between `swiper-isearch' and isearch.
-Intended to be bound in `isearch-mode-map' and `swiper-map'."
- (interactive)
- (if isearch-mode
- (let ((query (if isearch-regexp
- isearch-string
- (regexp-quote isearch-string))))
- (isearch-exit)
- (goto-char (or (and isearch-forward isearch-other-end)
- (point)))
- (swiper-isearch query))
- (ivy-exit-with-action
- (lambda (_)
- (when (looking-back ivy--old-re (line-beginning-position))
- (goto-char (match-beginning 0)))
- (isearch-mode t)
- (unless (string= ivy-text "")
- (isearch-yank-string ivy-text))))))
-
-(provide 'swiper)
-
-;;; swiper.el ends here
diff --git a/targets/checkdoc.el b/targets/checkdoc.el
deleted file mode 100644
index 3162d36..0000000
--- a/targets/checkdoc.el
+++ /dev/null
@@ -1,6 +0,0 @@
-(checkdoc-file "colir.el")
-(checkdoc-file "counsel.el")
-(checkdoc-file "ivy-overlay.el")
-(checkdoc-file "ivy-test.el")
-(checkdoc-file "ivy.el")
-(checkdoc-file "swiper.el")
diff --git a/targets/install-deps.el b/targets/install-deps.el
deleted file mode 100644
index 3089fc7..0000000
--- a/targets/install-deps.el
+++ /dev/null
@@ -1,38 +0,0 @@
-(setq melpa-stable (getenv "MELPA_STABLE"))
-(setq package-user-dir
- (expand-file-name
- (format "~/.elpa/%s/elpa"
- (concat emacs-version (when melpa-stable "-stable")))))
-(message "installing in %s ...\n" package-user-dir)
-(package-initialize)
-(setq package-archives
- (list (if melpa-stable
- '("melpa-stable" . "https://stable.melpa.org/packages/")
- '("melpa" . "http://melpa.org/packages/"))
- ;; '("gnu" . "http://elpa.gnu.org/packages/")
- ))
-(package-refresh-contents)
-
-(defconst ivy-dev-packages
- '(avy
- hydra
- wgrep))
-
-(dolist (package ivy-dev-packages)
- (if (package-installed-p package)
- (message "%S: OK" package)
- (condition-case nil
- (progn
- (package-install package)
- (message "%S: ...OK" package))
- (error
- (message "%S: FAIL" package)))))
-
-(save-window-excursion
- (package-list-packages t)
- (condition-case nil
- (progn
- (package-menu-mark-upgrades)
- (package-menu-execute t))
- (error
- (message "All packages up to date"))))
diff --git a/targets/obsolete-config.el b/targets/obsolete-config.el
deleted file mode 100644
index d38c7da..0000000
--- a/targets/obsolete-config.el
+++ /dev/null
@@ -1,3 +0,0 @@
-(add-to-list 'load-path default-directory)
-(require 'counsel)
-(byte-compile-file (expand-file-name "targets/obsolete-config.el"))
diff --git a/targets/plain.el b/targets/plain.el
deleted file mode 100644
index 140db3e..0000000
--- a/targets/plain.el
+++ /dev/null
@@ -1,9 +0,0 @@
-;; (package-initialize)
-(ivy-mode)
-(counsel-mode)
-(setq enable-recursive-minibuffers t)
-(global-set-key (kbd "C-c C-r") 'ivy-resume)
-(global-set-key (kbd "C-s") 'swiper)
-(global-set-key (kbd "C-c j") 'counsel-git-grep)
-(global-set-key (kbd "C-c k") 'counsel-rg)
-(global-set-key (kbd "C-c s") 'isearch-forward-regexp)
diff --git a/tests/find-file/directories-with-spaces/bar baz i/file1
b/tests/find-file/directories-with-spaces/bar baz i/file1
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/find-file/directories-with-spaces/bar baz ii/file2
b/tests/find-file/directories-with-spaces/bar baz ii/file2
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/find-file/dotfiles/.foobar1
b/tests/find-file/dotfiles/.foobar1
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/find-file/dotfiles/.foobar2
b/tests/find-file/dotfiles/.foobar2
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/find-file/dotfiles/foo/placeholder
b/tests/find-file/dotfiles/foo/placeholder
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/find-file/files-with-dollar/$
b/tests/find-file/files-with-dollar/$
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/find-file/files-with-dollar/foo$
b/tests/find-file/files-with-dollar/foo$
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/find-file/files-with-dollar/one
b/tests/find-file/files-with-dollar/one
deleted file mode 100644
index e69de29..0000000
diff --git a/tests/find-file/files-with-dollar/two
b/tests/find-file/files-with-dollar/two
deleted file mode 100644
index e69de29..0000000