Gnus development mailing list
 help / color / mirror / Atom feed
* Marking ! in virtual groups
@ 2014-02-14 12:41 Matt Ford
  2014-02-16 15:58 ` Matt Ford
  2014-02-17  3:18 ` Marking ! in virtual groups Matt Ford
  0 siblings, 2 replies; 6+ messages in thread
From: Matt Ford @ 2014-02-14 12:41 UTC (permalink / raw)
  To: ding

Hi,

Me again.  I think I ran into this many moons ago.  Within a virtual
group of two nnimap groups (Inbox and Sent) setting importance marks (!)
doesn't seem to propagate the marks back through to the real group on a
consistent basis.  It sometimes works nicely and other times not at
all.  No usage pattern seems to trigger it either way.

Also A W (warp to real article) doesn't seem to work.


-- 
Matt




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Marking ! in virtual groups
  2014-02-14 12:41 Marking ! in virtual groups Matt Ford
@ 2014-02-16 15:58 ` Matt Ford
  2014-02-16 19:35   ` Matt Ford
  2014-02-17  3:18 ` Marking ! in virtual groups Matt Ford
  1 sibling, 1 reply; 6+ messages in thread
From: Matt Ford @ 2014-02-16 15:58 UTC (permalink / raw)
  To: ding

Hi,

I dug out the old question and reply from Lars regarding this issue.

Matt Ford <matt@dancingfrog.co.uk> writes:

> Flagging in a nnvirtual group and then changing to one of the member
> nnimap groups shows the flag set in the nnimap group.  So, something is
> happening to make the local copy look like it's okay.  But it's
> misleading as the nnimap group no longer reflects the server.

Lars writes:

> Looking at the code, it looks like this should work.

> `gnus-update-read-articles' is called, which calls
> `gnus-request-set-mark', which should set the marks on the server.

> Could you edebug through `gnus-update-read-articles' and see what
> (doesn't) happen?

I should make clear that this issue only affects marked with a !
messages (that's what I mean by flagged).  Read and it's ilk work well.

I've tried edebug as suggested.  For the virtual group gnus-update-read
articles is called three times one for the virtual group and twice more
for each of the real groups that compose it.

Unfortunately my elisp and edebug skills aren't up to the task.  I made
sure my virtual group had only one Flagged (marked with a !)  message
and tried to compare variables in edebug for the virtual group setting
and real groups.  They all looked the same and I couldn't see anything
that obviously affects this.

Any help or pointers much appreciated.

Cheers,
-- 
Matt




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Marking ! in virtual groups
  2014-02-16 15:58 ` Matt Ford
@ 2014-02-16 19:35   ` Matt Ford
  2014-02-16 22:20     ` nnir and distant notmuch Erik Colson
  0 siblings, 1 reply; 6+ messages in thread
From: Matt Ford @ 2014-02-16 19:35 UTC (permalink / raw)
  To: ding

Hi,

A more easily reproduced case:

I set edebug on gnus-request-update-mark in gnus-int.el

Then I notice on read status (say a `d') change it's run twice first
with the virtual group then with the real back-end.

on `!' status change it's only run once with the virtual group.

-- 
Matt




^ permalink raw reply	[flat|nested] 6+ messages in thread

* nnir and distant notmuch
  2014-02-16 19:35   ` Matt Ford
@ 2014-02-16 22:20     ` Erik Colson
  0 siblings, 0 replies; 6+ messages in thread
From: Erik Colson @ 2014-02-16 22:20 UTC (permalink / raw)
  To: ding

Hi,

I'm currently using gnus with the notmuch workaround to search
mails. I'm issuing notmuch commands on a distant server which runs a
dovecot server which I query through normal imap in gnus. So, no local
storage.

I've been looking at the nnir backend for notmuch but could not make it
work to view the search results in a nnir buffer. By looking at the nnir
code I think it doesn't actually support this. Would this be doable ? Or
even better, maybe somebody already has a patch for this ?

thx
-- 
erik colson



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Marking ! in virtual groups
  2014-02-14 12:41 Marking ! in virtual groups Matt Ford
  2014-02-16 15:58 ` Matt Ford
@ 2014-02-17  3:18 ` Matt Ford
  2014-03-05 17:26   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 6+ messages in thread
From: Matt Ford @ 2014-02-17  3:18 UTC (permalink / raw)
  To: ding

Goodness, I'm making a mess of this.  Okay, a simple test case.

Setting edebug over gnus-request-set-mark shows behaviour like so:

In a *nnimap* summary buffer marking an article with ! and then doing M-g
results in the action part of the function

(defun gnus-request-set-mark (group action)
  "Set marks on articles in the back end."
  (let ((gnus-command-method (gnus-find-method-for-group group)))
    (if (not (gnus-check-backend-function
	      'request-set-mark (car gnus-command-method)))
	action
      (funcall (gnus-get-function gnus-command-method 'request-set-mark)
	       (gnus-group-real-name group) action
	       (nth 1 gnus-command-method))
      (gnus-run-hook-with-args gnus-after-set-mark-hook group action))))

being

(((6507) add (tick)))

However in a *nnvirtual* summary buffer marking and article with ! and then doing M-g
results in the action being

((((1 . 6508)) add (read)))

so the passed action parameter is wrong.

I had a look at the M-g code and I reckon it's the function

(defun gnus-update-marks ()
  "Enter the various lists of marked articles into the newsgroup info list."
...

In particular its the section of this function that builds up the
delta-marks data structure used for changing the info.  It looks like this

...
	(when (and (gnus-check-backend-function
		    'request-set-mark gnus-newsgroup-name)
		   (not (gnus-article-unpropagatable-p (cdr type))))
	  (let* ((old (cdr (assq (cdr type) (gnus-info-marks info))))
		 ;; Don't do anything about marks for articles we
		 ;; didn't actually get any headers for.
... SNIP ...
	    (when add
	      (push (list add 'add (list (cdr type))) delta-marks))
	    (when del
	      ;; Don't delete marks from outside the active range.
	      ;; This shouldn't happen, but is a sanity check.
	      (setq del (gnus-sorted-range-intersection
			 (gnus-active gnus-newsgroup-name) del))
	      (push (list del 'del (list (cdr type))) delta-marks))))

Other functions that set marks seem to have a more sophisticated form
of checking that looks to iterate over the actual backends.  For example,

(defun gnus-request-set-mark (group action)
  "Set marks on articles in the back end."
  (let ((gnus-command-method (gnus-find-method-for-group group)))
    (if (not (gnus-check-backend-function
	      'request-set-mark (car gnus-command-method)))
	action
      (funcall (gnus-get-function gnus-command-method 'request-set-mark)
	       (gnus-group-real-name group) action
	       (nth 1 gnus-command-method))
      (gnus-run-hook-with-args gnus-after-set-mark-hook group action))))

I think this more advanced check could be used in gnus-update-marks
function for generating delta-marks over the "real" back-ends.
      
This is all at the very limit of my elisp and gnus so perhaps I've got
this horribly wrong. I'm very unsure of myself here.

Any help appreciated.
-- 
Matt




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Marking ! in virtual groups
  2014-02-17  3:18 ` Marking ! in virtual groups Matt Ford
@ 2014-03-05 17:26   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Ingebrigtsen @ 2014-03-05 17:26 UTC (permalink / raw)
  To: Matt Ford; +Cc: ding

Matt Ford <matt@dancingfrog.co.uk> writes:

> Goodness, I'm making a mess of this.  Okay, a simple test case.
>
> Setting edebug over gnus-request-set-mark shows behaviour like so:
>
> In a *nnimap* summary buffer marking an article with ! and then doing M-g
> results in the action part of the function

Hm, yes.  Actually, now I can't find any part of the code that tries to
copy over any marks to the constituent groups...
`gnus-mark-xrefs-as-read' copies over readedness stuff to the
constituent groups, but nothing else.

So perhaps Gnus doesn't support copying over other marks?  Or am I
misreading the code yet again?

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-03-05 17:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-14 12:41 Marking ! in virtual groups Matt Ford
2014-02-16 15:58 ` Matt Ford
2014-02-16 19:35   ` Matt Ford
2014-02-16 22:20     ` nnir and distant notmuch Erik Colson
2014-02-17  3:18 ` Marking ! in virtual groups Matt Ford
2014-03-05 17:26   ` Lars Ingebrigtsen

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).