[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Recentish C-s M-y change

From: Drew Adams
Subject: RE: Recentish C-s M-y change
Date: Tue, 5 Jan 2021 08:30:27 -0800 (PST)

>   > > Except that with many control characters defined, it is hard to
>   > > remember which ones are defined -- hard to be confident that a given
>   > > control character is one that will exit the search for you.
>   > To this point (only), let me point out that we will
>   > have `describe-keymap' (in Emacs 28, I guess), to
>   > which you can enter `isearch-mode-map' at the prompt
>   > to see all of its key bindings human-readably.
> Sure -- there are various ways to find the current state
> of these bindings.  But not while thinking about how to
> exit the current search.

Not to belabor this, but in case it helps as food for
thought, to help deal with your concern:

1. We could provide a key in `isearch-mode-map', by
   default, that shows that info, and that continues
   searching normally when you hit some other key.

2. We could provide behavior similar to that of Icicles
   key completion or `which-key.el' but adapted to handle
   Isearch.  That is, continually show the keys available
   currently (either on demand or by option).

3. Provide such on-the-fly key help in some other way.


FWIW, although I haven't tried to address that need
directly, with my library isearch+.el you can already
get it currently, albeit in a somewhat roundabout way:

1. `C-x o' in Isearch opens a recursive edit.
2. `C-h M-k isearch-mode-map' shows Isearch keys.
3. `C-M-c' ends recursive edit and continues Isearch
   where you left off.

(`C-x o' is a general Isearch command.  It lets you
interrupt a search, do whatever, then continue the
search where you left off.)

And here's a quick and dirty command (thrown together
in a minute) that if bound to an Isearch key shows the
Isearch bindings in another window without interrupting
Isearch.  It makes use of another Isearch+ feature.

(defun isearchp-show-keys (arg)
  (interactive "P")
    (let ((isearchp-on-demand-action-function
      (isearchp-act-on-demand arg))
    (setq this-command  'isearchp-act-on-demand)))

(define-key isearch-mode-map <SOME KEY>

[`isearchp-act-on-demand' is itself bound in Isearch
to `C-M-RET'.  It invokes the value of option
`isearchp-on-demand-action-function', passing it the
current search hit string and its start/end positions.
Repeating it continues the action on subsequent hits.
The default value of the action function replaces the
search hit.  This means you can replace (or delete)
chosen search hits on demand.]

I'm not proposing any of this.  Just showing that we
could provide some on-the-fly key help, to give users
an idea what's possible at any time during Isearch.

(Yes, doing that might involve binding some key in
Isearch or setting some option.)

reply via email to

[Prev in Thread] Current Thread [Next in Thread]