]> code.delx.au - gnu-emacs-elpa/log
gnu-emacs-elpa
8 years agoAdd the '!' behavior into `ivy--regex-ignore-order'
Samuel Loury [Tue, 12 Jan 2016 09:28:30 +0000 (10:28 +0100)]
Add the '!' behavior into `ivy--regex-ignore-order'

8 years agoivy.el (ivy--regex-plus): Prettify a bit
Oleh Krehel [Tue, 12 Jan 2016 08:32:44 +0000 (09:32 +0100)]
ivy.el (ivy--regex-plus): Prettify a bit

Fixes #344

8 years agocounsel: Add counsel-up-directory to find-file-map
justbur [Tue, 12 Jan 2016 00:26:09 +0000 (19:26 -0500)]
counsel: Add counsel-up-directory to find-file-map

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.

Fixes #343

8 years agocounsel.el (counsel--async-sentinel): Re-display when no cands
Oleh Krehel [Mon, 11 Jan 2016 20:25:56 +0000 (21:25 +0100)]
counsel.el (counsel--async-sentinel): Re-display when no cands

8 years agocounsel.el (counsel--async-sentinel): Fix issue with ivy--regex-ignore-order
Oleh Krehel [Mon, 11 Jan 2016 20:25:22 +0000 (21:25 +0100)]
counsel.el (counsel--async-sentinel): Fix issue with ivy--regex-ignore-order

Fixes #342

8 years agoChange tramp prompt from "Find File: " to "user@host: "
Oleh Krehel [Mon, 11 Jan 2016 20:24:18 +0000 (21:24 +0100)]
Change tramp prompt from "Find File: " to "user@host: "

8 years agoivy.el (ivy-completion-in-region): Fix for 1 cand
Oleh Krehel [Fri, 8 Jan 2016 12:47:11 +0000 (13:47 +0100)]
ivy.el (ivy-completion-in-region): Fix for 1 cand

Set `ivy-state-window' properly.

8 years agoivy.el (ivy-completion-in-region): Optimize for 1 cand
Oleh Krehel [Fri, 8 Jan 2016 12:23:20 +0000 (13:23 +0100)]
ivy.el (ivy-completion-in-region): Optimize for 1 cand

When there's only one candidate, call the action immediately.

8 years agoivy.el (ivy-completion-in-region): Fix a few bugs
Oleh Krehel [Fri, 8 Jan 2016 08:38:04 +0000 (09:38 +0100)]
ivy.el (ivy-completion-in-region): Fix a few bugs

* ivy.el (ivy-completion-common-length): New defun.

`all-completions' doesn't always return candidates that can replace the
whole region between BEG and END. That's why
`completion-all-completions' should be used, which marks the common part
with 'completions-common-part face. Then the new region to replace is
((- END common-length) . END).

Note also that `text-property-any' doesn't always work in
`ivy-completion-common-length', since the 'face property can be a list.
(ivy-completion-in-region): Set `enable-recursive-minibuffers'.

Fixes #341

8 years agoivy.el (ivy-occur): Fix when ivy--old-re isn't a string
Oleh Krehel [Thu, 7 Jan 2016 16:32:31 +0000 (17:32 +0100)]
ivy.el (ivy-occur): Fix when ivy--old-re isn't a string

8 years agoProperly support matching ignoring order
Oleh Krehel [Thu, 7 Jan 2016 16:27:47 +0000 (17:27 +0100)]
Properly support matching ignoring order

* ivy.el (ivy--regex-ignore-order): Return a list of regexps rather than
  a single regexp.
(ivy--re-filter): New defun, extracted from `ivy--filter'.
(ivy--filter): Update.
(ivy--format-minibuffer-line): Add special highlighting for
`ivy--regex-ignore-order'.

* counsel.el (counsel--find-file-matcher): Use `ivy--re-filter'.

Fixes #296
Fixes #329

8 years agoivy: fix ivy--resize-minibuffer-to-fit for small delta
Felix Lange [Wed, 6 Jan 2016 22:28:24 +0000 (23:28 +0100)]
ivy: fix ivy--resize-minibuffer-to-fit for small delta

Very small size increments can be necessary if the initial candidate
list is short (e.g. 3 items) and line-height is set to something other
than zero. In that case, only half of the last line is initially
visible. ivy--resize-minibuffer-to-fit recognizes this and tries to
enlarge the window up the the exact pixel height required, however
window-resize doesn't do anything if the delta is below
frame-char-height.

8 years agoImprove flx highlighting
Oleh Krehel [Wed, 6 Jan 2016 11:31:01 +0000 (12:31 +0100)]
Improve flx highlighting

* ivy.el (ivy--flx-sort): Highlight continuous characters with same
  face.

8 years agoUse flx for highlighting fuzzy matches
Oleh Krehel [Wed, 6 Jan 2016 09:25:30 +0000 (10:25 +0100)]
Use flx for highlighting fuzzy matches

* ivy.el (ivy--flx-sort): `flx-score' returns ((score i1 i2 i3 ...) str).
Use i1, i2, i3 ... to highlight str appropriately.
(ivy--format-minibuffer-line): Don't re-highlight str for
`ivy--regex-fuzzy', it was already highlighted by `ivy--flx-sort'.

