]> code.delx.au - gnu-emacs-elpa/log
gnu-emacs-elpa
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

8 years agoivy.el (ivy-alt-done): Ensure the trailing slash for directories
Oleh Krehel [Tue, 10 Nov 2015 07:17:34 +0000 (08:17 +0100)]
ivy.el (ivy-alt-done): Ensure the trailing slash for directories

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

8 years agocounsel.el (counsel-M-x): Show current-prefix-arg in the prompt
Oleh Krehel [Fri, 6 Nov 2015 19:35:49 +0000 (20:35 +0100)]
counsel.el (counsel-M-x): Show current-prefix-arg in the prompt

* counsel.el (counsel--M-x-prompt): New defun.
(counsel-M-x): Update.

Fixes #287

8 years agodoc/ivy.org: Start writing a manual
Oleh Krehel [Fri, 6 Nov 2015 15:34:55 +0000 (16:34 +0100)]
doc/ivy.org: Start writing a manual

8 years agoFix directory validity check
Stephen Whipple [Thu, 5 Nov 2015 14:07:59 +0000 (07:07 -0700)]
Fix directory validity check

Directory validity check should be based on `ivy-text` and
`ivy--directory` rather than only `ivy-text`.

Fixes #283
Fixes #284

8 years agoAdd a better ivy-occur pulse to swiper and counsel-git-grep
Oleh Krehel [Thu, 5 Nov 2015 13:42:36 +0000 (14:42 +0100)]
Add a better ivy-occur pulse to swiper and counsel-git-grep

* ivy.el (ivy-occur-press): Bind `ivy-exit' to 'done, so that
  `swiper--add-overlays' called by ACTION don't do anything.
  Call another `swiper--add-overlays' for swiper and counsel-git-grep,
  limited to the current line. Call `swiper--cleanup' with a delay of 1
  second.

8 years agoswiper.el (swiper--add-overlays): Take extra WND arg
Oleh Krehel [Thu, 5 Nov 2015 13:41:24 +0000 (14:41 +0100)]
swiper.el (swiper--add-overlays): Take extra WND arg

8 years agocounsel.el (counsel-git-grep-query-replace): Should exit minibuffer
Oleh Krehel [Thu, 5 Nov 2015 12:48:04 +0000 (13:48 +0100)]
counsel.el (counsel-git-grep-query-replace): Should exit minibuffer

8 years agoInput "/sudo::" goes to current directory instead of root's home
Oleh Krehel [Thu, 5 Nov 2015 10:05:20 +0000 (11:05 +0100)]
Input "/sudo::" goes to current directory instead of root's home

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

Re #283

8 years agoFix /ssh: and /sudo:: broken in 71695df
Oleh Krehel [Thu, 5 Nov 2015 09:56:57 +0000 (10:56 +0100)]
Fix /ssh: and /sudo:: broken in 71695df

* ivy.el (ivy-alt-done): `file-directory-p' errors when given "/ssh:" or
  "/sudo::".

Re #283

8 years agoRebind ivy-occur to "C-c C-o" and "C-o u"
Oleh Krehel [Thu, 5 Nov 2015 07:35:00 +0000 (08:35 +0100)]
Rebind ivy-occur to "C-c C-o" and "C-o u"

* ivy.el (ivy-minibuffer-map): Update.

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

Wouldn't want to violate the "C-c LETTER" convention.

8 years agocounsel.el (counsel-M-x): Add "definition" action
Oleh Krehel [Wed, 4 Nov 2015 18:47:50 +0000 (19:47 +0100)]
counsel.el (counsel-M-x): Add "definition" action

8 years agoivy.el (ivy-occur-press): Extend with-ivy-window
Oleh Krehel [Wed, 4 Nov 2015 18:10:09 +0000 (19:10 +0100)]
ivy.el (ivy-occur-press): Extend with-ivy-window

ivy-occur-action should be called in (ivy--get-window ivy-last).

This means, for purposes of e.g. `counsel-find-symbol' or
`lispy--action-jump` that if *ivy-occur* is the only window, it will be
re-used.
But if the user wants *ivy-occur* not to get buried, then having at
least 2 windows solves that problem.

