John Mastro [Sat, 21 Mar 2015 22:23:40 +0000 (15:23 -0700)]
ivy.el (ivy-wrap): New defcustom
(ivy-next-line): Wrap around if `ivy-wrap' is non-nil
(ivy-next-line-or-history): Wrap around if `ivy-wrap' is non-nil
(ivy-previous-line): Wrap around if `ivy-wrap' is non-nil
(ivy-previous-line-or-history): Wrap around if `ivy-wrap' is non-nil
Oleh Krehel [Sat, 21 Mar 2015 16:47:50 +0000 (17:47 +0100)]
Update "C-n" and "C-p" bindings
* ivy.el (ivy-next-line): Don't touch history.
(ivy-next-line-or-history): Select previous history element if there's
no input.
(ivy-previous-line): Don't touch history.
(ivy-previous-line-or-history): Select previous history element if
there's no input.
Oleh Krehel [Sat, 21 Mar 2015 15:35:54 +0000 (16:35 +0100)]
Use `font-lock-append-text-property' to non-destructively modify a
string
* ivy.el (ivy--add-face): Improve.
`font-lock-append-text-property' non-destructively changes properties in
a string, which means if a string was copied from another and modified,
the original will not be changed.
In this way, it's better than `add-face-text-property'; and still better
than `propertize' that simply erases all properties before applying.
Oleh Krehel [Fri, 20 Mar 2015 14:27:00 +0000 (15:27 +0100)]
Call :post for :timeout
* hydra.el (hydra--make-defun): When both :timeout and :post are given,
if `hydra-timeout' runs out, it will call :post before
`hydra-keyboard-quit'.
(hydra-timeout): Update to call function if it's given. Always call
`hydra-keyboard-quit' afterwards.
- on "x" or "y", after one of them has started the timer, and the timer
ran out. The timer is set to 2.0 seconds, and is reset each time "x"
or "y" is pressed.
Oleh Krehel [Thu, 19 Mar 2015 18:11:06 +0000 (19:11 +0100)]
ivy.el (ivy-read): Allow for format-style PROMPT
* ivy.el (ivy-read): When given a prompt of e.g. "%d pattern: ", update
the number of candidates in the prompt.
(ivy--prompt): New defvar.
(ivy--insert-prompt): New defun.
(ivy--exhibit): Call `ivy--insert-prompt'.
(ivy-completions): Fix a bug of `ivy--index' becoming -1 when the number
of matches becomes zero.
* swiper.el (swiper--format-spec): New defvar.
(swiper--candidates): Update.
(swiper--ivy): Use `swiper--format-spec' to make the prompt.
Oleh Krehel [Thu, 19 Mar 2015 17:44:36 +0000 (18:44 +0100)]
ivy.el (ivy-read): Change index to preselect
* ivy.el (ivy-read): Update signature. Instead of giving the integer
index of what to preselect, give a string to preselect.
(ivy--preselect-index): New defun.
* swiper.el (swiper--index-at-point): Rename to `ivy--preselect-index'.
(swiper--ivy): Simplify.
Oleh Krehel [Wed, 18 Mar 2015 18:04:15 +0000 (19:04 +0100)]
Add isearch-like history behavior
* ivy.el (ivy-next-line): Select previous history element for empty
input.
(ivy-previous-line): Select previous history element for empty input.
(ivy-previous-history-element): New defun.
(ivy-next-history-element): New defun.
Oleh Krehel [Sat, 14 Mar 2015 15:53:23 +0000 (16:53 +0100)]
swiper.el: Save position before last search
* swiper.el (swiper--ivy): Forward to `swiper--action'.
(swiper--helm): Use `swiper--action-helm'.
(swiper--action-helm): New defun.
(swiper--action): Generalize, use push-mark, similarly to `isearch'.
jhonnyseven [Fri, 13 Mar 2015 14:12:21 +0000 (16:12 +0200)]
Fix switch-frame handling.
Calling only `hydra-keyboard-quit' on switch-frame event was
effectively stopping the original frame switch. This change adds a
call to the original handler after calling `hydra-keyboard-quit'.
Oleh Krehel [Fri, 13 Mar 2015 17:39:46 +0000 (18:39 +0100)]
ivy.el: Improve the highlighting in the minibuffer
* ivy.el (ivy--add-face): Use `add-face-text-property' if it's
available. You need to upgrade to Emacs 24.4 to get this feature.
(ivy-completions): Use `ivy--add-face'.
Oleh Krehel [Thu, 12 Mar 2015 15:31:37 +0000 (16:31 +0100)]
Add `ivy' back end
* ivy.el: New completion back end.
* swiper.el: Package doesn't depend on `helm'.
(ivy): Depend on `ivy'.
(swiper-completion-method): New defcustom.
(swiper--window): New var.
(swiper--helm-keymap): Rename from `swiper--keymap'.
(swiper): Change to a dispatch.
(swiper--init): New defun.
(swiper--ivy): New command.
(swiper--helm): New command.
(swiper--cleanup): New defun.
(swiper--update-input-helm): Rename from `swiper--update-input'.
(swiper--update-input-ivy): New defun.
(swiper--add-overlays): New defun.
(swiper--update-sel): Update.
(swiper--subexps):
(swiper--regex-hash):
(swiper--regex): Move to ivy.
(swiper--action): Update.
Oleh Krehel [Thu, 12 Mar 2015 13:00:09 +0000 (14:00 +0100)]
lv.el: Update truncation rules
* lv.el (lv-window): Defer `truncate-lines' to `lv-message'. Set window
hscroll to 0, just in case.
(lv-message): If STR is one-line, set `truncate-lines' to nil, otherwise
set it to t. Make `window-min-height' buffer-local and set it to the
amount of newlines in STR.