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

9 years agoMerge ivy--action into ivy-last
Oleh Krehel [Fri, 1 May 2015 19:49:25 +0000 (21:49 +0200)]
Merge ivy--action into ivy-last

* ivy.el (ivy-state): Add action field.
(ivy-set-action): New defun. Just a shortcut to set action.
(ivy--action): Remove defvar.
(ivy-read): Add action argument. Check (ivy-state-action ivy-last) in
the end and call it, since the action can change during the completion.
(ivy--insert-prompt): Add `counsel-find-symbol' to the list.
(ivy--format): If there are no matches, set `ivy--current' to "".

9 years agoMerge ivy-window into ivy-last
Oleh Krehel [Fri, 1 May 2015 18:37:54 +0000 (20:37 +0200)]
Merge ivy-window into ivy-last

* ivy.el (ivy-state): Add a window field.
(ivy-window): Remove defvar.
(ivy-next-line-and-call): Update.
(ivy-previous-line-and-call): Update.
(ivy-read): Update.

9 years agoMerge ivy-def into ivy-last
Oleh Krehel [Fri, 1 May 2015 18:34:05 +0000 (20:34 +0200)]
Merge ivy-def into ivy-last

* ivy.el (ivy-def): Remove defvar.
(ivy-read): Update.
(ivy--filter): Update.

9 years agoAllow to quote spaces while matching
Oleh Krehel [Fri, 1 May 2015 18:28:21 +0000 (20:28 +0200)]
Allow to quote spaces while matching

* ivy.el (ivy--split): New defun.

Use (ivy--split str) in place of (split-string str " +" t).
Allows to "quote" N spaces by inputting N+1 spaces.

9 years agoAdd ivy-state struct
Oleh Krehel [Fri, 1 May 2015 18:01:08 +0000 (20:01 +0200)]
Add ivy-state struct

* ivy.el (ivy-state): New defstruct.
(ivy-last): A single global to store an `ivy-state' struct.
(ivy-require-match): Move into `ivy-last'.
(ivy-done): Update.
(ivy-resume): New defun. Initial draft, kind of works for swiper. Need
to add a callback of what to do with the result as an argument.
(ivy-read): Store all arguments into `ivy-last'.
(ivy-completing-read): Update doc.

9 years agoAllow for "/ssh:user@" as well as for "/ssh:"
Oleh Krehel [Thu, 30 Apr 2015 10:25:50 +0000 (12:25 +0200)]
Allow for "/ssh:user@" as well as for "/ssh:"

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

Re #59

9 years agoImprove TRAMP completion for ivy-mode
Oleh Krehel [Thu, 30 Apr 2015 09:25:09 +0000 (11:25 +0200)]
Improve TRAMP completion for ivy-mode

* ivy.el (ivy-build-tramp-name): New defun.
(ivy-alt-done): Use arcane TRAMP stuff to complete host names.

Re #59

9 years agoivy.el (ivy-read): Reset `ivy-text' earlier
Oleh Krehel [Thu, 30 Apr 2015 09:24:06 +0000 (11:24 +0200)]
ivy.el (ivy-read): Reset `ivy-text' earlier

Related to `counsel-git-grep' "-3 chars more".

9 years agoivy.el (ivy--regex): Fixup
Oleh Krehel [Thu, 30 Apr 2015 07:15:10 +0000 (09:15 +0200)]
ivy.el (ivy--regex): Fixup

Fixes #62

9 years agoDon't error on bad regex
Oleh Krehel [Thu, 30 Apr 2015 06:42:01 +0000 (08:42 +0200)]
Don't error on bad regex

* ivy.el (ivy--filter): When on bad regex, just set the result to nil.

Fixes #70

9 years agoUpdate and improve faces
Oleh Krehel [Wed, 29 Apr 2015 15:00:54 +0000 (17:00 +0200)]
Update and improve faces

* ivy.el (ivy-subdir): Inherit from dired-directory.

* swiper.el (swiper-match-face-1): Update doc.
(swiper-match-face-2): Update doc.
(swiper-match-face-3): Update doc.
(swiper-match-face-4): Inherit from isearch-fail.
(swiper--add-overlays): Fix the faces order swapping on the second
match.

Now it finally works as planned: face-1 is the background (re group 0),
next it cycles: face-2, face-3, face-4, face-2, face-3, face-4.

