Synch to No Gnus 200402140029.
authoryamaoka <yamaoka>
Sat, 14 Feb 2004 01:08:33 +0000 (01:08 +0000)
committeryamaoka <yamaoka>
Sat, 14 Feb 2004 01:08:33 +0000 (01:08 +0000)
lisp/ChangeLog
lisp/binhex.el
lisp/deuglify.el
lisp/gnus-agent.el
lisp/gnus-cite.el
lisp/gnus-cus.el
lisp/gnus-group.el
lisp/gnus-int.el
lisp/gnus-sum.el
lisp/html2text.el
lisp/nnrss.el

index b7b15d8..4beea1a 100644 (file)
@@ -1,3 +1,27 @@
+2004-02-14  Jesper Harder  <harder@ifa.au.dk>
+
+       * nnrss.el (nnrss-request-article, nnrss-find-el): Cleanup.
+
+       * html2text.el (html2text-get-attr, html2text-fix-paragraph): do
+
+       * gnus-sum.el (gnus-summary-limit-to-age)
+       (gnus-summary-limit-children): do.
+
+       * gnus-int.el (gnus-request-scan): do.
+
+       * gnus-group.el (gnus-group-suspend): do.
+
+       * gnus-cus.el (gnus-agent-cat-prepare-category-field): do.
+
+       * gnus-cite.el (gnus-cite-parse-attributions): do.
+
+       * gnus-agent.el (gnus-summary-set-agent-mark)
+       (gnus-agent-regenerate-group): do.
+
+       * deuglify.el (gnus-article-outlook-unwrap-lines): do.
+
+       * binhex.el (binhex-decode-region-internal): do.
+
 2004-02-12  Katsumi Yamaoka  <yamaoka@jpl.org>
 
        * gnus-fun.el (gnus-face-properties-alist): New user option.
index 7622881..d0a6c05 100644 (file)
@@ -243,14 +243,13 @@ If HEADER-ONLY is non-nil only decode header and return filename."
                    (setq file-name-length (char-after (point-min))
                          data-fork-start (+ (point-min)
                                             file-name-length 22))))
-             (if (and (null header)
-                      (with-current-buffer work-buffer
-                        (>= (buffer-size) data-fork-start)))
-                 (progn
-                   (binhex-verify-crc work-buffer
-                                      (point-min) data-fork-start)
-                   (setq header (binhex-header work-buffer))
-                   (if header-only (setq tmp nil counter 0))))
+             (when (and (null header)
+                        (with-current-buffer work-buffer
+                          (>= (buffer-size) data-fork-start)))
+               (binhex-verify-crc work-buffer
+                                  (point-min) data-fork-start)
+               (setq header (binhex-header work-buffer))
+               (when header-only (setq tmp nil counter 0)))
              (setq tmp (and tmp (not (eq inputpos end)))))
            (cond
             ((= counter 3)
index 42c7514..c8de403 100644 (file)
@@ -322,11 +322,10 @@ NODISPLAY is non-nil, don't redisplay the article buffer."
               nil t)
        (let ((len12 (- (match-end 2) (match-beginning 1)))
              (len3 (- (match-end 3) (match-beginning 3))))
-         (if (and (> len12 gnus-outlook-deuglify-unwrap-min)
-                  (< (+ len12 len3) gnus-outlook-deuglify-unwrap-max))
-             (progn
-               (replace-match "\\1\\2 \\3")
-               (goto-char (match-beginning 0))))))))
+         (when (and (> len12 gnus-outlook-deuglify-unwrap-min)
+                    (< (+ len12 len3) gnus-outlook-deuglify-unwrap-max))
+           (replace-match "\\1\\2 \\3")
+           (goto-char (match-beginning 0)))))))
   (unless nodisplay (gnus-outlook-display-article-buffer)))
 
 (defun gnus-outlook-rearrange-article (attr-start)
index 7301da6..ac595e8 100644 (file)
@@ -973,11 +973,9 @@ article's mark is toggled."
              (setq gnus-newsgroup-downloadable
                    (delq article gnus-newsgroup-downloadable))
              (gnus-article-mark article))