Re #207

8 years agoivy.el (ivy-add-face-text-property): New defun
Oleh Krehel [Wed, 6 Jan 2016 09:21:37 +0000 (10:21 +0100)]
ivy.el (ivy-add-face-text-property): New defun

* ivy.el (ivy--format-minibuffer-line): Use `ivy-add-face-text-property'.

8 years agoivy.el (ivy-completion-in-region): Fix log 0 issue
Oleh Krehel [Wed, 6 Jan 2016 09:20:05 +0000 (10:20 +0100)]
ivy.el (ivy-completion-in-region): Fix log 0 issue

8 years agoCall ivy-set-actions with t to affect all commands
Oleh Krehel [Tue, 5 Jan 2016 18:12:29 +0000 (19:12 +0100)]
Call ivy-set-actions with t to affect all commands

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

Example:

(ivy-set-actions
 t
 '(("i" insert "insert")))

Now an "insert" action will be available for all `ivy-read' sessions
when pressing "M-o".

Fixes #337

8 years agocounsel.el (counsel-find-file): Add initial-input
Oleh Krehel [Tue, 5 Jan 2016 15:39:46 +0000 (16:39 +0100)]
counsel.el (counsel-find-file): Add initial-input

Re #336

8 years agoivy.el (ivy--reset-state): Don't null initial-input
Oleh Krehel [Tue, 5 Jan 2016 15:22:41 +0000 (16:22 +0100)]
ivy.el (ivy--reset-state): 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'.

Fixes #336

8 years agoivy.el (ivy-completion-in-region): Use compact ivy-count-format
Oleh Krehel [Tue, 5 Jan 2016 15:05:47 +0000 (16:05 +0100)]
ivy.el (ivy-completion-in-region): Use compact ivy-count-format

8 years agoivy.el (ivy-mode): Set completing-read-function
Oleh Krehel [Tue, 5 Jan 2016 14:32:18 +0000 (15:32 +0100)]
ivy.el (ivy-mode): Set completing-read-function

* ivy.el (ivy-completion-beg): Rename from `counsel-completion-beg'.
(ivy-completion-end): Rename from `counsel-completion-end'.
(ivy-completion-in-region-action): Rename from `counsel--el-action'.
(ivy-completion-in-region): New defun.
(ivy-mode): Set `completing-read-function' to 'ivy-completion-in-region.

* counsel.el: Update due to renames.

Fixes #331

8 years agoEnsure the return result of `ivy-read'
Oleh Krehel [Tue, 5 Jan 2016 14:12:05 +0000 (15:12 +0100)]
Ensure the return result of `ivy-read'

In some cases, `read-from-minibuffer' will return the whole minibuffer
contents (i.e. all available candidates). Return `ivy--current' instead.

8 years agocounsel.el (counsel-git): Fix window selection
Oleh Krehel [Tue, 5 Jan 2016 10:39:15 +0000 (11:39 +0100)]
counsel.el (counsel-git): Fix window selection

* counsel.el (counsel--git-dir): New defvar.
(counsel-git): Update.
(counsel-git-action): New defun. Use `with-ivy-window', so that each new
file chosen with e.g. "C-M-n" is selected in the same window.

8 years agoAdd cousel-ag-base-command var
justbur [Thu, 31 Dec 2015 22:05:11 +0000 (17:05 -0500)]
Add cousel-ag-base-command var

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.

8 years agoswiper.el (swiper-font-lock-ensure): Add bongo-library-mode
Oleh Krehel [Thu, 31 Dec 2015 08:40:16 +0000 (09:40 +0100)]
swiper.el (swiper-font-lock-ensure): Add bongo-library-mode

8 years agoswiper.el (swiper-font-lock-ensure): Add bongo-playlist-mode
Oleh Krehel [Wed, 30 Dec 2015 11:51:31 +0000 (12:51 +0100)]
swiper.el (swiper-font-lock-ensure): Add bongo-playlist-mode

Re #19

8 years agocounsel.el (counsel-M-x): Let-bind this-command
Oleh Krehel [Sun, 27 Dec 2015 08:59:35 +0000 (09:59 +0100)]
counsel.el (counsel-M-x): Let-bind this-command

This change allows in particular to customize `ivy-re-builders-alist'
via `this-command' and have `counsel-M-x' work properly with it.