8 years agoivy.el (ivy-minibuffer-map): Bind "C-M-a" to ivy-read-action
Oleh Krehel [Wed, 4 Nov 2015 18:09:44 +0000 (19:09 +0100)]
ivy.el (ivy-minibuffer-map): Bind "C-M-a" to ivy-read-action

8 years agocounsel.el (counsel-rhythmbox): Add :caller
Oleh Krehel [Wed, 4 Nov 2015 18:06:42 +0000 (19:06 +0100)]
counsel.el (counsel-rhythmbox): Add :caller

This results in more descriptive *ivy-occur* buffers.

8 years agoivy.el (ivy-occur-press): Work with counsel-rhythmbox
Oleh Krehel [Wed, 4 Nov 2015 17:41:57 +0000 (18:41 +0100)]
ivy.el (ivy-occur-press): Work with counsel-rhythmbox

> (cdr (assoc str coll))

Special behavior for `counsel-rhythmbox'.  Maybe not taking `cdr' is the
 right thing, but that's how Helm and `helm-rhythmbox-play-song' works.

8 years agofix 1-too-far scrolling issue
mike [Wed, 4 Nov 2015 15:08:51 +0000 (10:08 -0500)]
fix 1-too-far scrolling issue

Functions `ivy-scroll-up-command' and `ivy-scroll-down-command' would
scroll 1 unit too far. So one item in the list would be skipped
and never seen for each scroll.

8 years agoPulse after ivy-occur-press
Oleh Krehel [Wed, 4 Nov 2015 11:51:04 +0000 (12:51 +0100)]
Pulse after ivy-occur-press

* ivy.el (ivy-state): New field TEXT.
(ivy-occur): Add `ivy-text' to the name of the buffer. Also store
`ivy-text' in `ivy-occur-last'. Might be needed in the future for a more
specific pulse.
(ivy-occur-press): Pulse the selected line.

8 years agoMake ivy work with enable-recursive-minibuffers
Oleh Krehel [Tue, 3 Nov 2015 15:12:06 +0000 (16:12 +0100)]
Make ivy work with enable-recursive-minibuffers

* ivy.el (ivy-read): Fix the doc of DYNAMIC-COLLECTION.  Store the old
`ivy-last' in case `ivy-read' is called while inside the minibuffer.
Restore it after `ivy-call'.

8 years agoswiper.el (swiper-font-lock-ensure): Exclude debbugs-gnu-mode
Oleh Krehel [Tue, 3 Nov 2015 15:13:27 +0000 (16:13 +0100)]
swiper.el (swiper-font-lock-ensure): Exclude debbugs-gnu-mode

8 years agoivy.el (ivy-occur): Add and bind to "C-c o"
Oleh Krehel [Tue, 3 Nov 2015 10:43:47 +0000 (11:43 +0100)]
ivy.el (ivy-occur): Add and bind to "C-c o"

* ivy.el (ivy-minibuffer-map): Update.
(ivy-occur-action):
(ivy-occur-last):
(ivy-occur-map): New defvar.
(ivy-occur): New command.
(ivy-occur-click): New command bound to mouse click.
(ivy-occur-press): New command bound to "RET" press.

`ivy-occur' allows to store the current completion session for further
use. An unlimited amount of these sessions can be used, each in its own
buffer.

8 years agoivy.el (with-ivy-window): Ensure window is live
Oleh Krehel [Tue, 3 Nov 2015 10:42:41 +0000 (11:42 +0100)]
ivy.el (with-ivy-window): Ensure window is live

* ivy.el (ivy--get-window): New defun.

8 years agoivy.el (ivy-state): Add a new field BUFFER
Oleh Krehel [Tue, 3 Nov 2015 10:13:03 +0000 (11:13 +0100)]
ivy.el (ivy-state): Add a new field BUFFER

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