-         (progn
-           (setq gnus-newsgroup-downloadable
-                 (gnus-add-to-sorted-list gnus-newsgroup-downloadable article))
-           gnus-downloadable-mark)
-         )
+        (setq gnus-newsgroup-downloadable
+              (gnus-add-to-sorted-list gnus-newsgroup-downloadable article))
+        gnus-downloadable-mark)
        'unread))))
 
 (defun gnus-agent-get-undownloaded-list ()
@@ -3528,12 +3526,11 @@ If REREAD is not nil, downloaded articles are marked as unread."
  entries contained line that did not begin with an article number.  Deleted\
  line.")
                        (gnus-delete-line))))
-              (if load
-                  (progn
-                    (gnus-message 5 "gnus-agent-regenerate-group: Sorting NOV\
+              (when load
+               (gnus-message 5 "gnus-agent-regenerate-group: Sorting NOV\
  entries into ascending order.")
-                    (sort-numeric-fields 1 (point-min) (point-max))
-                    (setq nov-arts nil)))))
+               (sort-numeric-fields 1 (point-min) (point-max))
+               (setq nov-arts nil))))
           (gnus-agent-check-overview-buffer)
 
           ;; Construct a new article alist whose nodes match every header
index 8b13415..7de2998 100644 (file)
@@ -826,11 +826,10 @@ See also the documentation for `gnus-article-highlight-citation'."
        (let ((al (buffer-substring (save-excursion (beginning-of-line 0)
                                                    (1+ (point)))
                                    end)))
-         (if (not (assoc al al-alist))
-             (progn
-               (push (list wrote in prefix tag)
-                     gnus-cite-loose-attribution-alist)
-               (push (cons al t) al-alist))))))))
+         (when (not (assoc al al-alist))
+           (push (list wrote in prefix tag)
+                 gnus-cite-loose-attribution-alist)
+           (push (cons al t) al-alist)))))))
 
 (defun gnus-cite-connect-attributions ()
   ;; Connect attributions to citations
index 6298d75..c263d74 100644 (file)
@@ -930,11 +930,11 @@ articles in the thread.
 
        (if deflt
            (let ((tag (cdr (memq :tag type))))
-             (if (string-match "\n" deflt)
-                 (progn (while (progn (setq deflt (replace-match "\n " t t
-                                                                 deflt))
-                                      (string-match "\n" deflt (match-end 0))))
-                        (setq deflt (concat "\n" deflt))))
+             (when (string-match "\n" deflt)
+              (while (progn (setq deflt (replace-match "\n " t t
+                                                       deflt))
+                            (string-match "\n" deflt (match-end 0))))
+              (setq deflt (concat "\n" deflt)))
 
              (setcar tag (concat (car tag) deflt))))
 
index a62aba2..5fb04d8 100644 (file)
@@ -3957,10 +3957,8 @@ The hook `gnus-suspend-gnus-hook' is called before actually suspending."
   (let ((group-buf (get-buffer gnus-group-buffer)))
     (mapcar (lambda (buf)
              (unless (or (member buf (list group-buf gnus-dribble-buffer))
-                         (progn
-                           (save-excursion
-                             (set-buffer buf)
-                             (eq major-mode 'message-mode))))
+                         (with-current-buffer buf
+                           (eq major-mode 'message-mode)))
                (gnus-kill-buffer buf)))
            (gnus-buffers))
     (setq gnus-backlog-articles nil)
index 49c9ed6..8a2356a 100644 (file)
@@ -517,12 +517,11 @@ If GROUP is nil, all groups on GNUS-COMMAND-METHOD are scanned."
         (if group (gnus-find-method-for-group group) gnus-command-method))
        (gnus-inhibit-demon t)
        (mail-source-plugged gnus-plugged))
-    (if (or gnus-plugged (not (gnus-agent-method-p gnus-command-method)))
-       (progn
-         (setq gnus-internal-registry-spool-current-method gnus-command-method)
-         (funcall (gnus-get-function gnus-command-method 'request-scan)
-                  (and group (gnus-group-real-name group))
-                  (nth 1 gnus-command-method))))))
+    (when (or gnus-plugged (not (gnus-agent-method-p gnus-command-method)))
+      (setq gnus-internal-registry-spool-current-method gnus-command-method)
+      (funcall (gnus-get-function gnus-command-method 'request-scan)
+              (and group (gnus-group-real-name group))
+              (nth 1 gnus-command-method)))))
 
 (defsubst gnus-request-update-info (info gnus-command-method)
   "Request that GNUS-COMMAND-METHOD update INFO."
index 94abc68..4bcb038 100644 (file)
@@ -7594,10 +7594,9 @@ articles that are younger than AGE days."
        (if (numberp days)
           (progn
             (setq days-got t)
-            (if (< days 0)
-                (progn
-                  (setq younger (not younger))
-                  (setq days (* days -1)))))
+            (when (< days 0)
+              (setq younger (not younger))
+              (setq days (* days -1))))
         (message "Please enter a number.")
         (sleep-for 1)))
      (list days younger)))
