[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master c2d3a4c 184/184: Merge commit 'cd634c6f51458f81898ecf2821a
From: |
Oleh Krehel |
Subject: |
[elpa] master c2d3a4c 184/184: Merge commit 'cd634c6f51458f81898ecf2821ac3169cb65a1eb' from ivy |
Date: |
Wed, 16 Oct 2019 13:15:19 -0400 (EDT) |
branch: master
commit c2d3a4cc2bd1146ce42873f5e9bebd8ed048a8ca
Merge: 22e3e88 cd634c6
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Merge commit 'cd634c6f51458f81898ecf2821ac3169cb65a1eb' from ivy
---
packages/ivy/.dir-locals.el | 14 -
packages/ivy/.gitignore | 5 -
packages/ivy/CONTRIBUTING.org | 73 -
packages/ivy/Makefile | 31 -
packages/ivy/README.md | 141 -
packages/ivy/counsel.el | 1057 ++++---
packages/ivy/doc/Changelog.org | 5195 -------------------------------
packages/ivy/doc/Makefile | 2 -
packages/ivy/doc/ivy-help.org | 138 -
packages/ivy/doc/ivy-ox.el | 200 --
packages/ivy/doc/ivy.org | 1368 --------
packages/ivy/doc/scripts.el | 6 -
packages/ivy/ivy-hydra.el | 14 +-
packages/ivy/ivy-overlay.el | 7 +-
packages/ivy/ivy-test.el | 1313 --------
packages/ivy/ivy.el | 699 +++--
packages/ivy/ivy.info | 160 +-
packages/ivy/swiper.el | 459 +--
packages/ivy/targets/checkdoc.el | 8 -
packages/ivy/targets/obsolete-config.el | 5 -
packages/ivy/targets/plain.el | 11 -
21 files changed, 1463 insertions(+), 9443 deletions(-)
diff --git a/packages/ivy/.dir-locals.el b/packages/ivy/.dir-locals.el
deleted file mode 100644
index 3d5e818..0000000
--- a/packages/ivy/.dir-locals.el
+++ /dev/null
@@ -1,14 +0,0 @@
-;;; Directory Local Variables
-;;; For more information see (info "(emacs) Directory Variables")
-
-((nil
- (bug-reference-bug-regexp . "#\\(?2:[[:digit:]]+\\)")
- (bug-reference-url-format . "https://github.com/abo-abo/swiper/issues/%s")
- (copyright-names-regexp . "Free Software Foundation, Inc\\.")
- (sentence-end-double-space . t))
- (emacs-lisp-mode
- (indent-tabs-mode . nil)
- (outline-regexp . ";;[;*]+[\s\t]+")
- ;; extra config here:
https://github.com/abo-abo/oremacs/blob/github/modes/ora-elisp-style-guide.el
- ;; (lisp-indent-function . common-lisp-indent-function)
- ))
diff --git a/packages/ivy/.gitignore b/packages/ivy/.gitignore
deleted file mode 100644
index 5638667..0000000
--- a/packages/ivy/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-*.elc
-*~
-/doc/dir
-*-autoloads.el
-.dir-locals-2.el
diff --git a/packages/ivy/CONTRIBUTING.org b/packages/ivy/CONTRIBUTING.org
deleted file mode 100644
index 8d30208..0000000
--- a/packages/ivy/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/packages/ivy/Makefile b/packages/ivy/Makefile
deleted file mode 100644
index 2ad6a00..0000000
--- a/packages/ivy/Makefile
+++ /dev/null
@@ -1,31 +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
-
-test:
- $(emacs) -batch $(LOAD) -l ivy-test.el -f ert-run-tests-batch-and-exit
-
-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/packages/ivy/README.md b/packages/ivy/README.md
deleted file mode 100644
index 658504f..0000000
--- a/packages/ivy/README.md
+++ /dev/null
@@ -1,141 +0,0 @@
-[![Build
Status](https://travis-ci.org/abo-abo/swiper.svg?branch=master)](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
-
-[![MELPA](https://melpa.org/packages/ivy-badge.svg)](https://melpa.org/#/ivy)
-[![MELPA
Stable](https://stable.melpa.org/packages/ivy-badge.svg)](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
-
-[![MELPA](https://melpa.org/packages/counsel-badge.svg)](https://melpa.org/#/counsel)
-[![MELPA
Stable](https://stable.melpa.org/packages/counsel-badge.svg)](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
-
-[![MELPA](https://melpa.org/packages/swiper-badge.svg)](https://melpa.org/#/swiper)
-[![MELPA
Stable](https://stable.melpa.org/packages/swiper-badge.svg)](https://stable.melpa.org/#/swiper)
-
-Swiper is an alternative to isearch that uses ivy to show an overview
-of all matches.
-
-![swiper.png](https://oremacs.com/download/swiper.png)
-
-A helm version of swiper is also available:
-[swiper-helm](https://github.com/abo-abo/swiper-helm).
-
-## Screenshots
-
-![ivy-swiper-1.png](https://oremacs.com/download/ivy-swiper-1.png)
-
-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/packages/ivy/counsel.el b/packages/ivy/counsel.el
index 272a607..3ee1533 100644
--- a/packages/ivy/counsel.el
+++ b/packages/ivy/counsel.el
@@ -4,8 +4,8 @@
;; Author: Oleh Krehel <address@hidden>
;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.12.0
-;; Package-Requires: ((emacs "24.3") (swiper "0.12.0"))
+;; Version: 0.13.0
+;; Package-Requires: ((emacs "24.5") (swiper "0.13.0"))
;; Keywords: convenience, matching, tools
;; This file is part of GNU Emacs.
@@ -30,11 +30,11 @@
;;
;; Currently available:
;; - Symbol completion for Elisp, Common Lisp, Python, Clojure, C, C++.
-;; - Describe fuctions for Elisp: function, variable, library, command,
+;; - Describe functions for Elisp: function, variable, library, command,
;; bindings, theme.
;; - Navigation functions: imenu, ace-line, semantic, outline.
;; - Git utilities: git-files, git-grep, git-log, git-stash, git-checkout.
-;; - Grep utitilies: grep, ag, pt, recoll, ack, rg.
+;; - Grep utilities: grep, ag, pt, recoll, ack, rg.
;; - System utilities: process list, rhythmbox, linux-app.
;; - Many more.
@@ -50,10 +50,6 @@
:prefix "counsel-")
;;* Utility
-(define-obsolete-variable-alias 'counsel-more-chars-alist
'ivy-more-chars-alist "0.10.0")
-
-(define-obsolete-function-alias 'counsel-more-chars 'ivy-more-chars "0.10.0")
-
(defun counsel--elisp-to-pcre (regex &optional look-around)
"Convert REGEX from Elisp format to PCRE format, on best-effort basis.
REGEX may be of any format returned by an Ivy regex function,
@@ -115,7 +111,7 @@ complex regexes."
str))
(defun counsel-require-program (cmd)
- "Check system for program used in CMD, printing error if unfound.
+ "Check system for program used in CMD, printing error if not found.
CMD is either a string or a list of strings.
To skip the `executable-find' check, start the string with a space."
(unless (and (stringp cmd) (string-match-p "^ " cmd))
@@ -127,11 +123,6 @@ To skip the `executable-find' check, start the string with
a space."
(executable-find program))
(user-error "Required program \"%s\" not found in your path"
program)))))
-(defun counsel-prompt-function-default ()
- "Return prompt appended with a semicolon."
- (declare (obsolete ivy-set-prompt "0.10.0"))
- (ivy-add-prompt-count (concat (ivy-state-prompt ivy-last) ": ")))
-
(declare-function eshell-split-path "esh-util")
(defun counsel-prompt-function-dir ()
@@ -162,6 +153,9 @@ The time is measured in seconds.")
This plist maps commands to a plist mapping their exit codes to
descriptions.")
+(defvar counsel--async-last-error-string nil
+ "When the process returned non-0, store the output here.")
+
(defun counsel-set-async-exit-code (cmd number str)
"For CMD, associate NUMBER exit code with STR."
(let ((plist (plist-get counsel--async-exit-code-plist cmd)))
@@ -170,21 +164,15 @@ descriptions.")
cmd
(plist-put plist number str)))))
-(defvar counsel-async-split-string-re "\n"
- "Store the regexp for splitting shell command output.")
-(make-obsolete-variable
- 'counsel-async-split-string-re 'counsel-async-split-string-re-alist
"<2019-07-16 Tue>")
-
(defvar counsel-async-split-string-re-alist '((t . "\n"))
"Store the regexp for splitting shell command output.")
-(defvar counsel-async-ignore-re nil
- "Regexp matching candidates to ignore in `counsel--async-filter'.")
-(make-obsolete-variable 'counsel-async-ignore-re
'counsel-async-ignore-re-alist "<2019-07-16 Tue>")
-
(defvar counsel-async-ignore-re-alist nil
"An alist of regexp matching candidates to ignore in
`counsel--async-filter'.")
+(defvar counsel--async-last-command nil
+ "Store the last command ran by `counsel--async-command'.")
+
(defun counsel--async-command (cmd &optional sentinel filter name)
"Start and return new counsel process by calling CMD.
CMD can be either a shell command as a string, or a list of the
@@ -198,6 +186,7 @@ respectively."
(setq name (or name " *counsel*"))
(when (get-buffer name)
(kill-buffer name))
+ (setq counsel--async-last-command cmd)
(let* ((buf (get-buffer-create name))
(proc (if (listp cmd)
(apply #'start-file-process name buf cmd)
@@ -208,8 +197,6 @@ respectively."
(set-process-filter proc (or filter #'counsel--async-filter))
proc))
-(defvar counsel-grep-last-line nil)
-
(defun counsel--split-string (&optional str)
(split-string
(or str (buffer-string))
@@ -225,7 +212,6 @@ respectively."
(ivy--sort-maybe
(with-current-buffer (process-buffer process)
(counsel--split-string))))
- (setq counsel-grep-last-line nil)
(when counsel--async-start
(setq counsel--async-duration
(time-to-seconds (time-since counsel--async-start))))
@@ -243,6 +229,8 @@ respectively."
(if ivy--all-candidates
(ivy--exhibit)
(ivy--insert-minibuffer "")))
+ (setq counsel--async-last-error-string
+ (with-current-buffer (process-buffer process) (buffer-string)))
(setq ivy--all-candidates
(let ((status (process-exit-status process))
(plist (plist-get counsel--async-exit-code-plist
@@ -307,16 +295,16 @@ Update the minibuffer with the amount of lines collected
every
(if (string= str "")
(mapatoms
(lambda (x)
- (when (symbolp x)
+ (when (and (symbolp x) (funcall pred x))
(push (symbol-name x) symbol-names))))
(setq symbol-names (all-completions str obarray pred)))
(ivy-read "Symbol name: " symbol-names
- :caller 'counsel-el
- :predicate pred
:initial-input str
- :action #'ivy-completion-in-region-action)))
+ :action #'ivy-completion-in-region-action
+ :caller 'counsel-el)))
-(add-to-list 'ivy-height-alist '(counsel-el . 7))
+(ivy-configure 'counsel-el
+ :height 7)
;;** `counsel-cl'
(declare-function slime-symbol-start-pos "ext:slime")
@@ -362,11 +350,7 @@ Update the minibuffer with the amount of lines collected
every
ivy-completion-end))
(setq ivy-completion-beg (point))
(insert symbol-name)
- (setq ivy-completion-end (point))
- (when (equal (get-text-property 0 'symbol symbol-name) "f")
- (insert "()")
- (setq ivy-completion-end (point))
- (backward-char)))))
+ (setq ivy-completion-end (point)))))
;;** `counsel-clj'
(declare-function cider-sync-request:complete "ext:cider-client")
@@ -385,7 +369,8 @@ Update the minibuffer with the amount of lines collected
every
(delete-region (car bnd) (cdr bnd)))
(insert res))))
-(add-to-list 'ivy-height-alist '(counsel--generic . 7))
+(ivy-configure 'counsel--generic
+ :height 7)
;;;###autoload
(defun counsel-clj ()
@@ -421,9 +406,11 @@ Update the minibuffer with the amount of lines collected
every
(setq ivy-completion-end (point))
(ivy-read "Candidate: " company-candidates
:action #'ivy-completion-in-region-action
- :unwind #'company-abort
:caller 'counsel-company))))
+(ivy-configure 'counsel-company
+ :unwind-fn #'company-abort)
+
;;** `counsel-irony'
(declare-function irony-completion-candidates-async "ext:irony-completion")
(declare-function irony-completion-symbol-bounds "ext:irony-completion")
@@ -479,6 +466,7 @@ Used by commands `counsel-describe-variable' and
"Jump to the definition of the current symbol."
(interactive)
(ivy-exit-with-action #'counsel--find-symbol))
+(put 'counsel-find-symbol 'no-counsel-M-x t)
(defun counsel--info-lookup-symbol ()
"Lookup the current symbol in the info docs."
@@ -521,9 +509,6 @@ Used by commands `counsel-describe-variable' and
(error "Couldn't find definition of %s"
sym))))))))
-(define-obsolete-function-alias 'counsel-symbol-at-point
- 'ivy-thing-at-point "0.7.0")
-
(defun counsel--variable-p (symbol)
"Return non-nil if SYMBOL is a bound or documented variable."
(or (and (boundp symbol)
@@ -540,9 +525,6 @@ Used by commands `counsel-describe-variable' and
(ivy-append-face var 'ivy-highlight-face)
var))
-(ivy-set-display-transformer
- 'counsel-describe-variable 'counsel-describe-variable-transformer)
-
;;;###autoload
(defun counsel-describe-variable ()
"Forward to `describe-variable'.
@@ -557,11 +539,15 @@ Variables declared using `defcustom' are highlighted
according to
:history 'counsel-describe-symbol-history
:keymap counsel-describe-map
:preselect (ivy-thing-at-point)
- :sort t
:action (lambda (x)
(funcall counsel-describe-variable-function (intern
x)))
:caller 'counsel-describe-variable)))
+(ivy-configure 'counsel-describe-variable
+ :initial-input "^"
+ :display-transformer-fn #'counsel-describe-variable-transformer
+ :sort-fn #'ivy-string<)
+
;;** `counsel-describe-function'
(ivy-set-actions
'counsel-describe-function
@@ -578,9 +564,6 @@ Variables declared using `defcustom' are highlighted
according to
(ivy-append-face function-name 'ivy-highlight-face)
function-name))
-(ivy-set-display-transformer
- 'counsel-describe-function 'counsel-describe-function-transformer)
-
(defun ivy-function-called-at-point ()
(let ((f (function-called-at-point)))
(and f (symbol-name f))))
@@ -607,11 +590,15 @@ to `ivy-highlight-face'."
:history 'counsel-describe-symbol-history
:keymap counsel-describe-map
:preselect (funcall counsel-describe-function-preselect)
- :sort t
:action (lambda (x)
(funcall counsel-describe-function-function (intern
x)))
:caller 'counsel-describe-function)))
+(ivy-configure 'counsel-describe-function
+ :initial-input "^"
+ :display-transformer-fn #'counsel-describe-function-transformer
+ :sort-fn #'ivy-string<)
+
;;** `counsel-set-variable'
(defvar counsel-set-variable-history nil
"Store history for `counsel-set-variable'.")
@@ -739,7 +726,6 @@ a symbol and how to search for them."
(symbol-plist sym)))
:history 'counsel-apropos-history
:preselect (ivy-thing-at-point)
- :sort t
:action (lambda (pattern)
(when (string= pattern "")
(user-error "Please specify a pattern"))
@@ -754,6 +740,9 @@ a symbol and how to search for them."
(apropos (concat "\\`" pattern "\\'"))))
:caller 'counsel-apropos))
+(ivy-configure 'counsel-apropos
+ :sort-fn #'ivy-string<)
+
;;** `counsel-info-lookup-symbol'
(defvar info-lookup-mode)
(declare-function info-lookup-guess-default "info-look")
@@ -782,17 +771,24 @@ With prefix arg MODE a query for the symbol help mode is
offered."
(list (ivy-read "Describe symbol: " (info-lookup->completions topic
mode)
:history 'info-lookup-history
:preselect (info-lookup-guess-default topic mode)
- :sort t
:caller 'counsel-info-lookup-symbol)
mode))))
(info-lookup-symbol symbol mode))
+(ivy-configure 'counsel-info-lookup-symbol
+ :sort-fn #'ivy-string<)
+
;;** `counsel-M-x'
(defface counsel-key-binding
'((t :inherit font-lock-keyword-face))
"Face used by `counsel-M-x' for key bindings."
:group 'ivy-faces)
+(defface counsel-active-mode
+ '((t :inherit font-lock-builtin-face))
+ "Face used by `counsel-M-x' for activated modes."
+ :group 'ivy-faces)
+
(defcustom counsel-alias-expand t
"When non-nil, show the expansion of aliases in `counsel-M-x'."
:type 'boolean
@@ -800,8 +796,15 @@ With prefix arg MODE a query for the symbol help mode is
offered."
(defun counsel-M-x-transformer (cmd)
"Return CMD annotated with its active key binding, if any."
- (let ((alias (symbol-function (intern cmd)))
- (key (where-is-internal (intern cmd) nil t)))
+ (let* ((sym (intern cmd))
+ (alias (symbol-function sym))
+ (key (where-is-internal sym nil t)))
+ (when (or (eq sym major-mode)
+ (and
+ (memq sym minor-mode-list)
+ (boundp sym)
+ (buffer-local-value sym (ivy-state-buffer ivy-last))))
+ (setq cmd (propertize cmd 'face 'counsel-active-mode)))
(concat cmd
(when (and (symbolp alias) counsel-alias-expand)
(format " (%s)" alias))
@@ -867,6 +870,18 @@ packages are, in order of precedence, `amx' and `smex'."
(defvar counsel-M-x-history nil
"History for `counsel-M-x'.")
+(defun counsel-M-x-action (cmd)
+ "Execute CMD."
+ (setq cmd (intern cmd))
+ (cond ((bound-and-true-p amx-initialized)
+ (amx-rank cmd))
+ ((bound-and-true-p smex-initialized-p)
+ (smex-rank cmd)))
+ (setq prefix-arg current-prefix-arg)
+ (setq this-command cmd)
+ (setq real-this-command cmd)
+ (command-execute cmd 'record))
+
;;;###autoload
(defun counsel-M-x (&optional initial-input)
"Ivy version of `execute-extended-command'.
@@ -881,35 +896,28 @@ when available, in that order of precedence."
(setq real-this-command real-last-command)
(let ((externs (counsel--M-x-externs)))
(ivy-read (counsel--M-x-prompt) (or externs obarray)
- :predicate (and (not externs)
- (lambda (sym)
- (and (commandp sym)
- (not (get sym 'byte-obsolete-info)))))
+ :predicate (if externs
+ (lambda (x)
+ (not (get (intern x) 'no-counsel-M-x)))
+ (lambda (sym)
+ (and (commandp sym)
+ (not (get sym 'byte-obsolete-info))
+ (not (get sym 'no-counsel-M-x)))))
:require-match t
:history 'counsel-M-x-history
- :action (lambda (cmd)
- (setq cmd (intern cmd))
- (cond ((bound-and-true-p amx-initialized)
- (amx-rank cmd))
- ((bound-and-true-p smex-initialized-p)
- (smex-rank cmd)))
- (setq prefix-arg current-prefix-arg)
- (setq this-command cmd)
- (setq real-this-command cmd)
- (command-execute cmd 'record))
- :sort (not externs)
+ :action #'counsel-M-x-action
:keymap counsel-describe-map
:initial-input initial-input
:caller 'counsel-M-x)))
+(ivy-configure 'counsel-M-x
+ :initial-input "^"
+ :display-transformer-fn #'counsel-M-x-transformer)
+
(ivy-set-actions
'counsel-M-x
`(("d" counsel--find-symbol "definition")
- ("h" ,(lambda (x) (describe-function (intern x))) "help")))
-
-(ivy-set-display-transformer
- 'counsel-M-x
- 'counsel-M-x-transformer)
+ ("h" ,(lambda (x) (funcall counsel-describe-function-function (intern x)))
"help")))
;;** `counsel-command-history'
(defun counsel-command-history-action-eval (cmd)
@@ -1151,10 +1159,12 @@ back to the face of the character after point, and
finally the
:require-match t
:history 'face-name-history
:preselect (counsel--face-at-point)
- :sort t
:action counsel-describe-face-function
:caller 'counsel-describe-face))
+(ivy-configure 'counsel-describe-face
+ :sort-fn #'ivy-string<)
+
(defun counsel-customize-face (name)
"Customize face with NAME."
(customize-face (intern name)))
@@ -1172,8 +1182,7 @@ back to the face of the character after point, and
finally the
(defvar counsel--faces-format "%-40s %s")
(defun counsel--faces-format-function (names)
- "Customize `ivy-format-functions-alist' for `counsel-faces'.
-Each candidate is formatted based on the given FORMAT string."
+ "Format NAMES according to `counsel--faces-format'."
(let ((formatter
(lambda (name)
(format counsel--faces-format name
@@ -1198,11 +1207,12 @@ selected face."
:require-match t
:history 'face-name-history
:preselect (counsel--face-at-point)
- :sort t
:action counsel-describe-face-function
:caller 'counsel-faces)))
-(add-to-list 'ivy-format-functions-alist '(counsel-faces .
counsel--faces-format-function))
+(ivy-configure 'counsel-faces
+ :sort-fn #'ivy-string<
+ :format-fn #'counsel--faces-format-function)
(ivy-set-actions
'counsel-faces
@@ -1250,13 +1260,16 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
:action #'counsel-git-action
:caller 'counsel-git)))
+(ivy-configure 'counsel-git
+ :occur #'counsel-git-occur)
+
(defun counsel-git-action (x)
"Find file X in current Git repository."
(with-ivy-window
(let ((default-directory (ivy-state-directory ivy-last)))
(find-file x))))
-(defun counsel-git-occur ()
+(defun counsel-git-occur (&optional _cands)
"Occur function for `counsel-git' using `counsel-cmd-to-dired'."
(cd (ivy-state-directory ivy-last))
(counsel-cmd-to-dired
@@ -1294,19 +1307,15 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
(forward-line 2)
(dired-move-to-filename)))))))
-(ivy-set-occur 'counsel-git 'counsel-git-occur)
-
;;** `counsel-git-grep'
(defvar counsel-git-grep-map
(let ((map (make-sparse-keymap)))
(define-key map (kbd "C-l") 'ivy-call-and-recenter)
(define-key map (kbd "M-q") 'counsel-git-grep-query-replace)
(define-key map (kbd "C-c C-m") 'counsel-git-grep-switch-cmd)
+ (define-key map (kbd "C-x C-d") 'counsel-cd)
map))
-(ivy-set-occur 'counsel-git-grep 'counsel-git-grep-occur)
-(ivy-set-display-transformer 'counsel-git-grep 'counsel-git-grep-transformer)
-
(defvar counsel-git-grep-cmd-default "git --no-pager grep --full-name -n
--no-color -i -I -e \"%s\""
"Initial command for `counsel-git-grep'.")
@@ -1334,7 +1343,11 @@ Typical value: '(recenter)."
(defun counsel-git-grep-cmd-function-default (str)
(format counsel-git-grep-cmd
- (setq ivy--old-re (ivy--regex str t))))
+ (setq ivy--old-re
+ (if (eq ivy--regex-function #'ivy--regex-fuzzy)
+ (replace-regexp-in-string
+ "\n" "" (ivy--regex-fuzzy str))
+ (ivy--regex str t)))))
(defun counsel-git-grep-cmd-function-ignore-order (str)
(setq ivy--old-re (ivy--regex str t))
@@ -1362,7 +1375,9 @@ Typical value: '(recenter)."
(ivy-state-directory ivy-last)))
(goto-char (point-min))
(forward-line (1- (string-to-number line-number)))
- (re-search-forward (ivy--regex ivy-text t) (line-end-position) t)
+ (when (re-search-forward (ivy--regex ivy-text t) (line-end-position) t)
+ (when swiper-goto-start-of-match
+ (goto-char (match-beginning 0))))
(swiper--ensure-visible)
(run-hooks 'counsel-grep-post-action-hook)
(unless (eq ivy-exit 'done)
@@ -1390,7 +1405,7 @@ files in a project.")
proj)
(cond
((stringp cmd))
- (cmd
+ (current-prefix-arg
(if (setq proj
(cl-find-if
(lambda (x)
@@ -1407,13 +1422,12 @@ files in a project.")
(setq cmd counsel-git-grep-cmd-default)))
(cons proj cmd)))
-(define-obsolete-function-alias 'counsel--call 'counsel--command "0.11.0")
-
-(defun counsel--command (&rest command)
+(defun counsel--call (command &optional result-fn)
"Synchronously call COMMAND and return its output as a string.
COMMAND comprises the program name followed by its arguments, as
in `make-process'. Signal `file-error' and emit a warning if
-COMMAND fails. Obey file handlers based on `default-directory'."
+COMMAND fails. Obey file handlers based on `default-directory'.
+On success, RESULT-FN is called in output buffer with no arguments."
(let ((stderr (make-temp-file "counsel-call-stderr-"))
status)
(unwind-protect
@@ -1421,12 +1435,14 @@ COMMAND fails. Obey file handlers based on
`default-directory'."
(setq status (apply #'process-file (car command) nil
(list t stderr) nil (cdr command)))
(if (eq status 0)
- ;; Return all output except trailing newline.
- (buffer-substring (point-min)
- (- (point)
- (if (eq (bobp) (bolp))
- 0
- 1)))
+ (if result-fn
+ (funcall result-fn)
+ ;; Return all output except trailing newline.
+ (buffer-substring (point-min)
+ (- (point)
+ (if (eq (bobp) (bolp))
+ 0
+ 1))))
;; Convert process status into error list.
(setq status (list 'file-error
(mapconcat #'identity `(,@command "failed") "
")
@@ -1444,13 +1460,22 @@ COMMAND fails. Obey file handlers based on
`default-directory'."
(signal (car status) (cdr status))))
(delete-file stderr))))
+(defun counsel--command (&rest command)
+ "Forward COMMAND to `counsel--call'."
+ (counsel--call command))
+
+(defun counsel--grep-unwind ()
+ (counsel-delete-process)
+ (swiper--cleanup))
+
;;;###autoload
-(defun counsel-git-grep (&optional cmd initial-input)
+(defun counsel-git-grep (&optional initial-input initial-directory cmd)
"Grep for a string in the current Git repository.
+INITIAL-INPUT can be given as the initial minibuffer input.
+INITIAL-DIRECTORY, if non-nil, is used as the root directory for search.
When CMD is a string, use it as a \"git grep\" command.
-When CMD is non-nil, prompt for a specific \"git grep\" command.
-INITIAL-INPUT can be given as the initial minibuffer input."
- (interactive "P")
+When CMD is non-nil, prompt for a specific \"git grep\" command."
+ (interactive)
(let ((proj-and-cmd (counsel--git-grep-cmd-and-proj cmd))
proj)
(setq proj (car proj-and-cmd))
@@ -1460,22 +1485,25 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
(if proj
#'counsel-git-grep-proj-function
#'counsel-git-grep-function))
- (unwind-function
- (lambda ()
- (counsel-delete-process)
- (swiper--cleanup)))
- (default-directory (if proj
- (car proj)
- (counsel-locate-git-root))))
+ (default-directory (or initial-directory
+ (if proj
+ (car proj)
+ (counsel-locate-git-root)))))
(ivy-read "git grep: " collection-function
:initial-input initial-input
:dynamic-collection t
:keymap counsel-git-grep-map
:action #'counsel-git-grep-action
- :unwind unwind-function
:history 'counsel-git-grep-history
:caller 'counsel-git-grep))))
-(cl-pushnew 'counsel-git-grep ivy-highlight-grep-commands)
+
+(ivy-configure 'counsel-git-grep
+ :occur #'counsel-git-grep-occur
+ :unwind-fn #'counsel--grep-unwind
+ :index-fn #'ivy-recompute-index-swiper-async
+ :display-transformer-fn #'counsel-git-grep-transformer
+ :grep-p t
+ :exit-codes '(1 "No matches found"))
(defun counsel-git-grep-proj-function (str)
"Grep for STR in the current Git repository."
@@ -1510,16 +1538,11 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
(setq str (replace-match "" t t str 1))))
str)
-(defun counsel-git-grep-occur ()
- "Generate a custom occur buffer for `counsel-git-grep'.
-When REVERT is non-nil, regenerate the current *ivy-occur* buffer."
- (unless (eq major-mode 'ivy-occur-grep-mode)
- (ivy-occur-grep-mode)
- (setq default-directory (ivy-state-directory ivy-last)))
- (setq ivy-text
- (and (string-match "\"\\(.*\\)\"" (buffer-name))
- (match-string 1 (buffer-name))))
- (let* ((regex (funcall ivy--regex-function ivy-text))
+(defun counsel--git-grep-occur-cmd (input)
+ (let* ((regex (funcall ivy--regex-function input))
+ (regex (if (eq ivy--regex-function #'ivy--regex-fuzzy)
+ (replace-regexp-in-string "\n" "" regex)
+ regex))
(positive-pattern (replace-regexp-in-string
;; git-grep can't handle .*?
"\\.\\*\\?" ".*"
@@ -1530,16 +1553,12 @@ When REVERT is non-nil, regenerate the current
*ivy-occur* buffer."
(and (null (cdr x))
(format "| grep -v %s" (car x))))
regex
- " ")))
- (cmd (concat (format counsel-git-grep-cmd positive-pattern)
negative-patterns))
- cands)
- (setq cands (counsel--split-string (shell-command-to-string cmd)))
- ;; 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
- (mapcar #'counsel--normalize-grep-match cands))))
+ " "))))
+ (concat (format counsel-git-grep-cmd positive-pattern) negative-patterns)))
+
+(defun counsel-git-grep-occur (&optional _cands)
+ "Generate a custom occur buffer for `counsel-git-grep'."
+ (counsel-grep-like-occur #'counsel--git-grep-occur-cmd))
(defun counsel-git-grep-query-replace ()
"Start `query-replace' with string to replace from last search string."
@@ -1591,11 +1610,6 @@ done") "\n" t)))
(defvar counsel-git-log-cmd "GIT_PAGER=cat git log --grep '%s'"
"Command used for \"git log\".")
-(defvar counsel-git-log-split-string-re "^commit "
- "The `split-string' separates when split output of `counsel-git-log-cmd'.")
-(make-obsolete-variable
- 'counsel-git-log-split-string-re 'counsel-async-split-string-re-alist
"<2019-07-16 Tue>")
-
(defun counsel-git-log-function (str)
"Search for STR in git log."
(or
@@ -1718,11 +1732,13 @@ currently checked out."
(ivy-read "Grep log: " #'counsel-git-log-function
:dynamic-collection t
:action #'counsel-git-log-action
- :unwind #'counsel-delete-process
:caller 'counsel-git-log))
-(add-to-list 'ivy-format-functions-alist '(counsel-git-log .
counsel--git-log-format-function))
-(add-to-list 'ivy-height-alist '(counsel-git-log . 4))
+(ivy-configure 'counsel-git-log
+ :height 4
+ :unwind-fn #'counsel-delete-process
+ :format-fn #'counsel--git-log-format-function)
+
(add-to-list 'counsel-async-split-string-re-alist '(counsel-git-log . "^commit
"))
(add-to-list 'counsel-async-ignore-re-alist '(counsel-git-log . "^[ \n]*$"))
@@ -1735,9 +1751,6 @@ currently checked out."
(define-key map (kbd "`") (ivy-make-magic-action 'counsel-find-file "b"))
map))
-(define-obsolete-function-alias 'counsel-yank-directory
'ivy-insert-current-full
- "<2019-06-13 Thu>")
-
(when (executable-find "git")
(add-to-list 'ivy-ffap-url-functions 'counsel-github-url-p)
(add-to-list 'ivy-ffap-url-functions 'counsel-emacs-url-p))
@@ -1819,12 +1832,12 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise
default to
'counsel-find-file-move))
(defun counsel-find-file-mkdir-action (_x)
- "Create a directory from `ivy-text'."
+ "Create a directory and any nonexistent parent dirs from `ivy-text'."
(let ((dir (file-name-as-directory
(expand-file-name ivy-text ivy--directory)))
(win (and (not (eq ivy-exit 'done))
(active-minibuffer-window))))
- (make-directory dir)
+ (make-directory dir t)
(when win (with-selected-window win (ivy--cd dir)))))
(ivy-set-actions
@@ -1834,6 +1847,7 @@ choose between `yes-or-no-p' and `y-or-n-p'; otherwise
default to
("b" counsel-find-file-cd-bookmark-action "cd bookmark")
("x" counsel-find-file-extern "open externally")
("r" counsel-find-file-as-root "open as root")
+ ("R" find-file-read-only "read only")
("k" counsel-find-file-delete "delete")
("c" counsel-find-file-copy "copy file")
("m" counsel-find-file-move "move or rename")
@@ -1866,6 +1880,9 @@ but the leading dot is a lot faster."
,(regexp-opt completion-ignored-extensions))
(regexp :tag "Regex")))
+(defvar counsel--find-file-predicate nil
+ "When non-nil, `counsel--find-file-matcher' will use this predicate.")
+
(defun counsel--find-file-matcher (regexp candidates)
"Return REGEXP matching CANDIDATES.
Skip some dotfiles unless `ivy-text' requires them."
@@ -1875,6 +1892,9 @@ Skip some dotfiles unless `ivy-text' requires them."
(lambda (re-str)
(lambda (x)
(string-match re-str (directory-file-name x)))))))
+ (when counsel--find-file-predicate
+ (let ((default-directory ivy--directory))
+ (setq res (cl-remove-if-not counsel--find-file-predicate res))))
(if (or (null ivy-use-ignore)
(null counsel-find-file-ignore-regexp)
(string-match-p "\\`\\." ivy-text))
@@ -1910,7 +1930,7 @@ Skip some dotfiles unless `ivy-text' requires them."
(defun counsel--preselect-file ()
"Return candidate to preselect during filename completion.
-The preselect behaviour can be customized via user options
+The preselect behavior can be customized via user options
`counsel-find-file-at-point' and
`counsel-preselect-current-file', which see."
(or
@@ -1923,15 +1943,19 @@ The preselect behaviour can be customized via user
options
(file-name-nondirectory buffer-file-name))))
(defun counsel--find-file-1 (prompt initial-input action caller)
- (ivy-read prompt #'read-file-name-internal
- :matcher #'counsel--find-file-matcher
- :initial-input initial-input
- :action action
- :preselect (counsel--preselect-file)
- :require-match 'confirm-after-completion
- :history 'file-name-history
- :keymap counsel-find-file-map
- :caller caller))
+ (let ((default-directory
+ (if (eq major-mode 'dired-mode)
+ (dired-current-directory)
+ default-directory)))
+ (ivy-read prompt #'read-file-name-internal
+ :matcher #'counsel--find-file-matcher
+ :initial-input initial-input
+ :action action
+ :preselect (counsel--preselect-file)
+ :require-match 'confirm-after-completion
+ :history 'file-name-history
+ :keymap counsel-find-file-map
+ :caller caller)))
;;;###autoload
(defun counsel-find-file (&optional initial-input)
@@ -1943,7 +1967,9 @@ When INITIAL-INPUT is non-nil, use it in the minibuffer
during completion."
#'counsel-find-file-action
'counsel-find-file))
-(ivy-set-occur 'counsel-find-file 'counsel-find-file-occur)
+(ivy-configure 'counsel-find-file
+ :occur #'counsel-find-file-occur
+ :display-transformer-fn #'ivy-read-file-transformer)
(defvar counsel-find-file-occur-cmd "ls -a | %s | xargs -d '\\n' ls -d
--group-directories-first"
"Format string for `counsel-find-file-occur'.")
@@ -1970,29 +1996,31 @@ one that exists will be used.")
"Return a command that filters a file list to match ivy candidates.
If USE-IGNORE is non-nil, try to generate a command that respects
`counsel-find-file-ignore-regexp'."
- (let ((regex ivy--old-re)
- (filter-cmd (cl-find-if
- (lambda (x)
- (executable-find
- (car (split-string (car x)))))
- counsel-file-name-filter-alist))
- cmd)
- (when (and use-ignore ivy-use-ignore
- counsel-find-file-ignore-regexp
- (cdr filter-cmd)
- (not (string-match-p "\\`\\." ivy-text))
- (not (string-match-p counsel-find-file-ignore-regexp
- (or (car ivy--old-cands) ""))))
- (let ((ignore-re (list (counsel--elisp-to-pcre
- counsel-find-file-ignore-regexp))))
- (setq regex (if (stringp regex)
- (list ignore-re (cons regex t))
- (cons ignore-re regex)))))
- (setq cmd (format (car filter-cmd)
- (counsel--elisp-to-pcre regex (cdr filter-cmd))))
- (if (string-match-p "csh\\'" shell-file-name)
- (replace-regexp-in-string "\\?!" "?\\\\!" cmd)
- cmd)))
+ (let ((regex ivy--old-re))
+ (if (= 0 (length regex))
+ "cat"
+ (let ((filter-cmd (cl-find-if
+ (lambda (x)
+ (executable-find
+ (car (split-string (car x)))))
+ counsel-file-name-filter-alist))
+ cmd)
+ (when (and use-ignore ivy-use-ignore
+ counsel-find-file-ignore-regexp
+ (cdr filter-cmd)
+ (not (string-match-p "\\`\\." ivy-text))
+ (not (string-match-p counsel-find-file-ignore-regexp
+ (or (car ivy--old-cands) ""))))
+ (let ((ignore-re (list (counsel--elisp-to-pcre
+ counsel-find-file-ignore-regexp))))
+ (setq regex (if (stringp regex)
+ (list ignore-re (cons regex t))
+ (cons ignore-re regex)))))
+ (setq cmd (format (car filter-cmd)
+ (counsel--elisp-to-pcre regex (cdr filter-cmd))))
+ (if (string-match-p "csh\\'" shell-file-name)
+ (replace-regexp-in-string "\\?!" "?\\\\!" cmd)
+ cmd)))))
(defun counsel--occur-cmd-find ()
(let ((cmd (format
@@ -2012,7 +2040,7 @@ If USE-IGNORE is non-nil, try to generate a command that
respects
" | grep"
(concat " -type " type exclude-dots " | grep") cmd)))
-(defun counsel-find-file-occur ()
+(defun counsel-find-file-occur (&optional _cands)
(require 'find-dired)
(cd ivy--directory)
(if counsel-find-file-occur-use-find
@@ -2074,7 +2102,7 @@ See variable `counsel-up-directory-level'."
"When point is at an issue in a Git-versioned file, return the issue string."
(and (looking-at "#[0-9]+")
(or (eq (vc-backend buffer-file-name) 'Git)
- (eq major-mode 'magit-commit-mode)
+ (memq major-mode '(magit-commit-mode vc-git-log-view-mode))
(bound-and-true-p magit-commit-mode))
(match-string-no-properties 0)))
@@ -2161,10 +2189,14 @@ result as a URL."
"Forward to `dired'.
When INITIAL-INPUT is non-nil, use it in the minibuffer during completion."
(interactive)
- (counsel--find-file-1
- "Dired (directory): " initial-input
- (lambda (d) (dired (expand-file-name d)))
- 'counsel-dired))
+ (let ((counsel--find-file-predicate #'file-directory-p))
+ (counsel--find-file-1
+ "Dired (directory): " initial-input
+ (lambda (d) (dired (expand-file-name d)))
+ 'counsel-dired)))
+
+(ivy-configure 'counsel-dired
+ :display-transformer-fn #'ivy-read-file-transformer)
;;** `counsel-recentf'
(defvar recentf-list)
@@ -2188,6 +2220,49 @@ When INITIAL-INPUT is non-nil, use it in the minibuffer
during completion."
("f" find-file-other-frame "other frame")
("x" counsel-find-file-extern "open externally")))
+(defun counsel-buffer-or-recentf-candidates ()
+ "Return candidates for `counsel-buffer-or-recentf'."
+ (require 'recentf)
+ (recentf-mode)
+ (let ((buffers
+ (delq nil
+ (mapcar (lambda (b)
+ (when (buffer-file-name b)
+ (buffer-file-name b)))
+ (buffer-list)))))
+ (append
+ buffers
+ (cl-remove-if (lambda (f) (member f buffers))
+ (mapcar #'substring-no-properties recentf-list)))))
+
+;;;###autoload
+(defun counsel-buffer-or-recentf ()
+ "Find a buffer visiting a file or file on `recentf-list'."
+ (interactive)
+ (ivy-read "Buffer File or Recentf: " (counsel-buffer-or-recentf-candidates)
+ :action (lambda (s)
+ (with-ivy-window
+ (if (bufferp s)
+ (switch-to-buffer s)
+ (find-file s))))
+ :require-match t
+ :caller 'counsel-buffer-or-recentf))
+
+(ivy-configure 'counsel-buffer-or-recentf
+ :display-transformer-fn #'counsel-buffer-or-recentf-transformer)
+
+(ivy-set-actions
+ 'counsel-buffer-or-recentf
+ '(("j" find-file-other-window "other window")
+ ("f" find-file-other-frame "other frame")
+ ("x" counsel-find-file-extern "open externally")))
+
+(defun counsel-buffer-or-recentf-transformer (var)
+ "Propertize VAR if it's a buffer visiting a file."
+ (if (member var (mapcar #'buffer-file-name (buffer-list)))
+ (ivy-append-face var 'ivy-highlight-face)
+ var))
+
;;** `counsel-bookmark'
(defcustom counsel-bookmark-avoid-dired nil
"If non-nil, open directory bookmarks with `counsel-find-file'.
@@ -2223,7 +2298,7 @@ By default `counsel-bookmark' opens a dired buffer for
directories."
:caller 'counsel-bookmark))
(defun counsel--apply-bookmark-fn (fn)
- "Return a function applyinig FN to a bookmark's location."
+ "Return a function applying FN to a bookmark's location."
(lambda (bookmark)
(funcall fn (bookmark-location bookmark))))
@@ -2279,7 +2354,7 @@ can use `C-x r j i' to open that file."
(interactive)
(ivy-read "File Register: "
;; Use the `register-alist' variable to filter out file
- ;; registers. Each entry for a file registar will have the
+ ;; registers. Each entry for a file register will have the
;; following layout:
;;
;; (NUMBER 'file . "string/path/to/file")
@@ -2291,13 +2366,15 @@ can use `C-x r j i' to open that file."
(if (eq 'file (cadr register-alist-entry))
(cddr register-alist-entry)))
register-alist)
- :sort t
:require-match t
:history 'counsel-file-register
:caller 'counsel-file-register
:action (lambda (register-file)
(with-ivy-window (find-file register-file)))))
+(ivy-configure 'counsel-file-register
+ :sort-fn #'ivy-string<)
+
(ivy-set-actions
'counsel-file-register
'(("j" find-file-other-window "other window")))
@@ -2326,8 +2403,6 @@ string - the full shell command to run."
("r" counsel-find-file-as-root "open as root")
("d" counsel-locate-action-dired "dired")))
-(counsel-set-async-exit-code 'counsel-locate 1 "Nothing found")
-
(defvar counsel-locate-history nil
"History for `counsel-locate'.")
@@ -2371,12 +2446,22 @@ string - the full shell command to run."
(counsel-require-program "mdfind")
(format "mdfind -name '%s'" input))
+(defvar w32-ansi-code-page)
+
(defun counsel-locate-cmd-es (input)
"Return a shell command based on INPUT."
(counsel-require-program "es.exe")
- (format "es.exe -i -r -p %s"
- (counsel--elisp-to-pcre
- (ivy--regex input t))))
+ (let ((raw-string (format "es.exe -i -r -p %s"
+ (counsel--elisp-to-pcre
+ (ivy--regex input t)))))
+ ;; W32 don't use Unicode by default, so we encode search command
+ ;; to local codepage to support searching filename contains non-ASCII
+ ;; characters.
+ (if (and (eq system-type 'windows-nt)
+ (boundp 'w32-ansi-code-page))
+ (encode-coding-string raw-string
+ (intern (format "cp%d" w32-ansi-code-page)))
+ raw-string)))
(defun counsel-locate-function (input)
"Call the \"locate\" shell command with INPUT."
@@ -2391,16 +2476,20 @@ string - the full shell command to run."
"Location where to put the locatedb in case your home folder is encrypted."
:type 'file)
+(defun counsel-file-stale-p (fname seconds)
+ "Return non-nil if FNAME was modified more than SECONDS ago."
+ (> (time-to-seconds
+ (time-subtract
+ (current-time)
+ (nth 5 (file-attributes fname))))
+ seconds))
+
(defun counsel--locate-updatedb ()
(when (file-exists-p "~/.Private")
(let ((db-fname (expand-file-name counsel-locate-db-path)))
(setenv "LOCATE_PATH" db-fname)
(when (or (not (file-exists-p db-fname))
- (> (time-to-seconds
- (time-subtract
- (current-time)
- (nth 5 (file-attributes db-fname))))
- 60))
+ (counsel-file-stale-p db-fname 60))
(message "Updating %s..." db-fname)
(counsel--command
"updatedb" "-l" "0" "-o" db-fname "-U" (expand-file-name "~"))))))
@@ -2420,9 +2509,12 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
(with-ivy-window
(find-file
(concat (file-remote-p default-directory) file)))))
- :unwind #'counsel-delete-process
:caller 'counsel-locate))
+(ivy-configure 'counsel-locate
+ :unwind-fn #'counsel-delete-process
+ :exit-codes '(1 "Nothing found"))
+
;;** `counsel-fzf'
(defvar counsel-fzf-cmd "fzf -f \"%s\""
"Command for `counsel-fzf'.")
@@ -2458,9 +2550,9 @@ FZF-PROMPT, if non-nil, is passed as `ivy-read' prompt
argument."
(let ((fzf-basename (car (split-string counsel-fzf-cmd))))
(list nil
(when current-prefix-arg
- (read-directory-name (concat
- fzf-basename
- " in directory: "))))))
+ (counsel-read-directory-name (concat
+ fzf-basename
+ " in directory: "))))))
(counsel-require-program counsel-fzf-cmd)
(setq counsel--fzf-dir
(or initial-directory
@@ -2471,16 +2563,20 @@ FZF-PROMPT, if non-nil, is passed as `ivy-read' prompt
argument."
:re-builder #'ivy--regex-fuzzy
:dynamic-collection t
:action #'counsel-fzf-action
- :unwind #'counsel-delete-process
:caller 'counsel-fzf))
+(ivy-configure 'counsel-fzf
+ :occur #'counsel-fzf-occur
+ :unwind-fn #'counsel-delete-process
+ :exit-codes '(1 "Nothing found"))
+
(defun counsel-fzf-action (x)
"Find file X in current fzf directory."
(with-ivy-window
(let ((default-directory counsel--fzf-dir))
(find-file x))))
-(defun counsel-fzf-occur ()
+(defun counsel-fzf-occur (&optional _cands)
"Occur function for `counsel-fzf' using `counsel-cmd-to-dired'."
(cd counsel--fzf-dir)
(counsel-cmd-to-dired
@@ -2489,15 +2585,11 @@ FZF-PROMPT, if non-nil, is passed as `ivy-read' prompt
argument."
"%s --print0 | xargs -0 ls"
(format counsel-fzf-cmd ivy-text)))))
-(ivy-set-occur 'counsel-fzf 'counsel-fzf-occur)
-
(ivy-set-actions
'counsel-fzf
'(("x" counsel-locate-action-extern "xdg-open")
("d" counsel-locate-action-dired "dired")))
-(counsel-set-async-exit-code 'counsel-fzf 1 "Nothing found")
-
;;** `counsel-dpkg'
;;;###autoload
(defun counsel-dpkg ()
@@ -2540,28 +2632,40 @@ FZF-PROMPT, if non-nil, is passed as `ivy-read' prompt
argument."
(message (cdr x)))
:caller 'counsel-rpm)))
-(defcustom counsel-file-jump-args ". -name '.git' -prune -o -type f -print |
cut -c 3-"
+(defun counsel--find-return-list (args)
+ (unless (listp args)
+ (user-error "`counsel-file-jump-args' is a list now, please customize
accordingly."))
+ (counsel--call
+ (cons find-program args)
+ (lambda ()
+ (let (files)
+ (goto-char (point-min))
+ (while (< (point) (point-max))
+ (when (looking-at "\\./")
+ (goto-char (match-end 0)))
+ (push (buffer-substring (point) (line-end-position)) files)
+ (beginning-of-line 2))
+ (nreverse files)))))
+
+(defcustom counsel-file-jump-args (split-string ". -name .git -prune -o -type
f -print")
"Arguments for the `find-command' when using `counsel-file-jump'."
- :type 'string)
+ :type '(repeat string))
;;** `counsel-file-jump'
;;;###autoload
(defun counsel-file-jump (&optional initial-input initial-directory)
"Jump to a file below the current directory.
-List all files within the current directory or any of its subdirectories.
+List all files within the current directory or any of its sub-directories.
INITIAL-INPUT can be given as the initial minibuffer input.
INITIAL-DIRECTORY, if non-nil, is used as the root directory for search."
(interactive
(list nil
(when current-prefix-arg
- (read-directory-name "From directory: "))))
+ (counsel-read-directory-name "From directory: "))))
(counsel-require-program find-program)
(let ((default-directory (or initial-directory default-directory)))
(ivy-read "Find file: "
- (split-string
- (shell-command-to-string
- (concat find-program " " counsel-file-jump-args))
- "\n" t)
+ (counsel--find-return-list counsel-file-jump-args)
:matcher #'counsel--find-file-matcher
:initial-input initial-input
:action #'find-file
@@ -2577,28 +2681,26 @@ INITIAL-DIRECTORY, if non-nil, is used as the root
directory for search."
(dired (or (file-name-directory x) default-directory)))
"open in dired")))
-(defcustom counsel-dired-jump-args ". -name '.git' -prune -o -type d -print |
cut -c 3-"
+(defcustom counsel-dired-jump-args (split-string ". -name .git -prune -o -type
d -print")
"Arguments for the `find-command' when using `counsel-dired-jump'."
- :type 'string)
+ :type '(repeat string))
;;** `counsel-dired-jump'
;;;###autoload
(defun counsel-dired-jump (&optional initial-input initial-directory)
"Jump to a directory (see `dired-jump') below the current directory.
-List all subdirectories within the current directory.
+List all sub-directories within the current directory.
INITIAL-INPUT can be given as the initial minibuffer input.
INITIAL-DIRECTORY, if non-nil, is used as the root directory for search."
(interactive
(list nil
(when current-prefix-arg
- (read-directory-name "From directory: "))))
+ (counsel-read-directory-name "From directory: "))))
(counsel-require-program find-program)
(let ((default-directory (or initial-directory default-directory)))
(ivy-read "Find directory: "
- (split-string
- (shell-command-to-string
- (concat find-program " " counsel-dired-jump-args))
- "\n" t)
+ (cdr
+ (counsel--find-return-list counsel-dired-jump-args))
:matcher #'counsel--find-file-matcher
:initial-input initial-input
:action (lambda (d) (dired-jump nil (expand-file-name d)))
@@ -2651,10 +2753,6 @@ regex string."
(defvar counsel--regex-look-around nil)
-(counsel-set-async-exit-code 'counsel-ag 1 "No matches found")
-(ivy-set-occur 'counsel-ag 'counsel-ag-occur)
-(ivy-set-display-transformer 'counsel-ag 'counsel-git-grep-transformer)
-
(defconst counsel--command-args-separator "-- ")
(defun counsel--split-command-args (arguments)
@@ -2725,9 +2823,9 @@ CALLER is passed to `ivy-read'."
(when current-prefix-arg
(setq initial-directory
(or initial-directory
- (read-directory-name (concat
- (car (split-string counsel-ag-command))
- " in directory: "))))
+ (counsel-read-directory-name (concat
+ (car (split-string
counsel-ag-command))
+ " in directory: "))))
(setq extra-ag-args
(or extra-ag-args
(read-from-minibuffer (format
@@ -2745,21 +2843,36 @@ CALLER is passed to `ivy-read'."
:keymap counsel-ag-map
:history 'counsel-git-grep-history
:action #'counsel-git-grep-action
- :unwind (lambda ()
- (counsel-delete-process)
- (swiper--cleanup))
:caller (or caller 'counsel-ag))))
+(ivy-configure 'counsel-ag
+ :occur #'counsel-ag-occur
+ :unwind-fn #'counsel--grep-unwind
+ :display-transformer-fn #'counsel-git-grep-transformer
+ :grep-p t
+ :exit-codes '(1 "No matches found"))
+
+(defun counsel-read-directory-name (prompt)
+ "Read a directory name from user, a (partial) replacement of
`read-directory-name'."
+ (let ((counsel--find-file-predicate #'file-directory-p))
+ (ivy-read prompt
+ #'read-file-name-internal
+ :matcher #'counsel--find-file-matcher
+ :history 'file-name-history
+ :keymap counsel-find-file-map
+ :caller 'counsel-read-directory-name)))
+
+(ivy-configure 'counsel-read-directory-name
+ :display-transformer-fn #'ivy-read-file-transformer)
+
(defun counsel-cd ()
- "Change the directory for the currently running Ivy command."
+ "Change the directory for the currently running Ivy grep-like command.
+Works for `counsel-git-grep', `counsel-ag', etc."
(interactive)
(let ((input ivy-text)
- (new-dir (read-directory-name "cd: ")))
+ (new-dir (counsel-read-directory-name "cd: ")))
(ivy-quit-and-run
- (let ((default-directory new-dir))
- (funcall (ivy-state-caller ivy-last) input)))))
-
-(cl-pushnew 'counsel-ag ivy-highlight-grep-commands)
+ (funcall (ivy-state-caller ivy-last) input new-dir))))
(defun counsel-grep-like-occur (cmd-template)
(unless (eq major-mode 'ivy-occur-grep-mode)
@@ -2768,23 +2881,21 @@ CALLER is passed to `ivy-read'."
(setq ivy-text
(and (string-match "\"\\(.*\\)\"" (buffer-name))
(match-string 1 (buffer-name))))
- (let* ((command-args (counsel--split-command-args ivy-text))
- (regex (counsel--grep-regex (cdr command-args)))
- (switches (concat (car command-args)
- (counsel--ag-extra-switches regex)))
- (cmd (format cmd-template
+ (let* ((cmd
+ (if (functionp cmd-template)
+ (funcall cmd-template ivy-text)
+ (let* ((command-args (counsel--split-command-args ivy-text))
+ (regex (counsel--grep-regex (cdr command-args)))
+ (switches (concat (car command-args)
+ (counsel--ag-extra-switches regex))))
+ (format cmd-template
(concat
switches
- (shell-quote-argument regex))))
+ (shell-quote-argument regex))))))
(cands (counsel--split-string (shell-command-to-string cmd))))
- ;; 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
- (mapcar #'counsel--normalize-grep-match cands))))
+ (swiper--occur-insert-lines (mapcar #'counsel--normalize-grep-match
cands))))
-(defun counsel-ag-occur ()
+(defun counsel-ag-occur (&optional _cands)
"Generate a custom occur buffer for `counsel-ag'."
(counsel-grep-like-occur
counsel-ag-command))
@@ -2804,7 +2915,11 @@ This uses `counsel-ag' with `counsel-pt-base-command'
instead of
(let ((counsel-ag-base-command counsel-pt-base-command)
(counsel--grep-tool-look-around nil))
(counsel-ag initial-input :caller 'counsel-pt)))
-(cl-pushnew 'counsel-pt ivy-highlight-grep-commands)
+
+(ivy-configure 'counsel-pt
+ :unwind-fn #'counsel--grep-unwind
+ :display-transformer-fn #'counsel-git-grep-transformer
+ :grep-p t)
;;** `counsel-ack'
(defcustom counsel-ack-base-command
@@ -2828,15 +2943,31 @@ This uses `counsel-ag' with `counsel-ack-base-command'
replacing
;;** `counsel-rg'
-(defcustom counsel-rg-base-command "rg -S --no-heading --line-number --color
never %s ."
+(defcustom counsel-rg-base-command
+ (if (memq system-type '(ms-dos windows-nt))
+ "rg --with-filename --no-heading --line-number --path-separator /
--color never %s ."
+ "rg --with-filename --no-heading --line-number --color never %s")
"Alternative to `counsel-ag-base-command' using ripgrep.
Note: don't use single quotes for the regex."
:type 'string)
-(counsel-set-async-exit-code 'counsel-rg 1 "No matches found")
-(ivy-set-occur 'counsel-rg 'counsel-ag-occur)
-(ivy-set-display-transformer 'counsel-rg 'counsel-git-grep-transformer)
+(defun counsel--rg-targets ()
+ "Return a list of files to operate on, based on `dired-mode' marks."
+ (if (eq major-mode 'dired-mode)
+ (let ((files
+ (dired-get-marked-files 'no-dir nil nil t)))
+ (if (and (null (cdr files))
+ (not (when (string-match-p "\\*ivy-occur" (buffer-name))
+ (dired-toggle-marks)
+ (setq files (dired-get-marked-files 'no-dir))
+ (dired-toggle-marks)
+ t)))
+ ""
+ (concat
+ " "
+ (mapconcat #'shell-quote-argument (delq t files) " "))))
+ ""))
;;;###autoload
(defun counsel-rg (&optional initial-input initial-directory extra-rg-args
rg-prompt)
@@ -2849,7 +2980,8 @@ RG-PROMPT, if non-nil, is passed as `ivy-read' prompt
argument.
Example input with inclusion and exclusion file patterns:
-g*.py -g!*test* -- ..."
(interactive)
- (let ((counsel-ag-base-command counsel-rg-base-command)
+ (let ((counsel-ag-base-command
+ (concat counsel-rg-base-command (counsel--rg-targets)))
(counsel--grep-tool-look-around
(let ((rg (car (split-string counsel-rg-base-command)))
(switch "--pcre2"))
@@ -2857,7 +2989,13 @@ Example input with inclusion and exclusion file patterns:
switch))))
(counsel-ag initial-input initial-directory extra-rg-args rg-prompt
:caller 'counsel-rg)))
-(cl-pushnew 'counsel-rg ivy-highlight-grep-commands)
+
+(ivy-configure 'counsel-rg
+ :occur #'counsel-ag-occur
+ :unwind-fn #'counsel--grep-unwind
+ :display-transformer-fn #'counsel-git-grep-transformer
+ :grep-p t
+ :exit-codes '(1 "No matches found"))
;;** `counsel-grep'
(defvar counsel-grep-map
@@ -2887,6 +3025,12 @@ substituted by the search regexp and file, respectively.
Neither
(format counsel-grep-command (shell-quote-argument regex)))
nil)))
+(defvar counsel--grep-last-pos nil
+ "Store the last point and line that `counsel-grep-action' scrolled to.
+This speeds up scrolling: instead of going to `point-min' and
+`forward-line' with a huge arg (e.g. to scroll 50K lines), scroll
+relative to the last position stored here.")
+
(defun counsel-grep-action (x)
"Go to candidate X."
(with-ivy-window
@@ -2907,12 +3051,14 @@ substituted by the search regexp and file,
respectively. Neither
(with-current-buffer (or (get-file-buffer file-name)
(find-file file-name))
(setq line-number (string-to-number line-number))
- (if counsel-grep-last-line
- (forward-line (- line-number counsel-grep-last-line))
+ (if (and counsel--grep-last-pos (= (point) (car
counsel--grep-last-pos)))
+ (forward-line (- line-number (cdr counsel--grep-last-pos)))
(goto-char (point-min))
(forward-line (1- line-number)))
- (setq counsel-grep-last-line line-number)
- (re-search-forward (ivy--regex ivy-text t) (line-end-position) t)
+ (setq counsel--grep-last-pos (cons (point) line-number))
+ (when (re-search-forward (ivy--regex ivy-text t) (line-end-position)
t)
+ (when swiper-goto-start-of-match
+ (goto-char (match-beginning 0))))
(run-hooks 'counsel-grep-post-action-hook)
(if (eq ivy-exit 'done)
(swiper--ensure-visible)
@@ -2920,7 +3066,7 @@ substituted by the search regexp and file, respectively.
Neither
(line-end-position))
(swiper--add-overlays (ivy--regex ivy-text))))))))
-(defun counsel-grep-occur ()
+(defun counsel-grep-occur (&optional _cands)
"Generate a custom occur buffer for `counsel-grep'."
(counsel-grep-like-occur
(format
@@ -2930,9 +3076,6 @@ substituted by the search regexp and file, respectively.
Neither
(buffer-file-name
(ivy-state-buffer ivy-last)))))))
-(ivy-set-occur 'counsel-grep 'counsel-grep-occur)
-(counsel-set-async-exit-code 'counsel-grep 1 "")
-
(defvar counsel-grep-history nil
"History for `counsel-grep'.")
@@ -2944,7 +3087,6 @@ When non-nil, INITIAL-INPUT is the initial search
pattern."
(unless buffer-file-name
(user-error "Current buffer is not visiting a file"))
(counsel-require-program counsel-grep-base-command)
- (setq counsel-grep-last-line nil)
(setq counsel-grep-command
(format counsel-grep-base-command
"%s" (shell-quote-argument
@@ -2954,9 +3096,10 @@ When non-nil, INITIAL-INPUT is the initial search
pattern."
(init-point (point))
res)
(unwind-protect
- (setq res (ivy-read "grep: " 'counsel-grep-function
+ (setq res (ivy-read "grep: " #'counsel-grep-function
:initial-input initial-input
:dynamic-collection t
+ :require-match t
:preselect
(when (< (- (line-end-position)
(line-beginning-position)) 300)
(format "%d:%s"
@@ -2965,19 +3108,23 @@ When non-nil, INITIAL-INPUT is the initial search
pattern."
(buffer-substring-no-properties
(line-beginning-position)
(line-end-position)))))
-
:keymap counsel-grep-map
:history 'counsel-grep-history
- :update-fn 'auto
:re-builder #'ivy--regex
:action #'counsel-grep-action
- :unwind (lambda ()
- (counsel-delete-process)
- (swiper--cleanup))
:caller 'counsel-grep))
(unless res
(goto-char init-point)))))
+(ivy-configure 'counsel-grep
+ :update-fn 'auto
+ :unwind-fn #'counsel--grep-unwind
+ :index-fn #'ivy-recompute-index-swiper-async
+ :occur #'counsel-grep-occur
+ :more-chars 2
+ :grep-p t
+ :exit-codes '(1 ""))
+
;;;###autoload
(defun counsel-grep-backward (&optional initial-input)
"Grep for a string in the file visited by the current buffer going
@@ -3072,9 +3219,11 @@ INITIAL-INPUT can be given as the initial minibuffer
input."
(find-file file-name)
(unless (string-match "pdf$" x)
(swiper ivy-text)))))
- :unwind #'counsel-delete-process
:caller 'counsel-recoll))
+(ivy-configure 'counsel-recoll
+ :unwind-fn #'counsel-delete-process)
+
;;* Org
;;** `counsel-org-tag'
(defvar counsel-org-tags nil
@@ -3255,16 +3404,10 @@ otherwise continue prompting for tags."
#'counsel-org-tag))
(org-agenda-set-tags)))
-(define-obsolete-variable-alias 'counsel-org-goto-display-tags
- 'counsel-org-headline-display-tags "0.10.0")
-
(defcustom counsel-org-headline-display-tags nil
"If non-nil, display tags in matched `org-mode' headlines."
:type 'boolean)
-(define-obsolete-variable-alias 'counsel-org-goto-display-todo
- 'counsel-org-headline-display-todo "0.10.0")
-
(defcustom counsel-org-headline-display-todo nil
"If non-nil, display todo keywords in matched `org-mode' headlines."
:type 'boolean)
@@ -3317,7 +3460,7 @@ MAJOR-MODE and, if so, loads the settings specified by
PLIST
instead of the default settings. The following settings are
recognized:
-- `:outline-regexp' is a regexp to match the beggining of an
+- `:outline-regexp' is a regexp to match the beginning of an
outline heading. It is only checked at the start of a line and
so need not start with \"^\".
Defaults to the value of the variable `outline-regexp'.
@@ -3346,7 +3489,7 @@ recognized:
eponymous `ivy-read' keyword, as used by `counsel-outline'.
Defaults to the symbol `counsel-outline-history'.
-- `:caller' is a symbol to uniquely idendify the caller to
+- `:caller' is a symbol to uniquely identify the caller to
`ivy-read'. It corresponds directly to its eponymous
`ivy-read' keyword, as used by `counsel-outline'.
Defaults to the symbol `counsel-outline'.
@@ -3496,6 +3639,9 @@ include attachments of other Org buffers."
(org-capture nil (car (split-string x))))
:caller 'counsel-org-capture))
+(ivy-configure 'counsel-org-capture
+ :initial-input "^")
+
(ivy-set-actions
'counsel-org-capture
`(("t" ,(lambda (x)
@@ -3532,11 +3678,6 @@ include attachments of other Org buffers."
(defvar counsel-org-agenda-headlines-history nil
"History for `counsel-org-agenda-headlines'.")
-(define-obsolete-variable-alias 'counsel-org-goto-display-style
- 'counsel-outline-display-style "0.10.0")
-(define-obsolete-variable-alias 'counsel-org-headline-display-style
- 'counsel-outline-display-style "0.10.0")
-
(defcustom counsel-outline-display-style 'path
"The style used when displaying matched outline headings.
@@ -3558,11 +3699,6 @@ For displaying tags and TODO keywords in `org-mode'
buffers, see
(const :tag "Headline" headline)
(const :tag "Path" path)))
-(define-obsolete-variable-alias 'counsel-org-goto-separator
- 'counsel-outline-path-separator "0.10.0")
-(define-obsolete-variable-alias 'counsel-org-headline-path-separator
- 'counsel-outline-path-separator "0.10.0")
-
(defcustom counsel-outline-path-separator "/"
"String separating path entries in matched outline headings.
This variable has no effect unless
@@ -3628,20 +3764,20 @@ This variable has no effect unless
"Face for current `counsel-mark-ring' line."
:group 'ivy-faces)
-(defvar counsel--mark-ring-overray nil
- "Intarnal overray to highlight line by candidate of `counsel-mark-ring'.")
+(defvar counsel--mark-ring-overlay nil
+ "Internal overlay to highlight line by candidate of `counsel-mark-ring'.")
(defun counsel--mark-ring-add-highlight ()
"Add highlight to current line."
- (setq counsel--mark-ring-overray
+ (setq counsel--mark-ring-overlay
(make-overlay (line-beginning-position) (1+ (line-end-position))))
(with-ivy-window
- (overlay-put counsel--mark-ring-overray 'face
+ (overlay-put counsel--mark-ring-overlay 'face
'counsel--mark-ring-highlight)))
(defun counsel--mark-ring-delete-highlight ()
"If `counsel-mark-ring' have highlight, delete highlight."
- (if counsel--mark-ring-overray (delete-overlay counsel--mark-ring-overray)))
+ (if counsel--mark-ring-overlay (delete-overlay counsel--mark-ring-overlay)))
(defvar counsel--mark-ring-calling-point 0
"Internal variable to remember calling position.")
@@ -3653,41 +3789,46 @@ This variable has no effect unless
(defun counsel--mark-ring-update-fn ()
"Show preview by candidate."
- (let ((linenum (string-to-number (ivy-state-current ivy-last))))
+ (let ((pos (get-text-property 0 'point (ivy-state-current ivy-last))))
(counsel--mark-ring-delete-highlight)
- (unless (= linenum 0)
- (with-ivy-window
- (forward-line (- linenum (line-number-at-pos)))))))
+ (with-ivy-window
+ (goto-char pos)
+ (counsel--mark-ring-add-highlight))))
;;;###autoload
(defun counsel-mark-ring ()
"Browse `mark-ring' interactively.
Obeys `widen-automatically', which see."
(interactive)
- (let ((counsel--mark-ring-calling-point (point))
- (cands
- (save-excursion
- (save-restriction
- ;; Widen, both to save `line-number-at-pos' the trouble
- ;; and for `buffer-substring' to work.
- (widen)
- (let ((fmt (format "%%%dd %%s"
- (length (number-to-string
- (line-number-at-pos (point-max)))))))
- (mapcar (lambda (mark)
- (goto-char (marker-position mark))
- (let ((linum (line-number-at-pos))
- (line (buffer-substring
- (line-beginning-position)
- (line-end-position))))
- (cons (format fmt linum line) (point))))
- (sort (delete-dups (copy-sequence mark-ring)) #'<)))))))
+ (let* ((counsel--mark-ring-calling-point (point))
+ (width (length (number-to-string (line-number-at-pos (point-max)))))
+ (fmt (format "%%%dd %%s" width))
+ (make-candidate
+ (lambda (mark)
+ (goto-char (marker-position mark))
+ (let ((linum (line-number-at-pos))
+ (line (buffer-substring
+ (line-beginning-position) (line-end-position))))
+ (propertize (format fmt linum line) 'point (point)))))
+ (marks (copy-sequence mark-ring))
+ (marks (delete-dups marks))
+ (marks
+ ;; mark-marker is empty?
+ (if (equal (mark-marker) (make-marker))
+ marks
+ (cons (copy-marker (mark-marker)) marks)))
+ (cands
+ ;; Widen, both to save `line-number-at-pos' the trouble
+ ;; and for `buffer-substring' to work.
+ (save-excursion
+ (save-restriction
+ (widen)
+ (mapcar make-candidate marks)))))
(if cands
(ivy-read "Mark: " cands
:require-match t
- :update-fn #'counsel--mark-ring-update-fn
:action (lambda (cand)
- (let ((pos (cdr-safe cand)))
+ (let ((pos (get-text-property 0 'point cand)))
(when pos
(unless (<= (point-min) pos (point-max))
(if widen-automatically
@@ -3695,14 +3836,20 @@ Obeys `widen-automatically', which see."
(error "\
Position of selected mark outside accessible part of buffer")))
(goto-char pos))))
- :unwind #'counsel--mark-ring-unwind
:caller 'counsel-mark-ring)
(message "Mark ring is empty"))))
+(ivy-configure 'counsel-mark-ring
+ :update-fn #'counsel--mark-ring-update-fn
+ :unwind-fn #'counsel--mark-ring-unwind
+ :sort-fn #'ivy-string<)
+
;;** `counsel-package'
(defvar package--initialized)
(defvar package-alist)
(defvar package-archive-contents)
+(defvar package-archives)
+(defvar package-user-dir)
(declare-function package-installed-p "package")
(declare-function package-delete "package")
(declare-function package-desc-extras "package")
@@ -3714,8 +3861,16 @@ Position of selected mark outside accessible part of
buffer")))
"Return completion alist for `counsel-package'."
(unless package--initialized
(package-initialize t))
- (unless package-archive-contents
- (package-refresh-contents))
+ (if (or (not package-archive-contents)
+ (cl-find-if (lambda (package-archive)
+ (let ((fname
+ (format
+ "%s/archives/%s/archive-contents"
+ package-user-dir (car package-archive))))
+ (or (not (file-exists-p fname))
+ (counsel-file-stale-p fname (* 4 60 60)))))
+ package-archives))
+ (package-refresh-contents))
(sort (mapcar (lambda (entry)
(cons (let ((pkg (car entry)))
(concat (if (package-installed-p pkg) "-" "+")
@@ -3795,8 +3950,7 @@ Additional actions:\\<ivy-minibuffer-map>
(map-keymap (lambda (k v) (tmm-get-keymap (cons k v))) menu)
(setq tmm-km-list (nreverse tmm-km-list))
(setq out (ivy-read "Menu bar: " (tmm--completion-table tmm-km-list)
- :require-match t
- :sort nil))
+ :require-match t))
(setq choice (cdr (assoc out tmm-km-list)))
(setq chosen-string (car choice))
(setq choice (cdr choice))
@@ -3810,7 +3964,7 @@ Additional actions:\\<ivy-minibuffer-map>
;;;###autoload
(defun counsel-tmm ()
- "Text-mode emulation of looking and choosing from a menubar."
+ "Text-mode emulation of looking and choosing from a menu bar."
(interactive)
(require 'tmm)
(run-hooks 'menu-bar-update-hook)
@@ -3854,9 +4008,6 @@ Additional actions:\\<ivy-minibuffer-map>
(const :tag "Dashes" "\n----\n")
string))
-(define-obsolete-variable-alias 'counsel-yank-pop-height
- 'ivy-height-alist "0.11.0")
-
(defun counsel--yank-pop-format-function (cand-pairs)
"Transform CAND-PAIRS into a string for `counsel-yank-pop'."
(ivy--format-function-generic
@@ -3899,7 +4050,7 @@ All blank strings are deleted from `kill-ring' by
default."
(defun counsel--yank-pop-kills ()
"Return filtered `kill-ring' for `counsel-yank-pop' completion.
Both `kill-ring' and `kill-ring-yank-pointer' may be
-destructively modifed to eliminate duplicates under
+destructively modified to eliminate duplicates under
`equal-including-properties', satisfy `counsel-yank-pop-filter',
and incorporate `interprogram-paste-function'."
;; Protect against `kill-ring' and result of
@@ -4010,8 +4161,10 @@ Note: Duplicate elements of `kill-ring' are always
deleted."
:preselect preselect
:action #'counsel-yank-pop-action
:caller 'counsel-yank-pop)))
-(add-to-list 'ivy-format-functions-alist '(counsel-yank-pop .
counsel--yank-pop-format-function))
-(add-to-list 'ivy-height-alist '(counsel-yank-pop . 5))
+
+(ivy-configure 'counsel-yank-pop
+ :height 5
+ :format-fn #'counsel--yank-pop-format-function)
(ivy-set-actions
'counsel-yank-pop
@@ -4065,16 +4218,14 @@ matching the register's value description against a
regexp in
(list s))))
register-alist)
:require-match t
- :sort t
:history 'counsel-register-history
:action #'counsel-register-action
:caller 'counsel-register))
-;;** `counsel-evil-registers'
-(defcustom counsel-evil-registers-height 5
- "The `ivy-height' of `counsel-evil-registers'."
- :type 'integer)
+(ivy-configure 'counsel-register
+ :sort-fn #'ivy-string<)
+;;** `counsel-evil-registers'
;;;###autoload
(defun counsel-evil-registers ()
"Ivy replacement for `evil-show-registers'."
@@ -4087,8 +4238,9 @@ matching the register's value description against a
regexp in
:action #'counsel-evil-registers-action
:caller 'counsel-evil-registers)
(user-error "Required feature `evil' not installed.")))
-(add-to-list 'ivy-format-functions-alist '(counsel-evil-registers .
counsel--yank-pop-format-function))
-(add-to-list 'ivy-height-alist '(counsel-evil-registers . 5))
+(ivy-configure 'counsel-evil-registers
+ :height 5
+ :format-fn #'counsel--yank-pop-format-function)
(defun counsel-evil-registers-action (s)
"Paste contents of S, trimming the register part.
@@ -4104,28 +4256,40 @@ S will be of the form \"[register]: content\"."
(declare-function imenu--subalist-p "imenu")
(declare-function imenu--make-index-alist "imenu")
+(defun counsel--imenu-candidates ()
+ (unless (featurep 'imenu)
+ (require 'imenu nil t))
+ (let* ((imenu-auto-rescan t)
+ (imenu-auto-rescan-maxout (if current-prefix-arg
+ (buffer-size)
+ imenu-auto-rescan-maxout))
+ (items (imenu--make-index-alist t))
+ (items (delete (assoc "*Rescan*" items) items))
+ (items (counsel-imenu-categorize-functions items)))
+ (counsel-imenu-get-candidates-from items)))
+
(defun counsel-imenu-get-candidates-from (alist &optional prefix)
"Create a list of (key . value) from ALIST.
PREFIX is used to create the key."
- (cl-mapcan (lambda (elm)
- (if (imenu--subalist-p elm)
- (counsel-imenu-get-candidates-from
- (cl-loop for (e . v) in (cdr elm) collect
- (cons e (if (integerp v) (copy-marker v) v)))
- ;; pass the prefix to next recursive call
- (concat prefix (if prefix ".") (car elm)))
- (let ((key (concat
- (when prefix
- (concat
- (propertize prefix 'face 'ivy-grep-info)
- ": "))
- (car elm))))
- (list (cons key
- ;; create a imenu candidate here
- (cons key (if (overlayp (cdr elm))
- (overlay-start (cdr elm))
- (cdr elm))))))))
- alist))
+ (cl-mapcan
+ (lambda (elm)
+ (if (imenu--subalist-p elm)
+ (counsel-imenu-get-candidates-from
+ (cl-loop for (e . v) in (cdr elm) collect
+ (cons e (if (integerp v) (copy-marker v) v)))
+ ;; pass the prefix to next recursive call
+ (concat prefix (if prefix ".") (car elm)))
+ (let ((key (concat
+ (when prefix
+ (concat
+ (propertize prefix 'face 'ivy-grep-info)
+ ": "))
+ (car elm))))
+ (list (cons key
+ (cons key (if (overlayp (cdr elm))
+ (overlay-start (cdr elm))
+ (cdr elm))))))))
+ alist))
(defvar counsel-imenu-map
(let ((map (make-sparse-keymap)))
@@ -4140,29 +4304,20 @@ PREFIX is used to create the key."
`(("Functions" ,@fns)))
items)))
+(defun counsel-imenu-action (x)
+ (with-ivy-window
+ (imenu (cdr x))))
+
;;;###autoload
(defun counsel-imenu ()
"Jump to a buffer position indexed by imenu."
(interactive)
- (unless (featurep 'imenu)
- (require 'imenu nil t))
- (let* ((imenu-auto-rescan t)
- (imenu-auto-rescan-maxout (if current-prefix-arg
- (buffer-size)
- imenu-auto-rescan-maxout))
- (items (imenu--make-index-alist t))
- (items (delete (assoc "*Rescan*" items) items))
- (items (counsel-imenu-categorize-functions items)))
- (ivy-read "imenu items: " (counsel-imenu-get-candidates-from items)
- :preselect (thing-at-point 'symbol)
- :require-match t
- :action (lambda (candidate)
- (with-ivy-window
- ;; In org-mode, (imenu candidate) will expand child
node
- ;; after jump to the candidate position
- (imenu (cdr candidate))))
- :keymap counsel-imenu-map
- :caller 'counsel-imenu)))
+ (ivy-read "imenu items: " (counsel--imenu-candidates)
+ :preselect (thing-at-point 'symbol)
+ :require-match t
+ :action #'counsel-imenu-action
+ :keymap counsel-imenu-map
+ :caller 'counsel-imenu))
;;** `counsel-list-processes'
(defun counsel-list-processes-action-delete (x)
@@ -4265,6 +4420,15 @@ An extra action allows to switch to the process buffer."
(require 'comint)
(counsel--browse-history comint-input-ring))
+(defvar slime-repl-input-history)
+
+;;;###autoload
+(defun counsel-slime-repl-history ()
+ "Browse Slime REPL history."
+ (interactive)
+ (require 'slime-repl)
+ (counsel--browse-history slime-repl-input-history))
+
;;** `counsel-hydra-heads'
(defvar hydra-curr-body-fn)
(declare-function hydra-keyboard-quit "ext:hydra")
@@ -4368,9 +4532,6 @@ TREEP is used to expand internal nodes."
(counsel-imenu)))
;;** `counsel-outline'
-(define-obsolete-variable-alias 'counsel-org-goto-face-style
- 'counsel-outline-face-style "0.10.0")
-
(defcustom counsel-outline-face-style nil
"Determines how to style outline headings during completion.
@@ -4409,9 +4570,6 @@ For displaying tags and TODO keywords in `org-mode'
buffers, see
(const :tag "Custom" custom)
(const :tag "No style" nil)))
-(define-obsolete-variable-alias 'counsel-org-goto-custom-faces
- 'counsel-outline-custom-faces "0.10.0")
-
(defcustom counsel-outline-custom-faces nil
"List of faces for custom display of outline headings.
@@ -4477,7 +4635,7 @@ setting in `counsel-outline-settings', which see."
(funcall outline-level)))
(defvar counsel-outline--preselect 0
- "Index of the presected candidate in `counsel-outline'.")
+ "Index of the preselected candidate in `counsel-outline'.")
(defun counsel-outline-candidates (&optional settings prefix)
"Return an alist of outline heading completion candidates.
@@ -4711,7 +4869,6 @@ COUNT defaults to 1."
(setq ivy-completion-end (point))
(ivy-read "Unicode name: " counsel--unicode-table
:history 'counsel-unicode-char-history
- :sort t
:action (lambda (name)
(with-ivy-window
(delete-region ivy-completion-beg ivy-completion-end)
@@ -4720,6 +4877,9 @@ COUNT defaults to 1."
(setq ivy-completion-end (point))))
:caller 'counsel-unicode-char))
+(ivy-configure 'counsel-unicode-char
+ :sort-fn #'ivy-string<)
+
(defun counsel-unicode-copy (name)
"Ivy action to copy the unicode from NAME to the kill ring."
(kill-new (char-to-string (get-text-property 0 'code name))))
@@ -4819,7 +4979,8 @@ selected color."
:history 'counsel-colors-emacs-history
:action #'insert
:caller 'counsel-colors-emacs)))
-(add-to-list 'ivy-format-functions-alist '(counsel-colors-emacs .
counsel--colors-emacs-format-function))
+(ivy-configure 'counsel-colors-emacs
+ :format-fn #'counsel--colors-emacs-format-function)
(ivy-set-actions
'counsel-colors-emacs
@@ -4830,7 +4991,7 @@ selected color."
(defvar shr-color-html-colors-alist)
(defun counsel-colors--web-alist ()
- "Return list of CSS colours for `counsel-colors-web'."
+ "Return list of CSS colors for `counsel-colors-web'."
(require 'shr-color)
(let* ((alist (copy-alist shr-color-html-colors-alist))
(mp (assoc "MediumPurple" alist))
@@ -4863,16 +5024,34 @@ selected color."
(ivy-read "Web color: " colors
:require-match t
:history 'counsel-colors-web-history
- :sort t
:action #'insert
:caller 'counsel-colors-web)))
-(add-to-list 'ivy-format-functions-alist '(counsel-colors-web .
counsel--colors-web-format-function))
+(ivy-configure 'counsel-colors-web
+ :sort-fn #'ivy-string<
+ :format-fn #'counsel--colors-web-format-function)
+
(ivy-set-actions
'counsel-colors-web
'(("h" counsel-colors-action-insert-hex "insert hexadecimal value")
("H" counsel-colors-action-kill-hex "kill hexadecimal value")))
+;;** `counsel-fonts'
+(defvar counsel-fonts-history ()
+ "History for `counsel-fonts'.")
+
+;;;###autoload
+(defun counsel-fonts ()
+ "Show a list of all supported font families for a particular frame.
+
+You can insert or kill the name of the selected font."
+ (interactive)
+ (ivy-read "Font: " (delete-dups (font-family-list))
+ :require-match t
+ :history 'counsel-fonts-history
+ :action #'insert
+ :caller 'counsel-fonts))
+
;;* Misc. OS
;;** `counsel-rhythmbox'
(declare-function dbus-call-method "dbus")
@@ -5331,14 +5510,11 @@ The buffers are those opened during a session of
`counsel-switch-buffer'."
Display a preview of the selected ivy completion candidate buffer
in the current window."
(interactive)
- (ivy-read "Switch to buffer: " 'internal-complete-buffer
- :preselect (buffer-name (other-buffer (current-buffer)))
- :keymap ivy-switch-buffer-map
- :action #'ivy--switch-buffer-action
- :matcher #'ivy--switch-buffer-matcher
- :caller 'counsel-switch-buffer
- :unwind #'counsel--switch-buffer-unwind
- :update-fn 'counsel--switch-buffer-update-fn))
+ (let ((ivy-update-fns-alist
+ '((ivy-switch-buffer . counsel--switch-buffer-update-fn)))
+ (ivy-unwind-fns-alist
+ '((ivy-switch-buffer . counsel--switch-buffer-unwind))))
+ (ivy-switch-buffer)))
;;;###autoload
(defun counsel-switch-buffer-other-window ()
@@ -5346,13 +5522,11 @@ in the current window."
Display a preview of the selected ivy completion candidate buffer
in the current window."
(interactive)
- (ivy-read "Switch to buffer in other window: " 'internal-complete-buffer
- :preselect (buffer-name (other-buffer (current-buffer)))
- :action #'ivy--switch-buffer-other-window-action
- :matcher #'ivy--switch-buffer-matcher
- :caller 'counsel-switch-buffer-other-window
- :unwind #'counsel--switch-buffer-unwind
- :update-fn 'counsel--switch-buffer-update-fn))
+ (let ((ivy-update-fns-alist
+ '((ivy-switch-buffer-other-window .
counsel--switch-buffer-update-fn)))
+ (ivy-unwind-fns-alist
+ '((ivy-switch-buffer-other-window . counsel--switch-buffer-unwind))))
+ (ivy-switch-buffer-other-window)))
(defun counsel-open-buffer-file-externally (buffer)
"Open the file associated with BUFFER with an external program."
@@ -5370,6 +5544,11 @@ in the current window."
'ivy-switch-buffer
'(("x" counsel-open-buffer-file-externally "open externally")))
+(ivy-set-actions
+ 'counsel-switch-buffer
+ '(("x" counsel-open-buffer-file-externally "open externally")
+ ("j" ivy--switch-buffer-other-window-action "other window")))
+
;;** `counsel-compile'
(defvar counsel-compile-history nil
"History for `counsel-compile'.
@@ -5436,7 +5615,7 @@ Use the presence of a `dir-locals-file' to determine the
root."
"Additional compile invocations to feed into `counsel-compile'.
This can either be a list of compile invocation strings or
-functions that will provide such a list. You should customise
+functions that will provide such a list. You should customize
this if you want to provide specific non-standard build types to
`counsel-compile'. The default helpers are set up to handle
common build environments.")
@@ -5457,7 +5636,7 @@ list is passed to `compilation-environment'."
"History for `counsel-compile-env'.")
(defvar counsel-compile-env-pattern
- "[_[:digit:][:upper:]]+=[/[:album:]]*"
+ "[_[:digit:][:upper:]]+=[/[:alnum:]]*"
"Pattern to match valid environment variables.")
(defcustom counsel-compile-make-pattern "\\`\\(?:GNUm\\|[Mm]\\)akefile\\'"
@@ -5530,7 +5709,7 @@ The resulting strings are tagged with properties that
"Have a look in the root directory for any build control files.
The optional BLDDIR is useful for other helpers that have found
-subdirectories that builds may be invoked in."
+sub-directories that builds may be invoked in."
(let ((srcdir (counsel--compile-root)))
(when (directory-files (or blddir srcdir) nil
counsel-compile-make-pattern t)
@@ -5652,9 +5831,11 @@ specified by the `blddir' property."
(defun counsel-compile (&optional dir)
"Call `compile' completing with smart suggestions, optionally for DIR."
(interactive)
- (setq counsel-compile--current-build-dir (or dir default-directory))
+ (setq counsel-compile--current-build-dir (or dir
+ (counsel--compile-root)
+ default-directory))
(ivy-read "Compile command: "
- (counsel--get-compile-candidates dir)
+ (delete-dups (counsel--get-compile-candidates dir))
:action #'counsel-compile--action
:caller 'counsel-compile))
@@ -5695,7 +5876,9 @@ specified by the `blddir' property."
cand))
:history 'counsel-compile-env-history
:caller 'counsel-compile-env))
-(add-to-list 'ivy-format-functions-alist '(counsel-compile-env .
counsel-compile-env--format-hint))
+
+(ivy-configure 'counsel-compile-env
+ :format-fn #'counsel-compile-env--format-hint)
;;** `counsel-minor'
(defvar counsel-minor-history nil
@@ -5742,17 +5925,65 @@ Additional actions:\\<ivy-minibuffer-map>
(counsel--minor-candidates)
:require-match t
:history 'counsel-minor-history
- :sort t
:action (lambda (x)
(call-interactively (cdr x)))))
-(cl-pushnew '(counsel-minor . "^+") ivy-initial-inputs-alist :key #'car)
+(ivy-configure 'counsel-minor
+ :initial-input "^+"
+ :sort-fn #'ivy-string<)
(ivy-set-actions
'counsel-minor
`(("d" ,(lambda (x) (find-function (cdr x))) "definition")
("h" ,(lambda (x) (describe-function (cdr x))) "help")))
+;;;###autoload
+(defun counsel-major ()
+ (interactive)
+ (ivy-read "Major modes: " obarray
+ :predicate (lambda (f)
+ (and (commandp f) (string-match "-mode$" (symbol-name
f))
+ (or (and (autoloadp (symbol-function f))
+ (let ((doc-split (help-split-fundoc
(documentation f) f)))
+ ;; major mode starters have no
arguments
+ (and doc-split (null (cdr (read (car
doc-split)))))))
+ (null (help-function-arglist f)))))
+ :action #'counsel-M-x-action
+ :caller 'counsel-major))
+
+;;* `counsel-google'
+(declare-function request "ext:request")
+(defun counsel-google-function (input)
+ "Create a request to Google with INPUT.
+Return 0 tells `ivy--exhibit' not to update the minibuffer.
+We update it in the callback with `ivy-update-candidates'."
+ (or
+ (ivy-more-chars)
+ (progn
+ (require 'request)
+ (require 'json)
+ (request
+ "http://suggestqueries.google.com/complete/search"
+ :type "GET"
+ :params (list
+ (cons "client" "firefox")
+ (cons "q" input))
+ :parser 'json-read
+ :success (cl-function
+ (lambda (&key data &allow-other-keys)
+ (ivy-update-candidates
+ (mapcar #'identity (aref data 1))))))
+ 0)))
+
+(defun counsel-google ()
+ "Ivy interface for Google."
+ (interactive)
+ (ivy-read "search: " #'counsel-google-function
+ :action (lambda (x)
+ (browse-url (concat "https://www.google.com/search?q="
x)))
+ :dynamic-collection t
+ :caller 'counsel-google))
+
;;* `counsel-mode'
(defvar counsel-mode-map
(let ((map (make-sparse-keymap)))
diff --git a/packages/ivy/doc/Changelog.org b/packages/ivy/doc/Changelog.org
deleted file mode 100644
index 8c26c2d..0000000
--- a/packages/ivy/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/packages/ivy/doc/Makefile b/packages/ivy/doc/Makefile
deleted file mode 100644
index e104037..0000000
--- a/packages/ivy/doc/Makefile
+++ /dev/null
@@ -1,2 +0,0 @@
-ivy.texi: ivy.org
- emacs -batch -l ivy-ox.el -l scripts.el --eval "(org-to-texi
\"ivy.org\")"
diff --git a/packages/ivy/doc/ivy-help.org b/packages/ivy/doc/ivy-help.org
deleted file mode 100644
index 3a94118..0000000
--- a/packages/ivy/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/packages/ivy/doc/ivy-ox.el b/packages/ivy/doc/ivy-ox.el
deleted file mode 100644
index 22ab7a4..0000000
--- a/packages/ivy/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/packages/ivy/doc/ivy.org b/packages/ivy/doc/ivy.org
deleted file mode 100644
index 3258669..0000000
--- a/packages/ivy/doc/ivy.org
+++ /dev/null
@@ -1,1368 +0,0 @@
-#+TITLE: Ivy User Manual
-#+AUTHOR: Oleh Krehel
-#+EMAIL: address@hidden
-#+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.11.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-2018 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, with the Front-Cover Texts being ``A GNU Manual,''
-and with the Back-Cover Texts as in (a) below. A copy of the license
-is included in the section entitled ``GNU Free Documentation License.''
-
-(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
-modify this GNU manual.''
-#+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)
- (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)
- #+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 k") 'counsel-ag)
- (global-set-key (kbd "C-x l") 'counsel-locate)
- (global-set-key (kbd "C-S-o") 'counsel-rhythmbox)
- #+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)
- #+end_src
-
-** 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~. Applies an action and moves to next
- line.
-
- 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).
-
-*** 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.
-
-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
- :sort 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 =sort= argument is set to =t= so choosing between similar
- candidates becomes easier. Sometimes, the collection size will
- exceed =ivy-sort-max-size=, which is 30000 by default. In that case
- the sorting will not happen to avoid delays.
-
- Adjust this variable to choose between sorting time and completion
- start-up time.
-- 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/packages/ivy/doc/scripts.el b/packages/ivy/doc/scripts.el
deleted file mode 100644
index 8f25cef..0000000
--- a/packages/ivy/doc/scripts.el
+++ /dev/null
@@ -1,6 +0,0 @@
-;; Copyright (C) 2019 Free Software Foundation, Inc.
-
-(setq org-confirm-babel-evaluate nil)
-(defun org-to-texi (fname)
- (find-file fname)
- (org-texinfo-export-to-texinfo))
diff --git a/packages/ivy/ivy-hydra.el b/packages/ivy/ivy-hydra.el
index c4fa573..ce31f2b 100644
--- a/packages/ivy/ivy-hydra.el
+++ b/packages/ivy/ivy-hydra.el
@@ -4,8 +4,8 @@
;; Author: Oleh Krehel <address@hidden>
;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.12.0
-;; Package-Requires: ((emacs "24.1") (ivy "0.12.0") (hydra "0.13.4"))
+;; Version: 0.13.0
+;; Package-Requires: ((emacs "24.5") (ivy "0.13.0") (hydra "0.15.0"))
;; Keywords: convenience
;; This file is part of GNU Emacs.
@@ -77,7 +77,8 @@ _h_ ^+^ _l_ | _d_one ^ ^ | _o_ops | _M_: matcher
%-5s(ivy--matcher-desc)
("<" ivy-minibuffer-shrink)
("w" ivy-prev-action)
("s" ivy-next-action)
- ("a" ivy-read-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)
@@ -108,7 +109,8 @@ _h_ ^+^ _l_ | _d_one ^ ^ | _o_ops | _M_: matcher
%-5s(ivy--matcher-desc)
(estimated-len (length doc))
(n-columns (if (> estimated-len (window-width))
ivy-dispatching-done-columns
- nil)))
+ nil))
+ (i 0))
(if (null (ivy--actionp actions))
(ivy-done)
(funcall
@@ -118,13 +120,13 @@ _h_ ^+^ _l_ | _d_one ^ ^ | _o_ops | _M_: matcher
%-5s(ivy--matcher-desc)
,@(mapcar (lambda (x)
(list (nth 0 x)
`(progn
- (ivy-set-action ',(nth 1 x))
+ (setcar (ivy-state-action ivy-last) ,(cl-incf
i))
(ivy-done))
(nth 2 x)))
(cdr actions))
,@extra-actions))))))
-(define-key ivy-minibuffer-map (kbd "M-o") 'ivy-dispatching-done-hydra)
+(setq ivy-read-action-function (lambda (_) (ivy-dispatching-done-hydra)))
(provide 'ivy-hydra)
diff --git a/packages/ivy/ivy-overlay.el b/packages/ivy/ivy-overlay.el
index 7f56c6e..7a77bcf 100644
--- a/packages/ivy/ivy-overlay.el
+++ b/packages/ivy/ivy-overlay.el
@@ -62,6 +62,8 @@ Lines are truncated to the window width."
(when (fboundp 'company-abort)
(company-abort)))
+(defvar ivy-height)
+
(defun ivy-overlay-show-after (str)
"Display STR in an overlay at point.
@@ -71,6 +73,9 @@ Then attach the overlay to the character before point."
(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)
@@ -95,7 +100,7 @@ Then attach the overlay to the character before point."
(or
(and (eq major-mode 'org-mode)
(plist-get (text-properties-at (point)) 'src-block))
- (<= (window-height) (+ ivy-height 3))
+ (<= (window-height) (+ ivy-height 2))
(= (point) (point-min))
(< (- (+ (window-width) (window-hscroll)) (current-column))
30)))
diff --git a/packages/ivy/ivy-test.el b/packages/ivy/ivy-test.el
deleted file mode 100644
index 386fe9c..0000000
--- a/packages/ivy/ivy-test.el
+++ /dev/null
@@ -1,1313 +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:
-
-(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))
-
-(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'.")
-
-(defun ivy-eval ()
- "Evaluate `ivy-expr'."
- (interactive)
- (setq ivy-result (eval ivy-expr)))
-
-(global-set-key (kbd "C-c e") 'ivy-eval)
-
-(cl-defun ivy-with (expr keys &key dir)
- "Evaluate EXPR followed by KEYS."
- (let ((ivy-expr expr)
- (inhibit-message t)
- (buf (current-buffer)))
- (save-window-excursion
- (unwind-protect
- (progn
- ;; `execute-kbd-macro' doesn't pick up `default-directory'
- (when dir
- (dired (expand-file-name dir (counsel-locate-git-root))))
- (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\\)")))
-
-(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")))
-
-(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 "$")
- "$")))
-
-(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)))))
-
-(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 t))
- (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 ()
- (should
- (equal "/tmp/"
- (ivy-with
- '(read-directory-name "cd: " "/tmp")
- "RET"))))
-
-(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 ()
- (let ((kill-ring '("foo")))
- (should (equal
- (ivy-with-temp-buffer '(counsel-yank-pop) "C-m")
- '(4 "foo")))
- (let ((counsel-yank-pop-after-point t))
- (should (equal
- (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)
- ;; `ivy-read' returns "~/dummy-dir/dummy-file" (same object, not a copy).
- ;;
- ;; `read-file-name-default' will then return "" in order for
- ;; `set-visited-file-name' to detect that the user typed RET with
- ;; the minibuffer empty.
- (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")
- ""))
- (should
- (equal (ivy-state-current ivy-last) "~/dummy-dir/dummy-file"))
- (ivy-mode ivy-mode-reset-arg)))
-
-(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 (generate-new-buffer " *temp*")))
- (save-window-excursion
- (unwind-protect
- (progn
- (switch-to-buffer temp-buffer)
- (insert ,text)
- (search-backward "|")
- (delete-char 1)
- (setq current-prefix-arg nil)
- (let ((inhibit-message t))
- ,@(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-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)"))
- ;; NOTE: The following two behaviors do not match
- ;; `isearch-backward-regexp', but they match that of
- ;; `swiper-isearch-forward', as `swiper-isearch' does not reset the
- ;; point when the regexp becomes invalid, meaning the point is left
- ;; at the initial match of the first part of the regexp.
- (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(defvar bar)|"
- (global-set-key (kbd "C-r") #'swiper-isearch-backward)
- ("C-r" "defun\\|defvar" "C-n 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)")))
-
-(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 swiper--isearch-format ()
- (setq swiper--isearch-point-history
- (list
- (cons "" 1)))
- (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))))
-
-(defun counsel--setup-test-files ()
- (unless (file-exists-p "tests/")
- (shell-command
- "git clone -b test --single-branch https://github.com/abo-abo/swiper/
tests"))
- (let ((default-directory (expand-file-name "tests/"))
- (version "066ec1d"))
- (shell-command
- (format "git checkout %s || git fetch && git checkout %s" version
version))))
-
-(ert-deftest counsel-find-file-with-dollars ()
- (counsel--setup-test-files)
- (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 ()
- (counsel--setup-test-files)
- (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 ()
- (counsel--setup-test-files)
- (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")))))
-
-(provide 'ivy-test)
-
-;;; ivy-test.el ends here
diff --git a/packages/ivy/ivy.el b/packages/ivy/ivy.el
index c4633ca..1c733dd 100644
--- a/packages/ivy/ivy.el
+++ b/packages/ivy/ivy.el
@@ -4,8 +4,8 @@
;; Author: Oleh Krehel <address@hidden>
;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.12.0
-;; Package-Requires: ((emacs "24.1"))
+;; Version: 0.13.0
+;; Package-Requires: ((emacs "24.5"))
;; Keywords: matching
;; This file is part of GNU Emacs.
@@ -39,7 +39,6 @@
;;; Code:
(require 'cl-lib)
-(require 'ffap)
(require 'ivy-overlay)
(require 'colir)
(require 'ring)
@@ -179,6 +178,12 @@ Set this to \"(%d/%d) \" to display both the index and the
count."
(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)
@@ -222,24 +227,15 @@ Only \"./\" and \"../\" apply here. They appear in
reverse order."
(const :tag "Current Directory" "./"))))
(defcustom ivy-use-virtual-buffers nil
- "When non-nil, add recent files and bookmarks to `ivy-switch-buffer'."
- :type 'boolean)
-
-(defvar ivy-display-function nil
- "Determine where to display candidates.
-When nil (the default), candidates are shown in the minibuffer.
-Otherwise, this can be set to a function which takes a string
-argument comprising the current matching candidates and displays
-it somewhere.
-
-This user option acts as a global default for Ivy-based
-completion commands. You can customize the display function on a
-per-command basis via `ivy-display-functions-alist', which see.
-See also URL
-`https://github.com/abo-abo/swiper/wiki/ivy-display-function'.")
-
-(make-obsolete-variable
- 'ivy-display-function 'ivy-display-functions-alist "<2019-12-05 Mon>")
+ "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.")
@@ -252,14 +248,14 @@ 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 display-function.
+ "An alist for customizing where to display the candidates.
-display-function determine where to display candidates. it takes
-a string argument comprising the current matching candidates and
-displays it somewhere.
+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.
-When display-function is nil, candidates are shown in the
-minibuffer."
+See also `https://github.com/abo-abo/swiper/wiki/ivy-display-function'."
:type '(alist
:key-type symbol
:value-type (choice
@@ -303,7 +299,7 @@ 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 counsel grep-like commands.")
+ "List of grep-like commands.")
(defvar ivy--actions-list nil
"A list of extra actions per command.")
@@ -501,7 +497,9 @@ action functions.")
caller
current
def
- multi-action)
+ ignore
+ multi-action
+ extra-props)
(defvar ivy-last (make-ivy-state)
"The last parameters passed to `ivy-read'.
@@ -534,8 +532,7 @@ the restoring themselves.")
((thing-at-point 'url))
((and (eq (ivy-state-collection ivy-last) #'read-file-name-internal)
(let ((inhibit-message t))
- (ignore-errors
- (ffap-file-at-point)))))
+ (run-hook-with-args-until-success
'file-name-at-point-functions))))
((let ((s (thing-at-point 'symbol)))
(and (stringp s)
(if (string-match "\\`[`']?\\(.*?\\)'?\\'" s)
@@ -665,8 +662,7 @@ functionality, e.g. as seen in `isearch'."
"Store the current overriding `case-fold-search'.")
(defvar ivy-more-chars-alist
- '((counsel-grep . 2)
- (t . 3))
+ '((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.")
@@ -733,12 +729,13 @@ N is obtained from `ivy-more-chars-alist'."
"Insert TEXT and exit minibuffer."
(if (member (ivy-state-prompt ivy-last) '("Create directory: " "Make
directory: "))
(ivy-immediate-done)
- (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)))
+ (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)))
@@ -866,6 +863,13 @@ key (a string), cmd and doc (a string)."
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.
@@ -875,26 +879,44 @@ selection, non-nil otherwise."
(let ((actions (ivy-state-action ivy-last)))
(if (not (ivy--actionp actions))
t
- (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)))))))
+ (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."
@@ -971,14 +993,20 @@ contains a single candidate.")
(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)
+ (let ((dir (ivy--handle-directory ivy-text)))
(cond
- ((equal ivy-text "/sudo::")
- (setq dir (concat ivy-text (expand-file-name ivy--directory)))
- (ivy--cd dir)
- (ivy--exhibit))
+ (dir
+ (let ((inhibit-message t))
+ (ivy--cd dir)))
((ivy--directory-enter))
((unless (string= ivy-text "")
(let ((file (expand-file-name
@@ -1049,20 +1077,25 @@ When this directory doesn't exist, return nil."
"Complete the minibuffer text as much as possible.
If the text hasn't changed as a result, forward to `ivy-alt-done'."
(interactive)
- (if (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)))
- (or (ivy-partial)
- (when (or (eq this-command last-command)
- (eq ivy--length 1))
- (ivy-alt-done)))))
+ (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'."
@@ -1070,10 +1103,20 @@ If the text hasn't changed as a result, forward to
`ivy-alt-done'."
(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 (split-string ivy-text " " t) (list "")))
+ (let* ((parts (or (ivy--split-spaces ivy-text) (list "")))
(tail (last parts))
(postfix (car tail))
(case-fold-search (ivy--case-fold-p ivy-text))
@@ -1087,7 +1130,7 @@ If the text hasn't changed as a result, forward to
`ivy-alt-done'."
ivy--old-cands)))))
(cond ((eq new t) nil)
((string= new ivy-text) nil)
- ((string= (car tail) new) nil)
+ ((string= (car tail) (car (ivy--split-spaces new))) nil)
(new
(delete-region (minibuffer-prompt-end) (point-max))
(setcar tail
@@ -1099,13 +1142,7 @@ If the text hasn't changed as a result, forward to
`ivy-alt-done'."
(concat
(mapconcat #'identity parts " ")
(and ivy-tab-space (not (= (length ivy--old-cands) 1)) "
"))))
- (when (and
- (eq (ivy-state-collection ivy-last)
#'read-file-name-internal)
- (= 1 (length
- (all-completions ivy-text ivy--all-candidates)))
- (let ((default-directory ivy--directory))
- (file-directory-p (ivy-state-current ivy-last))))
- (ivy--directory-done))
+ (ivy--partial-cd-for-single-directory)
t))))
(defvar ivy-completion-beg nil
@@ -1125,8 +1162,14 @@ If the text hasn't changed as a result, forward to
`ivy-alt-done'."
((and (string= ivy-text "")
(eq (ivy-state-collection ivy-last)
#'read-file-name-internal))
- (or (ivy-state-def ivy-last)
- ivy--directory))
+ (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))
@@ -1140,10 +1183,12 @@ If the text hasn't changed as a result, forward to
`ivy-alt-done'."
(interactive)
(if (null (ivy-state-action ivy-last))
(user-error "The last session isn't compatible with `ivy-resume'")
- (when (eq (ivy-state-caller ivy-last) 'swiper)
+ (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)))
+ (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)
@@ -1160,6 +1205,7 @@ If the text hasn't changed as a result, forward to
`ivy-alt-done'."
: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
@@ -1260,6 +1306,7 @@ If the input is empty, select the previous history
element instead."
(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))
@@ -1326,8 +1373,8 @@ If the input is empty, select the previous history
element instead."
Example use:
(let* ((ivy-inhibit-action t)
- (str (counsel-locate \"lispy.el\")))
- ;; do whatever with str - the corresponding file will not be opened
+ (str (ivy-switch-buffer)))
+ ;; do whatever with str - the corresponding buffer will not be opened
)")
(defun ivy-recursive-restore ()
@@ -1423,7 +1470,7 @@ Call the permanent action if possible."
(ivy-call))
(defun ivy-previous-line-and-call (&optional arg)
- "Move cursor vertically down ARG candidates.
+ "Move cursor vertically up ARG candidates.
Call the permanent action if possible."
(interactive "p")
(ivy-previous-line arg)
@@ -1457,7 +1504,7 @@ Call the permanent action if possible."
(when (and (with-ivy-window (derived-mode-p 'prog-mode))
(eq (ivy-state-caller ivy-last) 'swiper)
(not (file-exists-p ivy--default))
- (not (ffap-url-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)))
@@ -1475,7 +1522,7 @@ If so, move to that directory, while keeping only the
file name."
(when ivy--directory
(let ((input (ivy--input))
url)
- (if (setq url (or (ffap-url-p input)
+ (if (setq url (or (ivy-ffap-url-p input)
(with-ivy-window
(cl-reduce
(lambda (a b)
@@ -1484,7 +1531,7 @@ If so, move to that directory, while keeping only the
file name."
:initial-value nil))))
(ivy-exit-with-action
(lambda (_)
- (funcall ffap-url-fetcher url)))
+ (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))))
@@ -1621,13 +1668,6 @@ This string is inserted into the minibuffer."
(const :tag "Full line" ivy-format-function-line)
(function :tag "Custom function"))))
-(defvar ivy-format-function #'ivy-format-function-default
- "Function to transform the list of candidates into a string.
-This string is inserted into the minibuffer.")
-
-(make-obsolete-variable
- 'ivy-format-function 'ivy-format-functions-alist "<2019-06-03 Mon>")
-
(eval-after-load 'avy
'(add-to-list 'avy-styles-alist '(ivy-avy . pre)))
@@ -1701,30 +1741,16 @@ Prioritize directories."
nil
(string< x y))))
-(declare-function ido-file-extension-lessp "ido")
-
-(defun ivy-sort-file-function-using-ido (x y)
- "Compare two files X and Y using `ido-file-extensions-order'.
-
-This function is suitable as a replacement for
-`ivy-sort-file-function-default' in `ivy-sort-functions-alist'."
- (if (and (bound-and-true-p ido-file-extensions-order))
- (ido-file-extension-lessp x y)
- (ivy-sort-file-function-default 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
- '((read-file-name-internal . ivy-sort-file-function-default)
- (internal-complete-buffer . nil)
- (ivy-completion-in-region . nil)
- (counsel-git-grep-function . nil)
- (Man-goto-section . nil)
- (org-refile . nil)
- (t . ivy-string<))
+ '((t . ivy-string<))
"An alist of sorting functions for each collection function.
Interactive functions that call completion fit in here as well.
@@ -1747,6 +1773,7 @@ See also `ivy-sort-max-size'."
: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")))))
@@ -1773,11 +1800,7 @@ specified for the current collection in
(ivy--reset-state ivy-last))))
(defvar ivy-index-functions-alist
- '((swiper . ivy-recompute-index-swiper)
- (swiper-multi . ivy-recompute-index-swiper)
- (counsel-git-grep . ivy-recompute-index-swiper)
- (counsel-grep . ivy-recompute-index-swiper-async)
- (t . ivy-recompute-index-zero))
+ '((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
@@ -1810,24 +1833,21 @@ like.")
'((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 buidler function.")
+ "An alist of highlighting functions for each regex builder function.")
(defcustom ivy-initial-inputs-alist
'((org-refile . "^")
(org-agenda-refile . "^")
(org-capture-refile . "^")
- (counsel-M-x . "^")
- (counsel-describe-function . "^")
- (counsel-describe-variable . "^")
- (counsel-org-capture . "^")
(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))))
+ :type '(alist
+ :key-type (symbol)
+ :value-type (choice (string) (function))))
(defcustom ivy-hooks-alist nil
"An alist associating commands to setup functions.
@@ -1835,6 +1855,79 @@ 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)
@@ -1902,7 +1995,9 @@ found, it falls back to the key t."
history preselect def keymap update-fn sort
action multi-action
unwind re-builder matcher
- dynamic-collection caller)
+ 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.
@@ -1935,13 +2030,14 @@ a regular expression.
DEF is for compatibility with `completing-read'.
-UPDATE-FN is called each time the candidate list is redisplayed.
+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 the candidate, which is a string, as its only argument.
+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
@@ -1960,9 +2056,15 @@ 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
@@ -1970,6 +2072,8 @@ customizations apply to the current completion session."
(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
@@ -1982,8 +2086,13 @@ customizations apply to the current completion session."
:keymap keymap
:update-fn (if (eq update-fn 'auto)
(lambda ()
- (funcall (ivy--get-action ivy-last)
- (ivy-state-current ivy-last)))
+ (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)
@@ -1997,6 +2106,7 @@ customizations apply to the current completion session."
: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)
@@ -2017,10 +2127,10 @@ customizations apply to the current completion session."
(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
+ 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
@@ -2099,6 +2209,7 @@ This is useful for recursive `ivy-read'."
(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))
@@ -2170,7 +2281,7 @@ This is useful for recursive `ivy-read'."
counsel-switch-buffer)))
predicate)))
(dynamic-collection
- (setq coll (funcall collection ivy-text)))
+ (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)))
@@ -2315,7 +2426,6 @@ INHERIT-INPUT-METHOD is currently ignored."
:def def
:history history
:keymap nil
- :sort t
:dynamic-collection ivy-completing-read-dynamic-collection
:caller (if (and collection (symbolp collection))
collection
@@ -2341,13 +2451,15 @@ behavior."
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 (fboundp 'mc/all-fake-cursors)
+ (let ((fake-cursors (and (require 'multiple-cursors-core nil t)
(mc/all-fake-cursors)))
(pt (point))
(beg ivy-completion-beg)
@@ -2406,6 +2518,8 @@ See `completion-in-region' for further information."
(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)
"")
@@ -2435,7 +2549,6 @@ See `completion-in-region' for further information."
;; `completion-all-completions'.
:predicate nil
:initial-input initial
- :sort t
:action #'ivy-completion-in-region-action
:unwind (lambda ()
(unless (eq ivy-exit 'done)
@@ -2484,7 +2597,9 @@ Minibuffer bindings:
(defun ivy--preselect-index (preselect candidates)
"Return the index of PRESELECT in CANDIDATES."
(cond ((integerp preselect)
- 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))))
@@ -2560,6 +2675,13 @@ regexp is passed to `regexp-quote'."
(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."
@@ -2571,6 +2693,7 @@ When GREEDY is non-nil, join words in a greedy way."
(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)
@@ -2602,7 +2725,7 @@ When GREEDY is non-nil, join words in a greedy way."
"Split STR into text before and after ! delimiter.
Do not split if the delimiter is escaped as \\!.
-Assumes there is at most one unescaped delimiter and discards
+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 "\\(?:\\`\\|[^\\]\\)\\(!\\)"))
@@ -2610,7 +2733,7 @@ text after delimiter if it is empty. Modifies match
data."
;; Store "\!" as "!".
(replace-regexp-in-string "\\\\!" "!" split t t))
(if (string-match delim str)
- ;; Ignore everything past first unescaped ! rather than
+ ;; 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))
@@ -2624,7 +2747,7 @@ text after delimiter if it is empty. Modifies match
data."
(defun ivy--split-spaces (str)
"Split STR on spaces, unless they're preceded by \\.
-No unescaped spaces are left in the output. Any substring not
+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.
@@ -2633,7 +2756,7 @@ constituting a valid regexp is passed to `regexp-quote'."
(while (string-match "\\(\\\\ \\)\\| +" str i)
(setq i (match-end 0))
(if (not (match-beginning 1))
- ;; Unescaped space(s).
+ ;; Un-escaped space(s).
(let ((delim (match-beginning 0)))
(when (< j delim)
(push (substring str j delim) parts))
@@ -2656,10 +2779,11 @@ 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\"
+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)))
@@ -2692,6 +2816,7 @@ match. Everything after \"!\" should not match."
(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)
@@ -2745,9 +2870,12 @@ tries to ensure that it does not change depending on the
number of candidates."
(defun ivy--input ()
"Return the current minibuffer input."
;; assume one-line minibuffer input
- (buffer-substring-no-properties
- (minibuffer-prompt-end)
- (line-end-position)))
+ (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."
@@ -2848,6 +2976,8 @@ parts beyond their respective faces `ivy-confirm-face' and
(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))))
@@ -2938,6 +3068,7 @@ Possible choices are
'ivy-magic-slash-non-match-cd-selected,
(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
@@ -3019,14 +3150,22 @@ Should be run via minibuffer `post-command-hook'."
'ivy--exhibit)))
(ivy--exhibit)))
-(defun ivy--magic-tilde-directory ()
- "Return an appropriate directory for when ~ or ~/ are entered."
+(defun ivy--magic-tilde-directory (dir)
+ "Return an appropriate home for DIR for when ~ or ~/ are entered."
(expand-file-name
(let (remote)
- (if (setq remote (file-remote-p ivy--directory))
+ (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'."
@@ -3037,15 +3176,24 @@ Should be run via minibuffer `post-command-hook'."
(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))
+ (let ((inhibit-message t)
+ coll in-progress)
(unless (equal ivy--old-text ivy-text)
(while-no-input
- (setq ivy--all-candidates
- (ivy--sort-maybe
- (funcall (ivy-state-collection ivy-last) ivy-text)))
+ (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
- (not (get-process " *counsel*")))
+ (and (not (get-process " *counsel*"))
+ (not in-progress)))
(ivy--set-index-dynamic-collection)
(ivy--insert-minibuffer
(ivy--format ivy--all-candidates))))
@@ -3053,7 +3201,7 @@ Should be run via minibuffer `post-command-hook'."
(cond ((or (string= "~/" ivy-text)
(and (string= "~" ivy-text)
ivy-magic-tilde))
- (ivy--cd (ivy--magic-tilde-directory)))
+ (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)
@@ -3313,9 +3461,6 @@ Prefix matches to NAME are put ahead of the list."
(defvar ivy--virtual-buffers nil
"Store the virtual buffers alist.")
-(define-obsolete-function-alias 'ivy-generic-regex-to-str
- 'ivy-re-to-str "0.10.0")
-
(defun ivy-re-to-str (re)
"Transform RE to a string.
@@ -3439,7 +3584,7 @@ CANDS are the current candidates."
(res 0)
(i 0))
(dolist (c cands)
- (when (eq n (read (get-text-property 0 'swiper-line-number c)))
+ (when (eq n (get-text-property 0 'swiper-line-number c))
(setq res i))
(cl-incf i))
res))))
@@ -3450,7 +3595,7 @@ CANDS are the current candidates."
CANDS are the current candidates."
(let ((idx (ivy-recompute-index-swiper re-str cands)))
(if (or (= idx -1)
- (<= (read (get-text-property 0 'swiper-line-number (nth idx
cands)))
+ (<= (get-text-property 0 'swiper-line-number (nth idx cands))
(line-number-at-pos)))
idx
(- idx 1))))
@@ -3706,7 +3851,7 @@ Note: The usual last two arguments are flipped for
convenience.")
(str (if (eq ivy-display-style 'fancy)
(if (memq (ivy-state-caller ivy-last)
ivy-highlight-grep-commands)
- (let* ((start (if (string-match "\\`[^:]+:[^:]+:" str)
+ (let* ((start (if (string-match
"\\`[^:]+:\\(?:[^:]+:\\)?" str)
(match-end 0) 0))
(file (substring str 0 start))
(match (substring str start)))
@@ -3732,13 +3877,6 @@ Note: The usual last two arguments are flipped for
convenience.")
olen (length str) 'ivy-completions-annotations str))
str))
-(ivy-set-display-transformer
- 'counsel-find-file 'ivy-read-file-transformer)
-(ivy-set-display-transformer
- 'counsel-dired 'ivy-read-file-transformer)
-(ivy-set-display-transformer
- 'read-file-name-internal 'ivy-read-file-transformer)
-
(defun ivy-read-file-transformer (str)
"Transform candidate STR when reading files."
(if (ivy--dirname-p str)
@@ -3755,7 +3893,7 @@ Note: The usual last two arguments are flipped for
convenience.")
(defun ivy--format (cands)
"Return a string for CANDS suitable for display in the minibuffer.
-CANDS is a list of strings."
+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)))
@@ -3768,6 +3906,7 @@ CANDS is a list of strings."
(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))
@@ -3806,12 +3945,19 @@ CANDS is a list of strings."
(require 'bookmark)
(unless recentf-mode
(recentf-mode 1))
- (let (virtual-buffers)
- (bookmark-maybe-load-default-file)
- (dolist (head (append recentf-list
- (delete " - no file -"
- (delq nil (mapcar #'bookmark-get-filename
- bookmark-alist)))))
+ (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)))
@@ -3934,7 +4080,7 @@ TREE can be nested multiple times to have multiple window
splits.")
When ARG is non-nil, replace a selected item on `ivy-views'.
-Currently, the split configuration (i.e. horizonal or vertical)
+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")
@@ -4167,11 +4313,6 @@ Skip buffers that match `ivy-ignore-buffers'."
(and (eq ivy-use-ignore t)
res)))))
-(ivy-set-display-transformer
- 'ivy-switch-buffer 'ivy-switch-buffer-transformer)
-(ivy-set-display-transformer
- 'internal-complete-buffer 'ivy-switch-buffer-transformer)
-
(defun ivy-append-face (str face)
"Append to STR the property FACE."
(setq str (copy-sequence str))
@@ -4191,21 +4332,23 @@ Skip buffers that match `ivy-ignore-buffers'."
(t str))
str)))
-(defun ivy-switch-buffer-occur ()
- "Occur function for `ivy-switch-buffer' using `ibuffer'."
+(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))))))
- ivy--old-cands)))))
+ cands)))))
;;;###autoload
(defun ivy-switch-buffer ()
"Switch to another buffer."
(interactive)
- (setq this-command #'ivy-switch-buffer)
(ivy-read "Switch to buffer: " #'internal-complete-buffer
:keymap ivy-switch-buffer-map
:preselect (buffer-name (other-buffer (current-buffer)))
@@ -4213,6 +4356,10 @@ Skip buffers that match `ivy-ignore-buffers'."
: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'."
@@ -4232,7 +4379,14 @@ Skip buffers that match `ivy-ignore-buffers'."
:keymap ivy-switch-buffer-map
:caller 'ivy-switch-buffer-other-window))
-(define-obsolete-function-alias 'ivy-recentf 'counsel-recentf "0.8.0")
+(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.
@@ -4252,7 +4406,10 @@ point before and after applying FN to ARGS."
(unless text
(goto-char beg)))))
(when text
- (insert (replace-regexp-in-string " +" " " text t t)))))
+ (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.
@@ -4349,9 +4506,6 @@ Don't finish completion."
(interactive)
(insert ivy--directory))
-(define-obsolete-variable-alias 'ivy--preferred-re-builders
- 'ivy-preferred-re-builders "0.10.0")
-
(defcustom ivy-preferred-re-builders
'((ivy--regex-plus . "ivy")
(ivy--regex-ignore-order . "order")
@@ -4401,20 +4555,23 @@ This list can be rotated with
`ivy-rotate-preferred-builders'."
(define-key map (kbd "C-k") 'ivy-reverse-i-search-kill)
map))
-(defun ivy-history-contents (sym-or-ring)
- "Copy contents of SYM-OR-RING.
+(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 SYM-OR-RING."
- (setq ivy--reverse-i-search-symbol sym-or-ring)
- (cond ((symbolp sym-or-ring)
+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
- (copy-sequence (symbol-value sym-or-ring))))
- ((ring-p sym-or-ring)
+ (when (> (ring-size history) 0)
+ (ring-elements history))))
+ ((sequencep history)
(delete-dups
- (when (> (ring-size sym-or-ring) 0)
- (ring-elements sym-or-ring))))
+ (copy-sequence history)))
(t
- (error "Expected a symbol or a ring: %S" sym-or-ring))))
+ (error "Expected a symbol, ring, or sequence: %S" history))))
(defun ivy-reverse-i-search ()
"Enter a recursive `ivy-read' session using the current history.
@@ -4447,8 +4604,13 @@ You can also delete an element from history with
\\[ivy-reverse-i-search-kill]."
"Restrict candidates to current input and erase input."
(interactive)
(delete-minibuffer-contents)
- (setq ivy--all-candidates
- (ivy--filter ivy-text ivy--all-candidates)))
+ (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
@@ -4541,6 +4703,16 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'."
(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].
@@ -4568,17 +4740,6 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'."
(when (fboundp 'wgrep-setup)
(wgrep-setup)))
-(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)))
-
-(ivy-set-occur 'ivy-switch-buffer 'ivy-switch-buffer-occur)
-(ivy-set-occur 'ivy-switch-buffer-other-window 'ivy-switch-buffer-occur)
-
(defun ivy--starts-with-dotslash (str)
(string-match-p "\\`\\.[/\\]" str))
@@ -4603,6 +4764,18 @@ When `ivy-calling' isn't nil, call `ivy-occur-press'."
(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.
@@ -4616,7 +4789,8 @@ There is no limit on the number of *ivy-occur* buffers."
(if (not (window-minibuffer-p))
(user-error "No completion session is active")
(let* ((caller (ivy-state-caller ivy-last))
- (occur-fn (plist-get ivy--occurs-list caller))
+ (occur-fn (or (plist-get ivy--occurs-list caller)
+ #'ivy--occur-default))
(buffer
(generate-new-buffer
(format "*ivy-occur%s \"%s\"*"
@@ -4625,25 +4799,20 @@ There is no limit on the number of *ivy-occur* buffers."
"")
ivy-text))))
(with-current-buffer buffer
- (let ((inhibit-read-only t))
- (erase-buffer)
- (if occur-fn
- (funcall occur-fn)
- (ivy-occur-mode)
- (insert (format "%d candidates:\n" (length ivy--old-cands)))
- (read-only-mode)
- (ivy--occur-insert-lines
- ivy--old-cands)))
+ (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))))))
+ (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 orignal buffer
+*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
@@ -4651,21 +4820,13 @@ updated original buffer."
(interactive)
(let ((caller (ivy-state-caller ivy-occur-last))
(ivy-last ivy-occur-last))
- (cond ((member caller '(swiper swiper-isearch))
- (let ((buffer (ivy-state-buffer ivy-occur-last)))
- (unless (buffer-live-p buffer)
- (error "Buffer was killed"))
- (let ((inhibit-read-only t))
- (erase-buffer)
- (funcall (plist-get ivy--occurs-list caller) t)
- (ivy-occur-grep-mode))))
- ((memq caller '(counsel-git-grep counsel-grep counsel-ag counsel-rg))
- (let ((inhibit-read-only t)
- (line (line-number-at-pos)))
- (erase-buffer)
- (funcall (plist-get ivy--occurs-list caller))
- (goto-char (point-min))
- (forward-line (1- line)))))
+ (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")
@@ -4709,15 +4870,14 @@ EVENT gives the mouse position."
(declare-function swiper--cleanup "swiper")
(declare-function swiper--add-overlays "swiper")
(defvar ivy-occur-timer nil)
-(defvar counsel-grep-last-line)
(defun ivy--occur-press-update-window ()
- (cl-case (ivy-state-caller ivy-occur-last)
- ((swiper swiper-isearch counsel-git-grep counsel-grep counsel-ag
counsel-rg)
+ (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)))
- (if (not (buffer-live-p buffer))
- (error "Buffer was killed")
+ (when (buffer-live-p buffer)
(cond ((or (not (window-live-p window))
(equal window (selected-window)))
(save-selected-window
@@ -4727,7 +4887,8 @@ EVENT gives the mouse position."
(with-selected-window window
(switch-to-buffer buffer)))))))
- ((counsel-describe-function counsel-describe-variable)
+ ((memq (ivy-state-caller ivy-occur-last)
+ '(counsel-describe-function counsel-describe-variable))
(setf (ivy-state-window ivy-occur-last)
(selected-window))
(selected-window))))
@@ -4755,7 +4916,6 @@ EVENT gives the mouse position."
(action (ivy--get-action ivy-last))
(ivy-exit 'done))
(with-ivy-window
- (setq counsel-grep-last-line nil)
(with-current-buffer (ivy--occur-press-buffer)
(save-restriction
(widen)
@@ -4765,8 +4925,7 @@ EVENT gives the mouse position."
(assoc str coll)
(substring str offset)))))
(if (memq (ivy-state-caller ivy-last)
- '(swiper swiper-isearch
- counsel-git-grep counsel-grep counsel-ag counsel-rg))
+ (append '(swiper swiper-isearch)
ivy-highlight-grep-commands))
(with-current-buffer (window-buffer (selected-window))
(swiper--cleanup)
(swiper--add-overlays
@@ -4872,6 +5031,26 @@ make decisions based on the whole marked list."
(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/packages/ivy/ivy.info b/packages/ivy/ivy.info
index 80263fd..caa0fd6 100644
--- a/packages/ivy/ivy.info
+++ b/packages/ivy/ivy.info
@@ -1,6 +1,6 @@
This is ivy.info, produced by makeinfo version 6.5 from ivy.texi.
-Ivy manual, version 0.11.0
+Ivy manual, version 0.13.0
Ivy is an interactive interface for completion in Emacs. Emacs uses
completion mechanism in a variety of contexts: code, menus, commands,
@@ -11,18 +11,14 @@ available choices while previewing in the minibuffer.
Selecting the
final candidate is either through simple keyboard character inputs or
through powerful regular expressions.
- Copyright (C) 2015-2018 Free Software Foundation, Inc.
+ Copyright (C) 2015-2019 Free Software Foundation, Inc.
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, with the Front-Cover Texts
- being “A GNU Manual,” and with the Back-Cover Texts as in (a)
- below. A copy of the license is included in the section entitled
- “GNU Free Documentation License.”
-
- (a) The FSF’s Back-Cover Text is: “You have the freedom to copy and
- modify this GNU manual.”
+ 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".
INFO-DIR-SECTION Emacs
START-INFO-DIR-ENTRY
* Ivy: (ivy). Using Ivy for completion.
@@ -314,14 +310,19 @@ with some sample bindings:
Ivy-based interface to standard commands
........................................
- (global-set-key (kbd "C-s") 'swiper)
+ (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)
Ivy-based interface to shell and system tools
.............................................
@@ -329,9 +330,14 @@ Ivy-based interface to shell and system tools
(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 k") 'counsel-ag)
+ (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)
Ivy-resume and other commands
.............................
@@ -339,6 +345,15 @@ Ivy-resume and other commands
‘ivy-resume’ resumes the last Ivy-based completion.
(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)
+
+ You can also enable ‘counsel-mode’ to make some global key binding
+remapping for you.
File: ivy.info, Node: Minibuffer key bindings, Prev: Global key bindings,
Up: Key bindings
@@ -499,8 +514,8 @@ version of the regular commands that enables applying
multiple actions.
‘C-M-n’ (‘ivy-next-line-and-call’)
..................................
- Combines ‘C-n’ and ‘C-M-m’. Applies an action and moves to next
- line.
+ 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’,
@@ -664,6 +679,17 @@ jjjj’ in Hydra.
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.
+
File: ivy.info, Node: Saving the current completion session to a buffer,
Prev: Hydra in the minibuffer, Up: Minibuffer key bindings
@@ -1299,6 +1325,11 @@ File: ivy.info, Node: Using TRAMP, Up: File Name
Completion
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.
@@ -1533,7 +1564,6 @@ argument.
:preselect (ivy-thing-at-point)
:history 'counsel-describe-symbol-history
:require-match t
- :sort t
:action (lambda (x)
(describe-function
(intern x)))
@@ -1555,13 +1585,6 @@ that they appear:
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 ‘sort’ argument is set to ‘t’ so choosing between similar
- candidates becomes easier. Sometimes, the collection size will
- exceed ‘ivy-sort-max-size’, which is 30000 by default. In that
- case the sorting will not happen to avoid delays.
-
- Adjust this variable to choose between sorting time and completion
- start-up time.
• The ‘action’ argument calls ‘describe-function’ on the interned
selected candidate.
• The ‘caller’ argument identifies this completion session. This is
@@ -1800,6 +1823,7 @@ Keystroke Index
(line 45)
* ~: File Name Completion. (line 30)
* ~ <1>: Using TRAMP. (line 9)
+* ~~: Using TRAMP. (line 29)
* a: Hydra in the minibuffer.
(line 65)
* a <1>: Saving the current completion session
to a buffer.
@@ -1874,53 +1898,53 @@ Keystroke Index
Tag Table:
-Node: Top1361
-Node: Introduction3272
-Node: Installation5795
-Node: Installing from Emacs Package Manager6245
-Node: Installing from the Git repository7359
-Node: Getting started8179
-Node: Basic customization8486
-Node: Key bindings9081
-Node: Global key bindings9273
-Node: Minibuffer key bindings10713
-Node: Key bindings for navigation11945
-Node: Key bindings for single selection action then exit minibuffer13152
-Node: Key bindings for multiple selections and actions keep minibuffer
open15799
-Node: Key bindings that alter the minibuffer input18191
-Node: Other key bindings20136
-Node: Hydra in the minibuffer20514
-Node: Saving the current completion session to a buffer22617
-Node: Completion Styles24029
-Node: ivy--regex-plus25780
-Node: ivy--regex-ignore-order27266
-Node: ivy--regex-fuzzy27634
-Node: Customization28131
-Node: Faces28317
-Node: Defcustoms30746
-Node: Actions32040
-Node: What are actions?32366
-Node: How can different actions be called?33184
-Node: How to modify the actions list?33755
-Node: Example - add two actions to each command34415
-Node: How to undo adding the two actions35374
-Node: How to add actions to a specific command35826
-Node: Example - define a new command with several actions36242
-Node: Test the above function with ivy-occur37130
-Node: Packages37972
-Node: Commands38937
-Node: File Name Completion39122
-Node: Using TRAMP40918
-Node: Buffer Name Completion42365
-Node: Counsel commands42980
-Node: API43627
-Node: Required arguments for ivy-read44225
-Node: Optional arguments for ivy-read44744
-Node: Example - counsel-describe-function48170
-Node: Example - counsel-locate51413
-Node: Example - ivy-read-with-extra-properties55163
-Node: Variable Index56371
-Node: Keystroke Index63418
+Node: Top1189
+Node: Introduction3100
+Node: Installation5623
+Node: Installing from Emacs Package Manager6073
+Node: Installing from the Git repository7187
+Node: Getting started8007
+Node: Basic customization8314
+Node: Key bindings8909
+Node: Global key bindings9101
+Node: Minibuffer key bindings11575
+Node: Key bindings for navigation12807
+Node: Key bindings for single selection action then exit minibuffer14014
+Node: Key bindings for multiple selections and actions keep minibuffer
open16661
+Node: Key bindings that alter the minibuffer input19053
+Node: Other key bindings20998
+Node: Hydra in the minibuffer21376
+Node: Saving the current completion session to a buffer23794
+Node: Completion Styles25206
+Node: ivy--regex-plus26957
+Node: ivy--regex-ignore-order28443
+Node: ivy--regex-fuzzy28811
+Node: Customization29308
+Node: Faces29494
+Node: Defcustoms31923
+Node: Actions33217
+Node: What are actions?33543
+Node: How can different actions be called?34361
+Node: How to modify the actions list?34932
+Node: Example - add two actions to each command35592
+Node: How to undo adding the two actions36551
+Node: How to add actions to a specific command37003
+Node: Example - define a new command with several actions37419
+Node: Test the above function with ivy-occur38307
+Node: Packages39149
+Node: Commands40114
+Node: File Name Completion40299
+Node: Using TRAMP42095
+Node: Buffer Name Completion43597
+Node: Counsel commands44212
+Node: API44859
+Node: Required arguments for ivy-read45457
+Node: Optional arguments for ivy-read45976
+Node: Example - counsel-describe-function49402
+Node: Example - counsel-locate52260
+Node: Example - ivy-read-with-extra-properties56010
+Node: Variable Index57218
+Node: Keystroke Index64265
End Tag Table
diff --git a/packages/ivy/swiper.el b/packages/ivy/swiper.el
index 500ac18..f2305ec 100644
--- a/packages/ivy/swiper.el
+++ b/packages/ivy/swiper.el
@@ -1,11 +1,11 @@
;;; swiper.el --- Isearch with an overview. Oh, man! -*- lexical-binding: t -*-
-;; Copyright (C) 2015-2018 Free Software Foundation, Inc.
+;; Copyright (C) 2015-2019 Free Software Foundation, Inc.
;; Author: Oleh Krehel <address@hidden>
;; URL: https://github.com/abo-abo/swiper
-;; Version: 0.12.0
-;; Package-Requires: ((emacs "24.1") (ivy "0.12.0"))
+;; Version: 0.13.0
+;; Package-Requires: ((emacs "24.5") (ivy "0.13.0"))
;; Keywords: matching
;; This file is part of GNU Emacs.
@@ -170,8 +170,9 @@ Treated as non-nil when searching backwards."
(let ((end (window-end (selected-window) t))
(re (ivy--regex ivy-text)))
(save-excursion
- (goto-char (window-start))
- (while (re-search-forward re end t)
+ (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
@@ -180,7 +181,9 @@ Treated as non-nil when searching backwards."
(lambda (x)
(list `(match-string ,x) (match-string x)))
(number-sequence 0 (1- (/ (length md) 2)))))
- (push ov swiper--query-replace-overlays)))))))
+ (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."
@@ -206,7 +209,7 @@ Treated as non-nil when searching backwards."
(ivy-read
(format "Query replace %s with: " from) nil
:def default
- :update-fn #'swiper--query-replace-updatefn)
+ :caller 'swiper-query-replace)
t)))
(swiper--cleanup)
(ivy-exit-with-action
@@ -218,6 +221,9 @@ Treated as non-nil when searching backwards."
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 ()
@@ -370,11 +376,17 @@ Make sure `swiper-mc' is on `mc/cmds-to-run-once' list."
(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)))
+ (recenter-top-bottom arg)
+ (setq swiper--current-window-start (window-start))))
(defvar swiper-font-lock-exclude
'(Man-mode
@@ -436,7 +448,7 @@ Make sure `swiper-mc' is on `mc/cmds-to-run-once' list."
(not (derived-mode-p 'prog-mode))))
(defun swiper-font-lock-ensure ()
- "Ensure the entired buffer is highlighted."
+ "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)
@@ -447,7 +459,7 @@ Make sure `swiper-mc' is on `mc/cmds-to-run-once' list."
"Store the current candidates format spec.")
(defvar swiper--width nil
- "Store the number of digits needed for the longest line nubmer.")
+ "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'.")
@@ -528,7 +540,7 @@ numbers; replaces calculating the width from buffer line
count."
(put-text-property
0 1 'display line-number-str str))
(put-text-property
- 0 1 'swiper-line-number line-number-str str))
+ 0 1 'swiper-line-number line-number str))
(push str candidates)))
(funcall advancer 1)
(cl-incf line-number))
@@ -538,13 +550,6 @@ numbers; replaces calculating the width from buffer line
count."
"The point when `swiper' starts.")
;;;###autoload
-(defun swiper (&optional initial-input)
- "`isearch-forward' with an overview.
-When non-nil, INITIAL-INPUT is the initial search pattern."
- (interactive)
- (swiper--ivy (swiper--candidates) initial-input))
-
-;;;###autoload
(defun swiper-backward (&optional initial-input)
"`isearch-backward' with an overview.
When non-nil, INITIAL-INPUT is the initial search pattern."
@@ -571,11 +576,6 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(deactivate-mark))
(swiper-all thing)))
-(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--extract-matches (regex cands)
"Extract captured REGEX groups from CANDS."
(let (res)
@@ -604,15 +604,16 @@ such as `scroll-conservatively' are set to a high value.")
(if (eq (ivy-state-caller ivy-last) 'swiper-isearch)
(swiper--isearch-occur-cands cands)
(mapcar (lambda (s)
- (let ((l (get-text-property 0 'swiper-line-number
s)))
+ (let ((n (get-text-property 0 'swiper-line-number
s)))
(setq s (substring s 1))
- (put-text-property 0 1 'swiper-line-number l s)
- (cons (read l) s)))
+ (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))))
@@ -629,11 +630,32 @@ such as `scroll-conservatively' are set to a high value.")
(setq last-pt pt))
(nreverse res)))
-(defun swiper-occur (&optional revert)
+(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 REVERT is non-nil, regenerate the current *ivy-occur* buffer.
When capture groups are present in the input, print them instead of lines."
- (let* ((buffer (ivy-state-buffer ivy-last))
+ (let* ((buffer (swiper--occur-buffer))
(fname (propertize
(with-ivy-window
(if (buffer-file-name buffer)
@@ -648,15 +670,14 @@ When capture groups are present in the input, print them
instead of lines."
(cands
(swiper--occur-cands
fname
- (if (not revert)
- ivy--old-cands
- (setq ivy--old-re nil)
- (save-window-excursion
- (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)))))))
+ (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
@@ -667,18 +688,8 @@ When capture groups are present in the input, print them
instead of lines."
(unless (eq major-mode 'ivy-occur-grep-mode)
(ivy-occur-grep-mode)
(font-lock-mode -1))
- (setq swiper--current-window-start nil)
- (insert (format "-*- mode:grep; default-directory: %S -*-\n\n\n"
- default-directory))
- (insert (format "%d candidates:\n" (length cands)))
- (ivy--occur-insert-lines
- (mapcar
- (lambda (cand) (concat "./" cand))
- cands))
- (goto-char (point-min))
- (forward-line 4))))
-
-(ivy-set-occur 'swiper 'swiper-occur)
+ (swiper--occur-insert-lines
+ (mapcar (lambda (cand) (concat "./" cand)) cands)))))
(declare-function evil-set-jump "ext:evil-jumps")
@@ -725,17 +736,26 @@ line numbers. For the buffer, use `ivy--regex' instead."
(cl-remove-if-not #'cdr re)
".*?")
re)))
- (if (zerop ivy--subexps)
- (prog1 (format "^ ?\\(%s\\)" re)
- (setq ivy--subexps 1))
- (format "^ %s" 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)
- (let ((subs (ivy--split str)))
- (setq ivy--subexps (length subs))
- (mapconcat
- (lambda (s) (format "\\(%s\\)" (char-fold-to-regexp s)))
- subs
- ".*?")))
+ (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))
@@ -750,43 +770,60 @@ line numbers. For the buffer, use `ivy--regex' instead."
"When non-nil don't go back to search start on abort."
:type 'boolean)
-(defun swiper--ivy (candidates &optional initial-input)
- "Select one of CANDIDATES and move there.
+;;;###autoload
+(defun swiper (&optional initial-input)
+ "`isearch-forward' with an overview.
When non-nil, INITIAL-INPUT is the initial search pattern."
- (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 preselect
- :require-match t
- :update-fn #'swiper--update-input-ivy
- :unwind #'swiper--cleanup
- :action #'swiper--action
- :re-builder #'swiper--re-builder
- :history 'swiper-history
- :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))
- (when swiper--reveal-mode
- (reveal-mode 1)))))
+ (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'."
@@ -891,15 +928,15 @@ the face, window and priority of the overlay."
(with-ivy-window
(swiper--cleanup)
(when (> (length (ivy-state-current ivy-last)) 0)
- (let ((regexps (swiper--positive-regexps ivy-text)))
+ (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))
- (str (get-text-property 0 'swiper-line-number
(ivy-state-current ivy-last)))
- (num (if (string-match "^[0-9]+" str)
- (string-to-number (match-string 0 str))
- 0)))
+ (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
@@ -924,12 +961,7 @@ the face, window and priority of the overlay."
(setq swiper--current-match-start (match-beginning 0))))
(isearch-range-invisible (line-beginning-position)
(line-end-position))
- (when (and (swiper--recenter-p)
- (or
- (< (point) (window-start))
- (> (point) (window-end (ivy-state-window ivy-last)
t))))
- (recenter))
- (setq swiper--current-window-start (window-start))))
+ (swiper--maybe-recenter)))
(swiper--add-overlays
re
(max
@@ -941,9 +973,11 @@ the face, window and priority of the overlay."
(if (swiper--recenter-p)
(window-end (selected-window) t)
(line-end-position (window-height)))
- swiper--point-max))))))))
+ swiper--point-max)
+ nil
+ re-idx)))))))
-(defun swiper--add-overlays (re &optional beg end wnd)
+(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."
@@ -984,16 +1018,16 @@ WND, when specified is the window."
(buffer-substring-no-properties
(line-beginning-position)
(line-end-position)))))))
- (swiper--add-properties faces adder-fn)))))))))
+ (swiper--add-properties faces adder-fn re-idx)))))))))
-(defun swiper--add-properties (faces adder-fn)
+(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)
- (cadr faces)
+ (nth (1+ (mod (or re-idx 0) (1- (length faces)))) faces)
(car faces))
0)))
(let ((i 1)
@@ -1023,11 +1057,23 @@ WND, when specified is the window."
(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- (read (get-text-property 0 'swiper-line-number x))))
- (re (ivy--regex ivy-text)))
+ (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
@@ -1045,11 +1091,7 @@ WND, when specified is the window."
(when (and (re-search-forward re (line-end-position) t)
swiper-goto-start-of-match)
(goto-char (match-beginning 0)))
(swiper--ensure-visible)
- (cond (swiper-action-recenter
- (recenter))
- ((and swiper--current-window-start
- (swiper--recenter-p))
- (set-window-start (selected-window)
swiper--current-window-start)))
+ (swiper--maybe-recenter)
(when (/= (point) swiper--opoint)
(unless (and transient-mark-mode mark-active)
(when (eq ivy-exit 'done)
@@ -1104,9 +1146,13 @@ Run `swiper' for those buffers."
(let ((swiper-window-width (- (- (frame-width) (if (display-graphic-p) 0 1))
4)))
(ivy-read "Swiper: " swiper-multi-candidates
:action #'swiper-multi-action-2
- :unwind #'swiper--cleanup
: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
@@ -1138,7 +1184,7 @@ otherwise continue prompting for buffers."
(with-ivy-window
(switch-to-buffer buffer-name)
(goto-char (point-min))
- (forward-line (1- (read (get-text-property 0 'swiper-line-number
x))))
+ (forward-line (1- (get-text-property 0 'swiper-line-number x)))
(re-search-forward
(ivy--regex ivy-text)
(line-end-position) t)
@@ -1248,14 +1294,15 @@ See `ivy-format-functions-alist' for further
information."
(let ((swiper-window-width (- (frame-width) (if (display-graphic-p) 0 1))))
(ivy-read "swiper-all: " 'swiper-all-function
:action #'swiper-all-action
- :unwind #'swiper--cleanup
- :update-fn 'auto
:dynamic-collection t
:keymap swiper-all-map
:initial-input initial-input
- :caller 'swiper-multi)))
+ :caller 'swiper-all)))
-(add-to-list 'ivy-format-functions-alist '(swiper-multi .
swiper--all-format-function))
+(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'."
@@ -1285,14 +1332,6 @@ See `ivy-format-functions-alist' for further
information."
res))
;;* `swiper-isearch'
-(defvar swiper--isearch-point-history nil
- "Store the current input and point history for a single search.
-Each element is a cons cell of an input and a point position that
-corresponds to it.
-
-This ensures that if the user enters \"ab\", the point will
-come back to the same place as when \"a\" was initially entered.")
-
(defun swiper-isearch-function (str)
"Collect STR matches in the current buffer for `swiper-isearch'."
(with-ivy-window
@@ -1306,44 +1345,79 @@ come back to the same place as when \"a\" was initially
entered.")
(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* ((case-fold-search (ivy--case-fold-p str))
- (re-full (funcall ivy--regex-function str))
- (re (ivy-re-to-str re-full)))
- (unless (string= re "")
- (let ((re (if (string-match "\\`\\(.*\\)[\\]|\\'" re)
- (match-string 1 re)
- re))
- (pt-hist (cdr (assoc str swiper--isearch-point-history)))
- cands
- idx-found
- (idx 0))
- (save-excursion
- (goto-char (if swiper--isearch-backward (point-max) (point-min)))
- (while (funcall (if swiper--isearch-backward #'re-search-backward
#'re-search-forward) re nil t)
- (when (swiper-match-usable-p)
- (unless idx-found
- (when (or
- (eq (match-beginning 0) pt-hist)
- (if swiper--isearch-backward
- (<= (match-beginning 0) (cdar
swiper--isearch-point-history))
- (>= (match-beginning 0) (cdar
swiper--isearch-point-history))))
- (push (cons str (match-beginning 0))
swiper--isearch-point-history)
- (setq idx-found idx)))
- (cl-incf idx)
- (let ((pos (if (or swiper--isearch-backward
swiper-goto-start-of-match)
- (match-beginning 0)
- (point))))
- (push pos cands)))))
+ (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)
- (when idx-found
- (ivy-set-index (if swiper--isearch-backward
- (- (length cands) idx-found 1)
- idx-found)))
- (setq ivy--old-cands (if swiper--isearch-backward
- cands
- (nreverse cands)))))))
+ (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.
@@ -1376,9 +1450,13 @@ that we search only for one character."
(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)))
- (when swiper-action-recenter
- (recenter))
+ (swiper--maybe-recenter)
(unless (eq ivy-exit 'done)
(swiper--cleanup)
(swiper--delayed-add-overlays)
@@ -1386,6 +1464,16 @@ that we search only for one character."
(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."
@@ -1399,8 +1487,6 @@ When not running `swiper-isearch' already, start it."
(deactivate-mark))
(bounds-of-thing-at-point 'symbol)))
(setq str (buffer-substring-no-properties (car bnd) (cdr bnd))))
- (setq swiper--isearch-point-history
- (list (cons "" (car bnd))))
(insert str)
(unless regionp
(ivy--insert-symbol-boundaries)))
@@ -1434,11 +1520,13 @@ When not running `swiper-isearch' already, start it."
(defun swiper-isearch-format-function (cands)
(if (numberp (car-safe cands))
- (swiper--isearch-format
- ivy--index ivy--length ivy--old-cands
- ivy--old-re
- (ivy-state-current ivy-last)
- (ivy-state-buffer ivy-last))
+ (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)
@@ -1518,10 +1606,8 @@ When not running `swiper-isearch' already, start it."
"A `swiper' that's not line-based."
(interactive)
(swiper--init)
+ (setq swiper--isearch-start-point (point))
(swiper-font-lock-ensure)
- (setq swiper--isearch-point-history
- (list
- (cons "" (- (point) (if swiper--isearch-backward 1 0)))))
(let ((ivy-fixed-height-minibuffer t)
(cursor-in-non-selected-windows nil)
(swiper-min-highlight 1)
@@ -1537,18 +1623,24 @@ When not running `swiper-isearch' already, start it."
:dynamic-collection t
:require-match t
:action #'swiper-isearch-action
- :update-fn 'auto
- :unwind #'swiper--cleanup
: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."
@@ -1556,9 +1648,6 @@ When not running `swiper-isearch' already, start it."
(let ((swiper--isearch-backward t))
(swiper-isearch initial-input)))
-(add-to-list 'ivy-format-functions-alist '(swiper-isearch .
swiper-isearch-format-function))
-(ivy-set-occur 'swiper-isearch 'swiper-occur)
-
(defun swiper-isearch-toggle ()
"Two-way toggle between `swiper-isearch' and isearch.
Intended to be bound in `isearch-mode-map' and `swiper-map'."
diff --git a/packages/ivy/targets/checkdoc.el b/packages/ivy/targets/checkdoc.el
deleted file mode 100644
index d49b6bf..0000000
--- a/packages/ivy/targets/checkdoc.el
+++ /dev/null
@@ -1,8 +0,0 @@
-;; Copyright (C) 2017 Free Software Foundation, Inc.
-
-(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/packages/ivy/targets/obsolete-config.el
b/packages/ivy/targets/obsolete-config.el
deleted file mode 100644
index e6fbe6f..0000000
--- a/packages/ivy/targets/obsolete-config.el
+++ /dev/null
@@ -1,5 +0,0 @@
-;; Copyright (C) 2017 Free Software Foundation, Inc.
-
-(add-to-list 'load-path default-directory)
-(require 'counsel)
-(byte-compile-file (expand-file-name "targets/obsolete-config.el"))
diff --git a/packages/ivy/targets/plain.el b/packages/ivy/targets/plain.el
deleted file mode 100644
index e73dc91..0000000
--- a/packages/ivy/targets/plain.el
+++ /dev/null
@@ -1,11 +0,0 @@
-;; Copyright (C) 2017 Free Software Foundation, Inc.
-
-(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)
- [elpa] master 589e03f 144/184: ivy.el (ivy-configure): Use for ivy-index-functions-alist, (continued)
- [elpa] master 589e03f 144/184: ivy.el (ivy-configure): Use for ivy-index-functions-alist, Oleh Krehel, 2019/10/16
- [elpa] master 64c0804 163/184: ivy.el (ivy-partial-or-done): Work with completion-cycle-threshold, Oleh Krehel, 2019/10/16
- [elpa] master 6f23c5e 152/184: ivy.el (ivy-occur-press): Re-use ivy-highlight-grep-commands, Oleh Krehel, 2019/10/16
- [elpa] master f46cdad 154/184: counsel.el (counsel-grep): Add :require-match, Oleh Krehel, 2019/10/16
- [elpa] master 2d840b8 157/184: ivy.el (ivy-configure): Add :sort-fn, Oleh Krehel, 2019/10/16
- [elpa] master f0451db 173/184: ivy.el (ivy-occur-revert-buffer): Don't error if the swiper buffer was killed, Oleh Krehel, 2019/10/16
- [elpa] master 3bd1d87 182/184: counsel.el (counsel-locate-cmd-es): Encode command to local codepage, Oleh Krehel, 2019/10/16
- [elpa] master 8b4693c 169/184: counsel.el (counsel-imenu-action and -get-canditates-from): Revert., Oleh Krehel, 2019/10/16
- [elpa] master 882d6c4 161/184: counsel.el (counsel-imenu): Work with :update-fn 'auto, Oleh Krehel, 2019/10/16
- [elpa] master 1a9002b 168/184: ivy.el: Clean up obsolete aliases, Oleh Krehel, 2019/10/16
- [elpa] master c2d3a4c 184/184: Merge commit 'cd634c6f51458f81898ecf2821ac3169cb65a1eb' from ivy,
Oleh Krehel <=
- [elpa] master 12f4771 124/184: ivy.el (ivy-completion-in-region): Add workaround for package-menu-filter, Oleh Krehel, 2019/10/16
- [elpa] master 2b974b4 139/184: ivy.el (ivy-update-fns-alist): New defcustom, Oleh Krehel, 2019/10/16
- [elpa] master 57e0b94 146/184: swiper.el (swiper--action): Set case-fold-search, Oleh Krehel, 2019/10/16
- [elpa] master cdca2fc 141/184: counsel.el (counsel-switch-buffer): Re-use ivy-switch-buffer, Oleh Krehel, 2019/10/16
- [elpa] master a5701a9 159/184: ivy.el (ivy-configure): Add :format-fn, Oleh Krehel, 2019/10/16
- [elpa] master 4d533b2 178/184: counsel.el (counsel-dired): Filter to directories only, Oleh Krehel, 2019/10/16
- [elpa] master ec1ed07 171/184: counsel.el (counsel--find-file-1): Use dired-current-directory for dired, Oleh Krehel, 2019/10/16
- [elpa] master 1d8803e 181/184: Ensure that ripgrep on windows uses '/' as the path-separator, Oleh Krehel, 2019/10/16
- [elpa] master 7854d03 129/184: counsel.el (counsel-google): Add, Oleh Krehel, 2019/10/16
- [elpa] master cd634c6 183/184: doc/Changelog.org: Release 0.13.0, Oleh Krehel, 2019/10/16