]> code.delx.au - gnu-emacs-elpa/log
gnu-emacs-elpa
9 years agoAllow "TAB" to complete when input starts with "^"
Oleh Krehel [Fri, 12 Jun 2015 08:37:08 +0000 (10:37 +0200)]
Allow "TAB" to complete when input starts with "^"

* ivy.el (ivy-partial): Strip "^" when forwarding to `try-completion'.
Afterwards, put it back.

Fixes #138

9 years agoFixup ivy-resume for file completion
Oleh Krehel [Wed, 10 Jun 2015 16:05:32 +0000 (18:05 +0200)]
Fixup ivy-resume for file completion

* ivy.el (ivy-resume): No longer add the preselect.
(ivy-read): Don't add initial-input "".

9 years agoAdd fuzzy matching function
Oleh Krehel [Wed, 10 Jun 2015 13:38:18 +0000 (15:38 +0200)]
Add fuzzy matching function

ivy.el (ivy--regex-fuzzy): New defun.

To enable fuzzy matching, set your `ivy-re-builders-alist' accordingly:

(setq ivy-re-builders-alist
      '((t . ivy--regex-fuzzy)))

Re #136

9 years agocounsel.el (counsel-M-x): Piggyback on smex for sorting
Oleh Krehel [Wed, 10 Jun 2015 13:25:03 +0000 (15:25 +0200)]
counsel.el (counsel-M-x): Piggyback on smex for sorting

* counsel.el (counsel-M-x): When smex is present, use it for sorting the
  candidates. Also use `counsel-describe-map', so that "C-." and "C-,"
  work for commands.

Re #136

9 years agocounsel.el (counsel-M-x): New command
Oleh Krehel [Wed, 10 Jun 2015 11:47:33 +0000 (13:47 +0200)]
counsel.el (counsel-M-x): New command

* counsel.el (counsel--format-function-M-x): New defun.

Re #136.

9 years agocounsel.el (counsel-symbol-at-point): Improve
Oleh Krehel [Wed, 10 Jun 2015 08:49:20 +0000 (10:49 +0200)]
counsel.el (counsel-symbol-at-point): Improve

Fixes #137

9 years agoAdd a hack for kill-buffer and invisible buffer
Oleh Krehel [Tue, 9 Jun 2015 17:37:55 +0000 (19:37 +0200)]
Add a hack for kill-buffer and invisible buffer

* ivy.el (ivy-read): When COLLECTION is 'internal-complete-buffer,
  ignore the fact that REQUIRE-MATCH was set to t.
  Normally, when REQUIRE-MATCH is t, the COLLECTION should not be
  extended with PRESELECT.

Fixes #135

9 years agoAccount for minibuffer-depth-indication-mode
Oleh Krehel [Tue, 9 Jun 2015 13:03:24 +0000 (15:03 +0200)]
Account for minibuffer-depth-indication-mode

* ivy.el (ivy--insert-prompt): When `minibuffer-depth-indication-mode'
  is on, and `minibuffer-depth' is more than 1, prepend it to prompt.

Fixes #134

9 years agoivy.el (ivy--switch-buffer-action): Add work-around
Oleh Krehel [Tue, 9 Jun 2015 12:54:24 +0000 (14:54 +0200)]
ivy.el (ivy--switch-buffer-action): Add work-around

If BUFFER is live, and can also be virtual, don't open the virtual one.
This work-around should be disabled once uniquify is added to buffer list.

9 years agocounsel-git-grep should quote strings better
Oleh Krehel [Tue, 9 Jun 2015 08:03:20 +0000 (10:03 +0200)]
counsel-git-grep should quote strings better

* counsel.el (counsel-git-grep-function):
(counsel--gg-candidates): Update.

Fixes an errror when the input has a " in it.

9 years agoivy.el (ivy-minibuffer-map): Bind ivy-yank-word to "M-j"
Oleh Krehel [Mon, 8 Jun 2015 19:37:54 +0000 (21:37 +0200)]
ivy.el (ivy-minibuffer-map): Bind ivy-yank-word to "M-j"

Re #133

9 years agoMake counsel-git-grep fully async
Oleh Krehel [Thu, 4 Jun 2015 16:45:40 +0000 (18:45 +0200)]
Make counsel-git-grep fully async

* counsel.el (counsel-git-grep-count): Rename to `counsel--gg-count' and
  make it async.
(counsel-git-grep-function): Set `ivy--full-length' to -1. It means that
`ivy--exhibit' should do nothing until the length is re-computed.
(counsel-git-grep): Use the sync version of `counsel-git-grep-count' for
the initial repo line count.
(counsel--gg-candidates): New defun. When called, kill the previous
git grep process and start a new one. The sentinel will insert the
candidates, bypassing the `ivy--exhibit'.
(counsel--gg-sentinel): New defun.
(counsel--gg-count): Rename from `counsel-git-grep-count'. When finished
computing, redisplay.

* ivy.el (ivy--exhibit): Don't expect dynamic collection to return the
  candidates as before. Just call it and expect it to redisplay the
  minibuffer.

9 years agoFixup compilation warnings
Oleh Krehel [Thu, 4 Jun 2015 16:42:52 +0000 (18:42 +0200)]
Fixup compilation warnings

9 years agoRegexp-quote name of candidate buffer to be preselected
Tassilo Horn [Thu, 4 Jun 2015 10:12:10 +0000 (12:12 +0200)]
Regexp-quote name of candidate buffer to be preselected

Fixes #128

9 years agoivy.el (ivy-virtual): New defface
Oleh Krehel [Thu, 4 Jun 2015 07:45:51 +0000 (09:45 +0200)]
ivy.el (ivy-virtual): New defface

* ivy.el (ivy--virtual-buffers): Use `ivy-virtual'.
No need for `ido-use-faces' approach, the user can just customize
`ivy-virtual' to look like `default' if needed.

Fixes #129

9 years agoivy.el (ivy--done): Set ivy--current
Oleh Krehel [Tue, 2 Jun 2015 09:33:55 +0000 (11:33 +0200)]
ivy.el (ivy--done): Set ivy--current

Fixes a bug of using :action for completing file names.

9 years agoHandle symbol-at-point better in non-Elisp buffers
Oleh Krehel [Tue, 2 Jun 2015 06:48:38 +0000 (08:48 +0200)]
Handle symbol-at-point better in non-Elisp buffers

* counsel.el (counsel-symbol-at-point): New defun.
(counsel-describe-variable): Update.
(counsel-describe-function): Update.

Fixes #126

9 years agoSwiper should preserve column for empty input
Oleh Krehel [Mon, 1 Jun 2015 15:50:43 +0000 (17:50 +0200)]
Swiper should preserve column for empty input

swiper.el (swiper--update-input-ivy): When there's no input yet, don't
move point.

Re #125

9 years agoivy.el (ivy-yank-word): New command
Oleh Krehel [Mon, 1 Jun 2015 12:09:33 +0000 (14:09 +0200)]
ivy.el (ivy-yank-word): New command

* swiper.el (swiper--update-input-ivy): Move point to current regex, not
  just current line.

Gives a behavior similar to "C-w" of `isearch'. Possible binding:

    (define-key ivy-minibuffer-map (kbd "C-w") 'ivy-yank-word)

Fixes #125

9 years agoivy.el (ivy-recentf): New command
Oleh Krehel [Mon, 1 Jun 2015 08:37:44 +0000 (10:37 +0200)]
ivy.el (ivy-recentf): New command

Fixes #124

9 years agocounsel.el (counsel-find-file-at-point): New defcustom
Oleh Krehel [Sat, 30 May 2015 14:24:47 +0000 (16:24 +0200)]
counsel.el (counsel-find-file-at-point): New defcustom

* counsel.el (counsel-find-file): When `counsel-find-file-at-point' is
  non-nil, add the file at point to the list of candidates.

Fixes #123

9 years agocounsel.el (counsel-find-file): Extend `find-file'
Oleh Krehel [Sat, 30 May 2015 13:48:10 +0000 (15:48 +0200)]
counsel.el (counsel-find-file): Extend `find-file'

* counsel.el (counsel-find-file): Forward to `find-file', with Ivy
  completion. `ivy-next-line-and-call' as well as `ivy-resume' should
  work.
(counsel--find-file-matcher): New defun.
(counsel-find-file-ignore-regexp): Regexp of files to ignore.

Fixes #122

Recommended binding:

(global-set-key (kbd "C-x C-f") 'counsel-find-file)

Peek at files with "C-M-n" and "C-M-p". Input a leading dot to see all
files.

9 years agocounsel.el (counsel-info-lookup-symbol): Add a require
Oleh Krehel [Thu, 28 May 2015 20:30:20 +0000 (22:30 +0200)]
counsel.el (counsel-info-lookup-symbol): Add a require

In case it's called non-interactively.

9 years agoAdd info lookup binding to counsel-describe-map
Tassilo Horn [Thu, 28 May 2015 19:50:19 +0000 (21:50 +0200)]
Add info lookup binding to counsel-describe-map

* counsel.el (counsel-describe-map): Bind C-, to
counsel--info-lookup-symbol.
(counsel--info-lookup-symbol): New command.  Just sets the ivy action to
counsel-info-lookup-symbol.

9 years agoChange the :matcher interface
Oleh Krehel [Thu, 28 May 2015 09:45:26 +0000 (11:45 +0200)]
Change the :matcher interface

* ivy.el (ivy--filter): The matcher is now a function that takes a
  regexp and candidates and returns the filtered candidates.

* counsel.el (counsel-git-grep-matcher): Cache matched candidates. This
  is very important for "C-n" / "C-p", especially near the threshold
  where a switch to :dynamic-collection is made.

9 years agoAvoid ensuring font lock when magit-blame-mode is active
Oleh Krehel [Thu, 28 May 2015 08:19:32 +0000 (10:19 +0200)]
Avoid ensuring font lock when magit-blame-mode is active

swiper.el (swiper-font-lock-ensure): Update.

9 years agoAllow to open an Info file on the file system
Oleh Krehel [Tue, 26 May 2015 10:43:06 +0000 (12:43 +0200)]
Allow to open an Info file on the file system

* ivy.el (ivy-alt-done): Update.

When in Info-mode, press "g" and select either "(./)" or "(../)" to
switch to file name completion. That file will be opened with Info.

9 years agoswiper.el (swiper--ivy): Don't double-quote preselect
Oleh Krehel [Mon, 25 May 2015 20:28:36 +0000 (22:28 +0200)]
swiper.el (swiper--ivy): Don't double-quote preselect

The :preselect is already quoted in `ivy--preselect-index'.

9 years agoswiper.el (swiper-avy): Don't start on empty input
Oleh Krehel [Mon, 25 May 2015 20:27:42 +0000 (22:27 +0200)]
swiper.el (swiper-avy): Don't start on empty input

Fixes abo-abo/avy#50

9 years agoivy.el (ivy-next-line): Fix wraparound at end of candidates
Ingo Lohmar [Sun, 24 May 2015 09:02:50 +0000 (11:02 +0200)]
ivy.el (ivy-next-line): Fix wraparound at end of candidates

9 years agoswiper.el (swiper-avy): Use only the current window
Oleh Krehel [Sat, 23 May 2015 20:24:56 +0000 (22:24 +0200)]
swiper.el (swiper-avy): Use only the current window

Fixes #117

9 years agoswiper.el: Bump version
Oleh Krehel [Sat, 23 May 2015 11:22:00 +0000 (13:22 +0200)]
swiper.el: Bump version

9 years agoREADME.md: Add a secion on Ivy
Oleh Krehel [Thu, 21 May 2015 09:45:17 +0000 (11:45 +0200)]
README.md: Add a secion on Ivy

9 years agoThe :action parameter to ivy-read should take one arg
Oleh Krehel [Wed, 20 May 2015 17:00:48 +0000 (19:00 +0200)]
The :action parameter to ivy-read should take one arg

* ivy.el (ivy-next-line-and-call): Update.
(ivy-previous-line-and-call): Update.
(ivy-read): Update.
(ivy--switch-buffer-action): Update.

* swiper.el (swiper-query-replace): Update.

* counsel.el (counsel--find-symbol): Update.
(counsel-describe-variable): Update.
(counsel-describe-function): Update.
(counsel-git): Update.
(counsel-git-grep-action): Update.

9 years agoFixup "C-u C-j" for `ivy-switch-buffer'
Oleh Krehel [Wed, 20 May 2015 11:05:03 +0000 (13:05 +0200)]
Fixup "C-u C-j" for `ivy-switch-buffer'

ivy.el (ivy-immediate-done): Since action-style call is used now,
`ivy--current' must be set to `ivy-test', since it's `ivy--current' that
will count as completion result.

9 years agocounsel.el (counsel-git): Switch to action-style call
Oleh Krehel [Wed, 20 May 2015 09:40:44 +0000 (11:40 +0200)]
counsel.el (counsel-git): Switch to action-style call

This allows "C-M-n" and "C-M-p" to be used.

Re #114

9 years agoivy.el (ivy-completing-read): Check for a cons initial-input
Oleh Krehel [Wed, 20 May 2015 08:48:15 +0000 (10:48 +0200)]
ivy.el (ivy-completing-read): Check for a cons initial-input

9 years ago* swiper/ivy.el: Clean up regexps and pseudo-closures
Stefan Monnier [Thu, 21 May 2015 01:36:48 +0000 (21:36 -0400)]
* swiper/ivy.el: Clean up regexps and pseudo-closures

Don't require cl-lib twice.
(ivy-read, ivy--filter): Use closures instead of `(lambda ...).
(ivy--format, ivy--filter, ivy--exhibit, ivy--insert-prompt)
(ivy--regex-ignore-order, ivy--regex, ivy--sorted-files)
(ivy-partial-or-done, ivy-alt-done): Don't use ^/$ to match string bounds.

9 years agoFixup compilation warnings
Oleh Krehel [Tue, 19 May 2015 14:13:41 +0000 (16:13 +0200)]
Fixup compilation warnings

9 years agoWhen building a regex, consider ^ only at start
Oleh Krehel [Tue, 19 May 2015 12:54:42 +0000 (14:54 +0200)]
When building a regex, consider ^ only at start

swiper.el (swiper--re-builder): Update.

9 years agocounsel.el (counsel-info-lookup-symbol): Turn on sorting
Oleh Krehel [Tue, 19 May 2015 10:11:03 +0000 (12:11 +0200)]
counsel.el (counsel-info-lookup-symbol): Turn on sorting

9 years agoDon't try to call permanent action if there's none
Oleh Krehel [Sun, 17 May 2015 18:22:38 +0000 (20:22 +0200)]
Don't try to call permanent action if there's none

* ivy.el (ivy-next-line-and-call): Update.
(ivy-previous-line-and-call): Update.

Fixes #114.

9 years agoivy.el (ivy-forward-char): Add and bind to "C-f"
Oleh Krehel [Sun, 17 May 2015 10:47:45 +0000 (12:47 +0200)]
ivy.el (ivy-forward-char): Add and bind to "C-f"

This is to avoid problems for the ido-related "C-x C-f C-f" reflex.

9 years agoDon't error on incomplete bad regexp in counsel-git-grep
Oleh Krehel [Sat, 16 May 2015 12:43:51 +0000 (14:43 +0200)]
Don't error on incomplete bad regexp in counsel-git-grep

counsel.el (counsel-git-grep-matcher): Update.

9 years agocounsel.el (counsel-git-grep): Warn if not in a repository
Oleh Krehel [Sat, 16 May 2015 12:39:10 +0000 (14:39 +0200)]
counsel.el (counsel-git-grep): Warn if not in a repository

9 years agoivy.el (ivy-kill-word): Add and bind to "M-d"
Oleh Krehel [Sat, 16 May 2015 07:50:32 +0000 (09:50 +0200)]
ivy.el (ivy-kill-word): Add and bind to "M-d"

Fixes #94

9 years agoREADME.md: Add sample init
Oleh Krehel [Fri, 15 May 2015 07:20:59 +0000 (09:20 +0200)]
README.md: Add sample init

Fixes #112

9 years agoFixed ivy--preselect-index on windows where the drives folders ends with a backslash...
__rompy [Fri, 15 May 2015 06:09:46 +0000 (09:09 +0300)]
Fixed ivy--preselect-index on windows where the drives folders ends with a backslash (C:\, D:\)

9 years agoUpdate the way spaces are quoted using ivy
Oleh Krehel [Thu, 14 May 2015 13:05:24 +0000 (15:05 +0200)]
Update the way spaces are quoted using ivy

* ivy.el (ivy--split): Split only on single spaces. From all other space
  groups, remove one space.

* ivy-test.el (ivy--split): Add test.

Fixes #109

9 years agoivy.el (ivy-partial-or-done): More predictability
Oleh Krehel [Wed, 13 May 2015 21:47:12 +0000 (23:47 +0200)]
ivy.el (ivy-partial-or-done): More predictability

* ivy.el (ivy-partial-or-done): Forward to `ivy-alt-done' only if
  `ivy-partial' did nothing new, and either previous command was
  `ivy-partial-or-done', or there's exactly one matching candidate.

Fixes #107

9 years agoAllow to recenter with "C-l" during counsel-git-grep
Oleh Krehel [Wed, 13 May 2015 08:08:17 +0000 (10:08 +0200)]
Allow to recenter with "C-l" during counsel-git-grep

* counsel.el (counsel-git-grep-map): New defvar.
(counsel-git-grep-recenter): New command.
(counsel-git-grep-action): New defun.
(counsel-git-grep): Update.

Fixes #103

9 years agoivy.el (ivy-partial-or-done): Update doc
Oleh Krehel [Wed, 13 May 2015 08:05:00 +0000 (10:05 +0200)]
ivy.el (ivy-partial-or-done): Update doc

Re #105

9 years agoivy.el (ivy-partial-or-done): Always forward to `ivy-alt-done'
Oleh Krehel [Wed, 13 May 2015 07:46:07 +0000 (09:46 +0200)]
ivy.el (ivy-partial-or-done): Always forward to `ivy-alt-done'

Fixes #105

9 years agoivy.el (ivy-delete-char): Add and bind to "C-d"
Oleh Krehel [Tue, 12 May 2015 16:38:44 +0000 (18:38 +0200)]
ivy.el (ivy-delete-char): Add and bind to "C-d"

`delete-char' must not be called when at end of line, since that would
bring the first candidate into the input.

Fixes #94

9 years agoivy.el (ivy-switch-buffer): Preselect other-buffer
Oleh Krehel [Tue, 12 May 2015 16:05:45 +0000 (18:05 +0200)]
ivy.el (ivy-switch-buffer): Preselect other-buffer

* ivy.el (ivy-switch-buffer): Preselect other buffer, just like
  `switch-to-buffer' does it.

9 years agoivy.el (ivy-read): Keep the last ivy--index for :dynamic-collection
Oleh Krehel [Tue, 12 May 2015 13:35:06 +0000 (15:35 +0200)]
ivy.el (ivy-read): Keep the last ivy--index for :dynamic-collection

9 years agocounsel-git-grep now works with ivy-resume
Oleh Krehel [Tue, 12 May 2015 13:24:29 +0000 (15:24 +0200)]
counsel-git-grep now works with ivy-resume

* ivy.el (ivy-state): New field DYNAMIC-COLLECTION.
(ivy-resume): Update.
(ivy-read): New argument DYNAMIC-COLLECTION. When this is non-nil,
ignore collection and matchers etc, and just obtain the filtered
candidates by calling DYNAMIC-COLLECTION each time the input changes.

Fixes #100

9 years agoIntroduce :matcher for counsel-git-grep
Oleh Krehel [Tue, 12 May 2015 12:55:18 +0000 (14:55 +0200)]
Introduce :matcher for counsel-git-grep

* ivy.el (ivy-state): Add MATCHER field.
(ivy-resume): Update.
(ivy-read): Add MATCHER argument. To make things faster, MATCHER can
reuse `ivy--old-re', but it's not required. MATCHER is a function that
takes a candidate and returns non-nil if it matches.

* counsel.el (counsel-git-grep): Use :matcher.
(counsel-git-grep-matcher): New defun. Skip the file name and line
number, then match as usual.

Fixes #99

9 years agoForward to minibuffer-complete for filenames only if "^/"
Oleh Krehel [Tue, 12 May 2015 11:34:03 +0000 (13:34 +0200)]
Forward to minibuffer-complete for filenames only if "^/"

* ivy.el (ivy-partial-or-done): Update.

Fixes #102

9 years agoProperly update virtual buffers for "^ " interaction
Oleh Krehel [Tue, 12 May 2015 09:34:26 +0000 (11:34 +0200)]
Properly update virtual buffers for "^ " interaction

* ivy.el (ivy-read): Use `ivy--buffer-list'.
(ivy--exhibit): Use `ivy--buffer-list'.
(ivy-add-virtual-buffers): Remove.
(ivy--buffer-list): New defun.

Re #68

9 years agoFix the error switching to non-existent buffers
Oleh Krehel [Tue, 12 May 2015 09:17:46 +0000 (11:17 +0200)]
Fix the error switching to non-existent buffers

* ivy.el (ivy-read): Use `ivy-add-virtual-buffers'.
(ivy-buffer-list): Remove.
(ivy-add-virtual-buffers): New defun.
(ivy--switch-buffer-action): New defun, consider `ivy--current' being
zero length.
(ivy-switch-buffer): Use `ivy--switch-buffer-action'.

Fixes #101

9 years agoivy.el (ivy-partial-or-done): Fixup
Oleh Krehel [Mon, 11 May 2015 14:55:18 +0000 (16:55 +0200)]
ivy.el (ivy-partial-or-done): Fixup

* ivy.el (ivy-partial-or-done): Switch `default-directory' so that
  `minibuffer-complete' is aware of it. Select a directory only if there
  is only one.

9 years agoivy.el (ivy-partial-or-done): Fixup
Oleh Krehel [Mon, 11 May 2015 14:15:18 +0000 (16:15 +0200)]
ivy.el (ivy-partial-or-done): Fixup

9 years agoWhen completing file names, defer to `minibuffer-complete' for "TAB"
Oleh Krehel [Mon, 11 May 2015 14:02:57 +0000 (16:02 +0200)]
When completing file names, defer to `minibuffer-complete' for "TAB"

* ivy.el (ivy-partial-or-done): Call `minibuffer-complete'. If the
  resulting text is a valid directory, move there.
(ivy-read): Setup `minibuffer-completion-table' and
`minibuffer-completion-predicate'. This makes `minibuffer-complete'
work.

Fixes #92

9 years agoswiper.el (swiper-font-lock-ensure): Ignore fundamental-mode
Oleh Krehel [Mon, 11 May 2015 13:58:53 +0000 (15:58 +0200)]
swiper.el (swiper-font-lock-ensure): Ignore fundamental-mode

ELP uses this.

9 years agoAllow to customize the minibuffer formatter
Oleh Krehel [Mon, 11 May 2015 10:42:56 +0000 (12:42 +0200)]
Allow to customize the minibuffer formatter

* ivy.el (ivy-format-function): New defvar.
(ivy-format-function-default): New defun.
(ivy-format-function-arrow): New defun, alternative for
`ivy-format-function'.

Fixes #87

9 years agoUpdate test
Oleh Krehel [Mon, 11 May 2015 09:36:45 +0000 (11:36 +0200)]
Update test

ivy-test.el (swiper--re-builder): Rename from `ivy--transform-re'.

9 years agoSwiper should use the :re-builder argument
Oleh Krehel [Mon, 11 May 2015 09:07:07 +0000 (11:07 +0200)]
Swiper should use the :re-builder argument

* ivy.el (ivy--transform-re): Remove defun, :re-builder should be used
  for this logic.
(ivy--filter): Update.

* swiper.el (swiper-avy): Use `ivy--regex'.
(swiper--init): Don't set `ivy--regex-function' - it will be set by
:re-builder.
(swiper--re-builder): New defun.
(swiper--ivy): Use :re-builder in call to `ivy-read'.
(swiper--update-input-ivy): Use `ivy--regex'.
(swiper--action): Use `ivy--regex'.

Fixes #90

9 years agoivy.el (ivy-read): Add a re-builder argument
Oleh Krehel [Mon, 11 May 2015 08:41:13 +0000 (10:41 +0200)]
ivy.el (ivy-read): Add a re-builder argument

* ivy.el (ivy-state): Add a RE-BUILDER field.
(ivy-resume): Use RE-BUILDER field.
(ivy-read): Set `ivy--regex-function' to RE-BUILDER if it's given.

9 years agoivy.el (ivy-backward-kill-word): Add and bind to "M-DEL"
Oleh Krehel [Mon, 11 May 2015 08:08:35 +0000 (10:08 +0200)]
ivy.el (ivy-backward-kill-word): Add and bind to "M-DEL"

Fixes #94

9 years agoFix the transition from a bad regex to good one
Oleh Krehel [Sat, 9 May 2015 15:07:44 +0000 (17:07 +0200)]
Fix the transition from a bad regex to good one

* ivy.el (ivy--filter): Update.

Fixes #93

9 years agoDeclare swiper-map
Oleh Krehel [Fri, 8 May 2015 20:47:47 +0000 (22:47 +0200)]
Declare swiper-map

Fixes #90

9 years agoRename avy-swiper to swiper-avy
Oleh Krehel [Fri, 8 May 2015 16:29:47 +0000 (18:29 +0200)]
Rename avy-swiper to swiper-avy

* swiper.el (swiper-avy): Rename and fix the regex.

9 years agoivy.el (ivy-use-virtual-buffers): New defcustom
Oleh Krehel [Fri, 8 May 2015 16:01:58 +0000 (18:01 +0200)]
ivy.el (ivy-use-virtual-buffers): New defcustom

Re #84

9 years agoAdd support for virtual buffers
Oleh Krehel [Fri, 8 May 2015 15:47:51 +0000 (17:47 +0200)]
Add support for virtual buffers

* ivy.el (ivy-mode-map): New defvar. Remap `switch-to-buffer' to
  `ivy-switch-buffer'.
(ivy-mode): Use `ivy-mode-map'.
(ivy--virtual-buffers): New devar.
(ivy--virtual-buffers): New defun.
(ivy-buffer-list): Return a list of buffers, taking
`ido-use-virtual-buffers' into account.
(ivy-switch-buffer): New command.

Fixes #84

9 years agoSimplify ivy-partial-or-done
Tassilo Horn [Fri, 8 May 2015 13:46:45 +0000 (15:46 +0200)]
Simplify ivy-partial-or-done

9 years agoAdd swiper -> avy finalizer
Oleh Krehel [Fri, 8 May 2015 13:18:43 +0000 (15:18 +0200)]
Add swiper -> avy finalizer

* ivy.el (ivy-quit-and-run): New defmacro.
(tramp-get-completion-function): Add declare.

* swiper.el (swiper-map): Bind `avy-swiper' to "C-'".
(avy-swiper): New defun - jump to one of the currently visible swiper
candidates using avy.

9 years agoAllow to use "^" in swiper
Oleh Krehel [Fri, 8 May 2015 12:35:29 +0000 (14:35 +0200)]
Allow to use "^" in swiper

* swiper.el (swiper--width): New defvar.
(swiper--candidates): Set `swiper--width'.

* ivy.el (ivy--transform-re): New defun - transform the regex
  specifically for `swiper'.
(ivy--filter): Call `ivy--transform-re'.

* ivy-test.el (ivy--transform-re): Add test.

Fixes #82

9 years agoAdd ivy-partial: partial complete without exiting
Oleh Krehel [Fri, 8 May 2015 08:18:38 +0000 (10:18 +0200)]
Add ivy-partial: partial complete without exiting

* ivy.el (ivy-partial-or-done): Forward to `ivy-partial'.
(ivy-partial): New defun.

If you want a different style of completion for "TAB", do this in your
config:

(define-key ivy-minibuffer-map (kbd "TAB") 'ivy-partial)

Fixes #85
Fixes #86

9 years agoTry to prevent the resize of minibuffer window
Oleh Krehel [Wed, 6 May 2015 19:01:14 +0000 (21:01 +0200)]
Try to prevent the resize of minibuffer window

* ivy.el (ivy--insert-minibuffer): Temporarily bind
  `resize-mini-windows' to nil.

From its doc:
    A value of `grow-only', the default, means let mini-windows grow only;
    they return to their normal size when the minibuffer is closed, or the
    echo area becomes empty.

It could be that an update catches this minibuffer empty during
`ivy--insert-minibuffer'.

Re #77

9 years agoMerge ivy--update-fn into ivy-last
Oleh Krehel [Wed, 6 May 2015 16:17:24 +0000 (18:17 +0200)]
Merge ivy--update-fn into ivy-last

* ivy.el (ivy--update-fn): Remove defvar.
(ivy-read): Update.
(ivy--insert-minibuffer): Update.

9 years agoAdd parents using 'display for `counsel-load-library'
Oleh Krehel [Wed, 6 May 2015 09:49:01 +0000 (11:49 +0200)]
Add parents using 'display for `counsel-load-library'

* counsel.el (counsel--find-symbol): The argument string may have a
  'full-name property.
(counsel-string-compose): New defun.
(counsel-load-library): Make libraries unique through text properties.

Re #79

9 years agoAdd counsel-load-library
Oleh Krehel [Wed, 6 May 2015 08:42:17 +0000 (10:42 +0200)]
Add counsel-load-library

* counsel.el (counsel-directory-parent): New defun.
(counsel-load-library): New command.

Improve on `load-library':

- don't consider .*elc or .*pkg.elc?, they're usually useless
- resolve duplicates in a similar way to uniquify (prepend parent directory)
- allow to jump-to-library with "C-." (see `counsel-describe-map')

9 years agoWork around grep-read-files
Oleh Krehel [Wed, 6 May 2015 07:09:04 +0000 (09:09 +0200)]
Work around grep-read-files

* ivy.el (ivy--done): If history is `grep-files-history', the caller is
  `grep-read-files'. Don't expand the file name, since it's probably a
  glob, and `find' doesn't work with expanded globs.

It should now be possible to simply "M-x" rgrep "RET" "RET" "RET".

Fixes #72

9 years agoivy.el (ivy-partial-or-done): Handle empty input
Oleh Krehel [Wed, 6 May 2015 06:39:30 +0000 (08:39 +0200)]
ivy.el (ivy-partial-or-done): Handle empty input

Fixes #81

9 years agoImprove "TAB" interaction with `confirm-nonexistent-file-or-buffer'
Oleh Krehel [Tue, 5 May 2015 08:14:17 +0000 (10:14 +0200)]
Improve "TAB" interaction with `confirm-nonexistent-file-or-buffer'

* ivy.el (ivy-partial-or-done): When
  `confirm-nonexistent-file-or-buffer' is t, and there are no
  candidates, modify the prompt to "(confirm)" right after the first
  "TAB".

Re #76

9 years agoivy.el (ivy-done): Simplify and improve
Oleh Krehel [Tue, 5 May 2015 07:33:41 +0000 (09:33 +0200)]
ivy.el (ivy-done): Simplify and improve

* ivy.el (ivy--done): New defun.
(ivy-done): Consider `confirm-nonexistent-file-or-buffer' for buffers as
well.

Fixes #76

9 years agoMerge ivy--collection into ivy-last
Oleh Krehel [Tue, 5 May 2015 07:12:05 +0000 (09:12 +0200)]
Merge ivy--collection into ivy-last

* ivy.el (ivy--collection): Delete defvar.
(ivy-read): Update.
(ivy--exhibit): Update.

9 years agoRequire dired when completing file names
Oleh Krehel [Tue, 5 May 2015 06:49:05 +0000 (08:49 +0200)]
Require dired when completing file names

* ivy.el (ivy-read): Update.

Fixes #78

9 years agoMake "TAB" switch directories properly
Oleh Krehel [Mon, 4 May 2015 15:18:49 +0000 (17:18 +0200)]
Make "TAB" switch directories properly

* ivy.el (ivy-partial-or-done): Forward to `ivy-alt-done'.

Fixes #75

9 years ago"TAB" shouldn't delete input when no candidate
Oleh Krehel [Mon, 4 May 2015 15:15:18 +0000 (17:15 +0200)]
"TAB" shouldn't delete input when no candidate

ivy.el (ivy-partial-or-done): Update.

Fixes #74

9 years agoIgnore case for "TAB"
Oleh Krehel [Mon, 4 May 2015 07:41:04 +0000 (09:41 +0200)]
Ignore case for "TAB"

* ivy.el (ivy-partial-or-done): Update.

Now, e.g. "pub" can expand to "Public License".

9 years agoivy.el (ivy-tab-space): New defcustom
Oleh Krehel [Mon, 4 May 2015 07:38:20 +0000 (09:38 +0200)]
ivy.el (ivy-tab-space): New defcustom

* ivy.el (ivy-partial-or-done): Insert an extra space when
  `ivy-tab-space' is non-nil. This is useful to complete partially and
  start a new group at once.

Fixes #73

9 years agoAdd an option for out-of-order matching
Oleh Krehel [Sun, 3 May 2015 14:31:47 +0000 (16:31 +0200)]
Add an option for out-of-order matching

* ivy.el (ivy--regex-ignore-order): New defun.

* swiper.el (swiper--init): Set `ivy--regex-function'.
(swiper--update-input-ivy): Use `ivy--regex-function'.
(swiper--action): Use `ivy--regex-function'.

Example of use:

(setq ivy-re-builders-alist
      '((t . ivy--regex-ignore-order)))

With this, e.g. swiper will match "bar foo" from input "foo bar".

9 years agoswiper.el: Bump version
Oleh Krehel [Sun, 3 May 2015 10:57:37 +0000 (12:57 +0200)]
swiper.el: Bump version

9 years agoivy.el (ivy-resume): Quote the preselect
Oleh Krehel [Sun, 3 May 2015 10:02:01 +0000 (12:02 +0200)]
ivy.el (ivy-resume): Quote the preselect

9 years agoFix the candidate index for `ivy-resume'
Oleh Krehel [Sat, 2 May 2015 16:04:17 +0000 (18:04 +0200)]
Fix the candidate index for `ivy-resume'

* ivy.el (ivy--preselect-index): The the regex, not the plain text.

9 years agoAdd unwind argument to ivy-read
Oleh Krehel [Sat, 2 May 2015 15:50:17 +0000 (17:50 +0200)]
Add unwind argument to ivy-read

* ivy.el (ivy-state): Add `unwind' field.
(ivy-resume): Update.
(ivy-read): Call the `unwind' argument in the unwind form.

* swiper.el (swiper--ivy): Use `unwind' for `ivy-read'.

9 years agoMerge ivy--persistent-action into ivy-state-action
Oleh Krehel [Fri, 1 May 2015 20:44:57 +0000 (22:44 +0200)]
Merge ivy--persistent-action into ivy-state-action

* counsel.el (counsel-git-grep): Update.

* ivy.el (ivy--persistent-action): Remove defvar.
(ivy-next-line-and-call): Update.
(ivy-previous-line-and-call): Update.

9 years agoivy-resume now works for functions that supply action
Oleh Krehel [Fri, 1 May 2015 20:01:30 +0000 (22:01 +0200)]
ivy-resume now works for functions that supply action

ivy.el (ivy-resume): Use action

Functions like `counsel-describe-funtion' and `counsel-describe-varible'
are now resume-able: after finishing with "RET" or breaking out with
"C-g" it's possible to resume the query in the same state as it
was (same collection, input, index).

With:

(global-set-key (kbd "C-c C-r") 'ivy-resume)

it's possible to e.g.:

- "F1 f" info read "RET" to describe Info-breadcrumbs
- "C-c C-r" "C-n" to describe Info-read-node-name
- "C-c C-r" "C-n" to describe Info-read-node-name-1
...