8 years agoivy.el (ivy-re-builders-alist): Allow this-command to be a key
Oleh Krehel [Sun, 27 Dec 2015 08:56:51 +0000 (09:56 +0100)]
ivy.el (ivy-re-builders-alist): Allow this-command to be a key

* ivy.el (ivy--reset-state): Allow to specify re-builder with
  `this-command'.

Example:

    (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)))

This is useful for commands that you didn't write. For new commands that
you write, consider using `ivy-read' and :caller.

Fixes #330

8 years agocounsel.el (counsel-imenu): Work when given positions are overlays
Oleh Krehel [Mon, 21 Dec 2015 09:38:35 +0000 (10:38 +0100)]
counsel.el (counsel-imenu): Work when given positions are overlays

* counsel.el (counsel-imenu-get-candidates-from): In semantic-enabled
  buffers, `imenu--make-index-alist' returns overlays for items.

(counsel-imenu): Add `with-ivy-window' wrapper.

8 years agosupport imenu
Chen Bin [Sat, 19 Dec 2015 01:19:29 +0000 (12:19 +1100)]
support imenu

8 years agoFix compilation warnings
Oleh Krehel [Fri, 18 Dec 2015 11:23:57 +0000 (12:23 +0100)]
Fix compilation warnings

* Makefile: Don't load files before compilation.

* ivy.el (swiper--cleanup):
(swiper--add-overlays): Declare.

Fixes #324

8 years agoFix recursive minibuffer exit with "C-g"
Oleh Krehel [Thu, 17 Dec 2015 10:35:24 +0000 (11:35 +0100)]
Fix recursive minibuffer exit with "C-g"

* ivy.el (ivy-read): Make it so e.g. "C-h f C-h v C-g" goes back to the
  describe-function selection.

8 years agoFix ivy-reverse-i-search broken by recursive update
Oleh Krehel [Thu, 17 Dec 2015 08:45:30 +0000 (09:45 +0100)]
Fix ivy-reverse-i-search broken by recursive update

* ivy.el (ivy-recursive-restore): New defvar.
(ivy-read): Don't restore `ivy-last' on exit if `ivy-recursive-restore'
is nil.
(ivy-reverse-i-search): Bind `ivy-recursive-restore' to nil.

Fixes #323

8 years agoImprove swiper for multiple occurrences on one line
Oleh Krehel [Sat, 12 Dec 2015 08:41:07 +0000 (09:41 +0100)]
Improve swiper for multiple occurrences on one line

* swiper.el (swiper--current-line):
(swiper--current-match-start): New defvar.
(swiper--init): Update.
(swiper--update-input-ivy): Don't move to line NUM if
`swiper--current-line' is equal to NUM. Later, store NUM in
`swiper--current-line' to avoid calling `line-number-at-pos'.
Additionally store `swiper--current-match-start' - it's necessary to
move there before searching for the regexp, since the point currently is
after the old regexp.

Fixes #314

8 years agoivy.el (ivy--get-window): Return a valid window
Oleh Krehel [Wed, 9 Dec 2015 09:15:18 +0000 (10:15 +0100)]
ivy.el (ivy--get-window): Return a valid window

Even if STATE is invalid.

8 years agoMake ivy--regex-plus recognize ! at the beginning of the str
Samuel Loury [Wed, 9 Dec 2015 07:51:47 +0000 (08:51 +0100)]
Make ivy--regex-plus recognize ! at the beginning of the str

When one types '!foo, he expects the candidates to be filtered out
by 'foo'.

8 years agodoc/ivy.org: Add "Variable Index" node
Oleh Krehel [Mon, 7 Dec 2015 16:06:18 +0000 (17:06 +0100)]
doc/ivy.org: Add "Variable Index" node

8 years agodoc/ivy.texi: Re-export using adjusted texinfo exporter
Oleh Krehel [Mon, 7 Dec 2015 16:01:24 +0000 (17:01 +0100)]
doc/ivy.texi: Re-export using adjusted texinfo exporter

* doc/ivy.org: Add defopt/endopt macros. Change `ivy-wrap' and
  `ivy-height' to defopt.

8 years agoswiper.el: Bump version to 0.7.0
Oleh Krehel [Mon, 7 Dec 2015 14:46:36 +0000 (15:46 +0100)]
swiper.el: Bump version to 0.7.0

8 years agodoc/Changelog.org: Update up to 706349f
Oleh Krehel [Mon, 7 Dec 2015 14:33:39 +0000 (15:33 +0100)]
doc/Changelog.org: Update up to 706349f

8 years agoivy.el (ivy-completing-read): Use completing-read-default for tmm
Oleh Krehel [Mon, 7 Dec 2015 11:20:37 +0000 (12:20 +0100)]
ivy.el (ivy-completing-read): Use completing-read-default for tmm

Fixes #316

8 years agocounsel.el (counsel-tmm): New command
Oleh Krehel [Mon, 7 Dec 2015 11:19:08 +0000 (12:19 +0100)]
counsel.el (counsel-tmm): New command

* counsel.el (counsel-tmm-prompt): New defun.
(tmm-km-list): Define this variable here, since `tmm-get-keymap'
modifies a global variable (yuck!).