* swiper.el (swiper--action): Use `ivy-state-buffer'.

8 years agoswiper.el (swiper-mc): Update
Oleh Krehel [Tue, 3 Nov 2015 10:10:21 +0000 (11:10 +0100)]
swiper.el (swiper-mc): Update

8 years agoHighlight modified file buffers with 'ivy-modified-buffer face
Oleh Krehel [Mon, 2 Nov 2015 14:12:26 +0000 (15:12 +0100)]
Highlight modified file buffers with 'ivy-modified-buffer face

* ivy.el (ivy-modified-buffer): New face, blank by default.
(ivy--format): When the collection is 'internal-complete-buffer,
highlight unsaved file visiting buffers with 'ivy-modified-buffer.

Fixes #280

Example custom setting for 'ivy-modified-buffer:

(custom-set-faces
 '(ivy-modified-buffer ((t (:background "#ff7777")))))

8 years agoivy.el (ffap): Move require
Oleh Krehel [Sun, 1 Nov 2015 12:21:38 +0000 (13:21 +0100)]
ivy.el (ffap): Move require

8 years agocounsel.el (counsel-git-grep-query-replace): Add and bind to "M-q"
Oleh Krehel [Sat, 31 Oct 2015 12:11:23 +0000 (13:11 +0100)]
counsel.el (counsel-git-grep-query-replace): Add and bind to "M-q"

* counsel.el (counsel-git-grep-map): Bind "M-q" to
  `counsel-git-grep-query-replace'.
(counsel-git-grep-query-replace): New command. Perform `query-replace'
on all matches of git-grep in all buffers.

8 years agoswiper.el (swiper-font-lock-ensure): Exclude eems-stream-mode
Oleh Krehel [Sat, 31 Oct 2015 11:05:42 +0000 (12:05 +0100)]
swiper.el (swiper-font-lock-ensure): Exclude eems-stream-mode

Re #19

8 years ago"C-x C-f M-n" can call ffap-url-fetcher when at URL
Oleh Krehel [Fri, 30 Oct 2015 14:00:30 +0000 (15:00 +0100)]
"C-x C-f M-n" can call ffap-url-fetcher when at URL

* ivy.el (ivy--cd-maybe): Check if the input is a valid URL.
If so, exit immediately by calling (funcall ffap-url-fetcher url).
Otherwise, do the usual `ivy--cd' thing.

8 years agoivy.el: "M-n" should prefer url at point to symbol at point
Oleh Krehel [Fri, 30 Oct 2015 13:54:24 +0000 (14:54 +0100)]
ivy.el: "M-n" should prefer url at point to symbol at point

* ivy.el (ivy--reset-state): Update.

8 years agocounsel.el (counsel--find-symbol): Resolve name clash better
Oleh Krehel [Fri, 30 Oct 2015 13:50:05 +0000 (14:50 +0100)]
counsel.el (counsel--find-symbol): Resolve name clash better

* counsel.el (counsel--find-symbol): When the symbol is both bound and
  fbound, prefer the fbound one, unless the :caller is
  `counsel-describe-variable'.
(counsel-describe-variable): Declare :caller.
(counsel-describe-function): Declare :caller.

One example is going to the definition of `isearch-forward' (also with
`counsel-M-x').

8 years agoImprove the preselect index in ivy-resume
Oleh Krehel [Fri, 30 Oct 2015 12:00:02 +0000 (13:00 +0100)]
Improve the preselect index in ivy-resume

* ivy.el (ivy--recompute-index): Don't change the ivy--index that was
  set in `ivy--reset-state' by `ivy-resume'.

With this, it's possible to e.g. "<f1> f", enter "for", navigate to
"format" and press "C-g". Calling `ivy-resume' will point to "format"
still.

8 years agoUse a specific blending method for dark themes
Oleh Krehel [Fri, 30 Oct 2015 11:21:25 +0000 (12:21 +0100)]
Use a specific blending method for dark themes

* colir.el (colir-blend): Use 'colir-compose-soft-light for dark themes.

Fixes #278

8 years agoRename and move the minibuffer faces
Oleh Krehel [Wed, 28 Oct 2015 12:38:45 +0000 (13:38 +0100)]
Rename and move the minibuffer faces

* swiper.el (swiper-minibuffer-match-face-1):
(swiper-minibuffer-match-face-2):
(swiper-minibuffer-match-face-3):
(swiper-minibuffer-match-face-4): Transform into obsolete aliases.

* ivy.el (ivy-minibuffer-match-face-1):
(ivy-minibuffer-match-face-2):
(ivy-minibuffer-match-face-3):
(ivy-minibuffer-match-face-4): New renamed faces.
(ivy-minibuffer-faces): Rename from `swiper-minibuffer-faces'.

