unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#39706: 28.0.50; Search prefix nroff-mode
@ 2020-02-20 23:51 Juri Linkov
  2020-02-21  7:48 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Juri Linkov @ 2020-02-20 23:51 UTC (permalink / raw)
  To: 39706

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)





^ permalink raw reply related	[flat|nested] 10+ messages in thread

* bug#39706: 28.0.50; Search prefix nroff-mode
  2020-02-20 23:51 bug#39706: 28.0.50; Search prefix nroff-mode Juri Linkov
@ 2020-02-21  7:48 ` Eli Zaretskii
  2020-02-23  0:40   ` Juri Linkov
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-02-21  7:48 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 39706

> From: Juri Linkov <juri@linkov.net>
> Date: Fri, 21 Feb 2020 01:51:31 +0200
> 
> 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:

Wouldn't it be more straight-forward and simple to add .log and .log.N
to auto-mode-alist, thus preventing nroff-mode from usurping these
files?

IOW, what you propose sounds like a very convoluted and indirect way
of fixing the problem you described, doesn't it?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#39706: 28.0.50; Search prefix nroff-mode
  2020-02-21  7:48 ` Eli Zaretskii
@ 2020-02-23  0:40   ` Juri Linkov
  2020-02-23 15:18     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Juri Linkov @ 2020-02-23  0:40 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39706

>> 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:
>
> Wouldn't it be more straight-forward and simple to add .log and .log.N
> to auto-mode-alist, thus preventing nroff-mode from usurping these
> files?

These files were some random files for my particular case.
I can customize auto-mode-alist to handle my use cases.

The point of my bug report is that I accidentally discovered
a problem in nroff-mode that otherwise I don't use.

> IOW, what you propose sounds like a very convoluted and indirect way
> of fixing the problem you described, doesn't it?

The proposed patch fixes nroff-mode to make the search prefix available
for users of nroff-mode.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#39706: 28.0.50; Search prefix nroff-mode
  2020-02-23  0:40   ` Juri Linkov
@ 2020-02-23 15:18     ` Eli Zaretskii
  2020-02-23 23:02       ` Juri Linkov
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-02-23 15:18 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 39706

> From: Juri Linkov <juri@linkov.net>
> Cc: 39706@debbugs.gnu.org
> Date: Sun, 23 Feb 2020 02:40:18 +0200
> 
> The point of my bug report is that I accidentally discovered
> a problem in nroff-mode that otherwise I don't use.
> 
> > IOW, what you propose sounds like a very convoluted and indirect way
> > of fixing the problem you described, doesn't it?
> 
> The proposed patch fixes nroff-mode to make the search prefix available
> for users of nroff-mode.

Sounds like I've misunderstood your report.  Apologies.  Could you
perhaps describe the root cause again, this time focusing on the
actual problem?  Your original description made me think the program
was with log files, and nroff-mode just got in the way, but you seem
to be talking about a genuine problem in nroff-mode.  What is that
problem?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#39706: 28.0.50; Search prefix nroff-mode
  2020-02-23 15:18     ` Eli Zaretskii
@ 2020-02-23 23:02       ` Juri Linkov
  2020-02-24 16:25         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Juri Linkov @ 2020-02-23 23:02 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39706

> Could you perhaps describe the root cause again, this time focusing on
> the actual problem?  Your original description made me think the
> program was with log files, and nroff-mode just got in the way, but
> you seem to be talking about a genuine problem in nroff-mode.  What is
> that problem?

Sorry for an unclear bug report.  What I described earlier is the case
that exposed the problem in nroff-mode.  The problem itself is that
the global search prefix keymap ‘M-s’ (search-map) is shadowed
in nroff-mode by a keybinding that bounds the same key ‘M-s’
in nroff-mode-map to ‘center-line’.

The solution already exists in text-mode from which nroff-mode inherits:
text-mode binds ‘center-line’ to ‘M-o M-s’.  Thus just removing the
keybinding ‘M-s’ from nroff-mode will make the search prefix ‘M-s’
of search-map available in nroff-mode, whereas ‘M-o M-s’ will call 
‘center-line’ previously bound to ‘M-s’.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#39706: 28.0.50; Search prefix nroff-mode
  2020-02-23 23:02       ` Juri Linkov
@ 2020-02-24 16:25         ` Eli Zaretskii
  2020-02-25  0:39           ` Juri Linkov
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-02-24 16:25 UTC (permalink / raw)
  To: Juri Linkov; +Cc: 39706

> From: Juri Linkov <juri@linkov.net>
> Cc: 39706@debbugs.gnu.org
> Date: Mon, 24 Feb 2020 01:02:46 +0200
> 
> Sorry for an unclear bug report.  What I described earlier is the case
> that exposed the problem in nroff-mode.  The problem itself is that
> the global search prefix keymap ‘M-s’ (search-map) is shadowed
> in nroff-mode by a keybinding that bounds the same key ‘M-s’
> in nroff-mode-map to ‘center-line’.
> 
> The solution already exists in text-mode from which nroff-mode inherits:
> text-mode binds ‘center-line’ to ‘M-o M-s’.  Thus just removing the
> keybinding ‘M-s’ from nroff-mode will make the search prefix ‘M-s’
> of search-map available in nroff-mode, whereas ‘M-o M-s’ will call 
> ‘center-line’ previously bound to ‘M-s’.