9 years agoAdd gamma-correction to alpha-blending
Oleh Krehel [Wed, 29 Apr 2015 12:32:36 +0000 (14:32 +0200)]
Add gamma-correction to alpha-blending

* colir.el (colir-compose-method): Make 'colir-compose-alpha default.
(colir-compose-alpha): Add gamma-correction.

9 years agocolir.el: Add two additional blend algorithms
Oleh Krehel [Wed, 29 Apr 2015 12:15:44 +0000 (14:15 +0200)]
colir.el: Add two additional blend algorithms

* colir.el (colir-join): Remove.
(color): Require.
(colir-compose-method): New defcustom.
(colir-compose-soft-light): New defun.
(colir-compose-overlay): New defun.
(colir-compose-alpha): New defun.
(colir-blend): Update.
(colir-blend-face-background): Update.

9 years agoivy.el (ivy--exhibit): Fixup last commit
Oleh Krehel [Wed, 29 Apr 2015 10:10:09 +0000 (12:10 +0200)]
ivy.el (ivy--exhibit): Fixup last commit

* ivy.el (ivy--old-text): Should always be a string.
(ivy-read): Update.
(ivy--exhibit): Recompute candidates on flip, always set `ivy--old-re'
to nil.

9 years agoImprove hidden buffer completion further
Oleh Krehel [Wed, 29 Apr 2015 08:14:23 +0000 (10:14 +0200)]
Improve hidden buffer completion further

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

Fixes #68
Fixes #69

9 years agoImprove the completion of hidden buffers
Oleh Krehel [Wed, 29 Apr 2015 06:48:39 +0000 (08:48 +0200)]
Improve the completion of hidden buffers

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

Re #68.

9 years agoBind "TAB" to do partial completion
Oleh Krehel [Wed, 29 Apr 2015 06:46:31 +0000 (08:46 +0200)]
Bind "TAB" to do partial completion

* ivy.el (ivy-minibuffer-map): Update.
(ivy-alt-done): New defun.
(ivy--old-text): Update.

Re #63.

9 years agocounsel.el (counsel-git-grep): Add optional initial-input
Oleh Krehel [Tue, 28 Apr 2015 19:58:44 +0000 (21:58 +0200)]
counsel.el (counsel-git-grep): Add optional initial-input

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

Fixes #66

9 years agoivy.el (ivy-re-builders-alist): Improve doc
Oleh Krehel [Tue, 28 Apr 2015 15:00:57 +0000 (17:00 +0200)]
ivy.el (ivy-re-builders-alist): Improve doc

Re #62

9 years agoivy.el: Fixup docstrings
Oleh Krehel [Tue, 28 Apr 2015 14:44:05 +0000 (16:44 +0200)]
ivy.el: Fixup docstrings

* ivy.el (ivy-require-match): Update.
(ivy-def): Update.
(ivy--prompt-extra): Update.
(ivy--maybe-scroll-history): Update.
(ivy-completing-read): Update.
(ivy--insert-minibuffer): Update.
(ivy--filter): Update.

9 years agoAdd an option for multi-tier regex matching
Oleh Krehel [Tue, 28 Apr 2015 14:35:32 +0000 (16:35 +0200)]
Add an option for multi-tier regex matching

* ivy.el (ivy--regex-plus): New defun. This is an example for the
  multi-tier interface.
(ivy--filter): Update.

To use it, add e.g.:

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

Example using boost_1_58_0 and `find-file-in-project`:

* "utility" - 234 matches
* "utility hpp" - 139 matches
* "utility !hpp" - 95 matches

Fixes #62

9 years agoMakefile: Update
Oleh Krehel [Tue, 28 Apr 2015 14:08:22 +0000 (16:08 +0200)]
Makefile: Update

9 years agoUse alpha compositing to add ivy-current-match face
Oleh Krehel [Tue, 28 Apr 2015 13:15:51 +0000 (15:15 +0200)]
Use alpha compositing to add ivy-current-match face

* ivy.el (ivy--exhibit): Use `colir-blend-face-background'. In case it
  fails, try `font-lock-append-text-property', which was used before.

* colir.el (colir-join): New defun.
(colir-blend): New defun.
(colir-blend-face-background): New defun.

9 years agoswiper.el (swiper-font-lock-ensure): Exclude `elfeed-search-mode'
Oleh Krehel [Tue, 28 Apr 2015 12:44:57 +0000 (14:44 +0200)]
swiper.el (swiper-font-lock-ensure): Exclude `elfeed-search-mode'

9 years agoivy.el (ivy--filter): Fixup
Oleh Krehel [Tue, 28 Apr 2015 11:01:23 +0000 (13:01 +0200)]
ivy.el (ivy--filter): Fixup

Fixes #65

9 years agoivy.el (ivy-alt-done): Treat `ivy-text' with ":" verbatim
Oleh Krehel [Tue, 28 Apr 2015 09:06:09 +0000 (11:06 +0200)]
ivy.el (ivy-alt-done): Treat `ivy-text' with ":" verbatim

* ivy.el (ivy-alt-done): Should work better now for ssh: stuff.

It should be possible to type in any directory: `/ssh:user@domain.com:`
<kbd>C-j</kbd> and get completion.

Re #59

9 years agoStore the preselect and use it for empty ivy-text
Oleh Krehel [Tue, 28 Apr 2015 08:46:28 +0000 (10:46 +0200)]
Store the preselect and use it for empty ivy-text

* ivy.el (ivy-def): New defvar.
(ivy-read): Store `ivy-def'.
(ivy-completing-read): Update.
(ivy--filter): When the input is empty, set `ivy--index' to select
`ivy-def'.

