unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: Pankaj Jangid <pankaj@codeisgreat.org>
Cc: 49866@debbugs.gnu.org, Andrew Cohen <cohen@bu.edu>,
	Lars Ingebrigtsen <larsi@gnus.org>
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	[thread overview]
Message-ID: <87wnoz4ltl.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <877dgz67ns.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Thu, 05 Aug 2021 11:57:59 -0700")

[-- Attachment #1: Type: text/plain, Size: 3738 bytes --]

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>>> Pankaj Jangid <pankaj@codeisgreat.org> writes:
>>>
>>>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>>>
>>>>> Pankaj Jangid <pankaj@codeisgreat.org> writes:
>>>>>
>>>>>> I think I have isolated the cause. And the error is cause by these lines
>>>>>> 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 ‘ebdb-mua-auto-update-p’ set to nil in my config. This was
>>>> already the case.
>>>>
>>>> But calling (describe-variable) on ‘ebdb-mua-auto-update’ 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!)


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnselect-update-marks.diff --]
[-- Type: text/x-patch, Size: 791 bytes --]

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

  reply	other threads:[~2021-08-05 21:35 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-04  6:41 bug#49866: 28.0.50; gnus-summary-exit from the transient search buffer giving error Pankaj Jangid
2021-08-04  8:48 ` Lars Ingebrigtsen
2021-08-04 11:09   ` Pankaj Jangid
2021-08-05 10:47     ` Lars Ingebrigtsen
2021-08-05 11:23       ` Pankaj Jangid
2021-08-05 16:34         ` Eric Abrahamsen
2021-08-05 17:06           ` Pankaj Jangid
2021-08-05 17:56             ` Eric Abrahamsen
2021-08-05 18:44               ` Eric Abrahamsen
2021-08-05 18:57                 ` Eric Abrahamsen
2021-08-05 21:35                   ` Eric Abrahamsen [this message]
2021-08-06  9:27                     ` Lars Ingebrigtsen
2021-08-06 10:11                       ` Andrew Cohen
2021-08-06  9:58                     ` Pankaj Jangid
2021-08-06 10:21                     ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-06 11:01                       ` Andrew Cohen
2021-08-06 11:04                         ` Andrew Cohen
2021-08-06  0:55                 ` Eric Abrahamsen
2021-08-06  9:29                   ` Lars Ingebrigtsen
2021-08-06 10:22                     ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-06 10:42                       ` Lars Ingebrigtsen
2021-08-06 11:24                         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-06 10:44                       ` Lars Ingebrigtsen
2021-08-06 11:25                         ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-06 16:25                           ` Eric Abrahamsen
2021-08-06 16:57                             ` Eric Abrahamsen
2021-08-06 17:13                               ` Lars Ingebrigtsen
2021-08-06 17:51                               ` akater
2021-08-06 18:05                                 ` akater
2021-08-06 18:47                                   ` Lars Ingebrigtsen
2021-08-06 19:14                                     ` akater
2021-08-06 20:27                                       ` Eric Abrahamsen
2021-08-07  5:26                                         ` Pankaj Jangid
2021-08-07 10:19                                           ` Lars Ingebrigtsen
2021-08-07 16:59                                             ` Pankaj Jangid
2021-08-07 19:40                                             ` akater
2021-08-07 22:56                                           ` Eric Abrahamsen
2021-08-07 23:10                                             ` Eric Abrahamsen
2021-08-07 23:20                                               ` akater
2021-08-07 23:17                                             ` akater
2021-08-09 16:50                                             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-09 23:07                                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-08-10  4:17                                                 ` Pankaj Jangid
2021-08-06 18:08                                 ` Eric Abrahamsen

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=87wnoz4ltl.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=49866@debbugs.gnu.org \
    --cc=cohen@bu.edu \
    --cc=larsi@gnus.org \
    --cc=pankaj@codeisgreat.org \
    /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).