GNU bug report logs - #39706
28.0.50; Search prefix nroff-mode

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Fri, 21 Feb 2020 00:11:03 UTC

Severity: normal

Tags: fixed, patch

Found in version 28.0.50

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39706 in the body.
You can then email your comments to 39706 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Fri, 21 Feb 2020 00:11:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Fri, 21 Feb 2020 00:11:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Search prefix nroff-mode
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)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Fri, 21 Feb 2020 07:50:01 GMT) Full text and rfc822 format available.

Message #8 received at 39706 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 39706 <at> debbugs.gnu.org
Subject: Re: bug#39706: 28.0.50; Search prefix nroff-mode
Date: Fri, 21 Feb 2020 09:48:51 +0200
> From: Juri Linkov <juri <at> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Sun, 23 Feb 2020 00:45:05 GMT) Full text and rfc822 format available.

Message #11 received at 39706 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39706 <at> debbugs.gnu.org
Subject: Re: bug#39706: 28.0.50; Search prefix nroff-mode
Date: Sun, 23 Feb 2020 02:40:18 +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?

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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Sun, 23 Feb 2020 15:19:02 GMT) Full text and rfc822 format available.

Message #14 received at 39706 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 39706 <at> debbugs.gnu.org
Subject: Re: bug#39706: 28.0.50; Search prefix nroff-mode
Date: Sun, 23 Feb 2020 17:18:02 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 39706 <at> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Sun, 23 Feb 2020 23:52:02 GMT) Full text and rfc822 format available.

Message #17 received at 39706 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39706 <at> debbugs.gnu.org
Subject: Re: bug#39706: 28.0.50; Search prefix nroff-mode
Date: Mon, 24 Feb 2020 01:02:46 +0200
> 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’.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Mon, 24 Feb 2020 16:26:01 GMT) Full text and rfc822 format available.

Message #20 received at 39706 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>
Cc: 39706 <at> debbugs.gnu.org
Subject: Re: bug#39706: 28.0.50; Search prefix nroff-mode
Date: Mon, 24 Feb 2020 18:25:49 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 39706 <at> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Tue, 25 Feb 2020 00:42:03 GMT) Full text and rfc822 format available.

Message #23 received at 39706 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39706 <at> debbugs.gnu.org
Subject: Re: bug#39706: 28.0.50; Search prefix nroff-mode
Date: Tue, 25 Feb 2020 02:39:00 +0200
>> 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'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Tue, 25 Feb 2020 05:43:02 GMT) Full text and rfc822 format available.

Message #26 received at 39706 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Juri Linkov <juri <at> linkov.net>, Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 39706 <at> debbugs.gnu.org
Subject: Re: bug#39706: 28.0.50; Search prefix nroff-mode
Date: Tue, 25 Feb 2020 07:42:07 +0200
> From: Juri Linkov <juri <at> linkov.net>
> Cc: 39706 <at> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Sat, 14 Mar 2020 12:32:01 GMT) Full text and rfc822 format available.

Message #29 received at 39706 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39706 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#39706: 28.0.50; Search prefix nroff-mode
Date: Sat, 14 Mar 2020 13:30:50 +0100
Eli Zaretskii <eliz <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#39706; Package emacs. (Sat, 15 Aug 2020 12:21:02 GMT) Full text and rfc822 format available.

Message #32 received at 39706 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 39706 <at> debbugs.gnu.org, Juri Linkov <juri <at> linkov.net>
Subject: Re: bug#39706: 28.0.50; Search prefix nroff-mode
Date: Sat, 15 Aug 2020 14:20:38 +0200
Lars Ingebrigtsen <larsi <at> 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




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 15 Aug 2020 12:21:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 39706 <at> debbugs.gnu.org and Juri Linkov <juri <at> linkov.net> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 15 Aug 2020 12:21:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 13 Sep 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 197 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.