Stefan Monnier [Sun, 19 Apr 2015 20:00:53 +0000 (16:00 -0400)]
hydra.el: Use add/remove-function. Fix warning.
* hydra.el (hydra--input-method-function): Move before first use.
(hydra--imf): New function.
(hydra-default-pre, hydra-disable): Use add/remove-function.
Oleh Krehel [Thu, 30 Apr 2015 07:44:12 +0000 (09:44 +0200)]
Make *LV* window fixed size
* lv.el (lv-window): Prevent `balance-windows' and the like from messing
things up.
(lv-message): Bind `window-size-fixed' to nil for
`fit-window-to-buffer'.
Oleh Krehel [Thu, 23 Apr 2015 09:10:32 +0000 (11:10 +0200)]
Allow heads to conditionally exit
* hydra.el (hydra-deactivate): New defvar.
(hydra-set-transient-map): When `hydra-deactivate' is set, quit.
(hydra-disable): Make sure that `hydra-deactivate' is reset back to nil.
Eric Abrahamsen [Thu, 23 Apr 2015 08:53:26 +0000 (16:53 +0800)]
Squashed 'packages/gnorb/' changes from 321b23b..4e7039a
4e7039a Various compiler-inspired improvements 9b2b269 Use with-eval-after-load not eval-after-load 86fa893 Fix up all cl-lib calls a59dac2 Use hook for determining Gnorb summary minor mode 4d3de61 Various documentation improvements acb91c5 Fix doc error 6fd368d Provide more format marks in summary buffers d9a1d89 Remove unused let variable 3f9c534 Report Gnorb email tracking usage 0f18c45 Allow persistent nnir search groups 2d30b0c Reset window conf after nnir-run-gnorb 160f43a New function for returning all tracked messages 9efae5a Fix call to cl-subseq ce764a5 fixup with new quick reply command b0fe9ae New command `gnorb-gnus-quick-reply' 5897188 Capture to child/sibling is done 4f99dd7 Handle conditions where `registry-search' returns nil b951675 Merge capture-to-child branch 13bb840 Hint which heading will be triggered c13f4df Better check for capture cleanup dfa0043 Safer usage of cl-subseq 94fe1b8 Incorporate changes from Stefan M d2e1e11 Mention registry bugs in README a4089f8 Fix completing-read in message disassociation 9c910c9 Re-raise errors in the triggering process 648f5a7 Remove process mark after bulk association 84ff7a7 Don't let attach errors derail the trigger process 819b1e5 Suggest binding gnorb-org-view in Org Agenda 9d64acb Update gnorb-registry-capture to use convenience funcs cc7d45b Be more careful handling org tags on BBDB records f585c03 condition-case the incoming trigger process 821a6b2 Allow bulk association of messages 4b19c83 New function for pruning dead associations 09679fa Misspelled function name 41c6778 nngnorb should be a virtual server 6e6ee46 Zap another with-eval-after-load c3279d2 Fix tracking messages from virtual groups 9220a10 Docstring fix c8b80c5 Bugfix for gnorb-gnus-view 8c333ee Merge pull request #20 from totherme/master 3801ad7 Check both gnus version and emacs version. 94f6897 Don't use with-eval-after-load fd91084 Remove incorrect "fix" for Gnus 5.13 8a9c167 Fix the cl-lib loading stuff
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.
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.
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)".
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.
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'.
* 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.
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.
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.
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.
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.
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'.