all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Oleh Krehel <ohwoeowho@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: bruce.connor.am@gmail.com, emacs-devel@gnu.org,
	monnier@iro.umontreal.ca, kaushal.modi@gmail.com,
	stephen@xemacs.org, Juri Linkov <juri@linkov.net>,
	drew.adams@oracle.com
Subject: Re: Displaying the state of isearch toggles [was Re: ASCII-folded search]
Date: Tue, 30 Jun 2015 09:53:25 +0200	[thread overview]
Message-ID: <87zj3hfx8q.fsf@gmail.com> (raw)
In-Reply-To: <83a8vh5316.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 30 Jun 2015 05:43:49 +0300")

[-- Attachment #1: Type: text/plain, Size: 1397 bytes --]

Eli Zaretskii <eliz@gnu.org> writes:

>> Do we want to go down this path?
>
> Maybe we do.  Are there good alternatives, when there are so many
> non-orthogonal options?

I have a good alternative for swiper.el (my isearch-replacement package
in GELPA).

Unlike the current isearch, which recently started displaying
"Char-fold I-search: " instead of the much better default "I-search: ",
swiper displays only "97 pattern: ", where "97" is the current number
of matches.

To see more options, I can press "C-o" to bring up a hydra - a keyboard
oriented menu, which is also a package of mine in GELPA. Pressing "C-o"
again hides this information.

I attach 3 screenshots.
First one: I only press "C-s" (`swiper') to get a minimal interface.
Second one: I press "C-o" to show me the options panel, which also
doubles as a command-mode:

- "C-n" becomes "j"
- "C-p" becomes "k"
- "M-<" becomes "h"
- "M->" becomes "l"

It's possible to toggle the matching function with "m", and the state
will be re-displayed to let the user know that the matcher has changed.
It's possible to re-size the minibuffer with "<" and ">".

Third one: I've re-sized the minibuffer to become smaller with "<<" and
changed the matcher to fuzzy with "m" (notice the number of candidates
grew from 97 to 543).

I could now dismiss the menu with "i" or "C-o" and go back to a minimal
interface, with the changes that I made.


[-- Attachment #2: swiper-example-1.png --]
[-- Type: image/png, Size: 101843 bytes --]

[-- Attachment #3: swiper-example-2.png --]
[-- Type: image/png, Size: 103119 bytes --]

[-- Attachment #4: swiper-example-3.png --]
[-- Type: image/png, Size: 97132 bytes --]

[-- Attachment #5: Type: text/plain, Size: 1378 bytes --]


I'd like to also emphasize that the whole menu string is displayed with
the `lv-message' function, which mirrors `message', except it uses an
equivalent of the Echo Area above the actual Echo Area.  This removes
the drawback of the 2-second delay whenever new messages need to be
displayed in the minibuffer, and also it doesn't get overwritten by
other messages.

Hydra has a pretty easy interface, similar to `easy-menu-define', to
define this menu (here ^ are just alignment chars):

(defhydra hydra-ivy (:hint nil
                     :color pink)
  "
^^^^^^          ^Yes^     ^No^     ^Maybe^
^^^^^^^^^^^^^^---------------------------------------
^ ^ _k_ ^ ^     _f_ollow  _i_nsert _c_: calling %s(if ivy-calling \"on\" \"off\")
_h_ ^+^ _l_     _d_one    _o_ops   _m_: matcher %s(if (eq ivy--regex-function 'ivy--regex-fuzzy) \"fuzzy\" \"ivy\")
^ ^ _j_ ^ ^     ^ ^       ^ ^      _<_/_>_: shrink/grow window
"
  ;; arrows
  ("h" ivy-beginning-of-buffer)
  ("j" ivy-next-line)
  ("k" ivy-previous-line)
  ("l" ivy-end-of-buffer)
  ;; actions
  ("o" keyboard-escape-quit :exit t)
  ("C-g" keyboard-escape-quit :exit t)
  ("i" nil)
  ("C-o" nil)
  ("f" ivy-alt-done :exit nil)
  ("C-j" ivy-alt-done :exit nil)
  ("d" ivy-done :exit t)
  ("C-m" ivy-done :exit t)
  ("c" ivy-toggle-calling)
  ("m" ivy-toggle-fuzzy)
  (">" ivy-minibuffer-grow)
  ("<" ivy-minibuffer-shrink))


  reply	other threads:[~2015-06-30  7:53 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <<CAAdUY-K3x4i+7wFvbEstvKVKuSZyM-DL4wB+Pe7ZbsHcVYXOfw@mail.gmail.com>
     [not found] ` <<831tgv7vbr.fsf@gnu.org>
2015-06-28 17:02   ` Displaying the state of isearch toggles [was Re: ASCII-folded search] Drew Adams
2015-06-28 17:29     ` Drew Adams
2015-06-29 22:03     ` Juri Linkov
2015-06-29 22:26       ` Drew Adams
2015-06-30 15:03         ` Eli Zaretskii
2015-06-30  2:43       ` Eli Zaretskii
2015-06-30  7:53         ` Oleh Krehel [this message]
     [not found]   ` <<ddcd0bf6-a60e-406b-a79d-088c13c2ac61@default>
     [not found]     ` <<87h9pq18ae.fsf@mail.linkov.net>
     [not found]       ` <<83a8vh5316.fsf@gnu.org>
2015-06-30  4:39         ` Drew Adams
2015-06-30  6:25           ` Artur Malabarba
2015-06-30 14:04             ` Drew Adams
2015-06-30 14:41               ` Artur Malabarba
2015-06-30 15:06           ` Eli Zaretskii
     [not found]         ` <<9da72b40-0236-4edd-983e-90c54ca7f827@default>
     [not found]           ` <<83616544o3.fsf@gnu.org>
2015-06-30 17:17             ` Drew Adams
     [not found]       ` <<d9b5bdf0-9a8f-48b8-b24f-1b7ead67220f@default>
     [not found]         ` <<837fql44s9.fsf@gnu.org>
2015-06-30 17:14           ` Drew Adams
2015-06-30 17:22             ` Eli Zaretskii
2015-06-28 10:47 Artur Malabarba
2015-06-28 14:37 ` Eli Zaretskii
2015-06-28 15:08   ` Kaushal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zj3hfx8q.fsf@gmail.com \
    --to=ohwoeowho@gmail.com \
    --cc=bruce.connor.am@gmail.com \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=juri@linkov.net \
    --cc=kaushal.modi@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=stephen@xemacs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.