From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#49866: 28.0.50; gnus-summary-exit from the transient search buffer giving error Date: Thu, 05 Aug 2021 14:35:02 -0700 Message-ID: <87wnoz4ltl.fsf@ericabrahamsen.net> References: <87zgtxlho6.fsf@gnus.org> <87mtpwi2wy.fsf@gnus.org> <87tuk34zr8.fsf@ericabrahamsen.net> <87k0kz4vxr.fsf@ericabrahamsen.net> <87a6lv4tp6.fsf@ericabrahamsen.net> <877dgz67ns.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27883"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 49866@debbugs.gnu.org, Andrew Cohen , Lars Ingebrigtsen To: Pankaj Jangid Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 05 23:36:10 2021 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 1mBl2A-0006xv-5U for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Aug 2021 23:36:10 +0200 Original-Received: from localhost ([::1]:35950 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBl28-0002Hv-Ma for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 05 Aug 2021 17:36:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45184) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBl22-0002Hm-9o for bug-gnu-emacs@gnu.org; Thu, 05 Aug 2021 17:36:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:37029) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mBl22-0001mr-3E for bug-gnu-emacs@gnu.org; Thu, 05 Aug 2021 17:36:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mBl21-00060t-ST for bug-gnu-emacs@gnu.org; Thu, 05 Aug 2021 17:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Aug 2021 21:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49866 X-GNU-PR-Package: emacs Original-Received: via spool by 49866-submit@debbugs.gnu.org id=B49866.162819931323060 (code B ref 49866); Thu, 05 Aug 2021 21:36:01 +0000 Original-Received: (at 49866) by debbugs.gnu.org; 5 Aug 2021 21:35:13 +0000 Original-Received: from localhost ([127.0.0.1]:48575 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBl1E-0005zr-Gy for submit@debbugs.gnu.org; Thu, 05 Aug 2021 17:35:12 -0400 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:53858) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBl1C-0005zY-KI for 49866@debbugs.gnu.org; Thu, 05 Aug 2021 17:35:11 -0400 Original-Received: from localhost (c-71-197-184-122.hsd1.wa.comcast.net [71.197.184.122]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 15241FA02D; Thu, 5 Aug 2021 21:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1628199304; bh=dcopuwzd4QEyQpwm0T55m4gAnLg01qLwzFaAA686Kgg=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Tz/upTM+SoRgxMgff1Z5U2236I7f/+MDnMQncg2+374QTUzkBLCojpDgOHqwvuX3O m24CYPDTW2+FXTnbErf46PVeeRBp3Qwhz6LmhcOCwAFwSU7lVEOu42FMVd5jJ/EX7Y Lu7V1n46cehzmyPSISFSgsdCsB6dMnlxP20IaJSA= In-Reply-To: <877dgz67ns.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 05 Aug 2021 11:57:59 -0700") 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" Xref: news.gmane.io gmane.emacs.bugs:211271 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Eric Abrahamsen writes: > Eric Abrahamsen writes: > >> Eric Abrahamsen writes: >> >>> Pankaj Jangid writes: >>> >>>> Eric Abrahamsen writes: >>>> >>>>> Pankaj Jangid writes: >>>>> >>>>>> I think I have isolated the cause. And the error is cause by these l= ines >>>>>> in my ~/.emacs.d/init.el (only if ebdb package is installed): >>>>>> >>>>>> (when (package-installed-p 'ebdb) >>>>>> (require 'ebdb-gnus) >>>>>> (require 'ebdb-message)) >>>>>> >>>>>> >>>>>> If I remove the package ebdb then the error goes away. >>>>> >>>>> That's pretty weird, as EBDB doesn't mess with Gnus marks at all. >>>>> Perhaps it is raising an error at some point, which is interrupting >>>>> nnselect's normal buffer setup? That's a completely wild guess. >>>>> >>>>> Maybe try setting `ebdb-mua-auto-update-p' to nil and try again? >>>>> Whatever damage EBDB might be doing to Gnus should be done in the auto >>>>> update process. >>>>> >>>>> But again, I can't even begin to guess why this would be happening. >>>> >>>> more weird things happening here. >>>> >>>> I have =E2=80=98ebdb-mua-auto-update-p=E2=80=99 set to nil in my confi= g. This was >>>> already the case. >>>> >>>> But calling (describe-variable) on =E2=80=98ebdb-mua-auto-update=E2=80= =99 shows this >>>> error with the following steps: >>>> >>>> Steps: >>>> >>>> 1. Start emacs afresh >>>> >>>> 2. (setq debug-on-error t) >>>> >>>> 3. Launch gnus >>>> >>>> 4. C-h v ebdb-mua-auto-update-p RET >>>> >>>> Result: >>>> >>>> Debugger entered--Lisp error: (file-missing "Cannot open load >>>> file" "No such file or directory" "vm-autoloads") >>>> require(vm-autoloads) >> >> Okay, after going into ebdb-vm.el and provoking the above error by >> eval-ling the (when t ...) statement, I'm now seeing the same bug when >> exiting search groups. In my case I'm seeing it when >> `nnselect-push-info' is cycling over mark types, and reaches "bookmark", >> which is of type 'tuple: the first mark of that type. >> >> That puts us into the (eq mark-type 'tuple) branch of the cond for the >> first time, which is also the first time it runs: >> >> (map-merge >> 'list list >> (alist-get type (gnus-info-marks group-info))) >> >> There are no bookmark marks in this group, so naturally we get the >> no-applicable-method error for "nil". >> >> This does nothing to explain how this code doesn't error normally, or >> how on earth raising a `require'-based error would change its behavior. > > Well I had to restart Emacs anyway in order to get a working Gnus back, > so I just checked this now. Apparently edebugging `nnselect-push-info' > was enough to raise the error. > > A little while ago I changed the `condition-case' inside `nnselect-run' > into a `condition-case-unless-debug', because it was swallowing useful > errors. I guess both Pankaj's `require' error and my edebugging put > Emacs into a "debug" mode, so an error that was being swallowed was now > raised. And of course this is complete nonsense because none of this group exiting code is called from within `nnselect-run' at all. I have no idea what I was thinking. I need to stop trying to squeeze debugging sessions into little ten-minute spaces. Of course, now I have no theory as to why the bug is swallowed until debugging conditions are triggered. I've attached a patch that I think solves the root problem, but given my track record today it should be taken with a grain of salt. (This doesn't mean I don't still think the `condition-case' in `nnselect-run' should be removed though!) --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=nnselect-update-marks.diff diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index ecec705b32..f3537376db 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -899,12 +899,12 @@ nnselect-push-info (setq list (cdr all)))) ;; now merge with the original list and sort just to ;; make sure - (setq list - (sort (map-merge - 'list list - (alist-get type (gnus-info-marks group-info))) - (lambda (elt1 elt2) - (< (car elt1) (car elt2)))))) + (when-let ((marked (alist-get + type (gnus-info-marks group-info)))) + (setq list + (sort (map-merge 'list list marked) + (lambda (elt1 elt2) + (< (car elt1) (car elt2))))))) (t (setq list (gnus-compress-sequence --=-=-=--