Fixes #64

9 years agoImprove completion history using the propertize trick
Oleh Krehel [Sat, 25 Apr 2015 11:44:52 +0000 (13:44 +0200)]
Improve completion history using the propertize trick

* ivy.el (ivy-previous-history-element): Update.
(ivy-next-history-element): Update.
(ivy--maybe-scroll-history): New defun. When the history element string
has ivy-index property, set `ivy--index' to that.

Fixes #46

9 years agoMinibuffer faces should inherit minibuffer-prompt
Oleh Krehel [Fri, 24 Apr 2015 11:36:40 +0000 (13:36 +0200)]
Minibuffer faces should inherit minibuffer-prompt

* ivy.el (ivy-confirm-face): Update.
(ivy-match-required-face): Update.

Re #60

9 years agoImprove the match confirm while completing files
Oleh Krehel [Fri, 24 Apr 2015 10:52:40 +0000 (12:52 +0200)]
Improve the match confirm while completing files

* ivy.el (ivy-confirm-face): New face.
(ivy-match-required-face): New face.
(ivy--prompt-extra): New defvar, the prompt is concatenaded with this.
(ivy--extend-prompt): Remove.
(ivy-done): Update.
(ivy--insert-prompt): Use `ivy--prompt-extra'. Reset it unless the
`this-command' is appropriate.
(ivy--set-match-props): New defun.

Fixes #60

9 years agoReset to the first candidate when switching directories
Oleh Krehel [Fri, 24 Apr 2015 09:54:46 +0000 (11:54 +0200)]
Reset to the first candidate when switching directories

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

9 years agoPropertize remote buffers with ivy-remote face
Oleh Krehel [Fri, 24 Apr 2015 06:06:48 +0000 (08:06 +0200)]
Propertize remote buffers with ivy-remote face

* ivy.el (ivy-remote): New face.
(ivy-read): Update.

Fixes #61

9 years agoRespect `confirm-nonexistent-file-or-buffer'
Oleh Krehel [Thu, 23 Apr 2015 21:21:26 +0000 (23:21 +0200)]
Respect `confirm-nonexistent-file-or-buffer'

* ivy.el (ivy--extend-prompt): New defun.
(ivy-done): Ask for a confirmation if no candidates match and
`confirm-nonexistent-file-or-buffer' is t.

Re #60

9 years agoivy.el (ivy-read): Fixup preselect addition
Oleh Krehel [Thu, 23 Apr 2015 21:19:15 +0000 (23:19 +0200)]
ivy.el (ivy-read): Fixup preselect addition

It was unnecessarily inserting `preselect' when completing tags.

9 years agoivy.el (ivy--cd): Reset `ivy--old-re'
Oleh Krehel [Thu, 23 Apr 2015 19:43:10 +0000 (21:43 +0200)]
ivy.el (ivy--cd): Reset `ivy--old-re'

* ivy.el (ivy--cd): Switching directory switches the candidates, so
`ivy--old-re' must be invalidated.

Fixes #58

