Subject: bug#16342: 24.3.50; RET during search inserts newline in PostScript mode

From: Juri Linkov <[email-masked]>
Date: Mon, 06 Jan 2014 11:38:14 +0200

> With "test.ps" which only contains the string "test", when I do:
>
>    $ emacs -Q test.ps
>
> and then search for 'e' with:
>
>    C-s e
>
> and then press RET to stop the search, it unexpectedly inserts a
> newline. This does not happen for example in fundamental-mode.

This is because ps-mode.el binds [return] in addition to "\r":

  (define-key ps-mode-map "\r" 'ps-mode-newline)
  (define-key ps-mode-map [return] 'ps-mode-newline)

whereas isearch.el binds only "\r":

  (define-key isearch-mode-map "\r" 'isearch-exit)

We could remove the [return] keybinding from ps-mode.el,
but there are many other places that bind [return] and [backspace]
in the Emacs source tree, external packages as well as in
countless user init files, so maybe better would be to add [return]
and [backspace] keybindings to isearch-mode-map in isearch.el.