Thanks.  I'm okay with the change, but I think it should be called out
in NEWS as an incompatible change, with an explanation why we did
that.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#39706: 28.0.50; Search prefix nroff-mode
  2020-02-24 16:25         ` Eli Zaretskii
@ 2020-02-25  0:39           ` Juri Linkov
  2020-02-25  5:42             ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Juri Linkov @ 2020-02-25  0:39 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39706

>> The solution already exists in text-mode from which nroff-mode inherits:
>> text-mode binds ‘center-line’ to ‘M-o M-s’.  Thus just removing the
>> keybinding ‘M-s’ from nroff-mode will make the search prefix ‘M-s’
>> of search-map available in nroff-mode, whereas ‘M-o M-s’ will call
>> ‘center-line’ previously bound to ‘M-s’.
>
> Thanks.  I'm okay with the change, but I think it should be called out
> in NEWS as an incompatible change, with an explanation why we did
> that.

Pushed to master with NEWS and removed the task from admin/release-process.

Not sure what to do with other remaining tasks in admin/release-process:

1. Gnus binds 'M-s' to 'gnus-summary-search-article-forward'.

2. Minibuffer binds 'M-s' to 'next-matching-history-element'
   (not useful any more since C-s can now search in the history).

3. PCL-CVS binds 'M-s' to 'cvs-status', and log-edit-mode binds it to
   'log-edit-comment-search-forward'.  Perhaps search commands
   on the global key binding 'M-s' are useless in these modes.

4. Rmail binds '\es' to 'rmail-search'/'rmail-summary-search'.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#39706: 28.0.50; Search prefix nroff-mode
  2020-02-25  0:39           ` Juri Linkov
@ 2020-02-25  5:42             ` Eli Zaretskii
  2020-03-14 12:30               ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2020-02-25  5:42 UTC (permalink / raw)
  To: Juri Linkov, Lars Ingebrigtsen; +Cc: 39706

> From: Juri Linkov <juri@linkov.net>
> Cc: 39706@debbugs.gnu.org
> Date: Tue, 25 Feb 2020 02:39:00 +0200
> 
> > Thanks.  I'm okay with the change, but I think it should be called out
> > in NEWS as an incompatible change, with an explanation why we did
> > that.
> 
> Pushed to master with NEWS and removed the task from admin/release-process.

Thanks.

> Not sure what to do with other remaining tasks in admin/release-process:
> 
> 1. Gnus binds 'M-s' to 'gnus-summary-search-article-forward'.
> 
> 2. Minibuffer binds 'M-s' to 'next-matching-history-element'
>    (not useful any more since C-s can now search in the history).
> 
> 3. PCL-CVS binds 'M-s' to 'cvs-status', and log-edit-mode binds it to
>    'log-edit-comment-search-forward'.  Perhaps search commands
>    on the global key binding 'M-s' are useless in these modes.
> 
> 4. Rmail binds '\es' to 'rmail-search'/'rmail-summary-search'.

IMO, only Gnus is popular enough to worry about.  Lars, any
suggestions?





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#39706: 28.0.50; Search prefix nroff-mode
  2020-02-25  5:42             ` Eli Zaretskii
@ 2020-03-14 12:30               ` Lars Ingebrigtsen
  2020-08-15 12:20                 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 10+ messages in thread
From: Lars Ingebrigtsen @ 2020-03-14 12:30 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39706, Juri Linkov

Eli Zaretskii <eliz@gnu.org> writes:

>> Not sure what to do with other remaining tasks in admin/release-process:
>> 
>> 1. Gnus binds 'M-s' to 'gnus-summary-search-article-forward'.

[...]

> IMO, only Gnus is popular enough to worry about.  Lars, any
> suggestions?

If I recall correctly, `M-s' has had its meaning in the Gnus summary
buffers since the 80s, so changing it is probably going to annoy some
people.  On the other hand, it's not a very useful command...

Perhaps moving the command to...  say...  `M-s M-s' would make sense?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#39706: 28.0.50; Search prefix nroff-mode
  2020-03-14 12:30               ` Lars Ingebrigtsen
@ 2020-08-15 12:20                 ` Lars Ingebrigtsen
  0 siblings, 0 replies; 10+ messages in thread
From: Lars Ingebrigtsen @ 2020-08-15 12:20 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: 39706, Juri Linkov

Lars Ingebrigtsen <larsi@gnus.org> writes:

>> IMO, only Gnus is popular enough to worry about.  Lars, any
>> suggestions?
>
> If I recall correctly, `M-s' has had its meaning in the Gnus summary
> buffers since the 80s, so changing it is probably going to annoy some
> people.  On the other hand, it's not a very useful command...
>
> Perhaps moving the command to...  say...  `M-s M-s' would make sense?

I've now done this change in Emacs 28.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-08-15 12:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-20 23:51 bug#39706: 28.0.50; Search prefix nroff-mode Juri Linkov
2020-02-21  7:48 ` Eli Zaretskii
2020-02-23  0:40   ` Juri Linkov
2020-02-23 15:18     ` Eli Zaretskii
2020-02-23 23:02       ` Juri Linkov
2020-02-24 16:25         ` Eli Zaretskii
2020-02-25  0:39           ` Juri Linkov
2020-02-25  5:42             ` Eli Zaretskii
2020-03-14 12:30               ` Lars Ingebrigtsen
2020-08-15 12:20                 ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).