From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <83h6ldhmrm.fsf@gnu.org> References: <2304350.1700612925@apps0.cs.toronto.edu> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18547"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 67359@debbugs.gnu.org To: Chris Siebenmann , Bill Wohler Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 22 15:44:12 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r5oSY-0004Xr-QH for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 22 Nov 2023 15:44:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5oSQ-0007dF-Hj; Wed, 22 Nov 2023 09:44:02 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5oSN-0007cI-Nf for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 09:43:59 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5oSN-0007na-5f for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 09:43:59 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r5oSQ-0004RV-Dy for bug-gnu-emacs@gnu.org; Wed, 22 Nov 2023 09:44:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 22 Nov 2023 14:44:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67359 X-GNU-PR-Package: emacs Original-Received: via spool by 67359-submit@debbugs.gnu.org id=B67359.170066421117005 (code B ref 67359); Wed, 22 Nov 2023 14:44:02 +0000 Original-Received: (at 67359) by debbugs.gnu.org; 22 Nov 2023 14:43:31 +0000 Original-Received: from localhost ([127.0.0.1]:58565 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5oRv-0004QD-1m for submit@debbugs.gnu.org; Wed, 22 Nov 2023 09:43:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r5oRs-0004Py-IX for 67359@debbugs.gnu.org; Wed, 22 Nov 2023 09:43:28 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r5oRi-0007hb-Uu; Wed, 22 Nov 2023 09:43:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=RQzOTV21NRv10ehhnCuisc/Gk7ZzntQp1tLgXL+uPX8=; b=V2yt5FY+SPyZ ojXCT5SUQCQNlRBtk16fVq+0o6pyKB2rqmnoYKT5gohy9YepFGSHyprR9BzYP2/icu6ecfTSN5hle yX6anr18izTNv7SkpX0quUJJJj3fId0ldtiO/DjpV4mIlwGi1wcHcBvGqZe37mhqDgYDGl7eCLhW6 UCPPmbzw9Bmws2kqPUZ51izP9JlMlQfhrJghU4Kfm35hIHsNiVAy1Z82Mkc94vQHTJOd4HJAPU6gP g1SJIK0J6/ixeHz4RaGXZu02V0SmGhi/ShcmjwjJX6b+g4sf7ZTaWiTAokDNeTotcoS2/p8JYbyZN 5S1Hes/xbYuQ/iahY8td0w==; In-Reply-To: <2304350.1700612925@apps0.cs.toronto.edu> (message from Chris Siebenmann on Tue, 21 Nov 2023 19:28:45 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:274759 Archived-At: > Cc: cks.emacsbugs-01@cs.toronto.edu > From: Chris Siebenmann > 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/.