Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Emacs CVS, question regarding ticked, dormant, \Flagged with nnimap.
@ 2005-03-27 15:47 Bruno Hertz
  2005-03-27 17:50 ` Bruno Hertz
  0 siblings, 1 reply; 4+ messages in thread
From: Bruno Hertz @ 2005-03-27 15:47 UTC (permalink / raw)


Hi folks

does anyone know why, when applying flags to an imap backend,
flag addition and removal are applied in that order?

Example: with nnimap-importantize-dormant enabled, if I enter
a buffer that has ticked articles and change those ticks into
dormant, on the imap side first (gnus-dormant \Flagged) is
stored on those articles, but then (\Flagged) is removed due
to removal of the tick, making importantize basically effectiveless.

You probably guess the reason I ask, i.e. I want to maintain
\Flagged cross-client, while hiding those articles upon entering
a summary buffer at the same time.

Sidenote: if you're about to recommend using (display . [unread])
to hide ticked articles per default, let me just note that this
doesn't work either.

Hints mucho appreciated.

Regards, Bruno.


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

* Re: Emacs CVS, question regarding ticked, dormant, \Flagged with nnimap.
  2005-03-27 15:47 Emacs CVS, question regarding ticked, dormant, \Flagged with nnimap Bruno Hertz
@ 2005-03-27 17:50 ` Bruno Hertz
  2005-03-27 20:52   ` Bruno Hertz
  0 siblings, 1 reply; 4+ messages in thread
From: Bruno Hertz @ 2005-03-27 17:50 UTC (permalink / raw)


"Bruno Hertz" <spammer.go.home@gmail.com> writes:

> Hi folks
>
> does anyone know why, when applying flags to an imap backend,
> flag addition and removal are applied in that order?
>
> Example: with nnimap-importantize-dormant enabled, if I enter
> a buffer that has ticked articles and change those ticks into
> dormant, on the imap side first (gnus-dormant \Flagged) is
> stored on those articles, but then (\Flagged) is removed due
> to removal of the tick, making importantize basically effectiveless.
>
> You probably guess the reason I ask, i.e. I want to maintain
> \Flagged cross-client, while hiding those articles upon entering
> a summary buffer at the same time.
>
> Sidenote: if you're about to recommend using (display . [unread])
> to hide ticked articles per default, let me just note that this
> doesn't work either.
>
> Hints mucho appreciated.
>
> Regards, Bruno.

Addition: the function in question seems to be gnus-update-marks,
portion

	(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))))
		 (del (gnus-remove-from-range (gnus-copy-sequence old) list))
		 (add (gnus-remove-from-range
		       (gnus-copy-sequence list) old)))
	    (when add
	      (push (list add 'add (list (cdr type))) delta-marks))
	    (when del
	      (push (list del 'del (list (cdr type))) delta-marks))))

which apparently is meant to work with any backend.

Still, anybody having an idea about whether exchanging add and del
might break anything?

Regards, Bruno.


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

* Re: Emacs CVS, question regarding ticked, dormant, \Flagged with nnimap.
  2005-03-27 17:50 ` Bruno Hertz
@ 2005-03-27 20:52   ` Bruno Hertz
  2005-03-28 16:55     ` Bruno Hertz
  0 siblings, 1 reply; 4+ messages in thread
From: Bruno Hertz @ 2005-03-27 20:52 UTC (permalink / raw)


"Bruno Hertz" <spammer.go.home@gmail.com> writes:

> Addition: the function in question seems to be gnus-update-marks,
> portion
>
> 	(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))))
> 		 (del (gnus-remove-from-range (gnus-copy-sequence old) list))
> 		 (add (gnus-remove-from-range
> 		       (gnus-copy-sequence list) old)))
> 	    (when add
> 	      (push (list add 'add (list (cdr type))) delta-marks))
> 	    (when del
> 	      (push (list del 'del (list (cdr type))) delta-marks))))
>
> which apparently is meant to work with any backend.
>
> Still, anybody having an idea about whether exchanging add and del
> might break anything?

OK, tracked this further down, the above remarks are apparently wrong.
The action list order applied to marks follows the order defined in
gnus-article-mark-lists, where 'ticked' comes before 'dormant'. So
ticked will be pushed first anyway onto the actions, regardless of
'add' or 'delete'. Which means it will be popped (and applied) last,
hence remove a \Flagged previously set by dormant.

Two solutions come to mind: redefine gnus-article-mark-lists, which
would be somewhat arbitrary and maybe invite for future mistakes, or
sort the actions in nnimap-request-set-mark to do deletes first.

I'm no elisp geek, so some advice on what best to do would be great.

Regards, Bruno.


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

* Re: Emacs CVS, question regarding ticked, dormant, \Flagged with nnimap.
  2005-03-27 20:52   ` Bruno Hertz
@ 2005-03-28 16:55     ` Bruno Hertz
  0 siblings, 0 replies; 4+ messages in thread
From: Bruno Hertz @ 2005-03-28 16:55 UTC (permalink / raw)


"Bruno Hertz" <spammer.go.home@gmail.com> writes:

> Two solutions come to mind: redefine gnus-article-mark-lists, which
> would be somewhat arbitrary and maybe invite for future mistakes, or
> sort the actions in nnimap-request-set-mark to do deletes first.

OK, for the records, as a quick fix I put the following into my .gnus:

 (defun nnimap-mark-action-is-less-p (a b)
   (if (and (eq (nth 1 a) 'del) (eq (nth 1 b) 'add)) t nil))
 (defadvice nnimap-request-set-mark
   (before nnimap-request-set-mark-sort-actions
           (group actions &optional server) activate compile)
   (setq actions (sort actions 'nnimap-mark-action-is-less-p)))

Regards, Bruno.


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

end of thread, other threads:[~2005-03-28 16:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-03-27 15:47 Emacs CVS, question regarding ticked, dormant, \Flagged with nnimap Bruno Hertz
2005-03-27 17:50 ` Bruno Hertz
2005-03-27 20:52   ` Bruno Hertz
2005-03-28 16:55     ` Bruno Hertz

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