9 years agoivy.el (Info-current-file): Declare
Oleh Krehel [Thu, 23 Apr 2015 17:54:28 +0000 (19:54 +0200)]
ivy.el (Info-current-file): Declare

9 years agoUse "//" to move to root instead of "/" as before
Oleh Krehel [Thu, 23 Apr 2015 17:49:15 +0000 (19:49 +0200)]
Use "//" to move to root instead of "/" as before

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

This improves the situation with tramp and generally avoids losing the
current directory by pressing "/" by accident.

Fixes #59

9 years agoAvoid sorting org refile candidates
Oleh Krehel [Thu, 23 Apr 2015 17:19:16 +0000 (19:19 +0200)]
Avoid sorting org refile candidates

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

9 years agoExclude jabber-chat-mode from font-lock
Oleh Krehel [Thu, 23 Apr 2015 16:42:59 +0000 (18:42 +0200)]
Exclude jabber-chat-mode from font-lock

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

9 years agoRemove globbing heuristics for file name completion
Oleh Krehel [Thu, 23 Apr 2015 16:09:48 +0000 (18:09 +0200)]
Remove globbing heuristics for file name completion

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

If you want to exit with the current text, ignoring candidates, use
`ivy-immediate-done' instead. Works for globs as well.

Fixes #55

9 years agocounsel.el (counsel-git-grep): Fixup
Oleh Krehel [Thu, 23 Apr 2015 11:15:36 +0000 (13:15 +0200)]
counsel.el (counsel-git-grep): Fixup

9 years agoivy.el (ivy-backward-delete-char): Expand `ivy--directory'
Oleh Krehel [Thu, 23 Apr 2015 11:13:18 +0000 (13:13 +0200)]
ivy.el (ivy-backward-delete-char): Expand `ivy--directory'

This avoids the situation of getting a nil for "~/".

Re #57

9 years agoivy.el (ivy-done): Update wrt globs
Oleh Krehel [Thu, 23 Apr 2015 11:08:22 +0000 (13:08 +0200)]
ivy.el (ivy-done): Update wrt globs

Re #55

9 years agoswiper.el (swiper-query-replace): Fix
Oleh Krehel [Thu, 23 Apr 2015 11:08:07 +0000 (13:08 +0200)]
swiper.el (swiper-query-replace): Fix

9 years agoswiper.el (swiper--ivy): Check for stand-alone ivy
Oleh Krehel [Thu, 23 Apr 2015 09:19:07 +0000 (11:19 +0200)]
swiper.el (swiper--ivy): Check for stand-alone ivy

Re #54

9 years agoivy.el (ivy-done): Don't expand globs
Oleh Krehel [Thu, 23 Apr 2015 08:18:53 +0000 (10:18 +0200)]
ivy.el (ivy-done): Don't expand globs

Re #55

9 years agoREADME.md: Update video link
Oleh Krehel [Wed, 22 Apr 2015 16:58:06 +0000 (18:58 +0200)]
README.md: Update video link

9 years agoFixup `swiper-query-replace'
Oleh Krehel [Wed, 22 Apr 2015 15:58:09 +0000 (17:58 +0200)]
Fixup `swiper-query-replace'

* swiper.el (swiper-query-replace): Make sure to use `swiper--window'.

* ivy.el (ivy--minibuffer-setup): Remove the `use-local-map' statement,
  the map is already set in `read-from-minibuffer'.

9 years agoivy-test.el (ivy-read): Update test.
Oleh Krehel [Wed, 22 Apr 2015 15:31:24 +0000 (17:31 +0200)]
ivy-test.el (ivy-read): Update test.

REQUIRE-MATCH is nil by default.

9 years agoivy.el (ivy-read): Fix preselect logic
Oleh Krehel [Wed, 22 Apr 2015 15:24:52 +0000 (17:24 +0200)]
ivy.el (ivy-read): Fix preselect logic

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

Fixes e.g. `ert' passing "t" as the default, which isn't in collection,
but `all-completions' doesn't return nil.

9 years agoivy.el (ivy-done): Fixup
Oleh Krehel [Wed, 22 Apr 2015 15:09:56 +0000 (17:09 +0200)]
ivy.el (ivy-done): Fixup

9 years agoivy.el (ivy--add-face): Don't fail for weird str
Oleh Krehel [Wed, 22 Apr 2015 14:32:04 +0000 (16:32 +0200)]
ivy.el (ivy--add-face): Don't fail for weird str