Re #316

8 years agoswiper.el (swiper-font-lock-ensure): Add vc-dir-mode
Oleh Krehel [Mon, 7 Dec 2015 09:12:40 +0000 (10:12 +0100)]
swiper.el (swiper-font-lock-ensure): Add vc-dir-mode

Re #19

8 years agoUse :caller for ivy-re-builders-alist
Oleh Krehel [Fri, 4 Dec 2015 08:23:19 +0000 (09:23 +0100)]
Use :caller for ivy-re-builders-alist

* counsel.el (counsel-M-x): Add :caller.

* ivy.el (ivy--reset-state): Use :caller.

8 years agoswiper.el (swiper--update-input-ivy): Add a work-around for "M-j"
Oleh Krehel [Fri, 4 Dec 2015 07:30:17 +0000 (08:30 +0100)]
swiper.el (swiper--update-input-ivy): Add a work-around for "M-j"

When `ivy-yank-word' is called, don't move to the line of the current
candidate. We're already there anyway. And not moving helps when there
are multiple occurrences of the current input on the current line.

Fixes #314

8 years agoivy.el: Structure all faces into ivy-faces custom group
Oleh Krehel [Wed, 2 Dec 2015 14:44:04 +0000 (15:44 +0100)]
ivy.el: Structure all faces into ivy-faces custom group

8 years agoFix due to visual-line-mode weirdness
Oleh Krehel [Sun, 29 Nov 2015 16:01:35 +0000 (17:01 +0100)]
Fix due to visual-line-mode weirdness

* swiper.el (swiper--candidates): Under a specific random condition,
(line-move 1) from the beginning of line doesn't move to the beginning
of the next visual line.

This change fixes it, but will result in an even slower startup when
`visual-line-mode' is active.

Fixes #313

8 years agoswiper.el: Use show-all if outline-show-all isn't there
Oleh Krehel [Sun, 29 Nov 2015 10:19:22 +0000 (11:19 +0100)]
swiper.el: Use show-all if outline-show-all isn't there

Fixes #312

8 years agoFix ivy-resume issue caused by the recursive calls change
Oleh Krehel [Sun, 29 Nov 2015 10:15:17 +0000 (11:15 +0100)]
Fix ivy-resume issue caused by the recursive calls change

* ivy.el (ivy-read): recursive-ivy-last is only set if there's an active
  minibuffer window. If this check isn't made, it causes the previous
  `ivy-last' to be reset after the current one, so `ivy-resume' would
  resume not the last command.

8 years agoFix the preselect for (swiper "one") again
Oleh Krehel [Sun, 29 Nov 2015 10:13:45 +0000 (11:13 +0100)]
Fix the preselect for (swiper "one") again

* ivy.el (ivy--reset-state): Take into account :preselect being integer.
This means that it's void once the candidates are filtered over
:initial-input.

Fixes #292

8 years agoFix the issue caused by recursive swiper calls
Oleh Krehel [Fri, 27 Nov 2015 22:21:40 +0000 (23:21 +0100)]
Fix the issue caused by recursive swiper calls

* swiper.el (swiper--ivy): Look at the return result of `ivy-read';
looking at `ivy-exit' no longer works.

Fixes #311

8 years agoRemove 'field text property for twittering-mode
Oleh Krehel [Fri, 27 Nov 2015 13:32:04 +0000 (14:32 +0100)]
Remove 'field text property for twittering-mode

* swiper.el (swiper--candidates): Update.
(swiper-font-lock-ensure): Add `twittering-mode'.

Fixes #310

8 years agoEnable recursive swiper calls
Oleh Krehel [Fri, 27 Nov 2015 13:03:41 +0000 (14:03 +0100)]
Enable recursive swiper calls

* ivy.el (ivy-read): Don't need to be in the minibuffer to do a
  recursive store/restore.

(ivy--reset-state): Avoid nil string while testing.

Fixes #309

8 years agodoc/Changelog.org: Update up to 2bec99d
Oleh Krehel [Thu, 26 Nov 2015 13:50:54 +0000 (14:50 +0100)]
doc/Changelog.org: Update up to 2bec99d

8 years agoFixes on the previous docstring edits
Oleh Krehel [Fri, 27 Nov 2015 07:17:04 +0000 (08:17 +0100)]
Fixes on the previous docstring edits

8 years agoEdit documentation strings in ivy.el
sjLambda [Thu, 26 Nov 2015 17:15:44 +0000 (09:15 -0800)]
Edit documentation strings in ivy.el

Fixes #308

8 years agoEase production of functions like ivy-format-function-default
Oleh Krehel [Thu, 26 Nov 2015 11:52:34 +0000 (12:52 +0100)]
Ease production of functions like ivy-format-function-default

* ivy.el (ivy--format-function-generic): New defun.
(ivy-format-function-default):
(ivy-format-function-arrow):
(ivy-format-function-line): Use `ivy--format-function-generic'.

