From e09ede86ddf1c05e0b5acccd9a2660ef2b8d4c2c Mon Sep 17 00:00:00 2001 From: yamaoka Date: Thu, 17 Jan 2002 13:27:41 +0000 Subject: [PATCH] Synch with Oort Gnus. --- lisp/ChangeLog | 7 ++++++ lisp/gnus-agent.el | 68 +++++++++++++++++++++++++++++----------------------- lisp/gnus-art.el | 14 +++++------ texi/ChangeLog | 5 ++++ texi/gnus-ja.texi | 8 +++---- texi/gnus.texi | 6 ++--- 6 files changed, 64 insertions(+), 44 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d1d6510..0b78888 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,10 @@ +2002-01-17 ShengHuo ZHU + + * gnus-agent.el (gnus-agent-retrieve-headers): Use correct buffer. + (gnus-agent-braid-nov): Switch back to nntp-server-buffer. Remove + duplications. + (gnus-agent-batch): Bind gnus-agent-confirmation-function. + 2002-01-16 Lars Magne Ingebrigtsen * gnus-sum.el (gnus-summary-initial-limit): Inline diff --git a/lisp/gnus-agent.el b/lisp/gnus-agent.el index 98c9d0f..52a2bbe 100644 --- a/lisp/gnus-agent.el +++ b/lisp/gnus-agent.el @@ -1107,11 +1107,16 @@ the actual number of articles toggled is returned." (unless (eobp) (gnus-agent-copy-nov-line (car articles)) (setq articles (cdr articles)))) + (set-buffer nntp-server-buffer) (when articles (let (b e) (set-buffer gnus-agent-overview-buffer) (setq b (point) e (point-max)) + (while (and (not (eobp)) + (<= (read (current-buffer)) (car articles))) + (forward-line 1) + (setq b (point))) (set-buffer nntp-server-buffer) (insert-buffer-substring gnus-agent-overview-buffer b e))))) @@ -1809,8 +1814,9 @@ The following commands are available: (let ((init-file-user "") (gnus-always-read-dribble-file t)) (gnus)) - (gnus-group-send-queue) - (gnus-agent-fetch-session)) + (let ((gnus-agent-confirmation-function 'gnus-agent-batch-confirmation)) + (gnus-group-send-queue) + (gnus-agent-fetch-session))) (defun gnus-agent-retrieve-headers (articles group &optional fetch-old) (save-excursion @@ -1832,36 +1838,38 @@ The following commands are available: (push (read (current-buffer)) cached-articles)) (forward-line 1)) (setq cached-articles (sort cached-articles '<)))) - (when (setq uncached-articles - (gnus-set-difference articles cached-articles)) + (if (setq uncached-articles + (gnus-set-difference articles cached-articles)) + (progn + (set-buffer nntp-server-buffer) + (erase-buffer) + (let (gnus-agent-cache) + (unless (eq 'nov + (gnus-retrieve-headers + uncached-articles group fetch-old)) + (nnvirtual-convert-headers))) + (set-buffer gnus-agent-overview-buffer) + (erase-buffer) + (set-buffer nntp-server-buffer) + (copy-to-buffer gnus-agent-overview-buffer (point-min) (point-max)) + (when (and uncached-articles (file-exists-p file)) + (gnus-agent-braid-nov group uncached-articles file)) + (set-buffer nntp-server-buffer) + (write-region-as-coding-system gnus-agent-file-coding-system + (point-min) (point-max) + file nil 'silent) + (gnus-agent-load-alist group) + (gnus-agent-save-alist group uncached-articles nil) + (gnus-agent-open-history) + (setq gnus-agent-current-history (gnus-agent-history-buffer)) + (gnus-agent-enter-history + "last-header-fetched-for-session" + (list (cons group (nth (- (length articles) 1) articles))) + (time-to-days (current-time))) + (gnus-agent-save-history)) (set-buffer nntp-server-buffer) (erase-buffer) - (let (gnus-agent-cache) - (unless (eq 'nov - (gnus-retrieve-headers - uncached-articles group fetch-old)) - (nnvirtual-convert-headers))) - (set-buffer gnus-agent-overview-buffer) - (erase-buffer) - (set-buffer nntp-server-buffer) - (copy-to-buffer gnus-agent-overview-buffer (point-min) (point-max)) - (when (and uncached-articles (file-exists-p file)) - (gnus-agent-braid-nov group uncached-articles file)) - (write-region-as-coding-system gnus-agent-file-coding-system - (point-min) (point-max) - file nil 'silent) - (gnus-agent-load-alist group) - (gnus-agent-save-alist group uncached-articles nil) - (gnus-agent-open-history) - (setq gnus-agent-current-history (gnus-agent-history-buffer)) - (gnus-agent-enter-history - "last-header-fetched-for-session" - (list (cons group (nth (- (length articles) 1) articles))) - (time-to-days (current-time))) - (gnus-agent-save-history))) - (set-buffer nntp-server-buffer) - (erase-buffer) - (insert-buffer-substring gnus-agent-overview-buffer) + (insert-buffer-substring gnus-agent-overview-buffer))) (if (and fetch-old (not (numberp fetch-old))) t ; Don't remove anything. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index cef1e4a..b9877ae 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -316,23 +316,23 @@ directly.") (defcustom gnus-emphasis-alist (let ((format - "\\(\\s-\\|^\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\s-\\|[-,;:\"]\\s-\\|[?!.]+\\s-\\|\\s)\\)") + "\\(\\s-\\|^\\|\\=\\|[-\"]\\|\\s(\\)\\(%s\\(\\w+\\(\\s-+\\w+\\)*[.,]?\\)%s\\)\\(\\([-,.;:\"]\\|\\s)\\)+\\s-\\|[?!.]\\s-\\|\\s)\\|\\s-\\)") (types - '(("_" "_" underline) + '(("\\*" "\\*" bold) + ("_" "_" underline) ("/" "/" italic) - ("\\*" "\\*" bold) ("_/" "/_" underline-italic) ("_\\*" "\\*_" underline-bold) ("\\*/" "/\\*" bold-italic) ("_\\*/" "/\\*_" underline-bold-italic)))) - `(("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)" - 2 3 gnus-emphasis-underline) - ,@(mapcar + `(,@(mapcar (lambda (spec) (list (format format (car spec) (car (cdr spec))) 2 3 (intern (format "gnus-emphasis-%s" (nth 2 spec))))) - types))) + types) + ("\\(\\s-\\|^\\)\\(_\\(\\(\\w\\|_[^_]\\)+\\)_\\)\\(\\s-\\|[?!.,;]\\)" + 2 3 gnus-emphasis-underline))) "*Alist that says how to fontify certain phrases. Each item looks like this: diff --git a/texi/ChangeLog b/texi/ChangeLog index ad18e66..385986f 100644 --- a/texi/ChangeLog +++ b/texi/ChangeLog @@ -1,3 +1,8 @@ +2002-01-17 ShengHuo ZHU + + * gnus.texi (Agent Commands): Use gnus-agent-batch instead of + gnus-agent-batch-fetch. + 2002-01-15 Tue Jari Aalto * gnus.texi (Really Various Summary Commands): Added commands how diff --git a/texi/gnus-ja.texi b/texi/gnus-ja.texi index 14540d0..b5a7598 100644 --- a/texi/gnus-ja.texi +++ b/texi/gnus-ja.texi @@ -15863,12 +15863,12 @@ file * Server Agent Commands:: @end menu -完全な一括取得を行うには、コマンド行から以下のおまじないを -実行すればできます。 +完全にバッチで動作させるには、コマンド行から以下のおまじないを実行すれば +できます。 -@cindex gnus-agent-batch-fetch +@cindex gnus-agent-batch @example -$ emacs -batch -l ~/.gnus.el -f gnus-agent-batch-fetch +$ emacs -batch -l ~/.gnus.el -f gnus-agent-batch @end example @node Group Agent Commands diff --git a/texi/gnus.texi b/texi/gnus.texi index 103c44d..fff2dbd 100644 --- a/texi/gnus.texi +++ b/texi/gnus.texi @@ -16236,12 +16236,12 @@ toggles the plugged/unplugged state of the Gnus Agent. * Server Agent Commands:: @end menu -You can run a complete batch fetch from the command line with the +You can run a complete batch command from the command line with the following incantation: -@cindex gnus-agent-batch-fetch +@cindex gnus-agent-batch @example -$ emacs -batch -l ~/.gnus.el -f gnus-agent-batch-fetch +$ emacs -batch -l ~/.gnus.el -f gnus-agent-batch @end example -- 1.7.10.4