From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/88224 Path: news.gmane.org!.POSTED!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Fixed bug with custom marks in registry Date: Mon, 05 Nov 2018 22:01:15 -0800 Message-ID: <87sh0ewxqs.fsf@ericabrahamsen.net> References: <87efcw1gsn.fsf@ericabrahamsen.net> <87muqn6n60.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1541484008 17287 195.159.176.226 (6 Nov 2018 06:00:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 6 Nov 2018 06:00:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: ding@gnus.org Original-X-From: ding-owner+M36434@lists.math.uh.edu Tue Nov 06 07:00:04 2018 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJuPE-0004NN-KI for ding-account@gmane.org; Tue, 06 Nov 2018 07:00:04 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.90_1) (envelope-from ) id 1gJuQl-0007c6-3w; Tue, 06 Nov 2018 00:01:39 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1gJuQa-0007ZC-NL for ding@lists.math.uh.edu; Tue, 06 Nov 2018 00:01:29 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.90_1) (envelope-from ) id 1gJuQY-0002cz-O6 for ding@lists.math.uh.edu; Tue, 06 Nov 2018 00:01:28 -0600 Original-Received: from [195.159.176.226] (helo=blaine.gmane.org) by quimby.gnus.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gJuQX-0007IC-GW for ding@gnus.org; Tue, 06 Nov 2018 07:01:25 +0100 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gJuOP-0003MM-A4 for ding@gnus.org; Tue, 06 Nov 2018 06:59:13 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 80 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:l8lG9rUSzhRiZjzruYRwT4IX06o= X-Spam-Score: -1.1 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:88224 Archived-At: Michael Heerdegen writes: > Eric Abrahamsen writes: > >> Obviously not too many people were using this feature, or else we would >> have heard about it sooner, but there was a bug in the Gnus registry >> where entries with custom marks attached to them could still be pruned >> (deleted), even though they're not supposed to be. >> >> That's fixed now, and the fix will go into Emacs 26.2 and 27, so if >> you'd run into this before and decided not to use custom marks in the >> registry, watch for updates. > > I've a question about the setup. I want Gnus to always auto-show all > registry-marked articles in the summary (maybe we should have an option > for that?). From the docs I derived that something like this would do: > > #+begin_src emacs-lisp > (add-function > :around gnus-alter-articles-to-read-function > (defun my-gnus-auto-show-registry-marked (f group-name article-list) > (cl-union > (delq nil > (mapcar (lambda (id) (cdr (gnus-request-head id group-name))) > (cl-loop for key being the hash-keys of (oref gnus-registry-db data) > using (hash-values v) > when (cdr (assoc 'mark v)) > collect key))) > (funcall f group-name article-list)))) > #+end_src TBH I hadn't even looked into this part of the code before you brought it up last time, so I'm not really ahead of you in this game. I think in principle it would be nice to have a higher-level, more user-friendly way of adjusting this behavior. I could certainly imagine using an option that let me say "always display any message that has registry keys marked "precious"". > That works but has the side effect that when I add or remove a registry > mark - e.g. simply M M i or M M I, after that the article line in the > summary is duplicated - one line has the mark, the other doesn't. Apart > from that, the lines are identical. When I restart Gnus, I get one > article line again as expected. I tried this with a basic setup, and didn't see a problem -- the message lines were not duplicated as I added/removed marks. Do you have multiple functions added to `gnus-alter-articles-to-read-function' that might be interacting with each other? I actually tried this with gnus-mock, which I continue to think is helpful. If you want to try that and see if it helps track down the problem, first wait until gnus-mock updates to 0.2.1 (*ahem*), then install it, set `gnus-mock-emacs-program' to whatever emacs you want to use, set `gnus-mock-gnus-file' to a random file and then put this in the file: #+begin_src elisp (setq gnus-summary-line-format "%U%R%z%uM%I%(%[%4L: %-23,23f%]%) %s\n") (defalias 'gnus-user-format-function-M 'gnus-registry-article-marks-to-chars) (gnus-registry-initialize) (add-function :around gnus-alter-articles-to-read-function (defun my-gnus-auto-show-registry-marked (f group-name article-list) (cl-union (delq nil (mapcar (lambda (id) (cdr (gnus-request-head id group-name))) (cl-loop for key being the hash-keys of (oref gnus-registry-db data) using (hash-values v) when (cdr (assoc 'mark v)) collect key))) (funcall f group-name article-list)))) #+end_src That should get you as close to "gnus -Q" as you can get, and might provide a starting place for tracking down the weird behavior. Eric