* counsel.el (counsel--M-x-transformer): Add an extra space to simplify
  the logic.

Re #307

8 years agoConvert ivy formatting functions to dotted pairs.
Stephen Whipple [Thu, 26 Nov 2015 07:07:16 +0000 (00:07 -0700)]
Convert ivy formatting functions to dotted pairs.

`ivy-format-function' now expects to operate on dotted pairs
representing (stub . extra), where `stub' is the original
candidate and `extra' is any extra information that has been
added by counsel or other libraries.

The format function can differentiate between the original stub
and extra information and choose how to display the result to
the user.

8 years agoUpdate ivy format functions.
Stephen Whipple [Wed, 25 Nov 2015 13:56:02 +0000 (06:56 -0700)]
Update ivy format functions.

`ivy-format-function' now accessible via Customize system.

`ivy-format-function-default' and `ivy-format-function-arrow'
simplified.

New format `ivy-format-function-line' added.

`counsel-M-x' restores `ivy-format-function' before executing command.

Fixes #306

8 years agoAdd counsel-grep
Oleh Krehel [Wed, 25 Nov 2015 14:24:58 +0000 (15:24 +0100)]
Add counsel-grep

* ivy.el (ivy--reset-state): Don't push preselect onto collection for
  :dynamic-collection.
(ivy-recompute-index-swiper-async): New defun. It's useful for
re-anchoring on collections produced async processes. The major
difference from `ivy-recompute-index-swiper' is using `equal' instead of `eq'.

* counsel.el (counsel--async-sentinel): Add index recomputing logic.
When `ivy--old-cands' are null, recompute the index according to
:preselect, otherwise try `ivy--recompute-index'.
(counsel-grep): New command. Very similar to `swiper', except calls an
external process for each key update. Should be much faster for very
large files, both for startup and for matching. For smaller files, it's
less convenient.
(counsel-grep-function): New defun.
(counsel-grep-action): New defun.

Fixes #299

8 years agoIvy-resume should restore the buffer for swiper
Oleh Krehel [Tue, 24 Nov 2015 11:11:11 +0000 (12:11 +0100)]
Ivy-resume should restore the buffer for swiper

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

Fixes #302

8 years agoFix broken candidate index in ivy-resume
Oleh Krehel [Tue, 24 Nov 2015 11:09:37 +0000 (12:09 +0100)]
Fix broken candidate index in ivy-resume

* ivy.el (ivy--reset-state): When given initial-input, call
  `ivy--preselect-index' on candidates filtered by initial-input. This
  is important for `ivy-resume'.

8 years agoWarn the user about the behavior of ivy--regex-ignore-order
Samuel Loury [Tue, 24 Nov 2015 07:29:04 +0000 (08:29 +0100)]
Warn the user about the behavior of ivy--regex-ignore-order

Fixes #296
Fixes #305

8 years agoMinor fixes to ivy.org and export to ivy.texi
Oleh Krehel [Tue, 24 Nov 2015 11:00:12 +0000 (12:00 +0100)]
Minor fixes to ivy.org and export to ivy.texi

Fixes #304

8 years agoivy.org manual edits
sjLambda [Tue, 24 Nov 2015 03:36:04 +0000 (19:36 -0800)]
ivy.org manual edits

8 years agoFix `counsel-ag` on Windows
kovrik [Mon, 23 Nov 2015 21:24:22 +0000 (10:24 +1300)]
Fix `counsel-ag` on Windows

8 years agoswiper.el (swiper--action): push-mark only if exited the minibuffer
Oleh Krehel [Sun, 22 Nov 2015 13:00:51 +0000 (14:00 +0100)]
swiper.el (swiper--action): push-mark only if exited the minibuffer

"C-M-n" and "C-M-p" will no longer push mark and annoy with messages.

8 years agoPerform string-match in the original buffer
Oleh Krehel [Sun, 22 Nov 2015 12:59:27 +0000 (13:59 +0100)]
Perform string-match in the original buffer

* ivy.el (ivy--exhibit): Wrap in `with-current-buffer'
  `ivy-state-buffer'.
(ivy-recompute-index-swiper): Reset to the candidate at the current line
number, in case the previous regex resulted in 0 candidates.

Fixes #298

8 years agoswiper.el (swiper--candidates): Require outline
Oleh Krehel [Sat, 21 Nov 2015 22:14:49 +0000 (23:14 +0100)]
swiper.el (swiper--candidates): Require outline

Fixes #297

8 years agoFix the preselect for (swiper "one")
Oleh Krehel [Fri, 20 Nov 2015 12:13:40 +0000 (13:13 +0100)]
Fix the preselect for (swiper "one")

* ivy.el (ivy--reset-state): Ignore INITIAL-INPUT on the first
  step. Then all `ivy--filter' on the second step.
