]> code.delx.au - gnu-emacs-elpa/log
gnu-emacs-elpa
8 years agocounsel.el (counsel-M-x): Don't rely on package-installed-p
Oleh Krehel [Tue, 29 Sep 2015 14:34:23 +0000 (16:34 +0200)]
counsel.el (counsel-M-x): Don't rely on package-installed-p

* counsel.el (counsel-M-x): Use `require' instead. `package-installed-p'
  may fail if package wasn't initialized.

8 years agocounsel.el (counsel-ag-function): Improve for fancy faces
Oleh Krehel [Tue, 29 Sep 2015 12:40:10 +0000 (14:40 +0200)]
counsel.el (counsel-ag-function): Improve for fancy faces

Set `ivy--old-re' in order for fancy `ivy-display-style' to work.

8 years agocounsel.el (counsel--find-symbol): Allow to jump back with pop-tag-mark
Oleh Krehel [Tue, 29 Sep 2015 11:53:25 +0000 (13:53 +0200)]
counsel.el (counsel--find-symbol): Allow to jump back with pop-tag-mark

Using "C-." in:

- counsel-describe-function
- counsel-describe-variable
- counsel-load-library

will change the current buffer. The buffer and point can be restored
with "M-*" (`pop-tag-mark').

I also recommend this binding:

    (global-set-key (kbd "M-,") 'pop-tag-mark)

8 years agoswiper.el (swiper-font-lock-ensure): Add mu4e
Oleh Krehel [Tue, 29 Sep 2015 10:03:44 +0000 (12:03 +0200)]
swiper.el (swiper-font-lock-ensure): Add mu4e

Re #19

8 years agoivy.el (ivy--insert-prompt): Avoid negative length error
Oleh Krehel [Sat, 26 Sep 2015 14:42:30 +0000 (16:42 +0200)]
ivy.el (ivy--insert-prompt): Avoid negative length error

8 years agoTruncate minibuffer prompts longer than window-width
Oleh Krehel [Sat, 26 Sep 2015 11:56:19 +0000 (13:56 +0200)]
Truncate minibuffer prompts longer than window-width

* ivy.el (ivy--insert-prompt): When the prompt string is longer than the
  window width, truncate it to window width minus 26 chars.

Fixes #240

8 years agoMake ivy-display-style more compatible with 24.3
Oleh Krehel [Sat, 26 Sep 2015 11:28:46 +0000 (13:28 +0200)]
Make ivy-display-style more compatible with 24.3

* ivy.el (ivy--format-minibuffer-line): Use
  `font-lock-append-text-property' instead of
  `add-face-text-property'. It's not optimal, since the new face needs
  to be put in front, but at least it doesn't error out.

8 years agoivy.el (ivy--resize-minibuffer-to-fit): Make compatible with 24.3
Oleh Krehel [Sat, 26 Sep 2015 11:28:23 +0000 (13:28 +0200)]
ivy.el (ivy--resize-minibuffer-to-fit): Make compatible with 24.3

Fixes #220

8 years agoswiper.el (swiper--ivy): Remove obsolete version check
Oleh Krehel [Fri, 25 Sep 2015 13:04:30 +0000 (15:04 +0200)]
swiper.el (swiper--ivy): Remove obsolete version check

8 years agoFix minibuffer collapse in text mode emacs
Julien Wietrich [Tue, 22 Sep 2015 17:02:39 +0000 (19:02 +0200)]
Fix minibuffer collapse in text mode emacs

In graphic mode : resize-mini-windows is temporarily set to nil, the
only value which does not collapse the minibuffer.

In text mode : if resize-mini-windows is nil, it is temporarily set to
'grow-only (default emacs value).

This prevent the minibuffer collapse in both graphic and text mode.

In text mode it respects the user settings if it is already set to
'grow-only or t.

Fix #237 in text mode emacs too.

8 years agoswiper.el (swiper--ivy): Use minibuffer-allow-text-properties
Oleh Krehel [Tue, 22 Sep 2015 11:03:02 +0000 (13:03 +0200)]
swiper.el (swiper--ivy): Use minibuffer-allow-text-properties

Using `minibuffer-allow-text-properties' makes Emacs not strip the text
properties from the result of `read-from-minibuffer'. This is better
because a function call result is used instead of a global var to pass
this info.

8 years agoRevert multiple frames workaround
Julien Wietrich [Sat, 19 Sep 2015 17:21:46 +0000 (19:21 +0200)]
Revert multiple frames workaround

Since SHA:d8d7ed45f07b52ab63eca444f0e6fa03747fab9e
workaround SHA:435f2b6edfe3ab517c9eda56c6351f0bcfdf3845 is no longer
required.

8 years agoFix minibuffer collapses to one line
Julien Wietrich [Sat, 19 Sep 2015 17:12:15 +0000 (19:12 +0200)]
Fix minibuffer collapses to one line

It happens since commit SHA:d374afea36df19b5d6b654adc6018b25d6c1d8f2
when resize-mini-windows is set to true.

It also happens when resize-mini-windows is set to 'grow-only (default)
and multiple frames are open.
(Although SHA:435f2b6edfe3ab517c9eda56c6351f0bcfdf3845 work around it)

Temporarily bind `resize-mini-windows' to nil before calling
`read-from-minibuffer'.

Fix #237 and #229

It might fix #77 although this need to be checked as I cannot reproduce it.

8 years agoAdd autoloads to some important functions
PythonNut [Sat, 19 Sep 2015 04:10:24 +0000 (21:10 -0700)]
Add autoloads to some important functions

8 years agoivy.el (ivy-switch-buffer): Make "M-o r" rename buffer
Oleh Krehel [Fri, 18 Sep 2015 17:24:21 +0000 (20:24 +0300)]
ivy.el (ivy-switch-buffer): Make "M-o r" rename buffer

* ivy.el (ivy--rename-buffer-action): New defun.

Fixes #233

8 years agoMake "<left>" and "<right>" behave as in fundamental-mode
Oleh Krehel [Fri, 18 Sep 2015 17:17:41 +0000 (20:17 +0300)]
Make "<left>" and "<right>" behave as in fundamental-mode

Fixes #232

8 years agoAdd work-around for minibuffer not re-sizing for many frames
Oleh Krehel [Tue, 15 Sep 2015 11:46:41 +0000 (14:46 +0300)]
Add work-around for minibuffer not re-sizing for many frames

* ivy.el (ivy--minibuffer-setup): When `truncate-lines' is set, it works
  fine for one graphic frame, but not for two (unknown why); add a
  work-around.

Fixes #229

8 years agocounsel.el (counsel-yank-pop): Add autoload
Oleh Krehel [Sun, 13 Sep 2015 06:26:10 +0000 (08:26 +0200)]
counsel.el (counsel-yank-pop): Add autoload

8 years agoivy.el (ivy-format-function-default): Fix boundp bug
Oleh Krehel [Sat, 12 Sep 2015 14:52:51 +0000 (16:52 +0200)]
ivy.el (ivy-format-function-default): Fix boundp bug

Fixes #225

8 years agocounsel.el (counsel-yank-pop-truncate): Add group
Oleh Krehel [Sat, 12 Sep 2015 11:58:51 +0000 (13:58 +0200)]
counsel.el (counsel-yank-pop-truncate): Add group

8 years agoswiper.el (swiper--ivy): Fix compiler warning
Oleh Krehel [Sat, 12 Sep 2015 11:58:30 +0000 (13:58 +0200)]
swiper.el (swiper--ivy): Fix compiler warning

8 years agocounsel.el (counsel-yank-pop): New command
Oleh Krehel [Fri, 11 Sep 2015 15:28:38 +0000 (17:28 +0200)]
counsel.el (counsel-yank-pop): New command

* counsel.el (counsel-yank-pop-truncate): New defcustom. Choose whether
  to truncate strings over 4 lines.
(counsel-yank-pop-action): New defun.

Fixes #218

8 years agoMake line numbers in swiper into display properties
Oleh Krehel [Fri, 11 Sep 2015 14:52:02 +0000 (16:52 +0200)]
Make line numbers in swiper into display properties

* swiper.el (swiper--candidates): Each candidate is now a single space
  plus the original string. The display property of the single space
  holds the line number. This means that it's no longer possible to
  match line numbers in queries. Also, the preselect of the current line
  is slightly worse (in case there are two identical lines in a buffer).
(swiper--ivy): Update the preselect to not include the line
number. Also, call `ivy--action' on `ivy-current' instead of `res',
because `res' doesn't have the string property that points to the line
number.
(swiper--update-input-ivy): Update.
(swiper--action): Update.

Fixes #224

8 years agoSet truncate-lines in the minibuffer
Oleh Krehel [Fri, 11 Sep 2015 09:42:18 +0000 (11:42 +0200)]
Set truncate-lines in the minibuffer

* ivy.el (ivy--minibuffer-setup): Update.
(ivy-format-function-default): Check `truncate-lines'. Check if
`fringe-mode' is bound.

Fixes #223

8 years agoivy.el (ivy--resize-minibuffer-to-fit): Make compatible with 24.3
Oleh Krehel [Thu, 10 Sep 2015 09:24:54 +0000 (11:24 +0200)]
ivy.el (ivy--resize-minibuffer-to-fit): Make compatible with 24.3

Re #220

8 years agoivy.el (ivy-format-function-default): Handle fringe-mode 0
Oleh Krehel [Thu, 10 Sep 2015 09:21:12 +0000 (11:21 +0200)]
ivy.el (ivy-format-function-default): Handle fringe-mode 0

Fixes #219

8 years agocounsel.el (counsel-unicode-char): Add own history
Oleh Krehel [Wed, 9 Sep 2015 13:21:43 +0000 (15:21 +0200)]
counsel.el (counsel-unicode-char): Add own history

Also make "C-M-n", "C-M-p", and `ivy-resume' work properly.

8 years agoFix up the "foo ! bar" matching and highlighting
Oleh Krehel [Tue, 8 Sep 2015 11:48:29 +0000 (13:48 +0200)]
Fix up the "foo ! bar" matching and highlighting

* ivy.el (ivy--filter): When regex returned is a list, use only the
  first string part.

* swiper.el (swiper--update-input-ivy): When regex returned is a list,
  use only the first string part.

8 years agoMove swiper-minibuffer-faces to ivy.el
Oleh Krehel [Tue, 8 Sep 2015 06:25:09 +0000 (08:25 +0200)]
Move swiper-minibuffer-faces to ivy.el

Fixes #217

8 years agoDeclare some SLIME functions
Oleh Krehel [Mon, 7 Sep 2015 12:08:31 +0000 (14:08 +0200)]
Declare some SLIME functions

* counsel.el (slime-symbol-start-pos):
(slime-symbol-end-pos):
(slime-contextual-completions): Declare.

8 years agocounsel.el (counsel-git-grep-function): Fix up
Oleh Krehel [Mon, 7 Sep 2015 12:06:14 +0000 (14:06 +0200)]
counsel.el (counsel-git-grep-function): Fix up

Set `ivy--old-re' for the benefit of fancy minibuffer faces.

8 years agoMake the minibuffer faces look nicer
Oleh Krehel [Mon, 7 Sep 2015 12:03:08 +0000 (14:03 +0200)]
Make the minibuffer faces look nicer

* ivy.el (ivy-current-match): Update background and add white
  foreground for light themes. Update background and add black
  foreground for dark themes.
(ivy--add-face): If a face has an explicit foreground, add it ahead,
with no blending. Blend the background as usual.

* swiper.el (swiper-minibuffer-match-face-1):
(swiper-minibuffer-match-face-2): Update the background for light
  themes.
(swiper-minibuffer-match-face-4): Update the background for dark themes.

8 years agoAdd default values for minibuffer faces
Oleh Krehel [Sun, 6 Sep 2015 11:30:43 +0000 (13:30 +0200)]
Add default values for minibuffer faces

* swiper.el (swiper-minibuffer-match-face-1):
(swiper-minibuffer-match-face-2):
(swiper-minibuffer-match-face-3):
(swiper-minibuffer-match-face-4): Update.

Re #215

8 years agoivy.el (ivy--format-minibuffer-line): Fix nil regexp
Oleh Krehel [Fri, 4 Sep 2015 11:52:49 +0000 (13:52 +0200)]
ivy.el (ivy--format-minibuffer-line): Fix nil regexp

8 years agoMake ivy-current blend correctly for fancy minibuffer
Oleh Krehel [Fri, 4 Sep 2015 09:38:38 +0000 (11:38 +0200)]
Make ivy-current blend correctly for fancy minibuffer

* ivy.el (ivy--format-minibuffer-line): Stop setting :height - it messes
  with blending. Also, the minibuffer height issue was fixed in an
  earlier pull request.

(ivy--format): Call `ivy--add-face' on modified string, not on the
original one.

8 years agoivy.el (ivy--format-minibuffer-line): Use add-face-text-property
Oleh Krehel [Fri, 4 Sep 2015 09:25:43 +0000 (11:25 +0200)]
ivy.el (ivy--format-minibuffer-line): Use add-face-text-property

8 years agoAdd extra faces for minibuffer highlighting
Oleh Krehel [Fri, 4 Sep 2015 08:50:15 +0000 (10:50 +0200)]
Add extra faces for minibuffer highlighting

* swiper.el (swiper-minibuffer-match-face-1):
(swiper-minibuffer-match-face-2):
(swiper-minibuffer-match-face-3):
(swiper-minibuffer-match-face-4): New defface.
(swiper-minibuffer-faces): New defvar.

* ivy.el (ivy--format-minibuffer-line): New defun.
(ivy--format): Use `ivy--format-minibuffer-line'.

8 years agoivy.el (ivy-display-style): New defcustom
Oleh Krehel [Thu, 3 Sep 2015 11:41:59 +0000 (13:41 +0200)]
ivy.el (ivy-display-style): New defcustom

* ivy.el (ivy--format): Add additional highlighting for the minibuffer,
  similar to `swiper', when `ivy-display-style' is set to 'fancy.

Fixes #212

8 years agocounsel.el (counsel-cl): New command
Oleh Krehel [Mon, 31 Aug 2015 10:15:50 +0000 (12:15 +0200)]
counsel.el (counsel-cl): New command

* counsel.el (counsel--el-action): Add `with-ivy-window' wrapper.

8 years agocounsel.el (counsel--py-action): Work with "C-M-n"
Oleh Krehel [Tue, 25 Aug 2015 14:03:44 +0000 (16:03 +0200)]
counsel.el (counsel--py-action): Work with "C-M-n"

* counsel.el (counsel--py-action): Include the inserted parens in to
  bounds, so that "C-M-n", "C-M-p" and `ivy-resume' work.

8 years agocounsel.el (counsel-jedi): New command
Oleh Krehel [Tue, 25 Aug 2015 13:57:48 +0000 (15:57 +0200)]
counsel.el (counsel-jedi): New command

* counsel.el (counsel--py-action): New defun.

Add a few declares as well.

8 years agoAdd swiper-multi command
Oleh Krehel [Fri, 21 Aug 2015 14:57:22 +0000 (16:57 +0200)]
Add swiper-multi command

* swiper.el (swiper-multi-buffers): New defvar.
(swiper-multi-candidates): New defvar.
(swiper-multi-prompt): New defun.
(swiper-multi-action-1): New defun.
(swiper-multi-action-2): New defun.

Fixes #182.

Basic usage tips for selecting multiple buffers:

- Use "C-M-m" (`ivy-call') to add or remove one more buffer without exiting.
- Use "C-m" (`ivy-done') to add one last buffer.
- Or use "C-M-j" (`ivy-immediate-done') to finish without adding more buffers.
- Hold "C-M-n" (`ivy-next-line-and-call') to add a lot of buffers at once.

8 years agocounsel.el (counsel-org-tag): Now works in agenda
Oleh Krehel [Thu, 20 Aug 2015 10:11:54 +0000 (12:11 +0200)]
counsel.el (counsel-org-tag): Now works in agenda

* counsel.el (counsel-org--set-tags): New defun.
(counsel-org-tag-action): Update.

When on an agenda item, add/remove tags for that item.

When any agenda items are marked with "m", add selected tags to all
items, with no duplicates.

Fixed the bug of setting tags to "::" sometimes.
Fixed "C-M-j" not exiting.

Fixes #200

8 years agoivy: enlarge the minibuffer window if the candiate list doesn't fit
Felix Lange [Tue, 18 Aug 2015 09:16:44 +0000 (11:16 +0200)]
ivy: enlarge the minibuffer window if the candiate list doesn't fit

Fixes #161
Fixes #198

8 years agoSet line-spacing to 0 in the minibuffer
Oleh Krehel [Tue, 18 Aug 2015 07:40:35 +0000 (09:40 +0200)]
Set line-spacing to 0 in the minibuffer

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

Fixes #198

8 years agoivy.el (ivy-kill-ring-save): Add and bind to "M-w"
Oleh Krehel [Fri, 14 Aug 2015 15:18:53 +0000 (17:18 +0200)]
ivy.el (ivy-kill-ring-save): Add and bind to "M-w"

Fixes #197

8 years agoivy.el (ivy-completing-read): Fix up last commit
Oleh Krehel [Wed, 12 Aug 2015 18:05:15 +0000 (20:05 +0200)]
ivy.el (ivy-completing-read): Fix up last commit

Check if string before using `string-match'.

8 years agoWhen initial input contains a plus, escape it
Oleh Krehel [Wed, 12 Aug 2015 17:54:08 +0000 (19:54 +0200)]
When initial input contains a plus, escape it

* ivy.el (ivy-completing-read): Escape the plus in the initial input,
  for it to not be interpreted like a regex.

Fixes #195

8 years agoFix #126 again.
Tassilo Horn [Wed, 12 Aug 2015 11:34:40 +0000 (13:34 +0200)]
Fix #126 again.

After #126 has been solved, the regexp has been changed to

  "\\`[`']?\\(.*\\)'?\\'"

where the trailing ' is optional ("'?").  However, the preceeding
"\\(.*\\)" group will already capture the trailing ' because .* is
greedy.  Now I've replaced it with the non-greedy .*? which makes it
work again.

8 years agoFix :dynamic-collection not being sorted
Oleh Krehel [Fri, 7 Aug 2015 14:21:16 +0000 (16:21 +0200)]
Fix :dynamic-collection not being sorted

* ivy.el (ivy--sort-maybe): New defun. If the current completion has
  sorting enabled, try to find the sorting function either in :sort or
  `ivy-sort-functions-alist'.
(ivy--exhibit): Use `ivy--sort-maybe'.

* counsel.el (counsel--async-sentinel): Use `ivy--sort-maybe'.

8 years agocounsel-locate should use '' for the regex
Oleh Krehel [Fri, 7 Aug 2015 06:01:41 +0000 (08:01 +0200)]
counsel-locate should use '' for the regex

* counsel.el (counsel-unquote-regex-parens): New defun.
(counsel-locate-function): Update.
(counsel-ag-function): Update.

Fixes #194

8 years ago(counsel-locate): Support OS X
Chunyang Xu [Thu, 6 Aug 2015 16:17:08 +0000 (00:17 +0800)]
(counsel-locate): Support OS X

- OS X "open" is the equivalent to "xdg-open"
- OS X "locate" doesn't support "--regex"

8 years ago(counsel-locate): Allow customizing locate options
Tassilo Horn [Thu, 6 Aug 2015 05:50:15 +0000 (07:50 +0200)]
(counsel-locate): Allow customizing locate options

8 years agoFix up ivy-recentf and ivy-switch-buffer window-wise
Oleh Krehel [Wed, 5 Aug 2015 16:06:32 +0000 (18:06 +0200)]
Fix up ivy-recentf and ivy-switch-buffer window-wise

* ivy.el (ivy--switch-buffer-action):
(ivy-recentf): Use `with-ivy-window'.

8 years agodoc/Changelog.org: Add
Oleh Krehel [Wed, 5 Aug 2015 09:25:46 +0000 (11:25 +0200)]
doc/Changelog.org: Add

8 years agocounsel.el (counsel-find-file): Fix window focus issue
Oleh Krehel [Wed, 5 Aug 2015 08:29:53 +0000 (10:29 +0200)]
counsel.el (counsel-find-file): Fix window focus issue

"C-M-n" should work fine now.

8 years agoPreselect perfect matches with a leading ^
Oleh Krehel [Mon, 3 Aug 2015 12:26:03 +0000 (14:26 +0200)]
Preselect perfect matches with a leading ^

* ivy.el (ivy--filter): When e.g. "filter" is in the collection,
  "^filter" input should always select it, even if other candidates
  match.

8 years agoAllow ivy-count-format to be set as nil
Chunyang Xu [Sat, 1 Aug 2015 05:42:46 +0000 (13:42 +0800)]
Allow ivy-count-format to be set as nil

8 years agoAdd with-ivy-window macro
Oleh Krehel [Thu, 30 Jul 2015 13:59:41 +0000 (15:59 +0200)]
Add with-ivy-window macro

* ivy.el (with-ivy-window): New macro.
(ivy-yank-word): Update.

* swiper.el (swiper--window): Remove defvar.
(swiper-query-replace):
(swiper-avy):
(swiper-recenter-top-bottom):
(swiper--init):
(swiper--update-input-ivy):
(swiper--add-overlays): Update.

* counsel.el (counsel-git-grep-recenter):
(counsel-git-grep-action):
(counsel-M-x): Update.
(org-agenda-set-tags): Add a declare.

8 years agoBind "C-M-j" to ivy-immediate-done
Oleh Krehel [Thu, 30 Jul 2015 08:30:40 +0000 (10:30 +0200)]
Bind "C-M-j" to ivy-immediate-done

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

`ivy-immediate-done' will return with the current minibuffer input, even
if the input matches a candidate.

It was possible so far to call it with "C-u C-j".

Fixes #183

8 years agocounsel.el (counsel-org-tag-agenda): New command
Oleh Krehel [Tue, 28 Jul 2015 16:04:49 +0000 (18:04 +0200)]
counsel.el (counsel-org-tag-agenda): New command

* counsel.el (counsel-org-tag-agenda): It's just a flet wrapper around
  `org-agenda-set-tags', changing `org-set-tags' to `counsel-org-tag'.
(counsel-org-tag-action): Don't use `with-selected-window', since
`org-agenda-set-tags' will change the buffer for us.

Re #177

8 years agocounsel.el (org-bound-and-true-p): Use bound-and-true-p
Oleh Krehel [Tue, 28 Jul 2015 12:50:04 +0000 (14:50 +0200)]
counsel.el (org-bound-and-true-p): Use bound-and-true-p

8 years agoAdd a few more Org declarations
Oleh Krehel [Tue, 28 Jul 2015 12:17:10 +0000 (14:17 +0200)]
Add a few more Org declarations

Re #179

8 years agocounsel.el (org-last-tags-completion-table): Declare
Oleh Krehel [Tue, 28 Jul 2015 12:03:32 +0000 (14:03 +0200)]
counsel.el (org-last-tags-completion-table): Declare

Re #179

8 years agocounsel.el (org-setting-tags): Declare dynamic var
Oleh Krehel [Tue, 28 Jul 2015 12:02:31 +0000 (14:02 +0200)]
counsel.el (org-setting-tags): Declare dynamic var

Re #179

8 years agoswiper.el (swiper-from-isearch): New command
Oleh Krehel [Tue, 28 Jul 2015 07:32:42 +0000 (09:32 +0200)]
swiper.el (swiper-from-isearch): New command

Fixes #180

8 years agocounsel.el (org-bound-and-true-p): Update declare
Oleh Krehel [Tue, 28 Jul 2015 07:31:59 +0000 (09:31 +0200)]
counsel.el (org-bound-and-true-p): Update declare

8 years agoUse recoll -t instead of recollq
Erik Hetzner [Tue, 28 Jul 2015 03:25:50 +0000 (20:25 -0700)]
Use recoll -t instead of recollq

8 years agocounsel.el (counsel-org-tag): Delete dups
Oleh Krehel [Mon, 27 Jul 2015 14:38:19 +0000 (16:38 +0200)]
counsel.el (counsel-org-tag): Delete dups

The issue of duplicates arises from this setting (off by default):

    (setq org-complete-tags-always-offer-all-agenda-tags t)

Re #177

8 years agocounsel.el (counsel-recoll): Simplify
Oleh Krehel [Mon, 27 Jul 2015 14:24:13 +0000 (16:24 +0200)]
counsel.el (counsel-recoll): Simplify

8 years agocounsel.el (counsel-org-tag): No need to be at heading
Oleh Krehel [Mon, 27 Jul 2015 13:32:28 +0000 (15:32 +0200)]
counsel.el (counsel-org-tag): No need to be at heading

* counsel.el (counsel-org-tag): When not at heading, move there.
Save excursion.

8 years agocounsel.el (counsel-recoll): New command
Oleh Krehel [Mon, 27 Jul 2015 13:11:08 +0000 (15:11 +0200)]
counsel.el (counsel-recoll): New command

* counsel.el (counsel-recoll-function): New function.

8 years agocounsel.el (counsel-ag): New command
Oleh Krehel [Mon, 27 Jul 2015 11:09:10 +0000 (13:09 +0200)]
counsel.el (counsel-ag): New command

* counsel.el (counsel-ag-function): New defun.
(counsel-git-grep): Update prompt.

Going from sync to async now is as simple as:

- add :dynamic-collection t
- replace `shell-command-to-string' with `counsel--async-command'

8 years agoUpdate :dynamic-collection to be a boolean
Oleh Krehel [Mon, 27 Jul 2015 11:03:50 +0000 (13:03 +0200)]
Update :dynamic-collection to be a boolean

* ivy.el (ivy--exhibit): Always use `ivy-state-collection', instead of
  possibly `ivy-state-dynamic-collection'. The collection function may
  return nil if it's async and doesn't want to update the minibuffer on
  exit (to update it later in the sentinel).

* counsel.el (counsel-more-chars): New defun.
(counsel-git-grep-function): Use `counsel-more-chars'; in the async
case, return nil.
(counsel-git-grep): Update :dynamic-collection to a boolean.
(counsel--gg-sentinel):
(counsel--async-sentinel): Update to set the candidates to "Error"
instead of message "Error" - a lot less distracting this way.
(counsel-locate-function): Use `counsel-more-chars'; return "Working",
since it takes a few seconds to complete a single locate query.
(counsel-locate): Update.

8 years agoivy.el (ivy--exhibit): Check if in post-command-hook
Oleh Krehel [Mon, 27 Jul 2015 10:24:48 +0000 (12:24 +0200)]
ivy.el (ivy--exhibit): Check if in post-command-hook

* ivy.el (ivy--exhibit): A situation can occur when an async command
  calls `ivy--exhibit' in the sentinel. It causes problems when the
  minibuffer has already exited with "C-g".

8 years agoSimplify counsel-git-grep logic
Oleh Krehel [Mon, 27 Jul 2015 09:51:08 +0000 (11:51 +0200)]
Simplify counsel-git-grep logic

* ivy.el (ivy--exhibit): Remove the condition on (eq ivy--full-length -1).

* counsel.el (counsel-git-grep-function): Simplify.
(counsel-gg-state): New defvar. Use this instead of
(setq ivy--full-length -1).
(counsel--gg-candidates): Set `counsel-gg-state' to -2. There are two
async processes to wait for until `ivy--exhibit' can be called:
- get the candidate count
- get the candidates
Each of the async processes will increase the number, and call
`ivy--exhibit' if the number reaches 0.
(counsel--gg-sentinel): Update.
(counsel--gg-count): Update.

8 years agoFix "DEL" generating a "Quit" sometimes for counsel-git-grep
Oleh Krehel [Mon, 27 Jul 2015 09:22:26 +0000 (11:22 +0200)]
Fix "DEL" generating a "Quit" sometimes for counsel-git-grep

* ivy.el (ivy-backward-kill-word): It seems that `backward-kill-word' is
  too elaborate; falling back to something simpler fixed the problem.

8 years agoAllow "M-o j" to switch to virtual buffers in other window
Oleh Krehel [Sun, 26 Jul 2015 13:24:34 +0000 (15:24 +0200)]
Allow "M-o j" to switch to virtual buffers in other window

* ivy.el (ivy--switch-buffer-other-window-action): New defun.
(ivy-set-actions): Use `ivy--switch-buffer-other-window-action' instead
of `switch-to-buffer-other-window'.

8 years agocounsel.el (counsel-org-change-tags): Improve removing tags
Oleh Krehel [Fri, 24 Jul 2015 16:56:20 +0000 (18:56 +0200)]
counsel.el (counsel-org-change-tags): Improve removing tags

8 years agoFixup counsel-org-tag
Oleh Krehel [Fri, 24 Jul 2015 15:25:31 +0000 (17:25 +0200)]
Fixup counsel-org-tag

* counsel.el (counsel-org-tag-action): Add ::
(counsel-org-tag): Set `org-last-tags-completion-table', otherwise
`org-tags-completion-function' doesn't work.

8 years agocounsel.el (counsel-org-tag): Replace org-set-tags
Oleh Krehel [Fri, 24 Jul 2015 15:04:42 +0000 (17:04 +0200)]
counsel.el (counsel-org-tag): Replace org-set-tags

* counsel.el (counsel-org-tags): New defvar.
(counsel-org-change-tags): New defun, adapted from part of
`org-set-tags'.
(counsel-org-tag-action): New defun.
(counsel-org-tag-prompt): New defun.
(counsel-org-tag): New command.

**Using counsel-org-tag**

- The prompt is auto-updated to the currently selected tags.
- Selecting one of the already selected tags removes it from selection.

The best shortcut for selecting/removing multiple tags is "C-M-m" (or
"g" when the "C-o" hydra is active).

Re #177
Re #91

8 years agoivy.el (ivy-call): Remove with-selected-window
Oleh Krehel [Fri, 24 Jul 2015 14:39:32 +0000 (16:39 +0200)]
ivy.el (ivy-call): Remove with-selected-window

* counsel.el (counsel-git-grep-action): Add with-selected-window.

* ivy.el (ivy-dispatching-done): Remove trailing ": ".
(ivy-switch-buffer): Add extra action "j" calls
`switch-to-buffer-other-window'. The change `ivy-dispatching-done' had
to be done because of this.

8 years agoAdd actions for counsel-describe-function
Oleh Krehel [Fri, 24 Jul 2015 08:56:02 +0000 (10:56 +0200)]
Add actions for counsel-describe-function

8 years agoAdd actions for counsel-describe-variable
Oleh Krehel [Fri, 24 Jul 2015 08:55:52 +0000 (10:55 +0200)]
Add actions for counsel-describe-variable

8 years agoivy.el (ivy-dispatching-done): Add a trailing newline
Oleh Krehel [Thu, 23 Jul 2015 13:41:15 +0000 (15:41 +0200)]
ivy.el (ivy-dispatching-done): Add a trailing newline

8 years agoivy.el (ivy-dispatching-done): Display the candidate
Oleh Krehel [Thu, 23 Jul 2015 13:27:01 +0000 (15:27 +0200)]
ivy.el (ivy-dispatching-done): Display the candidate

8 years agoAllow "C-g" to interrupt ivy-dispatching-done
Oleh Krehel [Thu, 23 Jul 2015 13:25:29 +0000 (15:25 +0200)]
Allow "C-g" to interrupt ivy-dispatching-done

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

8 years agoivy.el (ivy--preselect-index): Add matcher to arglist
Oleh Krehel [Thu, 23 Jul 2015 12:01:03 +0000 (14:01 +0200)]
ivy.el (ivy--preselect-index): Add matcher to arglist

* ivy.el (ivy--reset-state): Call `ivy--preselect-index' with matcher.
(ivy--preselect-index): In case there's a special matcher set, it
affects the candidate list, therefore it affects the preselect index.

Fixes #165

8 years agoivy.el (ivy-dispatching-done): New command on "M-o"
Oleh Krehel [Wed, 22 Jul 2015 10:10:13 +0000 (12:10 +0200)]
ivy.el (ivy-dispatching-done): New command on "M-o"

* ivy.el (ivy-minibuffer-map): Bind "M-o" to `ivy-dispatching-done'.
(ivy-action-name): Update, all actions are now in hydra's format - key
binding, command, hint.
(ivy-read): The default action is bound to "o" in the dispatch.
(ivy-switch-buffer): Update to new action format.

* counsel.el (counsel-locate):
(counsel-rhythmbox): Update to new action format.

The new interface allows to do whatever you want with the selected
candidate with a very short key binding.

The old interface with "C-o w/s" still works, but:

- it gives a lot more info than necessary for only selecting action
- doesn't scale well with the number of actions: for 10 actions you
  would cycle "w/s" a lot.

Example with `ivy-switch-buffer':

- switch to selected buffer: "C-m"
- kill selected buffer: "M-o k"; you get a hint right after "M-o".

When there is only one action, "M-o" will forward to "C-m".

8 years agoivy.el (ivy-call): Add selected-window work-around for M-x
Oleh Krehel [Wed, 22 Jul 2015 20:24:11 +0000 (22:24 +0200)]
ivy.el (ivy-call): Add selected-window work-around for M-x

* ivy.el (ivy-call): For some commands that depend on the buffer, like
`counsel-git-grep' the action needs to be performed in
`ivy-state-window'. However, this results in wrong window for M-x calc.
Add a workaround until I figure out why this happens.

Fixes #176

8 years agoivy-hydra.el: Add featurep for hydra
Oleh Krehel [Tue, 21 Jul 2015 16:27:33 +0000 (18:27 +0200)]
ivy-hydra.el: Add featurep for hydra

Fixes #174

8 years agocounsel.el (counsel-variable-list): Add
Oleh Krehel [Tue, 21 Jul 2015 14:28:07 +0000 (16:28 +0200)]
counsel.el (counsel-variable-list): Add

* counsel.el (counsel-describe-variable): Use `counsel-variable-list'.

8 years agoswiper.el: Update avy--goto -> avy-action-goto
Oleh Krehel [Tue, 21 Jul 2015 14:27:24 +0000 (16:27 +0200)]
swiper.el: Update avy--goto -> avy-action-goto

8 years agoswiper.el (swiper-font-lock-ensure): Ignore Man-mode
Oleh Krehel [Tue, 14 Jul 2015 11:53:30 +0000 (13:53 +0200)]
swiper.el (swiper-font-lock-ensure): Ignore Man-mode

8 years agoivy.el (ivy-call): Bind to "C-M-m" or "M-RET"
Oleh Krehel [Mon, 13 Jul 2015 12:36:33 +0000 (14:36 +0200)]
ivy.el (ivy-call): Bind to "C-M-m" or "M-RET"

"C-M-m" is close to "C-M-n" and "C-M-p", just as "M-RET" is close to
"RET". Previously, the only binding was "C-o g".

8 years agoivy.el (ivy-count-format): Improve docstring
Oleh Krehel [Mon, 13 Jul 2015 12:06:45 +0000 (14:06 +0200)]
ivy.el (ivy-count-format): Improve docstring

* ivy.el (ivy-minibuffer-grow):
(ivy-toggle-calling):
(ivy-sort-functions-alist): Checkdoc.

8 years agoAllow % in prompt string
Erik Hetzner [Sun, 12 Jul 2015 01:16:41 +0000 (18:16 -0700)]
Allow % in prompt string

- quote % when passing prompt from ivy-completing-read to ivy-read
- add documentation in ivy-read that all % should be quoted

8 years agocounsel.el (counsel-rhythmbox-history): Add
Oleh Krehel [Fri, 10 Jul 2015 10:04:54 +0000 (12:04 +0200)]
counsel.el (counsel-rhythmbox-history): Add

* counsel.el (counsel-rhythmbox): Update.

8 years agoivy.el (ivy-read): Improve ivy-set-actions interaction
Oleh Krehel [Thu, 9 Jul 2015 16:19:31 +0000 (18:19 +0200)]
ivy.el (ivy-read): Improve ivy-set-actions interaction

* ivy.el (ivy-read): When the base action is already a list, merge it
  with the one obtained from `ivy-set-actions'.

8 years agoAdd counsel-rhythmbox
Oleh Krehel [Thu, 9 Jul 2015 13:54:51 +0000 (15:54 +0200)]
Add counsel-rhythmbox

* counsel.el (counsel-completion-beg):
(counsel-completion-end): Move declarations before first use.
(dired-jump): Declare.
(counsel-rhythmbox-enqueue-song): New defun.
(counsel-rhythmbox): New command. Requires `helm-rhythmbox' package, and
Rhythmbox, obviously.

* ivy.el (ivy-call): Make interactive. Add special handling for the case
  when the collection is an alist. In that case, call the action not
  with the collection item, but with the cdr of said item. A bit weird,
  but that's the way Helm does it, and doing it in the same way means
  the action functions are cross-compatible.

* ivy-hydra.el (hydra-ivy): Bind "g" to call the current action on
  current candidate without exiting.

Now it's possible to make a query to Rhythmbox, "C-o" and navigate to a
song with "j" and "k". Try the song with "g".  Or use "s" once and then
enqueue different songs with e.g. "jjgjjjgjgkkg".