Gnus development mailing list
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Subject: Re: gnus-sync-save fails with "wrong-type-argument number-or-marker-p"
Date: Thu, 08 Dec 2011 09:50:09 -0500	[thread overview]
Message-ID: <87aa73p17i.fsf@lifelogs.com> (raw)
In-Reply-To: <87vcpt1jsq.fsf@dod.no>

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

On Tue, 06 Dec 2011 22:17:57 +0100 Steinar Bang <sb@dod.no> wrote: 

>>>>>> Steinar Bang <sb@dod.no>:
>> However, on the home desktop, doing `gnus-sync-read' wasn't enough to
>> fix the issue.  I still get the error message (or a similar one) on all
>> attempts to `gnus-sync-save'.

SB> On the home desktop (debian testing, GNU Emacs 23.3.1), I get the
SB> following message in the mini-buffer when trying to do `gnus-sync-save': 
SB>  Wrong type argument: number-or-marker-p, "8-54ce40d61d4b92eda3bffb29c6e0b1c6"

SB> The stack trace, is:
SB>   (lambda (entry) (gnus-sync-lesync-pre-save-group-entry (cadr gnus-sync-backend) entry (cons ... ftime)))(("nntp+nntp.dod.no:no.alt.motorsykler" 6 ((1 . 33536)) ((subscribe-all) (_deleted_conflicts "8-54ce40d61d4b92eda3bffb29c6e0b1c6") (subscribe-all nil)) (nntp "nntp.dod.no") ((charset . iso-8859-1))))
SB>   mapcar((lambda (entry) (gnus-sync-lesync-pre-save-group-entry (cadr gnus-sync-backend) entry (cons ... ftime))) (("nntp+nntp.dod.no:no.alt.motorsykler" 6 (...) (... ... ...) (nntp "nntp.dod.no") (...)) ("nntp+news.gmane.org:gmane.linux.drivers.bcm54xx.devel" 6 (...) (... ... ...) "nntp:news.gmane.org") ("nntp+news.gmane.org:gmane.discuss" 3 (...) (... ... ... ... ...) "nntp:news.gmane.org") ("nntp+news.gmane.org:gmane.comp.db.postgresql.german" 7 nil (... ...) "nntp:news.gmane.org")))
SB>   (let* ((ftime ...) (url ...) (entries ...) (sync ...)) (mapcar (lambda ... ...) sync))
SB>   (cond ((and ... ... ...) (when force ...) (let* ... ...)) ((stringp gnus-sync-backend) (gnus-message 7 "gnus-sync-save: saving to backend %s" gnus-sync-backend) (let ... ...)) (nil))
SB>   gnus-sync-save(nil)
SB>   call-interactively(gnus-sync-save t nil)
SB>   execute-extended-command(nil)
SB>   call-interactively(execute-extended-command nil nil)

I'm at a conference so I can't do the code fix properly, but I think if
you try the attached patch it will fix the issue.

The root of the problem is that CouchDB saw a conflict and inserted a
parameter telling you so, and gnus-sync.el thinks the parameter is a
mark.  It's not a big deal.  The patch skips any such unused (by
gnus-sync.el) parameters with a warning but I'll think about better
handling at the root of the problem, when your save conflicts with
another.

Ted


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sync-junk.patch --]
[-- Type: text/x-diff, Size: 1658 bytes --]

diff --git a/lisp/gnus-sync.el b/lisp/gnus-sync.el
index 612e586..765e759 100644
--- a/lisp/gnus-sync.el
+++ b/lisp/gnus-sync.el
@@ -105,7 +105,7 @@
   :version "24.1"
   :group 'gnus)
 
-(defcustom gnus-sync-newsrc-groups `("nntp" "nnrss")
+(defcustom gnus-sync-newsrc-groups '("nntp" "nnrss")
   "List of groups to be synchronized in the gnus-newsrc-alist.
 The group names are matched, they don't have to be fully
 qualified.  Typically you would choose all of these.  That's the
@@ -488,10 +488,18 @@ Updates `gnus-sync-lesync-props-hash'."
       ;; the read marks
       ,(cons 'read (gnus-sync-range2invlist (nth 2 nentry)))
       ;; the other marks
-      ,@(mapcar (lambda (mark-entry)
-                  (cons (car mark-entry)
-                        (gnus-sync-range2invlist (cdr mark-entry))))
-                (nth 3 nentry)))))
+      ,@(delq nil (mapcar (lambda (mark-entry)
+                            (if (listp (cdr mark-entry))
+                                (cons (car mark-entry)
+                                      (gnus-sync-range2invlist
+                                       (cdr mark-entry)))
+                              (progn    ; else this is not a list
+                                (gnus-message 9 "%s: non-list param %s in %s"
+                                              loc
+                                              (car mark-entry)
+                                              (nth 3 nentry))
+                                nil)))
+                          (nth 3 nentry))))))
 
 (defun gnus-sync-lesync-post-save-group-entry (url entry)
   (let* ((loc "gnus-sync-lesync-post-save-group-entry")

  reply	other threads:[~2011-12-08 14:50 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-23 19:55 Steinar Bang
2011-11-23 20:27 ` Steinar Bang
2011-12-06 21:17   ` Steinar Bang
2011-12-08 14:50     ` Ted Zlatanov [this message]
2011-12-08 19:07       ` Steinar Bang
2011-12-10  7:11         ` Steinar Bang
2011-12-10  7:29           ` Steinar Bang
2011-12-10  8:10             ` Backquotes and commas and ",@" (Was: gnus-sync-save fails with "wrong-type-argument number-or-marker-p") Steinar Bang
2011-12-10  9:04               ` Backquotes and commas and ",@" Andreas Schwab
2011-12-10  9:52                 ` Steinar Bang
2011-12-10 10:39               ` Ted Zlatanov
2011-12-10 11:07         ` gnus-sync-save fails with "wrong-type-argument number-or-marker-p" Ted Zlatanov
2011-12-10 14:19           ` Steinar Bang
2011-12-10 14:45             ` Steinar Bang
2011-12-10 14:49               ` Steinar Bang

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=87aa73p17i.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --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).