Fixes #44

9 years agoswiper.el (swiper--ivy): Fix preselect being added
Oleh Krehel [Wed, 22 Apr 2015 13:42:39 +0000 (15:42 +0200)]
swiper.el (swiper--ivy): Fix preselect being added

9 years agoivy.el (ivy--exhibit): Wrap in `while-no-input'
Oleh Krehel [Wed, 22 Apr 2015 13:37:11 +0000 (15:37 +0200)]
ivy.el (ivy--exhibit): Wrap in `while-no-input'

* ivy.el (ivy--exhibit): `ivy--dynamic-function' will sometimes use
  `call-process'. Adding `while-no-input' speeds up things a lot, at the
  cost of a small message interrupting the minibuffer when
  `call-process' takes too long or the user types too fast.
  This message is not an issue for emacs-snapshot.

9 years agoBind "M-q" to `ivy-toggle-regexp-quote'
Oleh Krehel [Wed, 22 Apr 2015 13:36:46 +0000 (15:36 +0200)]
Bind "M-q" to `ivy-toggle-regexp-quote'

* ivy.el (ivy-minibuffer-map): Update.
(ivy--regexp-quote): New defvar.
(ivy-toggle-regexp-quote): New command, toggle `ivy--regex-function'
between the value selected in `ivy-read' and `ivy--regexp-quote'.
(ivy-read): Reset `ivy--regexp-quote' to 'regexp-quote.

Fixes #48

9 years agoAllow to customize the regex matching per-collection
Oleh Krehel [Wed, 22 Apr 2015 13:15:51 +0000 (15:15 +0200)]
Allow to customize the regex matching per-collection

* ivy.el (ivy--regex-function): New defvar.
(ivy-re-builders-alist): New defvar, use this to customize.
(ivy-read): Update.
(ivy--filter): Update.

Currently, it only works for function collections. Example:

(setq ivy-re-builders-alist
  '((read-file-name-internal . regexp-quote)
    (t . ivy--regex)))

Re #48

9 years agoivy.el (ivy-done): Be more strict for `require-match'
Oleh Krehel [Wed, 22 Apr 2015 10:59:21 +0000 (12:59 +0200)]
ivy.el (ivy-done): Be more strict for `require-match'

When `require-match' isn't in (nil confirm confirm-after-completion),
don't allow to exit if there isn't a match. Instead, amend the prompt
with "(match required)".

9 years agoChange `ivy-read' to a cl-defun
Oleh Krehel [Wed, 22 Apr 2015 10:56:19 +0000 (12:56 +0200)]
Change `ivy-read' to a cl-defun

* ivy.el (ivy-read): All args but PROMPT and COLLECTION are now keys.
The existing basic calls to `ivy-read' should still work, the others
need to be updated. It's best to try to use `ivy-completing-read' if
possible, since it conforms to the `completing-read' arguments.
New arguments: REQUIRE-MATCH and HISTORY. If HISTORY is nil, `ivy-history'
is used.

(ivy--sorted-files): Don't try to extend the collection.
(ivy-completing-read): Update.

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

* counsel.el (counsel-describe-symbol-history): New defvar.
(counsel-describe-variable): Update the call, require match, use
`counsel-describe-symbol-history'.
(counsel-describe-function): Update the call, require match, use
`counsel-describe-symbol-history'.

* ivy-test.el: Update tests, since zero and one length input doesn't
  return immediately any more.

Re #46

9 years agoivy.el (ivy--filter): Update prefix optimization
Oleh Krehel [Wed, 22 Apr 2015 10:33:16 +0000 (12:33 +0200)]
ivy.el (ivy--filter): Update prefix optimization

* ivy.el (ivy--filter): Don't use prefix optimization when the input
  contains "\".

9 years agoREADME.md: Add a note on outdated ivy package
Oleh Krehel [Wed, 22 Apr 2015 09:23:23 +0000 (11:23 +0200)]
README.md: Add a note on outdated ivy package

Fixes #51

9 years agoivy.el (ivy--filter): Try directory expansion with "/"
Oleh Krehel [Tue, 21 Apr 2015 16:12:54 +0000 (18:12 +0200)]
ivy.el (ivy--filter): Try directory expansion with "/"

