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.
Oleh Krehel [Fri, 17 Apr 2015 10:53:43 +0000 (12:53 +0200)]
Add "/" and "~" shortcuts while finding files
* ivy.el (ivy--cd): New defun.
(ivy-backward-delete-char): Use `ivy--cd'.
(ivy--exhibit): When the file completion text ends in "/" or "~", move to
those dirs.
Oleh Krehel [Thu, 16 Apr 2015 19:20:42 +0000 (21:20 +0200)]
Ivy-mode now works better with `find-file'
* ivy.el (ivy-minibuffer-map): Bind "C-j" to visit a directory without
exiting the minibuffer.
(ivy--directory): New defvar.
(ivy-done): Expand file names.
(ivy-alt-done): New defun.
(ivy-backward-delete-char): When completing file names, visit the parent dir.
(ivy-read): Add the predicate argument, similar to `completing-read'.
All code that uses `ivy-read' needs to be updated. Move the collection/predicate stuff here.
(ivy-completing-read): Update.
(ivy--insert-prompt): Display the current directory when completing file names.
Oleh Krehel [Thu, 16 Apr 2015 16:26:52 +0000 (18:26 +0200)]
Add require-match functionality
* ivy.el (ivy-require-match): New defvar.
(ivy-done): When nothing matches, and `ivy-require-match' isn't t, use
the current text anyway.
(ivy-completing-read): Update.
Oleh Krehel [Thu, 16 Apr 2015 13:05:45 +0000 (15:05 +0200)]
Declare the hint early to avoid compile warnings
* hydra.el (hydra-fontify-head-greyscale): Update unused arg.
(hydra--make-defun): Update.
(hydra--head-name): Take one less arg.
(defhydra): Update hint position.
* hydra-init.el: Byte compile more stuff.
* hydra-test.el: Update tests.
* Makefile: Rename compile target to "run", update "compile".
Stefan Monnier [Wed, 15 Apr 2015 21:18:37 +0000 (17:18 -0400)]
* js2-mode.el (js2-mode): Use cursor-sensor-mode if available.
(js2-export-node): Fix apparent paren typo.
(js2-get-token-internal-1): Remove unused var `quote-char'.
(js2-clear-face): Also remove cursor-sensor-functions.
(js2-parse-primary-expr): Remove unused var `pn'.
(js2-parse-legacy-array-comp): Remove unused var `first'.
(js2-mode-show-node, js2-mode-show-warn-or-err): Use cursor-sensor-functions
if available.
(js2-mode-hide-overlay, js2-echo-error): Adapt to new calling convention.
(js2-echo-help): Declare obsolete.
(js2-mode-extend-comment): Look for the appropriate property.
With this code, `hydra-zoom/body' will display the hint not immediately
but after 1.0 seconds. If you manage to exit the hydra by then, the hint
will not be displayed. Other functions will display the hint
immediately.
Oleh Krehel [Tue, 14 Apr 2015 11:34:09 +0000 (13:34 +0200)]
Work around `overriding-terminal-local-map' being terminal-local
* hydra.el (hydra-disable): Try to reset `overriding-terminal-local-map'
for each frame, so that it doesn't happen that the hydra is cancelled
in one frame, but not in the other. `hydra-curr-on-exit' is called in
the first frame for which there's a transient map.
(hydra--clearfun): Disable when `overriding-terminal-local-map' is nil.
Oleh Krehel [Mon, 13 Apr 2015 12:08:43 +0000 (14:08 +0200)]
hydra.el (hydra--head-color): Simplify
* hydra.el (hydra-face-red):
(hydra-face-blue):
(hydra-face-amaranth):
(hydra-face-pink):
(hydra-face-teal): Improve docstrings.
(hydra--head-color): Simplify.
(defhydra): Use copy-sequence on inherited heads. Move :cmd-name setting
to the very end, when :exit is already set.
Just flatten these two functions to their 25.2 bodies, and don't call
the `set-transient-map' variants, since the map remains anyway because
of `hydra-base-map'.
Oleh Krehel [Mon, 13 Apr 2015 09:33:01 +0000 (11:33 +0200)]
Finalize head inheritance
* hydra.el (hydra--body-exit): New defun.
(defhydra): Ensure that each head doesn't need the :exit info from the
body any more by putting the aggregated :exit in the head's own plist.
* hydra-test.el: Update tests.
Each hydra will now declare its own heads as a variable `foo/heads`.
It's possible to inherit them like this: