Ask HN: Emacs-like Incremental Search?

2 points by _acme ↗ HN
Is there a native macOS text editor that supports emacs-like incremental search, meaning that upon completion of the search, the cursor is left at the beginning of the match? If I search for "apple" and type "ap", the cursor should be left before/on "a" when I end the search; "ap" should not be highlighted.

3 comments

[ 3.0 ms ] story [ 13.7 ms ] thread
That's funny. I've used the original ITS Emacs, Zmacs (the Lisp Machine editor), MINCE, Coral Common Lisp's FRED, GNU Emacs, XEmacs, and probably a couple more Emacs clones I've forgotten, and I don't recall any of them having that behavior when searching forward. (They do leave the cursor at the beginning of the match when searching backward.)

Anyway, you can get Aquamacs and customize its behavior to your liking.

To save a google search, here's an emacs customization to leave cursor at the start of the match.

From http://endlessparentheses.com/leave-the-cursor-at-start-of-m...

    (add-hook 'isearch-mode-end-hook
              #'endless/goto-match-beginning)
    (defun endless/goto-match-beginning ()
      "Go to the start of current isearch match.
    Use in `isearch-mode-end-hook'."
      (when (and isearch-forward
                 (number-or-marker-p isearch-other-end)
                 (not mark-active)
                 (not isearch-mode-end-hook-quit))
        (goto-char isearch-other-end)))
>> Is there a native macOS text editor that supports emacs-like...

Nothing more "emacs-like" than emacs. Turn on CUA mode if common key binds is what you're after.