(ivy--preselect-index): Change arglist. No longer takes INITIAL-INPUT.
(ivy--recompute-index): Update the call to `ivy--preselect-index'.

Fixes #292

8 years agoivy.el (ivy-alt-done): Split into smaller defuns
Oleh Krehel [Thu, 19 Nov 2015 12:57:28 +0000 (13:57 +0100)]
ivy.el (ivy-alt-done): Split into smaller defuns

* ivy.el (ivy--directory-done): New defun.
(ivy-alt-done): Forward to `ivy--directory-done'.

8 years agoivy.el (ivy-alt-done): Refactor
Oleh Krehel [Thu, 19 Nov 2015 12:52:59 +0000 (13:52 +0100)]
ivy.el (ivy-alt-done): Refactor

Collect all `ivy--directory' branches into a single `cond'.

8 years agoAllow access to TRAMP from "// C-j"
Oleh Krehel [Thu, 19 Nov 2015 10:02:38 +0000 (11:02 +0100)]
Allow access to TRAMP from "// C-j"

* ivy.el (ivy-alt-done): Match not only `ivy-text' but also
  `ivy--current' for TRAMP regex.

Re #285

8 years agoImprove ivy TRAMP support
Stephen Whipple [Thu, 19 Nov 2015 02:41:16 +0000 (19:41 -0700)]
Improve ivy TRAMP support

8 years agoivy.el (ivy-completing-read): Fix off by one
Oleh Krehel [Wed, 18 Nov 2015 13:34:46 +0000 (14:34 +0100)]
ivy.el (ivy-completing-read): Fix off by one

Re #295

8 years agoSwitch to using ivy-exit-with-action
Oleh Krehel [Wed, 18 Nov 2015 10:55:45 +0000 (11:55 +0100)]
Switch to using ivy-exit-with-action

* ivy.el (ivy-exit-with-action): Add a missing quote.
(ivy--cd-maybe): Use `ivy-exit-with-action'.

* counsel.el (counsel-find-symbol):
(counsel--info-lookup-symbol):
(counsel-git-grep-query-replace): Use `ivy-exit-with-action'.

* swiper.el (swiper-query-replace):
(swiper-mc): Use `ivy-exit-with-action'.

The previous approach was overwriting the action list, so when
`ivy-resume' was called, only a single action was present.  The new
approach doesn't have this bug.

So now it's possible to e.g. `counsel-describe-function' -> "M-o d" ->
`ivy-resume' -> "M-o o" -> `ivy-resume' -> "M-o i".

8 years agoMake ivy-completing-read handle history as cons
Samuel Loury [Wed, 18 Nov 2015 10:31:48 +0000 (11:31 +0100)]
Make ivy-completing-read handle history as cons

The ivy-read function assumes that history is a symbol, hence
ivy-completing-read now makes sure that a symbol is given to
ivy-read.

Moreover, it makes sure that the value of initial-input is
coherent with the value of the HISTPOS part of the history
variable if it exists.

Fixes #295

8 years agoswiper.el: Modify the behavior with org-mode and visual-line-mode
Oleh Krehel [Tue, 17 Nov 2015 07:27:39 +0000 (08:27 +0100)]
swiper.el: Modify the behavior with org-mode and visual-line-mode

* swiper.el (swiper--candidates): Set `swiper-use-visual-line' even for
  `org-mode'. In that case, reveal all text to prevent `line-move'
  weirdness.
(swiper--ivy): Use `swiper-use-visual-line'.

Re #291
Re #227

8 years agoREADME.md: Add more bindings
Oleh Krehel [Mon, 16 Nov 2015 17:15:21 +0000 (18:15 +0100)]
README.md: Add more bindings

8 years agoAdd precise preselect for swiper with visual-line-mode
Oleh Krehel [Mon, 16 Nov 2015 14:25:12 +0000 (15:25 +0100)]
Add precise preselect for swiper with visual-line-mode

* swiper.el (swiper--ivy): Use `count-screen-lines' to calculate the
  visual line number.

