I don't really want s-g to exit the Isearch minor mode but it does. The reason this is happening to me is unclear, because investigation of the binding of s-g reveals it is supposed to be a standard isearch-repeat-forward. So it seems that Emacs has gotten into a state where two keys bound to the same thing have different behavior.

Question: Why is Emacs behaving this way, how is it happening, and is this intended behavior?

  1. Edit contents of /tmp/blah.txt to be:
  1. emacs -Q /tmp/blah.txt
  2. s-fsomething -- modeline should now indicate you are in Isearch minor mode
  3. Enter C-hks-g -- note that output indicates both s-g and C-s are bound to this function (isearch-repeat-forward)
s-g runs the command isearch-repeat-forward (found in global-map),
which is an interactive compiled Lisp function in ‘isearch.el’.

It is bound to C-s, C-M-s, <menu-bar> <search-menu>
<isearch-repeat-forward>, s-g.
  1. Press one of

    • s-g -- modeline indicates Isearch minor mode is no longer active
    • C-s -- modeline indicates Isearch minor mode is still active
  2. Start over and press the key you didn't press in step 4

My Emacs About panel indicates Version 28.0.50 (9.0).

  • 2
    Be aware that Emacs 28 development snapshots reflect ongoing changes. In particular, there are changes afoot to make Isearch use the minibuffer, and that could perhaps be a cause of the problem you're seeing. You might try with an Emacs release (e.g. 27.2) instead, to see if the problem is there as well. If not, consider filing a bug or otherwise reporting it: M-x report-emacs-bug.
    – Drew
    Commented May 23, 2021 at 14:39
  • In addition to what @Drew said, I recommend avoiding key chords that end up bound to ⌘ (a la super, by default) when you can. macOS isn't always great at passing the key events down to the application. In this case, isearch, use the chords with Control and Meta instead. Rebind your Caps Lock to Control if you have to.
    – nega
    Commented May 26, 2021 at 23:14


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.