(gnus-spam-mark): set to `$'
[gnus] / lisp / nnmaildir.el
index 977ea83..dff0443 100644 (file)
@@ -248,13 +248,14 @@ by nnmaildir-request-article.")
   (delete-directory dir))
 
 (defun nnmaildir--group-maxnum (server group)
-  (let ((x (nnmaildir--srvgrp-dir (nnmaildir--srv-dir server)
-                                 (nnmaildir--grp-name group))))
-    (setq x (nnmaildir--nndir x)
-         x (nnmaildir--num-dir x)
-         x (nnmaildir--num-file x)
-         x (file-attributes x))
-    (if x (1- (nth 1 x)) 0)))
+  (if (zerop (nnmaildir--grp-count group)) 0
+    (let ((x (nnmaildir--srvgrp-dir (nnmaildir--srv-dir server)
+                                   (nnmaildir--grp-name group))))
+      (setq x (nnmaildir--nndir x)
+           x (nnmaildir--num-dir x)
+           x (nnmaildir--num-file x)
+           x (file-attributes x))
+      (if x (1- (nth 1 x)) 0))))
 
 ;; Make the given server, if non-nil, be the current server.  Then make the
 ;; given group, if non-nil, be the current group of the current server.  Then
@@ -370,8 +371,7 @@ by nnmaildir-request-article.")
            (setq nov-mid 0))
          (goto-char (point-min))
          (delete-char 1)
-         (nnheader-fold-continuation-lines)
-         (setq nov (nnheader-parse-head 'naked)
+         (setq nov (nnheader-parse-naked-head)
                field (or (mail-header-lines nov) 0)))
        (unless (or (zerop field) (nnmaildir--param pgname 'distrust-Lines:))
          (setq nov-mid field))
@@ -462,7 +462,7 @@ by nnmaildir-request-article.")
          (setq nlist (cons (cons num article) nlist))
        (setq insert-nlist t
              nlist-cdr (cdr nlist))
-       (while (< num (caar nlist-cdr))
+       (while (and nlist-cdr (< num (caar nlist-cdr)))
          (setq nlist nlist-cdr
                nlist-cdr (cdr nlist))))
       (let ((inhibit-quit t))
@@ -924,16 +924,16 @@ by nnmaildir-request-article.")
 (defun nnmaildir-request-group (gname &optional server fast)
   (let ((group (nnmaildir--prepare server gname))
        deactivate-mark)
-    (nnmaildir--with-nntp-buffer
-      (erase-buffer)
-      (catch 'return
-       (unless group
-         (insert "411 no such news group\n")
-         (setf (nnmaildir--srv-error nnmaildir--cur-server)
-               (concat "No such group: " gname))
-         (throw 'return nil))
-       (setf (nnmaildir--srv-curgrp nnmaildir--cur-server) group)
-       (if fast (throw 'return t))
+    (catch 'return
+      (unless group
+       ;; (insert "411 no such news group\n")
+       (setf (nnmaildir--srv-error nnmaildir--cur-server)
+             (concat "No such group: " gname))
+       (throw 'return nil))
+      (setf (nnmaildir--srv-curgrp nnmaildir--cur-server) group)
+      (if fast (throw 'return t))
+      (nnmaildir--with-nntp-buffer
+       (erase-buffer)
        (insert "211 ")
        (princ (nnmaildir--grp-count group) nntp-server-buffer)
        (insert " ")