@@ -8038,13 +8037,12 @@ fetch-old-headers verbiage, and so on."
            (and gnus-newsgroup-display
                 (not (funcall gnus-newsgroup-display)))
            ;; Check NoCeM things.
-           (if (and gnus-use-nocem
-                    (gnus-nocem-unwanted-article-p
-                     (mail-header-id (car thread))))
-               (progn
-                 (setq gnus-newsgroup-unreads
-                       (delq number gnus-newsgroup-unreads))
-                 t))))
+           (when (and gnus-use-nocem
+                      (gnus-nocem-unwanted-article-p
+                       (mail-header-id (car thread))))
+             (setq gnus-newsgroup-unreads
+                   (delq number gnus-newsgroup-unreads))
+             t)))
          ;; Nope, invisible article.
          0
        ;; Ok, this article is to be visible, so we add it to the limit
index 8822ea9..79c1008 100644 (file)
@@ -212,41 +212,26 @@ formatting, and then moved afterward.")
     (setq next (nth 2 tmp-list))
     (setq index 1)
 
-    (if (not (string-match "=" prev))
-       (progn
-         (if (not (string= (substring this 0 1) "="))
-             (setq attr-list (cons (list prev nil) attr-list))
-           )
-         )
-      )
+    (unless (string-match "=" prev)
+      (unless (string= (substring this 0 1) "=")
+       (setq attr-list (cons (list prev nil) attr-list))))
 
     (while (< index (1- (length tmp-list)))
       (if (not (string-match "=" this))
          (if (not (or (string= (substring next 0 1) "=")
                       (string= (substring prev -1) "=")))
-             (setq attr-list (cons (list this nil) attr-list))
-           )
-       )
+             (setq attr-list (cons (list this nil) attr-list))))
       (setq index (1+ index))
       (setq prev this)
       (setq this next)
-      (setq next (nth (1+ index) tmp-list))
-      )
+      (setq next (nth (1+ index) tmp-list)))
 
-    (if this
-       (progn
-         (if (not (string-match "=" this))
-             (progn
-               (if (not (string= (substring prev -1) "="))
-                   (setq attr-list (cons (list this nil) attr-list))
-                 )
-               )
-           )
-         )
-      )
-    attr-list ;; return - value
-    )
-  )
+    (when this
+      (unless (string-match "=" this)
+       (unless (string= (substring prev -1) "=")
+         (setq attr-list (cons (list this nil) attr-list)))))
+    attr-list)) ;; return - value
+    
 
 ;;
 ;; </Functions related to attributes>
@@ -391,38 +376,29 @@ formatting, and then moved afterward.")
   (let ((has-br-line)
        (refill-start)
        (refill-stop))
-    (if (re-search-forward "<br>$" p2 t)
-       (setq has-br-line t)
-      )
-    (if has-br-line
-       (progn
-         (goto-char p1)
-         (if (re-search-forward ".+[^<][^b][^r][^>]$" p2 t)
-             (progn
-               (beginning-of-line)
-               (setq refill-start (point))
-               (goto-char p2)
-               (re-search-backward ".+[^<][^b][^r][^>]$" refill-start t)
-               (next-line 1)
-               (end-of-line)
-               ;; refill-stop should ideally be adjusted to
-               ;; accomodate the "<br>" strings which are removed
-               ;; between refill-start and refill-stop.  Can simply
-               ;; be returned from my-replace-string
-               (setq refill-stop (+ (point)
-                                    (html2text-replace-string
-                                     "<br>" ""
-                                     refill-start (point))))
-               ;; (message "Point = %s  refill-stop = %s" (point) refill-stop)
-               ;; (sleep-for 4)
-               (fill-region refill-start refill-stop)
-               )
-           )
-         )
-      )
-    )
-  (html2text-replace-string "<br>" "" p1 p2)
-  )
+    (when (re-search-forward "<br>$" p2 t)
+      (setq has-br-line t))
+    (when has-br-line
+       (goto-char p1)
+       (when (re-search-forward ".+[^<][^b][^r][^>]$" p2 t)
+         (beginning-of-line)
+         (setq refill-start (point))
+         (goto-char p2)
+         (re-search-backward ".+[^<][^b][^r][^>]$" refill-start t)
+         (next-line 1)
+         (end-of-line)
+         ;; refill-stop should ideally be adjusted to
+         ;; accomodate the "<br>" strings which are removed
+         ;; between refill-start and refill-stop.  Can simply
+         ;; be returned from my-replace-string
+         (setq refill-stop (+ (point)
+                              (html2text-replace-string
+                               "<br>" ""
+                               refill-start (point))))
+         ;; (message "Point = %s  refill-stop = %s" (point) refill-stop)
+         ;; (sleep-for 4)
+         (fill-region refill-start refill-stop))))
+  (html2text-replace-string "<br>" "" p1 p2))
 
 ;;
 ;; This one is interactive ...
