From 594b506aee83de29786723c8dd4216c08d47a1df Mon Sep 17 00:00:00 2001 From: tsuchiya Date: Sat, 5 Jan 2002 04:44:01 +0000 Subject: [PATCH] (nnshimbun-request-article): Handle the article properly when no group is specified. (nnshimbun-write-nov, nnshimbun-save-nov): Save nov databases only when their sizes are greater than zero. --- ChangeLog | 5 +++++ lisp/nnshimbun.el | 24 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09219c7..b0de648 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2002-01-05 TSUCHIYA Masatoshi + * lisp/nnshimbun.el (nnshimbun-request-article): Handle the + article properly when no group is specified. + (nnshimbun-write-nov, nnshimbun-save-nov): Save nov databases only + when their sizes are greater than zero. + * lisp/gnus-namazu.el (gnus-namazu-query-highlight): New option. (gnus-namazu-query-highlight-face): New face. (gnus-namazu/check-cache-group): New function. diff --git a/lisp/nnshimbun.el b/lisp/nnshimbun.el index aaa5a3f..a4c8400 100644 --- a/lisp/nnshimbun.el +++ b/lisp/nnshimbun.el @@ -389,7 +389,14 @@ GROUP has a full name." (deffoo nnshimbun-request-article (article &optional group server to-buffer) (when (nnshimbun-possibly-change-group group server) (when (stringp article) - (setq article (nnshimbun-search-id group article))) + (let ((num (when (or group (setq group nnshimbun-current-group)) + (nnshimbun-search-id group article)))) + (unless num + (let ((groups (shimbun-groups (shimbun-open server)))) + (while (and (not num) groups) + (setq group (pop groups) + num (nnshimbun-search-id group article))))) + (setq article num))) (if (integerp article) (nnshimbun-request-article-1 article group server to-buffer) (nnheader-report 'nnshimbun "Couldn't retrieve article: %s" @@ -637,19 +644,20 @@ also be nil." (when (buffer-live-p buffer) (save-excursion (set-buffer buffer) - (buffer-modified-p) - (nnmail-write-region 1 (point-max) nnshimbun-nov-buffer-file-name - nil 'nomesg))))) + (and (> (buffer-size) 0) + (buffer-modified-p) + (nnmail-write-region 1 (point-max) nnshimbun-nov-buffer-file-name + nil 'nomesg)))))) (defun nnshimbun-save-nov () (save-excursion (while nnshimbun-nov-buffer-alist (when (buffer-name (cdar nnshimbun-nov-buffer-alist)) (set-buffer (cdar nnshimbun-nov-buffer-alist)) - (when (buffer-modified-p) - (nnmail-write-region 1 (point-max) nnshimbun-nov-buffer-file-name - nil 'nomesg)) - (set-buffer-modified-p nil) + (and (> (buffer-size) 0) + (buffer-modified-p) + (nnmail-write-region 1 (point-max) nnshimbun-nov-buffer-file-name + nil 'nomesg)) (kill-buffer (current-buffer))) (setq nnshimbun-nov-buffer-alist (cdr nnshimbun-nov-buffer-alist))))) -- 1.7.10.4