[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: Fri, 1 Jan 2021 11:12:50 -0800 (PST)

> I almost always exit a search with a command that
> will execute after exiting.

Some thoughts (maybe relevant, maybe not):

1. There is (longstanding) option `search-exit-option'.
   But I guess that doesn't override explicit bindings
   in `isearch-mode-map'.

   Its doc string doesn't say that, however.  At least
   the doc string of `isearch-forward' does suggest it:

   "Other control and meta characters terminate the
    search and are then executed normally (depending on

   That "other" comes after descriptions of keys that
   are bound in `isearch-mode-map', so it suggests that
   IF a control or meta char isn't bound in the Isearch
   map THEN `search-exit-option' applies.

2. In Emacs 27, `search-exit-option' has more possible
   values.  Perhaps it could have a value that lets
   control and meta bindings override `isearch-mode-map'
   bindings.  (I'm not _proposing_ that.)

3. FWIW, in `isearch+.el' I have a white-list option,
   `isearchp-initiate-edit-commands', whose commands /
   keys don't exit Isearch but instead initiate
   `isearch-edit'.  E.g., if `backward-char' is in the
   list then `C-b' during Isearch won't exit search but
   will instead invoke `isearch-edit-string'.

   A similar white-list option could be added to Emacs
   to let users specify commands/keys that _should_
   exit and perform their own actions, e.g. movements.
   IOW, this would override their bindings, if any, in
   `isearch-mode-map'.  This would provide more specific
   control than would an overriding `search-exit-option' (#2).

   (Of course, users can explicitly bind whatever
   control or meta keys they want to `isearch-exit',
   but that doesn't, by itself, let the command perform
   its normal action.)

reply via email to

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