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'.
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.
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'.
Stefan Monnier [Mon, 20 Apr 2015 01:28:01 +0000 (21:28 -0400)]
Squashed 'packages/gnorb/' changes from de3a512..321b23b
321b23b Remove gnus-interactive 3877b2d Still didn't have incoming-do-todo logic right de0dff5 Protection for message disassociation a55b0c0 Make gnorb-ids precious earlier in registry setup 806775c Wrap save-excursion around more of gnorb-org-view 982aee9 Adjust requires and autoloads 67ce358 Version 1.0.1, plus docs and NEWS 15b35dc Don't store a link to message we're replying to b82576c Always clear attachments during triggering 7a43d8b Bug in message disassociation c44a87b Deletion of associations when composing messages 6aef624 Restore the layout after the restore process 04ec3ab Fix logic of choosing heading to trigger de3182e Shift location of org-reveal during trigger process 14471db Silence compiler warnings for unbound vars aaf8556 Be a good citizen about the cl package ad1538d Autoload cookie for gnorb-tracking-initialize 8db194a Add TAGS to .gitignore 5688114 Bugfix: Adding mailtos to newly-setup messages e1fb666 Function for deleting all assocations of an Org heading d4a4ccf Better handling of non-existent Org headings 4b8a6da New function for removing message/heading association 1b56250 Change wording of disassociation message bfd8566 Be more careful about brackets on message-ids 1e071a0 Further refinements to link following 0a138f9 Reuse existing frames/windows when following links f0ba4d7 Improvements to message disassociation 2c0f43d Refinements to link extraction 35284f2 Add TODO for collecting BBDB messages by thread 2834602 Move roadmap/todo list from manual to README dd46ce4 Refactor finding trigger candidates 354705a Provide completion for Org tags on BBDB records
Stefan Monnier [Sun, 19 Apr 2015 20:00:53 +0000 (16:00 -0400)]
* hydra/hydra.el: Use add/remove-function. Fix warning.
* hydra/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 [Sun, 19 Apr 2015 13:26:23 +0000 (15:26 +0200)]
Add a matching optimization
* ivy.el (ivy-completions): When the new regex `re' is a contains the
old regex `ivy--old-re', it must be true that all candidates that
match `re' are contained inside all candidates that match
`ivy--old-re', i.e. the pre-computed in the last step
`ivy--old-cands'.
This should speed up completion for large (~100k) amount of candidates,
for the particular case of regex simply being extended.
Oleh Krehel [Sat, 18 Apr 2015 18:12:45 +0000 (20:12 +0200)]
swiper.el: Add a work-around for window-start not being current
* swiper.el (swiper--update-input-ivy): Update.
This results in double the window-height amount of lines being
heightlighted, instead of just window-height. But at least it doesn't
happen that some candidates within the current window aren't highlighted
since they're beyond the outdated window-start and window-end.
An alternative would be to use `redisplay' to update `window-start' and
`window-end', but that causes excessive blinking.
Oleh Krehel [Sat, 18 Apr 2015 16:13:05 +0000 (18:13 +0200)]
Add a work-around for completing topics in the info dir
* ivy.el (ivy-read): Weirdly, the topic names need to be wrapped in
"(...)". Also, `all-completions' returns nothing for "", but returns
stuff for "(". Also, `all-completions' for "(" returns plenty of
duplicates.
Oleh Krehel [Fri, 17 Apr 2015 11:29:41 +0000 (13:29 +0200)]
Add sorting for file completion
* ivy.el (ivy-alt-done): Exit with current directory when on first
element, which is always "./", thanks to sorting.
(ivy--cd): Update.
(ivy--sorted-files): New defun for sorting file names. "./" and "../"
are always the first, then come the directories, then the files.
(ivy-read): Update.