From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/84228 Path: news.gmane.org!not-for-mail From: Matt Ford Newsgroups: gmane.emacs.gnus.general Subject: Re: Marking ! in virtual groups Date: Mon, 17 Feb 2014 03:18:23 +0000 Organization: Dancingfrog Message-ID: <87k3cu2zr4.fsf@rss01.mhs.man.ac.uk> References: <87zjlt27eb.fsf@rss01.mhs.man.ac.uk> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1392607215 30211 80.91.229.3 (17 Feb 2014 03:20:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 17 Feb 2014 03:20:15 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M32478@lists.math.uh.edu Mon Feb 17 04:20:22 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WFEko-00010S-3p for ding-account@gmane.org; Mon, 17 Feb 2014 04:20:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1WFEjD-0005kd-95; Sun, 16 Feb 2014 21:18:43 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1WFEjB-0005kL-UF for ding@lists.math.uh.edu; Sun, 16 Feb 2014 21:18:41 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1WFEjA-0001bu-Et for ding@lists.math.uh.edu; Sun, 16 Feb 2014 21:18:41 -0600 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1WFEj7-00057Y-5O for ding@gnus.org; Mon, 17 Feb 2014 04:18:37 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1WFEj6-000718-G2 for ding@gnus.org; Mon, 17 Feb 2014 04:18:36 +0100 Original-Received: from rain.gmane.org ([80.91.229.7]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Feb 2014 04:18:36 +0100 Original-Received: from matt by rain.gmane.org with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 17 Feb 2014 04:18:36 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 78 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: rain.gmane.org Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAFVBMVEXHvb86JiddPDoWCQtk VVRvTEd2YV7TtTAGAAAB90lEQVQ4jXXUQa+bMAwA4Bw27g6l58WFd0+j3lteHvcxhXPowP//J8xO oKTSG1KrKh+OY2OqVL6oBzjF9Estar/IG90OHocSSFb53goAHNxl6QVK8R4AtXMAHwcsg8As685Z kSXnWrwf6Ede54t32yMYFt5/W4dW+QMeR4DW9+EAU7tNLOc/wPNBIR1LoKUX9LVFRAMu+emAh2tC GEcE0N1v0EMB0xqYEDtaQd9fUFvaYCKCUwFXCnJ1gYjMNxA4oJqhgGbNQBTVE78FUusbvHaK73Ar of0P/Dz9KmDLwaSqssDbioCdlDhRVdRxuQVuIoP0RBU5HueRu9rQaKCn6GMJGqAj/uZC6ID+zLvr jgLvRGqP8AJrajl3jG8PJewN4QAewRg3+Mq9ShAVPbH1Xsks+K2F1UopM38q5XfowhRXaXyehQxf XDTXxw94osjjUy1tBi9Fa8QwcohMyYI78HGlKSOfGRgqeoOJBJ4CMUPfjUYjJ+Ly57MmbXKOnieR +z4G4AGa7ScP8JSgdlpCgnSeZmecDUHgwkOOIxrdSZV/na5dM6oU4CSEsyeoLTg7KxnpBPL4Am3g pI5PgSvmNspWFqxrlMc6Q0rAzfqTIrQy+eW7ot7m/VI7hqva3laLJjVlIvmDKMAhVyiwuveIWkt3 sVvHDf4Bn+7uegzOHIsAAAAASUVORK5CYII= User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.2.50 (gnu/linux) Cancel-Lock: sha1:oB7pLpexftQVVquqPSpeop7qXGY= X-Spam-Score: -2.5 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:84228 Archived-At: 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