* ivy.el (ivy--filter): If candidate is "x" and completing file names,
  check if "x/" is among the candidates, and if so, set `ivy--index'
  accordingly.

Re #50

9 years agoFix the default-directory for `counsel-git-grep'
Oleh Krehel [Tue, 21 Apr 2015 15:08:05 +0000 (17:08 +0200)]
Fix the default-directory for `counsel-git-grep'

* counsel.el (counsel--git-grep-dir): New defvar.
(counsel-git-grep-count): Update.
(counsel-git-grep-function): Update.
(counsel-git-grep): Update.

9 years agoAdd a way to exit ignoring the candidates
Oleh Krehel [Tue, 21 Apr 2015 15:01:58 +0000 (17:01 +0200)]
Add a way to exit ignoring the candidates

* ivy.el (ivy-immediate-done): New commad, currently unbound.
Exit the minibuffer, ignoring the candidates. Solves the same problem as
"C-f" in `ido-mode'.
(ivy-alt-done): With a prefix arg, e.g. "C-u C-j", forward to `ivy-immediate-done'.

Re #50

9 years agoivy.el (ivy-read): Don't add the `default-directory'
Oleh Krehel [Tue, 21 Apr 2015 14:46:26 +0000 (16:46 +0200)]
ivy.el (ivy-read): Don't add the `default-directory'

9 years agoivy.el (ivy-read): Use initial-input when completing files
Oleh Krehel [Tue, 21 Apr 2015 13:09:43 +0000 (15:09 +0200)]
ivy.el (ivy-read): Use initial-input when completing files

* ivy.el (ivy-read): Unless `require-match', add `initial-input' to the
  collection. This is important e.g. for `dired-dwim-target'.

9 years agoswiper.el (swiper--add-overlays): Make bounds optional
Oleh Krehel [Tue, 21 Apr 2015 13:09:23 +0000 (15:09 +0200)]
swiper.el (swiper--add-overlays): Make bounds optional

9 years agocounsel.el (counsel-git-grep-count): Ignore case
Oleh Krehel [Tue, 21 Apr 2015 13:08:57 +0000 (15:08 +0200)]
counsel.el (counsel-git-grep-count): Ignore case

9 years agoFix describe-function / -variable "C-." interaction
Oleh Krehel [Tue, 21 Apr 2015 11:46:07 +0000 (13:46 +0200)]
Fix describe-function / -variable "C-." interaction

* counsel.el (counsel-describe-variable): Don't describe variable if
  jump-to-symbol action was chosen.
(counsel-describe-function): Don't describe variable if
  jump-to-symbol action was chosen.

I should handle this more gracefully if multiple actions become a
pattern.

9 years agocounsel.el: Add awesome swiper highlighting to git grep
Oleh Krehel [Tue, 21 Apr 2015 11:33:18 +0000 (13:33 +0200)]
counsel.el: Add awesome swiper highlighting to git grep

* counsel.el (swiper): Require.
(counsel-git-grep-function): Use `swiper--add-overlays'. Remember to set
`swiper--window', and call `swiper--cleanup'. Use `ivy--regex' in all
cases to build the regex.

9 years agoivy.el (ivy--regex): Add optional greedy arg
Oleh Krehel [Tue, 21 Apr 2015 11:30:35 +0000 (13:30 +0200)]
ivy.el (ivy--regex): Add optional greedy arg

* ivy.el (ivy--regex): When optional greedy arg is t, be greedy.  Don't
wrap a sub-expr in a group if it's already a group, for instance
"forward \(char\|list\)".

Greedy is needed, for instance, for "git grep", which doesn't work great
with non-greedy regex.

Re #47

9 years agoswiper.el (swiper--add-overlays): Update arglist
Oleh Krehel [Tue, 21 Apr 2015 10:43:43 +0000 (12:43 +0200)]
swiper.el (swiper--add-overlays): Update arglist

* swiper.el (swiper--update-input-ivy): Update.
(swiper--add-overlays): Take only the regexp as the argument.
Figure out the bounds by itself.

9 years agoivy.el (ivy-done): Don't directory-expand glob filename
Oleh Krehel [Tue, 21 Apr 2015 10:36:41 +0000 (12:36 +0200)]
ivy.el (ivy-done): Don't directory-expand glob filename

* ivy.el (ivy-done): Don't directory-expand if there's a star in the
  file name.