Fixes #276

8 years agocounsel.el (counsel-git): Update default-directory
Oleh Krehel [Sat, 24 Oct 2015 17:10:37 +0000 (19:10 +0200)]
counsel.el (counsel-git): Update default-directory

8 years agoivy-immediate-done should use ivy--directory
Oleh Krehel [Fri, 23 Oct 2015 12:12:53 +0000 (14:12 +0200)]
ivy-immediate-done should use ivy--directory

* ivy.el (ivy-immediate-done): When completing file names, expand the
  file name properly.

Fixes #275

8 years agoswiper.el (swiper-font-lock-ensure): Amend exception list
Oleh Krehel [Fri, 23 Oct 2015 12:08:15 +0000 (14:08 +0200)]
swiper.el (swiper-font-lock-ensure): Amend exception list

Re #19

8 years agoivy.el (ivy-alt-done): Fix up last commit
Oleh Krehel [Thu, 22 Oct 2015 10:52:54 +0000 (12:52 +0200)]
ivy.el (ivy-alt-done): Fix up last commit

8 years ago"C-j" should not stop completion for a pasted file path
Oleh Krehel [Thu, 22 Oct 2015 10:27:37 +0000 (12:27 +0200)]
"C-j" should not stop completion for a pasted file path

* ivy.el (ivy-alt-done): If you paste a file path, it won't match
  anything in the current directory. Previously, "C-j" would open dired
  for that path. Now, "C-j" will switch to the pasted directory and
  continue completion.

This behavior conforms to `ido-find-file'.

8 years agoFix pasting file paths on Windows
Oleh Krehel [Thu, 22 Oct 2015 10:20:35 +0000 (12:20 +0200)]
Fix pasting file paths on Windows

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

Fixes #272

8 years agoFix Custom menus
Stephen Whipple [Thu, 22 Oct 2015 02:36:21 +0000 (20:36 -0600)]
Fix Custom menus

Custom menus for `ivy-virtual-abbreviate' and `ivy-sort-functions-alist'
now display a better user interface.

Fixes #274

8 years agoAdd a test for the perfect match logic
Oleh Krehel [Tue, 20 Oct 2015 13:05:22 +0000 (15:05 +0200)]
Add a test for the perfect match logic

Re #270

8 years agoBring back the lost perfect match logic
Oleh Krehel [Tue, 20 Oct 2015 13:01:20 +0000 (15:01 +0200)]
Bring back the lost perfect match logic

* ivy.el (ivy--recompute-index): Don't defer the perfect match logic to
  `ivy-index-functions-alist'.
(ivy-recompute-index-swiper): Simplify.

Once again, if the minibuffer text becomes `equal' to one of the
candidates, that candidate will be selected.

Fixes #270

8 years agoivy.el (ivy-resume): Pass caller
Oleh Krehel [Tue, 20 Oct 2015 07:01:49 +0000 (09:01 +0200)]
ivy.el (ivy-resume): Pass caller

Fixes #245

8 years agoivy.el (ivy-partial): Fix for fuzzy completion
Oleh Krehel [Mon, 19 Oct 2015 10:38:13 +0000 (12:38 +0200)]
ivy.el (ivy-partial): Fix for fuzzy completion

Postfix doesn't always work if the completion is fuzzy, so check if
`string-match' succeeds.

Fixes #266

8 years agoFix the count in user-specified counsel-git-grep
Oleh Krehel [Mon, 19 Oct 2015 10:24:15 +0000 (12:24 +0200)]
Fix the count in user-specified counsel-git-grep

* counsel.el (counsel--gg-count): Generate the count command from
`counsel-git-grep-cmd' by replacing "--full-name" with "-c".

Re #244

8 years agoivy.el (ivy-sort-functions-alist): Upgrade to defcustom
Oleh Krehel [Sun, 18 Oct 2015 16:13:41 +0000 (18:13 +0200)]
ivy.el (ivy-sort-functions-alist): Upgrade to defcustom

Add the proper :type.