Fixes #291

8 years agoIntermediate fix for :preselect with visual-line-mode
Oleh Krehel [Mon, 16 Nov 2015 11:50:42 +0000 (12:50 +0100)]
Intermediate fix for :preselect with visual-line-mode

* swiper.el (swiper--ivy): Use `beginning-of-visual-line' and
  `end-of-visual-line'. This should fix the preselect problem for
  non-duplicate buffer lines.

For duplicate buffer lines, a `visual-line-number-at-pos' function is
necessary. I don't currently know how to implement such a function in an
efficient way. The naive implementation could be pretty inefficient,
comparable to doubling `swiper' startup time with `visual-line-mode'.

Re #291

8 years agoFix swiper preselect issue with similar or identical lines
Oleh Krehel [Sun, 15 Nov 2015 10:14:05 +0000 (11:14 +0100)]
Fix swiper preselect issue with similar or identical lines

* ivy.el (ivy--preselect-index): Allow PRESELECT to be an integer.

* swiper.el (swiper--anchor):
(swiper--len): Remove unused defvar.
(swiper--init): Update.
(swiper--ivy): Set PRESELECT to `line-number-at-pos'.

Fixes #290

8 years agoswiper.el (swiper-all): New command to swiper all file buffers
Oleh Krehel [Sat, 14 Nov 2015 15:27:41 +0000 (16:27 +0100)]
swiper.el (swiper-all): New command to swiper all file buffers

* swiper.el (swiper--candidates): Add NUMBERS-WIDTH arg.  It could be
done better by calculating the line count of each buffer and then
getting the max of that, but this way is faster, since the collections
are traversed only once.
(swiper-multi): Update.
(swiper-all): New command. This is like `swiper-multi' where the buffer
list is pre-selected to be all file visiting buffers.
(swiper--multi-candidates): New defun.
(swiper-multi-action-1): Use `swiper--multi-candidates'.
(swiper-multi-action-2): Update - the line number is in the 'display
property of the first char.

Re #234

8 years agoswiper.el (swiper--candidates): Replace "\t" with " "
Oleh Krehel [Sat, 14 Nov 2015 15:23:12 +0000 (16:23 +0100)]
swiper.el (swiper--candidates): Replace "\t" with "    "

This will allow the minibuffer strings to align nicer for
`swiper-multi'.

8 years agoivy.el (ivy--truncate-string): New defun
Oleh Krehel [Sat, 14 Nov 2015 15:22:39 +0000 (16:22 +0100)]
ivy.el (ivy--truncate-string): New defun

* ivy.el (ivy-format-function-default): Use `ivy--truncate-string'.

8 years agocounsel.el (counsel-locate): Add INTIAL-INPUT arg
Oleh Krehel [Sat, 14 Nov 2015 11:10:48 +0000 (12:10 +0100)]
counsel.el (counsel-locate): Add INTIAL-INPUT arg

Fixes #289

8 years agoivy.el (ivy--sort-files-by-date): Fix due to destructive cl-sort
Oleh Krehel [Fri, 13 Nov 2015 15:58:04 +0000 (16:58 +0100)]
ivy.el (ivy--sort-files-by-date): Fix due to destructive cl-sort

8 years agoAllow to sort files by last modification time.
Oleh Krehel [Fri, 13 Nov 2015 14:50:55 +0000 (15:50 +0100)]
Allow to sort files by last modification time.

* ivy.el (ivy--sort-files-by-date): New defun.

Example of use:

(add-to-list
 'ivy-sort-matches-functions-alist
 '(read-file-name-internal . ivy--sort-files-by-date))

This will result in e.g. `find-file' or `counsel-find-file' sorting
files by last modification time.

Fixes #213

8 years agoAllow user-specified matched candidate sorting
Oleh Krehel [Fri, 13 Nov 2015 14:37:15 +0000 (15:37 +0100)]
Allow user-specified matched candidate sorting

* ivy.el (ivy-prefix-sort): Remove defcustom.
(ivy--filter): Forward sorting of matched candidates to `ivy--sort'.
(ivy-sort-matches-functions-alist): New defcustom.
(ivy--sort): New defun.

Fixes #269
Fixes #265

8 years agoivy.el (ivy-prefix-sort): New defcustom, off by default for now
Oleh Krehel [Fri, 13 Nov 2015 14:04:56 +0000 (15:04 +0100)]
ivy.el (ivy-prefix-sort): New defcustom, off by default for now

* ivy.el (ivy--filter): When `ivy-prefix-sort' is non-nil, additionally
  sort the matching candidates with `ivy--prefix-sort'.
(ivy--prefix-sort): New defun.

Fixes #265

8 years agoivy.el (ivy-sort-functions-alist): Update doc
Oleh Krehel [Fri, 13 Nov 2015 13:25:41 +0000 (14:25 +0100)]
ivy.el (ivy-sort-functions-alist): Update doc

Mention `ivy-sort-max-size'.

