* gnus-undo-mode and nnimap @ 2000-09-12 10:08 Toby Speight 2000-09-12 14:00 ` Simon Josefsson 0 siblings, 1 reply; 6+ messages in thread From: Toby Speight @ 2000-09-12 10:08 UTC (permalink / raw) Try this: 1. Enter a nnimap group with unread articles. 2. Read the articles and leave the group. The *Group* buffer will show the group as having 0 unread articles. 3. M-x gnus-undo (or C-_, by default). The *Group* buffer will now show the group as having >0 unread articles. 4. Enter the group. The articles you thought you had, er, unread (by undoing the read) are marked with the read mark. I know this is the same effect as the generally useful feature of accepting the server's marks over Gnus's, but WIBNI gnus-undo actually told the backend to change its stored marks? (Or if that's already the case, WIBNI nnimap DTRT when it's told?) ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gnus-undo-mode and nnimap 2000-09-12 10:08 gnus-undo-mode and nnimap Toby Speight @ 2000-09-12 14:00 ` Simon Josefsson 2000-09-12 15:45 ` Toby Speight 0 siblings, 1 reply; 6+ messages in thread From: Simon Josefsson @ 2000-09-12 14:00 UTC (permalink / raw) Cc: ding Toby Speight <streapadair@gmx.net> writes: > I know this is the same effect as the generally useful feature of > accepting the server's marks over Gnus's, but WIBNI gnus-undo actually > told the backend to change its stored marks? Yup. See if it works and I could commit it. 2000-09-12 Simon Josefsson <simon@josefsson.org> * gnus-sum.el (gnus-update-read-articles): Undo `gnus-request-set-mark' operation. Index: gnus-sum.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/gnus-sum.el,v retrieving revision 5.131 diff -w -u -u -w -r5.131 gnus-sum.el --- gnus-sum.el 2000/09/03 19:52:43 5.131 +++ gnus-sum.el 2000/09/12 13:56:38 @@ -9493,13 +9493,7 @@ (if compute read (save-excursion - (set-buffer gnus-group-buffer) - (gnus-undo-register - `(progn - (gnus-info-set-marks ',info ',(gnus-info-marks info) t) - (gnus-info-set-read ',info ',(gnus-info-read info)) - (gnus-get-unread-articles-in-group ',info (gnus-active ,group)) - (gnus-group-update-group ,group t)))) + (let (setmarkundo) ;; Propagate the read marks to the backend. (if (gnus-check-backend-function 'request-set-mark group) (let ((del (gnus-remove-from-range (gnus-info-read info) read)) @@ -9509,7 +9503,19 @@ (error "Can't open server for %s" group)) (gnus-request-set-mark group (delq nil (list (if add (list add 'add '(read))) - (if del (list del 'del '(read))))))))) + (if del (list del 'del '(read)))))) + (setq setmarkundo + `(gnus-request-set-mark + ,group ',(delq nil (list (if del (list del 'add '(read))) + (if add (list add 'del '(read)))))))))) + (set-buffer gnus-group-buffer) + (gnus-undo-register + `(progn + (gnus-info-set-marks ',info ',(gnus-info-marks info) t) + (gnus-info-set-read ',info ',(gnus-info-read info)) + (gnus-get-unread-articles-in-group ',info (gnus-active ,group)) + (gnus-group-update-group ,group t) + ,setmarkundo)))) ;; Enter this list into the group info. (gnus-info-set-read info read) ;; Set the number of unread articles in gnus-newsrc-hashtb. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gnus-undo-mode and nnimap 2000-09-12 14:00 ` Simon Josefsson @ 2000-09-12 15:45 ` Toby Speight 2000-09-13 12:29 ` Simon Josefsson 0 siblings, 1 reply; 6+ messages in thread From: Toby Speight @ 2000-09-12 15:45 UTC (permalink / raw) Cc: ding 0> Toby Speight <streapadair@gmx.net> writes: >> I know this is the same effect as the generally useful feature of >> accepting the server's marks over Gnus's, but WIBNI gnus-undo >> actually told the backend to change its stored marks? 0> In article <iluem2paex5.fsf@barbar.josefsson.org>, 0> Simon Josefsson <URL:mailto:simon@josefsson.org> ("Simon") wrote: Simon> Yup. See if it works and I could commit it. Thanks for the quick response, Simon! It works a little better now - read articles re-appear with the "M" mark (duplicate suppressed), which I guess is a bug with duplicate suppression, not nnimap... But if I tick an article and then undo it, it still appears as ticked. Though I haven't tried, I expect the same is true of other changes (ticked->dormant, perhaps?). ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gnus-undo-mode and nnimap 2000-09-12 15:45 ` Toby Speight @ 2000-09-13 12:29 ` Simon Josefsson 2000-09-13 12:53 ` Toby Speight 2000-09-13 13:31 ` Kai Großjohann 0 siblings, 2 replies; 6+ messages in thread From: Simon Josefsson @ 2000-09-13 12:29 UTC (permalink / raw) Cc: ding Toby Speight <streapadair@gmx.net> writes: > It works a little better now - read articles re-appear with the "M" > mark (duplicate suppressed), which I guess is a bug with duplicate > suppression, not nnimap... Yes, probably. > But if I tick an article and then undo it, it still appears as > ticked. Though I haven't tried, I expect the same is true of other > changes (ticked->dormant, perhaps?). No, only read-marks are undoable, other marks have never been undoable even in other backends. Perhaps we should change this? It has some complications though. Should it be possible to undo a "Answered" flag? What would that mean? And if you undo a "dormant" flag, should you remove the article from the cache? What about "Saved" flags? "Downloadable" flags? "Bookmark" flags? "Expire" flags when using total/auto-expire? Perhaps we should only allow undo of tick flags. ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gnus-undo-mode and nnimap 2000-09-13 12:29 ` Simon Josefsson @ 2000-09-13 12:53 ` Toby Speight 2000-09-13 13:31 ` Kai Großjohann 1 sibling, 0 replies; 6+ messages in thread From: Toby Speight @ 2000-09-13 12:53 UTC (permalink / raw) 0> In article <iluhf7kqxut.fsf@barbar.josefsson.org>, 0> Simon Josefsson <URL:mailto:simon@josefsson.org> ("Simon") wrote: Simon> Toby Speight <streapadair@gmx.net> writes: >> ... if I tick an article and then undo it, it still appears as >> ticked. Though I haven't tried, I expect the same is true of other >> changes (ticked->dormant, perhaps?). Simon> No, only read-marks are undoable, other marks have never been Simon> undoable even in other backends. Ah. I didn't check this. Simon> Perhaps we should change this? Simon> Simon> It has some complications though. Should it be possible to Simon> undo a "Answered" flag? What would that mean? And if you undo Simon> a "dormant" flag, should you remove the article from the cache? Simon> What about "Saved" flags? "Downloadable" flags? "Bookmark" Simon> flags? "Expire" flags when using total/auto-expire? Simon> Simon> Perhaps we should only allow undo of tick flags. I think it would be nice (but not essential) to support as much as is meaningful ;-) The question of undoing cache entry for ticked/dormant (or, I guess, manually caching) is particularly tricky, given that it may be impossible to re-do (if the article has been expired in NNTP, or deleted from another client in IMAP). Undoing answers doesn't seem reasonable, given that there's no way to cancel mail messages - IMO the flag should reflect the state of the Real World. It does look like the undoability of flags and marks needs to be considered on a case-by-case basis :-(. As a start, I'd suggest all the marks in "Read Articles" and "Unread Articles" in the manual, and probably none of the ones in "Other Marks". Having nnimap consistent with the other backends is a Good Thing, of course, so I'm pleased with your patch :-). ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: gnus-undo-mode and nnimap 2000-09-13 12:29 ` Simon Josefsson 2000-09-13 12:53 ` Toby Speight @ 2000-09-13 13:31 ` Kai Großjohann 1 sibling, 0 replies; 6+ messages in thread From: Kai Großjohann @ 2000-09-13 13:31 UTC (permalink / raw) Cc: Toby Speight, ding On 13 Sep 2000, Simon Josefsson wrote: > It has some complications though. Should it be possible to undo a > "Answered" flag? What would that mean? And if you undo a "dormant" > flag, should you remove the article from the cache? What about > "Saved" flags? "Downloadable" flags? "Bookmark" flags? "Expire" > flags when using total/auto-expire? > > Perhaps we should only allow undo of tick flags. Note that the ticked and dormant marks have the same issue w.r.t. the cache. Hm. When gnus-use-cache is t and a message was entered into the cache because it was ticked or marked as dormant, then marking it as read does not immediately remove it from the cache. I'm not sure when it is removed from the cache, though. Maybe when the group is exited? I think as a first approach, the unread, read, and expirable flags should be taken into consideration for undoing. It does not make sense to undo an answered flag, and undoing a saved flag would mean deleting the file in question. Not what we want, I think. kai -- I like BOTH kinds of music. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2000-09-13 13:31 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2000-09-12 10:08 gnus-undo-mode and nnimap Toby Speight 2000-09-12 14:00 ` Simon Josefsson 2000-09-12 15:45 ` Toby Speight 2000-09-13 12:29 ` Simon Josefsson 2000-09-13 12:53 ` Toby Speight 2000-09-13 13:31 ` Kai Großjohann
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).