Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: gnus uses a cache?  And how it affects mairix searches...
Date: Thu, 13 Nov 2014 08:26:56 +0800	[thread overview]
Message-ID: <87r3x8q71r.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <87oasc5csk.fsf@uwo.ca>

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

Dan Christensen <jdc@uwo.ca> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>>> Andreas Schwab <schwab@linux-m68k.org> writes:
>>>
>>>> Dan Christensen <jdc@uwo.ca> writes:
>>>>
>>>>> In gnus.el, it doesn't list nnmairix at all, but somehow when using
>>>>> nnmairix, an entry for nnmairix gets added to this list, without the
>>>>> virtual keyword (see below).
>>>>
>>>> diff --git a/lisp/nnmairix.el b/lisp/nnmairix.el
>>>> index 0cef699..b2f74e3 100644
>>>> --- a/lisp/nnmairix.el
>>>> +++ b/lisp/nnmairix.el
>>>> @@ -417,7 +417,7 @@ Other back ends might or might not work.")
>>>>  
>>>>  (nnoo-define-basics nnmairix)
>>>>  
>>>> -(gnus-declare-backend "nnmairix" 'mail 'address)
>>>> +(gnus-declare-backend "nnmairix" 'mail 'address 'virtual)
>>>>  
>>>>  (deffoo nnmairix-open-server (server &optional definitions)
>>>>    ;; just set server variables
>>>>
>>>> Andreas.
>>>
>>> After look at this for a while, I do think this is the right solution --
>>> what do you all think? Can someone apply this change?
>>
>> Oh never mind, I guess I didn't look long enough. For any backend
>> declared as virtual, `gnus-cache-possibly-enter-article' will use
>> `nnvirtual-find-group-art' to get the real group name.
>>
>> That means that if a backend is declared 'virtual but isn't actually
>> nnvirtual, the caching mechanism will use the wrong lookup function.
>
> I don't follow you.  Isn't the relevant function gnus-backlog-enter-article,
> which skips the backlog for groups that are declared virtual?
>
> I haven't actually tested the patch and instead simply disabled the
> backlog entirely, but I suspect the patch will work.

Ha, yes! Between then and now I somehow started looking at the wrong
mechanism altogether. Sorry about that.

I've attached patches for both the backlog edit and the nnmairix edit.

Eric



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Mark-nnmairix-as-a-virtual-backend.patch --]
[-- Type: text/x-diff, Size: 796 bytes --]

From 0f70f9fedda2de3a424384272c2e1adfdad9fdd7 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Thu, 13 Nov 2014 08:15:35 +0800
Subject: [PATCH 1/2] Mark nnmairix as a virtual backend

* lisp/nnmairix.el: Add 'virtual to call to `gnus-declare-backend'
---
 lisp/nnmairix.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/nnmairix.el b/lisp/nnmairix.el
index 0cef699..b2f74e3 100644
--- a/lisp/nnmairix.el
+++ b/lisp/nnmairix.el
@@ -417,7 +417,7 @@ Other back ends might or might not work.")
 
 (nnoo-define-basics nnmairix)
 
-(gnus-declare-backend "nnmairix" 'mail 'address)
+(gnus-declare-backend "nnmairix" 'mail 'address 'virtual)
 
 (deffoo nnmairix-open-server (server &optional definitions)
   ;; just set server variables
-- 
2.1.3


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Disable-backlog-altogethe-for-virtual-groups.patch --]
[-- Type: text/x-diff, Size: 884 bytes --]

From f297d0bdc31e69661ad3e09279e16fd6605da621 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Thu, 13 Nov 2014 08:16:13 +0800
Subject: [PATCH 2/2] Disable backlog altogethe for virtual groups

* lisp/gnus-bcklg.el (gnus-backlog-enter-article): No articles from
  virtual groups should be added to the backlog.
---
 lisp/gnus-bcklg.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/gnus-bcklg.el b/lisp/gnus-bcklg.el
index db80800..eb3c9f0 100644
--- a/lisp/gnus-bcklg.el
+++ b/lisp/gnus-bcklg.el
@@ -61,7 +61,7 @@
 
 (defun gnus-backlog-enter-article (group number buffer)
   (when (and (numberp number)
-	     (not (string-match "^nnvirtual" group)))
+	     (not (gnus-virtual-group-p group)))
     (gnus-backlog-setup)
     (let ((ident (intern (concat group ":" (int-to-string number))
 			 gnus-backlog-hashtb))
-- 
2.1.3


  reply	other threads:[~2014-11-13  0:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-06 22:36 gnus uses a cache? Sharon Kimble
2014-09-07 11:40 ` Adam Sjøgren
2014-09-07 14:22 ` James Cloos
2014-09-08  1:26   ` gnus uses a cache? And how it affects mairix searches Dan Christensen
2014-10-20 22:51     ` Dan Christensen
2014-10-20 23:57       ` Eric Abrahamsen
2014-10-22  7:47         ` Eric Abrahamsen
2014-10-22  8:30           ` Eric Abrahamsen
2014-10-23  6:59             ` Alan Schmitt
2014-10-24 15:13       ` Eric Abrahamsen
2014-10-28 14:32         ` Dan Christensen
2014-10-28 17:52           ` Andreas Schwab
2014-11-12  1:45             ` Eric Abrahamsen
2014-11-12  3:08               ` Eric Abrahamsen
2014-11-12 21:28                 ` Dan Christensen
2014-11-13  0:26                   ` Eric Abrahamsen [this message]
2014-11-16  1:00                     ` Dan Christensen
2014-11-16  3:36                       ` Eric Abrahamsen
2015-01-27  5:03                         ` Lars Ingebrigtsen
2014-09-24 15:35 ` gnus uses a cache? Ted Zlatanov

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

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

  git send-email \
    --in-reply-to=87r3x8q71r.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=ding@gnus.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.
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 NNTP newsgroup(s).