From: yamaoka Date: Wed, 30 Jun 2004 21:54:45 +0000 (+0000) Subject: Synch to No Gnus 200406301819. X-Git-Tag: t-gnus-6_17_4-quimby-~832 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1cb7fcd2411803cc7df1aee1070c7a66818dba99;p=elisp%2Fgnus.git- Synch to No Gnus 200406301819. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a2aa049..75ccc01 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,14 @@ +2004-06-30 Teodor Zlatanov + + * gnus-registry.el (gnus-registry-trim): don't allow a negative + trim value + +2004-01-25 Paul Jarc + + * nnmaildir.el (nnmaildir--condcase, nnmaildir--enoent-p): + New macro and function. + (nnmaildir--new-number, nnmaildir-request-set-mark): Use them. + 2004-06-29 Katsumi Yamaoka * mm-util.el (mm-enrich-utf-8-by-mule-ucs): Fix cleaning of @@ -70,7 +81,7 @@ * message.el (message-idna-to-ascii-rhs-1): Don't choke on invalid addresses. -2004-06-21 Teodor Zlatanov +2004-06-21 Teodor Zlatanov * spam.el: section markers changed, TODO list revised (spam-backends): new master list of all installed backends diff --git a/lisp/gnus-registry.el b/lisp/gnus-registry.el index 5e8415f..712d88c 100644 --- a/lisp/gnus-registry.el +++ b/lisp/gnus-registry.el @@ -269,9 +269,11 @@ way." (if (null gnus-registry-max-entries) alist ; just return the alist ;; else, when given max-entries, trim the alist - (let ((timehash (make-hash-table + (let* ((timehash (make-hash-table :size 4096 - :test 'equal))) + :test 'equal)) + (trim-length (- (length alist) gnus-registry-max-entries)) + (trim-length (if (natnump trim-length) trim-length 0))) (maphash (lambda (key value) (puthash key (gnus-registry-fetch-extra key 'mtime) timehash)) @@ -280,7 +282,7 @@ way." ;; we use the return value of this setq, which is the trimmed alist (setq alist (nthcdr - (- (length alist) gnus-registry-max-entries) + trim-length (sort alist (lambda (a b) (time-less-p @@ -387,7 +389,7 @@ See the Info node `(gnus)Fancy Mail Splitting' for more details." sender) (maphash (lambda (key value) - (let ((this-sender (cdr + (let ((this-sender (cdr (gnus-registry-fetch-extra key 'sender)))) (when (and single-match this-sender diff --git a/lisp/nnmaildir.el b/lisp/nnmaildir.el index bd498a5..8de58fd 100644 --- a/lisp/nnmaildir.el +++ b/lisp/nnmaildir.el @@ -54,6 +54,7 @@ (put 'nnmaildir--with-work-buffer 'lisp-indent-function 0) (put 'nnmaildir--with-nov-buffer 'lisp-indent-function 0) (put 'nnmaildir--with-move-buffer 'lisp-indent-function 0) + (put 'nnmaildir--condcase 'lisp-indent-function 2) ) ] @@ -302,10 +303,19 @@ by nnmaildir-request-article.") (setq pos (match-end 0)))) string) +(defmacro nnmaildir--condcase (errsym body &rest handler) + `(condition-case ,errsym + (let ((system-messages-locale "C")) ,body) + (error . ,handler))) + (defun nnmaildir--emlink-p (err) (and (eq (car err) 'file-error) (string= (caddr err) "too many links"))) +(defun nnmaildir--enoent-p (err) + (and (eq (car err) 'file-error) + (string= (caddr err) "no such file or directory"))) + (defun nnmaildir--eexist-p (err) (eq (car err) 'file-already-exists)) @@ -336,21 +346,20 @@ by nnmaildir-request-article.") ;; and failed. (signal 'error `("Corrupt internal nnmaildir data" ,path-open))) (setq path-link (concat numdir (number-to-string number-link))) - (condition-case err + (nnmaildir--condcase err (progn (add-name-to-file path-open path-link) (throw 'return number-link)) - (error - (cond - ((nnmaildir--emlink-p err) - (setq make-new-file t - number-open number-link)) - ((nnmaildir--eexist-p err) - (let ((attr (file-attributes path-link))) - (if (/= (nth 10 attr) ino-open) - (setq number-open number-link - number-link 0)))) - (t (signal (car err) (cdr err)))))))))) + (cond + ((nnmaildir--emlink-p err) + (setq make-new-file t + number-open number-link)) + ((nnmaildir--eexist-p err) + (let ((attr (file-attributes path-link))) + (if (/= (nth 10 attr) ino-open) + (setq number-open number-link + number-link 0)))) + (t (signal (car err) (cdr err))))))))) (defun nnmaildir--update-nov (server group article) (let ((nnheader-file-coding-system 'binary) @@ -1379,15 +1388,13 @@ by nnmaildir-request-article.") nnmaildir--cur-server) "24-hour timer expired") (throw 'return nil)))) - (condition-case nil - (add-name-to-file nnmaildir--file tmpfile) + (condition-case nil (add-name-to-file nnmaildir--file tmpfile) (error (write-region (point-min) (point-max) tmpfile nil 'no-message nil 'excl) (unix-sync))) ;; no fsync :( (cancel-timer 24h) - (condition-case err - (add-name-to-file tmpfile curfile) + (condition-case err (add-name-to-file tmpfile curfile) (error (setf (nnmaildir--srv-error nnmaildir--cur-server) (concat "Error linking: " (prin1-to-string err))) @@ -1540,22 +1547,19 @@ by nnmaildir-request-article.") (setq mdir (nnmaildir--subdir marksdir (symbol-name mark)) permarkfile (concat mdir ":") mfile (concat mdir (nnmaildir--art-prefix article))) - (condition-case err - (add-name-to-file permarkfile mfile) - (error - (cond - ((nnmaildir--eexist-p err)) - ((and (eq (car err) 'file-error) - (string= (caddr err) "no such file or directory")) - (nnmaildir--mkdir mdir) - (nnmaildir--mkfile permarkfile) - (add-name-to-file permarkfile mfile)) - ((nnmaildir--emlink-p err) - (let ((permarkfilenew (concat permarkfile "{new}"))) - (nnmaildir--mkfile permarkfilenew) - (rename-file permarkfilenew permarkfile 'replace) - (add-name-to-file permarkfile mfile))) - (t (signal (car err) (cdr err))))))) + (nnmaildir--condcase err (add-name-to-file permarkfile mfile) + (cond + ((nnmaildir--eexist-p err)) + ((nnmaildir--enoent-p err) + (nnmaildir--mkdir mdir) + (nnmaildir--mkfile permarkfile) + (add-name-to-file permarkfile mfile)) + ((nnmaildir--emlink-p err) + (let ((permarkfilenew (concat permarkfile "{new}"))) + (nnmaildir--mkfile permarkfilenew) + (rename-file permarkfilenew permarkfile 'replace) + (add-name-to-file permarkfile mfile))) + (t (signal (car err) (cdr err)))))) todo-marks)) set-action (lambda (article) (funcall add-action)