Hacker News new | past | comments | ask | show | jobs | submit login

Well, there are lots of customizations doable (I’m still rocking my .emacs from the 1990’s going through several platforms, Linux→MacOS→Linux, refined over the years with custom functions etc.) but to name a single example: my keyboard does have a Find key, and I tried mapping isearch-forward to it instead of the default CTRL+S. That’s trivial, but then, you know how you can press CTRL+S again to go to the next result? Well, that key combo is hardcoded in LISP. So yes, you technically can remap isearch-forward, but in a useless way.



> that key combo is hardcoded in LISP

isearch-forward turns on a minor mode that has it's own keymap

a snippet from isearch.el:

  (defvar isearch-mode-map
    ...
    ;; Several non-printing chars change the searching behavior.
    (define-key map "\C-s" 'isearch-repeat-forward)
    (define-key map "\C-r" 'isearch-repeat-backward)
hence to redefine C-s, to, say F12:

  (global-set-key [f12] 'isearch-forward)
  (define-key isearch-mode-map [f12] 'isearch-repeat-forward)
& so on

I don't see what is the problem here


I see, thanks for the correction.


What HNer henry_flower neglected to state explicitly in his helpful comment is that it is false that pressing C-s to go to the next result is hardcoded in some Emacs Lisp function. I just wanted to say that in case non-Emacsers don't know it's implied by what Henry did say. (What he said is much better than just "that's not true!", he also tells you how to change the C-s key that goes to the next match.)


I realize now that I misused the term “hardcoded”, thanks.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: