Gnus development mailing list
 help / color / mirror / Atom feed
From: Eric Abrahamsen <eric@ericabrahamsen.net>
To: ding@gnus.org
Subject: Re: hard rescan broken?
Date: Thu, 14 Jan 2016 12:27:56 +0800	[thread overview]
Message-ID: <87si20lr8z.fsf@ericabrahamsen.net> (raw)
In-Reply-To: <12595.1452742046@allegro.localdomain>

[-- Attachment #1: Type: text/plain, Size: 923 bytes --]

Mike Kupfer <m.kupfer@acm.org> writes:

> In the *Group* buffer, the docstring for "g" says
>
>     If ARG is non-nil and not a number, this will force
>     "hard" re-reading of the active files from all servers.
>
> So IIUC,
>
>   C-u g
>
> should give me a hard rescan.  Instead I get an error with the following
> backtrace:
>
>   Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p (4))
>     <=(1 (4))
>     gnus-get-unread-articles((4) nil nil)
>     gnus-group-get-new-news((4))
>     funcall-interactively(gnus-group-get-new-news (4))
>     call-interactively(gnus-group-get-new-news nil nil)
>     command-execute(gnus-group-get-new-news)
>
> I see this with Emacs 24.5 and Emacs 25.  Am I confused or is this
> broken?
>
> thanks,
> mike

My vote is for "broken". Would you try out the attached patch? It will
avoid the error -- I also hope it will produce the correct behavior.

Thanks,
Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Honor-docstring-of-gnus-group-get-new-news.patch --]
[-- Type: text/x-diff, Size: 1325 bytes --]

From 7ef58efd161bbcc11df99ec7a4856a3f3bf84896 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Thu, 14 Jan 2016 12:25:21 +0800
Subject: [PATCH] Honor docstring of gnus-group-get-new-news

* lisp/gnus-start.el (gnus-get-unread-articles): If the prefix arg is t,
  but non-numeric, unconditionally consider all groups to need updating.
---
 lisp/gnus-start.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/gnus-start.el b/lisp/gnus-start.el
index f03ff85..f2e6978 100644
--- a/lisp/gnus-start.el
+++ b/lisp/gnus-start.el
@@ -1672,10 +1672,11 @@ backend check whether the group actually exists."
 	(push (setq method-group-list (list method method-type nil nil))
 	      type-cache))
       ;; Only add groups that need updating.
-      (if (funcall (if one-level #'= #'<=) (gnus-info-level info)
-	      (if (eq (cadr method-group-list) 'foreign)
-		  foreign-level
-		alevel))
+      (if (or (and foreign-level (null (numberp foreign-level)))
+	   (funcall (if one-level #'= #'<=) (gnus-info-level info)
+		    (if (eq (cadr method-group-list) 'foreign)
+			foreign-level
+		      alevel)))
 	  (setcar (nthcdr 2 method-group-list)
 		  (cons info (nth 2 method-group-list)))
 	;; The group is inactive, so we nix out the number of unread articles.
-- 
2.7.0


  reply	other threads:[~2016-01-14  4:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14  3:27 Mike Kupfer
2016-01-14  4:27 ` Eric Abrahamsen [this message]
2016-01-14 17:39   ` Mike Kupfer
2016-01-15  1:20     ` Eric Abrahamsen
2016-01-15 16:25       ` Eric Abrahamsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87si20lr8z.fsf@ericabrahamsen.net \
    --to=eric@ericabrahamsen.net \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).