index 6735eda..5613481 100644 (file)
@@ -167,28 +167,28 @@ ARTICLE is the article number of the current headline.")
                          (nth 2 e))))
            (insert "\n\n--" boundary "\nContent-Type: text/plain\n\n")
            (let ((point (point)))
-             (if text
-                 (progn (insert text)
-                        (goto-char point)
-                        (while (re-search-forward "\n" nil t)
-                          (replace-match " "))
-                        (goto-char (point-max))
-                        (insert "\n\n")))
-             (if link
-                 (insert link)))
+             (when text
+               (insert text)
+               (goto-char point)
+               (while (re-search-forward "\n" nil t)
+                 (replace-match " "))
+               (goto-char (point-max))
+               (insert "\n\n"))
+             (when link
+               (insert link)))
            (insert "\n\n--" boundary "\nContent-Type: text/html\n\n")
            (let ((point (point)))
-             (if text
-                 (progn (insert "<html><head></head><body>\n" text "\n</body></html>")
-                        (goto-char point)
-                        (while (re-search-forward "\n" nil t)
-                          (replace-match " "))
-                        (goto-char (point-max))
-                        (insert "\n\n")))
-             (if link
-                 (insert "<p><a href=\"" link "\">link</a></p>\n"))))
-         (if nnrss-content-function
-             (funcall nnrss-content-function e group article)))))
+             (when text
+               (insert "<html><head></head><body>\n" text "\n</body></html>")
+               (goto-char point)
+               (while (re-search-forward "\n" nil t)
+                 (replace-match " "))
+               (goto-char (point-max))
+               (insert "\n\n"))
+             (when link
+               (insert "<p><a href=\"" link "\">link</a></p>\n"))))
+         (when nnrss-content-function
+           (funcall nnrss-content-function e group article)))))
     (cond
      (err
       (nnheader-report 'nnrss err))
@@ -524,22 +524,22 @@ It is useful when `(setq nnrss-use-local t)'."
 large documents!"
   (if (listp data)
       (mapcar (lambda (bit)
-               (if (car-safe bit)
-                   (progn (if (equal tag (car bit))
-                              (setq found-list
-                                    (append found-list
-                                            (list bit))))
-                          (if (and (listp (car-safe (caddr bit)))
-                                   (not (stringp (caddr bit))))
-                              (setq found-list
-                                    (append found-list
-                                            (nnrss-find-el
-                                             tag (caddr bit))))
-                            (setq found-list
-                                  (append found-list
-                                          (nnrss-find-el
-                                           tag (cddr bit))))))))
-               data))
+               (when (car-safe bit)
+                 (when (equal tag (car bit))
+                   (setq found-list
+                         (append found-list
+                                 (list bit))))
+                 (if (and (listp (car-safe (caddr bit)))
+                          (not (stringp (caddr bit))))
+                     (setq found-list
+                           (append found-list
+                                   (nnrss-find-el
+                                    tag (caddr bit))))
+                   (setq found-list
+                         (append found-list
+                                 (nnrss-find-el
+                                  tag (cddr bit)))))))
+             data))
   found-list)
 
 (defun nnrss-rsslink-p (el)