GNU bug report logs - #31394
„gnus-newsgroup-headers” not reduced to limited to articles

Previous Next

Packages: emacs, gnus;

Reported by: Felix Dietrich <felix.dietrich <at> sperrhaken.name>

Date: Wed, 9 May 2018 21:29:01 UTC

Severity: minor

Tags: notabug

Found in version 5.13

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 31394 in the body.
You can then email your comments to 31394 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bugs <at> gnus.org:
bug#31394; Package gnus. (Wed, 09 May 2018 21:29:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Felix Dietrich <felix.dietrich <at> sperrhaken.name>:
New bug report received and forwarded. Copy sent to bugs <at> gnus.org. (Wed, 09 May 2018 21:29:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Felix Dietrich <felix.dietrich <at> sperrhaken.name>
To: submit <at> debbugs.gnu.org (The Gnus Bugfixing Girls + Boys)
Subject: „gnus-newsgroup-headers” not reduced to
 limited to articles
Date: Wed, 09 May 2018 23:22:27 +0200
[Message part 1 (text/plain, inline)]
Gnus v5.13
GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.28)
 of 2018-02-19, modified by Debian
--------------------

Hello,

I was dabbling around with creating a custom limiting function and came
upon „gnus-summary-limit-to-predicate”.  Upon using it I noticed that it
call the predicate not with only the current limited set of articles
shown in the summary buffer but with the superset of what I assume are
all the already fetched headers.  That is: „gnus-newsgroup-headers”
(used in the loop in „gnus-summary-limit-to-predicate”) does not get
reduced to contain only the articles in the current limited set like
„gnus-newsgroup-data” (used in other limiting functions).

  Comparing the length of „gnus-newsgroup-headers” and
  „gnus-newsgroup-data” before and after limiting was applied

    (length gnus-newsgroup-data)
    => 154
    (length gnus-newsgroup-headers)
    => 154

    (gnus-summary-limit-to-subject "gnus")

    (length gnus-newsgroup-data)
    => 75
    (length gnus-newsgroup-headers)
    => 154

That the predicate was called with articles from
„gnus-newsgroup-headers” not in „gnus-newsgroup-data” became an issue
when I tried to further limit an already limited set of articles: I was
selecting each article and the pseudo article test in
„gnus-summary-select-article” identified those article numbers not in
„gnus-newsgroup-data” as referring to pseudo articles which caused an
error – or when setting the PSEUDO parameter to „t” caused a warning
messages (e.g. „Can’t find article 9450”).

Should „gnus-newsgroup-headers” contain only the reduced set of article
headers similar to „gnus-newsgroup-data”?  Is
„gnus-summary-limit-to-predicate” working, without that reduction, as it
is supposed to, always passing the unlimited set of articles to the
predicate?

I have also attach my function with which I noticed the described
behaviour as an example.

[Message part 2 (text/plain, inline)]
(defun my/gnus-summary-limit-to-orig-date-diff ()
  "Limit summary articles by X-Original-Date to Date difference"
  (interactive)
  (gnus-summary-limit-to-predicate
   (lambda (header)
     (let ((original-date) (date) (age-in-days 5)
           ;; copied from `gnus-summary-limit-to-bodies' (Gnus v5.13)
           (gnus-select-article-hook nil)	;Disable hook.
           (gnus-article-prepare-hook nil)
           (gnus-use-article-prefetch nil)
           (gnus-keep-backlog nil)
           (gnus-break-pages nil)
           (gnus-summary-display-arrow nil)
           (gnus-updated-mode-lines nil)
           (gnus-auto-center-summary nil)
           (gnus-display-mime-function nil)
           (gnus-mark-article-hook)
           ;; end of copied from `gnus-summary-limit-to-bodies'
           )
       ;; not setting PSEUDO paramter to `t' causes error
       (gnus-summary-select-article t t t (mail-header-number header))
       (with-current-buffer gnus-article-buffer
         (article-narrow-to-head)
         (gnus-article-goto-header "X-Original-Date")
         (setq original-date (safe-date-to-time (buffer-substring
                                                 (point)
                                                 (point-at-eol)))
               date (safe-date-to-time (mail-header-date header)))
         (not (time-less-p (time-subtract date original-date)
                           (days-to-time age-in-days)))))
     ))
  )
[Message part 3 (text/plain, inline)]
--
Felix Dietrich

Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#31394; Package emacs,gnus. (Sat, 22 Jun 2019 13:47:02 GMT) Full text and rfc822 format available.

Message #8 received at 31394 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Felix Dietrich <felix.dietrich <at> sperrhaken.name>
Cc: 31394 <at> debbugs.gnu.org
Subject: Re: bug#31394: „gnus-newsgroup-headers”
 not reduced to limited to articles
Date: Sat, 22 Jun 2019 15:46:29 +0200
Felix Dietrich <felix.dietrich <at> sperrhaken.name> writes:

> Should „gnus-newsgroup-headers” contain only the reduced set of article
> headers similar to „gnus-newsgroup-data”?  Is
> „gnus-summary-limit-to-predicate” working, without that reduction, as it
> is supposed to, always passing the unlimited set of articles to the
> predicate?

I think it's by design, so that the predicate can either narrow or widen
the limit.  If you only want to narrow it, check whether the article is
in gnus-newsgroup-limit in the predicate and only return a subset of that.

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




Added tag(s) notabug. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 22 Jun 2019 13:47:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 31394 <at> debbugs.gnu.org and Felix Dietrich <felix.dietrich <at> sperrhaken.name> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Sat, 22 Jun 2019 13:47:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 21 Jul 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 274 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.