Subject: bug#39706: 28.0.50; Search prefix nroff-mode

From: Juri Linkov <[email-masked]>
Date: Fri, 21 Feb 2020 01:51:31 +0200

Tags: patch

Often logs files have numeric file extensions such as log.1, log.2, ...
thus visited in nroff-mode.  I don't care about the wrong mode since
they are visited in read-only anyway just for a quick peek.

But the problem is that nroff-mode steals the global prefix M-s
used to run search commands.

nroff-mode inherits from text-mode that puts 'center-line'
on the key 'M-o M-s', so this is what nroff-mode should use as well:

diff --git a/lisp/textmodes/nroff-mode.el b/lisp/textmodes/nroff-mode.el
index 62e8b1f093..99e144d215 100644
--- a/lisp/textmodes/nroff-mode.el
+++ b/lisp/textmodes/nroff-mode.el
@@ -50,7 +50,8 @@ nroff-mode-map
   (let ((map (make-sparse-keymap))
 	(menu-map (make-sparse-keymap)))
     (define-key map "\t"  'tab-to-tab-stop)
-    (define-key map "\es" 'center-line)
+    ;; Should use 'M-o M-s' from text-mode
+    ;; (define-key map "\es" 'center-line)
     (define-key map "\e?" 'nroff-count-text-lines)
     (define-key map "\n"  'nroff-electric-newline)
     (define-key map "\en" 'nroff-forward-text-line)