This change fixes the behavior of `rgrep`. It can't handle the case of
e.g. /foo/bar/\*.el, but handles \*.el fine.

Re #45

9 years agoAdd an option to call the completion action without exiting
Oleh Krehel [Tue, 21 Apr 2015 09:49:46 +0000 (11:49 +0200)]
Add an option to call the completion action without exiting

* ivy.el (ivy--persistent-action): New defvar. This is a lambda that the
  caller sets if the caller has a plan for persistent actions.
(ivy-next-line-and-call): Add and bind to "C-M-n". Identical to "C-n",
except calls `ivy--persistent-action' when it's not nil.
Add and bind to "C-M-p". Identical to "C-p",
except calls `ivy--persistent-action' when it's not nil.
(ivy-window): New defvar.
(ivy-read): Store `ivy-window'.

* counsel.el (counsel-git-grep): Use `ivy--persistent-action'.

For `counsel-git-grep', as an example, it's possible to move to the
matched place without exiting the completion with "C-M-n" and "C-M-p".
This is a nice advantage, since it gives a full context to each one-line
git grep match.

9 years agoFix double-sorting for file names
Oleh Krehel [Tue, 21 Apr 2015 09:20:31 +0000 (11:20 +0200)]
Fix double-sorting for file names

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

9 years agoivy.el (ivy--sorted-files): Avoid returning an empty list
Oleh Krehel [Tue, 21 Apr 2015 09:10:06 +0000 (11:10 +0200)]
ivy.el (ivy--sorted-files): Avoid returning an empty list

Fixes #49

9 years agoAllow to customize the sorting methods
Oleh Krehel [Tue, 21 Apr 2015 08:44:52 +0000 (10:44 +0200)]
Allow to customize the sorting methods

* ivy.el (ivy-sort-functions-alist): New defvar, stores sorting
  functions for various function collection types.
(ivy-sort-file-function): Remove, merge into `ivy-sort-functions-alist'.
(ivy-sort-max-size): Don't sort candidate lists larger than this size.
(ivy--sorted-files): Update.
(ivy-read): Add an argument SORT. When it's t, sort the candidates
according to `ivy-sort-functions-alist'.  It's assumed that if
COLLECTION is a function it's OK to `cl-sort' it without making a copy.
(ivy-completing-read): Call with SORT t.

* counsel.el (counsel-describe-variable): Call with SORT t.
(counsel-describe-function): Call with SORT t.

9 years agoivy.el (ivy--regex): Switch to non-greedy ".*?" joiner
Oleh Krehel [Tue, 21 Apr 2015 07:07:08 +0000 (09:07 +0200)]
ivy.el (ivy--regex): Switch to non-greedy ".*?" joiner

Fixes #47

9 years agoivy.el (ivy-done): Expand file name for empty text
Oleh Krehel [Tue, 21 Apr 2015 06:49:13 +0000 (08:49 +0200)]
ivy.el (ivy-done): Expand file name for empty text

Fixes #45

9 years ago`counsel-git-grep' can now handle huge git repos
Oleh Krehel [Mon, 20 Apr 2015 16:34:43 +0000 (18:34 +0200)]
`counsel-git-grep' can now handle huge git repos

* counsel.el (counsel-git-grep-count): Return a number instead of a
  string. Apply `ivy--regex' on the input.
(counsel--git-grep-count): New defvar.
(counsel-git-grep-function): If the repo has >20000 lines, use `head' 5000
instead, but still display the true amount of matches.
(counsel-git-grep): Set `ivy--dynamic-function'.
(counsel-locate-function): Update.

* ivy.el (ivy--dynamic-function): New defvar. When this isn't nil, it
  will be called to get a new batch of candidates in case the `ivy-text'
  was changed.
(ivy--full-length): The true candidates length in case of `head' shenanigans.
(ivy--old-text): Store the old text for when `ivy--dynamic-function' was
called last.
(ivy--insert-prompt): Update.
(ivy--exhibit): Don't do filtering for non-nil `ivy--dynamic-function' -
let the caller (usually a shell tool) do the filtering.
(ivy--insert-minibuffer): New defun, created from a part of
`ivy--exhibit'.

9 years agoUse cl-plusp instead of plusp
Oleh Krehel [Mon, 20 Apr 2015 15:57:44 +0000 (17:57 +0200)]
Use cl-plusp instead of plusp

* ivy.el (cl-lib): Add require.
(ivy-alt-done): Update.

Re #43

9 years agoAdd a dynamic counsel-locate
Oleh Krehel [Sun, 19 Apr 2015 16:59:44 +0000 (18:59 +0200)]
Add a dynamic counsel-locate

* counsel.el (counsel-locate-function): New defun.
(counsel-locate): New defun.

* ivy.el (ivy--dynamic-function): New defvar.
(ivy--exhibit): Re-compute candidates use `ivy--dynamic-function' if
it's non-nil.