8 years agoswiper.el: Add support for evil-jumper/backward
Oleh Krehel [Fri, 13 Nov 2015 13:08:26 +0000 (14:08 +0100)]
swiper.el: Add support for evil-jumper/backward

* swiper.el (evil-jumper--set-jump): Declare.
(swiper--init): When `evil-jumper-mode' is on, call `evil-jumper--set-jump'.

* ivy.el (counsel-git-grep-cmd): Declare to silence the byte compiler.

Fixes #268

8 years agoswiper.el (swiper-font-lock-ensure): Add eww-mode
Oleh Krehel [Fri, 13 Nov 2015 11:35:43 +0000 (12:35 +0100)]
swiper.el (swiper-font-lock-ensure): Add eww-mode

8 years agoswiper.el (swiper-font-lock-ensure): Add occur-mode
Oleh Krehel [Thu, 12 Nov 2015 12:37:23 +0000 (13:37 +0100)]
swiper.el (swiper-font-lock-ensure): Add occur-mode

8 years agoivy.el (ivy-occur): Give full counsel-git-grep cands
Oleh Krehel [Wed, 11 Nov 2015 15:21:02 +0000 (16:21 +0100)]
ivy.el (ivy-occur): Give full counsel-git-grep cands

This means that the " | head -n 200" speed-up isn't used and full
candidates are returned.

8 years agoivy.el (ivy-occur-mode-map): Bind "q" to quit-window
Oleh Krehel [Wed, 11 Nov 2015 15:14:55 +0000 (16:14 +0100)]
ivy.el (ivy-occur-mode-map): Bind "q" to quit-window

8 years agoAllow counsel-git-grep -> ivy-occur -> wgrep
Oleh Krehel [Wed, 11 Nov 2015 14:47:02 +0000 (15:47 +0100)]
Allow counsel-git-grep -> ivy-occur -> wgrep

* ivy.el (ivy-exit-with-action): New defun.
(ivy-occur-action): Remove defvar. It's part of `ivy-occur-last' now.
(ivy-occur-last): Update doc.
(ivy-occur-map): Rename to `ivy-occur-mode-map'.
(ivy-occur-mode): New major mode.
(ivy-occur): When the caller is `counsel-git-grep', enter `grep-mode';
otherwise enter the new `ivy-occur-mode'.
For `wgrep' to work, two things are changed: candidates need to start on
the 5th line, and candidates need to be prefixed with "./".
(ivy-occur-read-action): New command, bound to "a".
(ivy-occur-dispatch): New command, bound to "o".
(ivy-occur-press): Update to work with `grep-mode'.
(ivy-occur-grep-mode-map): New defvar.
(ivy-occur-grep-mode): New major mode. Basically, it's grep-mode with
"C-x C-q" bound to `wgrep-change-to-wgrep-mode'.

8 years agoivy.el (ivy-dispatching-done): Don't set action permanently
Oleh Krehel [Wed, 11 Nov 2015 14:46:22 +0000 (15:46 +0100)]
ivy.el (ivy-dispatching-done): Don't set action permanently

8 years agocounsel.el (counsel--find-symbol): Silence byte compiler
Oleh Krehel [Wed, 11 Nov 2015 14:38:45 +0000 (15:38 +0100)]
counsel.el (counsel--find-symbol): Silence byte compiler

8 years agoswiper.el (swiper-toggle-face-matching): Add and bind to "C-c C-f"
Oleh Krehel [Wed, 11 Nov 2015 11:01:43 +0000 (12:01 +0100)]
swiper.el (swiper-toggle-face-matching): Add and bind to "C-c C-f"

* swiper.el (swiper-map): Bind `swiper-toggle-face-matching' to
  "C-c C-f".
(swiper-invocation-face): New defvar.
(swiper--ivy): Set `swiper-invocation-face'.
(swiper-toggle-face-matching): Toggle `ivy-state-matcher' between
nil (the initial value) and 'swiper--face-matcher.
(swiper--face-matcher): New defun. In addition to filtering CANDIDATES
by having them match REGEXP, also ensure that every match has
`swiper-invocation-face'.

Example of usage:

1. Move point to a variable with e.g. `font-lock-keyword-face' and "C-s"
<input>.

2. Use "C-c C-f" to filter the candidates further by selecting only the
ones that have `font-lock-keyword-face'.
Note that "M-q" (`swiper-query-replace') is also affected by the filtering.

3. Use "C-c C-f" to toggle the filtering off.

Fixes #288