From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/69914 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.gnus.general Subject: Re: overriding marks for synchronization Date: Fri, 13 Aug 2010 09:29:46 -0500 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <878w4aegbp.fsf@lifelogs.com> References: <87eie6fzr5.fsf@lifelogs.com> <87d3tpmft7.fsf@lifelogs.com> <87y6cbehau.fsf@lifelogs.com> <878w4afzez.fsf@lifelogs.com> <87zkwqej4u.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1281709837 15282 80.91.229.12 (13 Aug 2010 14:30:37 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 13 Aug 2010 14:30:37 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M18300@lists.math.uh.edu Fri Aug 13 16:30:36 2010 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OjvHD-0006xQ-GB for ding-account@gmane.org; Fri, 13 Aug 2010 16:30:31 +0200 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 1OjvGq-0004Oo-Tr; Fri, 13 Aug 2010 09:30:08 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1OjvGp-0004OZ-Gh for ding@lists.math.uh.edu; Fri, 13 Aug 2010 09:30:07 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.72) (envelope-from ) id 1OjvGn-00064g-St for ding@lists.math.uh.edu; Fri, 13 Aug 2010 09:30:06 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1OjvGn-00024N-00 for ; Fri, 13 Aug 2010 16:30:05 +0200 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1OjvGj-0006fL-Aj for ding@gnus.org; Fri, 13 Aug 2010 16:30:01 +0200 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Aug 2010 16:30:01 +0200 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Aug 2010 16:30:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 111 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6;d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:sV58ci2z9gxwZ7b6daLZELeBHsw= X-Spam-Score: -0.7 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:69914 Archived-At: On Fri, 13 Aug 2010 16:12:41 +0200 Steinar Bang wrote: >>>>>> Ted Zlatanov : >> Both changes were just comitted. Test and let me know. SB> Closer. Firstly I seem to need to do a SB> (require 'gnus-sync) SB> to actually load gnus-sync. Is that expected? (ie. did I miss it from SB> the documentatio?) Is it forgotten from the documentation? Or SB> shouldn't it be neccessary? It's necessary currently. I'm not sure if it should be always on (since it does nothing by default) or on request, that's why I didn't put it in the docs. What do you thikn? SB> When I do that it saves the file. But the file doesn't have any read SB> marks. SB> Here are the contents of the remote file saved over ssh: SB> ;; -*- mode:emacs-lisp; coding: emacs-mule; -*- SB> ;; Gnus sync data v. 0.0.1 SB> (setq gnus-newsrc-last-checked-date '"Fri, 13 Aug 2010 16:07:55 +0200") For me, there's quite a bit in between: (setq gnus-sync-newsrc-loader '( ... many lines omitted ...) That's where the marks are stored. You should see a message like "gnus-sync: stored variables %s and %d groups in %s" in your messages. It seems like gnus-sync-newsrc-loader is empty so that group count is probably 0. I think I see the problem; it didn't happen for me because gnus-sync-newsrc-loader was already populated. Try the following fixed function (nunion should be on loader; also I added a "skipping empty variable" comment): (defun gnus-sync-save () "Save the Gnus sync data to the backend." (interactive) (cond ((stringp gnus-sync-backend) (gnus-message 7 "gnus-sync: saving to backend %s" gnus-sync-backend) ;; populate gnus-sync-newsrc-loader from all but the first dummy ;; entry in gnus-newsrc-alist whose group matches any of the ;; gnus-sync-newsrc-groups (let* ((loader (loop for entry in (cdr gnus-newsrc-alist) when (gnus-grep-in-list (car entry) ;the group name gnus-sync-newsrc-groups) collect (cons (car entry) (mapcar (lambda (offset) (cons offset (nth offset entry))) gnus-sync-newsrc-offsets)))) (gnus-sync-newsrc-loader (nunion loader (set-difference gnus-sync-newsrc-loader loader :key 'car) :key 'car))) (with-temp-file gnus-sync-backend (progn (let ((coding-system-for-write gnus-ding-file-coding-system) (standard-output (current-buffer))) (princ (format ";; -*- mode:emacs-lisp; coding: %s; -*-\n" gnus-ding-file-coding-system)) (princ ";; Gnus sync data v. 0.0.1\n") (let* ((print-quoted t) (print-readably t) (print-escape-multibyte nil) (print-escape-nonascii t) (print-length nil) (print-level nil) (print-circle nil) (print-escape-newlines t) (variables (cons 'gnus-sync-newsrc-loader gnus-sync-global-vars)) variable) (while variables (if (and (boundp (setq variable (pop variables))) (symbol-value variable)) (progn (princ "\n(setq ") (princ (symbol-name variable)) (princ " '") (prin1 (symbol-value variable)) (princ ")\n")) (princ "\n;;; skipping empty variable ") (princ (symbol-name variable))))) (gnus-message 7 "gnus-sync: stored variables %s and %d groups in %s" gnus-sync-global-vars (length gnus-sync-newsrc-loader) gnus-sync-backend) ;; Idea from Dan Christensen ;; Save the .eld file with extra line breaks. (gnus-message 8 "gnus-sync: adding whitespace to %s" gnus-sync-backend) (save-excursion (goto-char (point-min)) (while (re-search-forward "^(\\|(\\\"" nil t) (replace-match "\n\\&" t)) (goto-char (point-min)) (while (re-search-forward " $" nil t) (replace-match "" t t)))))))) ;; the pass-through case: gnus-sync-backend is not a known choice (nil)))