unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Chris Siebenmann <cks.emacsbugs-01@cs.toronto.edu>,
	Bill Wohler <wohler@newt.com>
Cc: 67359@debbugs.gnu.org
Subject: bug#67359: 29.1; 29.1: MH-E limited display malfunctions if nothing is matched
Date: Wed, 22 Nov 2023 16:43:09 +0200	[thread overview]
Message-ID: <83h6ldhmrm.fsf@gnu.org> (raw)
In-Reply-To: <2304350.1700612925@apps0.cs.toronto.edu> (message from Chris Siebenmann on Tue, 21 Nov 2023 19:28:45 -0500)

> Cc: cks.emacsbugs-01@cs.toronto.edu
> From: Chris Siebenmann <cks.emacsbugs-01@cs.toronto.edu>
> Date: Tue, 21 Nov 2023 19:28:45 -0500
> 
> The summary is that if you use one of the MH-E limit commands, normally
> bound under / in MH-E folder mode, and you attempt to limit (narrow) to
> something that isn't present, MH-E doesn't handle the situation properly
> and winds up with a narrowed list of folder contents displaying nothing
> useful instead of reporting that no messages matched.
> 
> To reproduce this, you will need NMH and MH-E configured. Then:
> 
> * Enter MH-E, for example with 'M-x mh-rmail'.
> * widen the display to cover your entire inbox, '/ w'.
> * search for something that is not present: 'C-u / s', and change the
>   subject to search for to, for example, 'nosuchsubjectstring'.
> 
> When you do this, MH-E will first show an error message in a buffer
> below the folder window and then narrow the main folder window to a
> single line showing 'scan: no messages match specification'. ('/ w' will
> then fix the situation.)
> 
> When this happens, my *MH-E Log* buffer shows (without the leading
> indent):
> 	Errors when executing: mark +inbox -add -sequence header 0 0
> 	mark: no messages match specification
> 
> The NMH commands MH-E has run (for me) are:
> 	/usr/bin/mh/pick +inbox 1-382 -list -subject nosuchsubjectstring
> 	/usr/bin/mh/mark +inbox -add -sequence header 0 0
> 
> The output from this pick command if run by hand *without standard
> output being a tty* are:
> 	$ pick +inbox 1-382 -list -subject nosuchsubjectstring | cat
> 	pick: no messages match specification
> 	0
> 
> The potentially surprising '0' is documented in the current NMH pick
> manual page in "Output when no messages are matched". In brief, with
> -list and standard output not being a tty, pick deliberately outputs as
> '0' to standard output to signal error.
> 
> I believe the code problem is in mh-narrow-to-header-field in
> mh-limit.el, where it processes pick output using 'string-to-number' on
> each line and then pushes the nominal resulting number on to the
> msg-list list with:
> 	(when num (push num msg-list))
> 
> I think that there are two problems with this code. The first is that
> string-to-number doesn't return nil on non-numbers, it returns 0. The
> second is that sometimes a real '0' is present, but should not be pushed
> into the message list either. The two together explain why mark was
> invoked with the odd '0 0'; one is from the pick error line and one is
> from the actual '0' it output.
> 
> I am using the version of NMH packaged with Ubuntu 22.04, which is
> listed as NMH 1.7.1. My Emacs is a locally compiled 29.1.
> 
> NOTE: This reproduces in 'emacs -Q', but this report is submitted from
> inside my regular Emacs environment because life is too short. You can
> ignore the list of third party packages, load-path shadows, and other
> things.

Adding Bill.

I'm not sure if it is better to report MH-E-related bugs here or
submit the reports to https://sourceforge.net/p/mh-e/bugs/.





  reply	other threads:[~2023-11-22 14:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-22  0:28 bug#67359: 29.1; 29.1: MH-E limited display malfunctions if nothing is matched Chris Siebenmann
2023-11-22 14:43 ` Eli Zaretskii [this message]
2023-11-22 16:08   ` Mike Kupfer
2023-11-22 16:21     ` Chris Siebenmann
2023-11-23  1:56   ` Bill Wohler via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-11-23  6:53     ` Eli Zaretskii
2023-11-23 19:59       ` Mike Kupfer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83h6ldhmrm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=67359@debbugs.gnu.org \
    --cc=cks.emacsbugs-01@cs.toronto.edu \
    --cc=wohler@newt.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).