9 years agoSplit `ivy-completions' into `ivy--filter' and `ivy--format'
Oleh Krehel [Mon, 20 Apr 2015 15:37:13 +0000 (17:37 +0200)]
Split `ivy-completions' into `ivy--filter' and `ivy--format'

* ivy.el (ivy--exhibit): Update.
(ivy-completions): Remove.
(ivy--filter): New defun.
(ivy--format): New defun.

9 years agocounsel.el (counsel-git-grep-count): Add defun
Oleh Krehel [Mon, 20 Apr 2015 14:01:03 +0000 (16:01 +0200)]
counsel.el (counsel-git-grep-count): Add defun

9 years agoswiper.el: Fix compilation warnings
Oleh Krehel [Mon, 20 Apr 2015 14:00:24 +0000 (16:00 +0200)]
swiper.el: Fix compilation warnings

9 years agoBind arrows
Oleh Krehel [Mon, 20 Apr 2015 13:53:10 +0000 (15:53 +0200)]
Bind arrows

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

Re #40

9 years agoAdd an optimization to speed up matching
Oleh Krehel [Mon, 20 Apr 2015 12:43:14 +0000 (14:43 +0200)]
Add an optimization to speed up matching

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

9 years agoswiper.el: Bump version
Oleh Krehel [Mon, 20 Apr 2015 12:32:05 +0000 (14:32 +0200)]
swiper.el: Bump version

9 years agoivy.el (ivy-done): Still expand "./" though
Oleh Krehel [Mon, 20 Apr 2015 11:51:04 +0000 (13:51 +0200)]
ivy.el (ivy-done): Still expand "./" though

9 years agoDon't expand the default when completing file names
Oleh Krehel [Mon, 20 Apr 2015 11:47:49 +0000 (13:47 +0200)]
Don't expand the default when completing file names

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

This affects e.g. `rgrep': "\*.el" as the default will work, but
"foo/\*.el" won't.

9 years agoPropertize directories with ivy-subdir face
Oleh Krehel [Mon, 20 Apr 2015 09:51:08 +0000 (11:51 +0200)]
Propertize directories with ivy-subdir face

* ivy.el (ivy-subdir): New defface.
(ivy-completions): Update.

9 years agoSpeed up the default file sorting even more
Oleh Krehel [Mon, 20 Apr 2015 09:50:10 +0000 (11:50 +0200)]
Speed up the default file sorting even more

* ivy.el (ivy--sorted-files): Use `string-match-p' instead of
  `file-directory-p'.

9 years agoSpeed up the default file sorting
Oleh Krehel [Mon, 20 Apr 2015 09:37:44 +0000 (11:37 +0200)]
Speed up the default file sorting

* ivy.el (ivy-sort-file-function-default): Update.
(ivy--sorted-files): Update.

Turns out that calling `file-directory-p' in `cl-sort' is too expensive.
So when `ivy-sort-file-function' is `ivy-sort-file-function-default',
propertize all strings with whether they are directories or not.

When `ivy-sort-file-function' is something different,
e.g. `string-lessp', don't do propertizing since it also can be slow.

9 years agoivy.el (ivy--preselect-index): Give priority to perfect match
Oleh Krehel [Mon, 20 Apr 2015 09:06:46 +0000 (11:06 +0200)]
ivy.el (ivy--preselect-index): Give priority to perfect match

9 years agoAllow "C-." to jump to current symbol definition
Oleh Krehel [Mon, 20 Apr 2015 08:55:18 +0000 (10:55 +0200)]
Allow "C-." to jump to current symbol definition

* counsel.el (counsel-describe-map): New defvar.
(counsel-find-symbol): New defun.
(counsel--find-symbol): New defun - jump to definition of function or
symbol or library.
(counsel-describe-variable): Use `counsel-describe-map'.
(counsel-describe-function): Use `counsel-describe-map'.