emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 8497af6: * lisp/gnus/nnmh.el (nnmh-newsgroup-articles): Declare v


From: Stefan Monnier
Subject: master 8497af6: * lisp/gnus/nnmh.el (nnmh-newsgroup-articles): Declare var
Date: Thu, 11 Mar 2021 01:14:36 -0500 (EST)

branch: master
commit 8497af6892fcf9b08a1c120e897c9f5c21ea64fa
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * lisp/gnus/nnmh.el (nnmh-newsgroup-articles): Declare var
    
    Reported by Barry Fishman <barry@ecubist.org>.
    
    Along the way, I checked other variables which are similarly let-bound
    to nil and then read with any intervening assignment, which found
    another similar case of missing `defvar`s plus a bit of dead code.
    
    * lisp/gnus/gnus-kill.el (gnus-apply-kill-file-internal):
    Remove constant nil var `beg`.
    * lisp/gnus/gnus-search.el (gnus-search-query-parse-kv):
    Remove constant nil var `return`.
    * lisp/gnus/gnus-start.el (gnus-ask-server-for-new-groups):
    Remove constant nil var `group`.
    (gnus-killed-assoc, gnus-marked-assoc, gnus-newsrc-assoc): Declare vars.
    * lisp/gnus/gnus-sum.el (gnus-compute-read-articles):
    Remove constant nil var `first`.
    * lisp/gnus/nnbabyl.el (nnbabyl-request-accept-article):
    Remove constant nil var `beg`.
    * lisp/gnus/nnfolder.el (nnfolder-possibly-change-group):
    Remove constant nil var `inf`.
    * lisp/gnus/nnrss.el (nnrss-request-article):
    Remove constant nil var `err`.
---
 lisp/gnus/gnus-kill.el   |  4 ++--
 lisp/gnus/gnus-search.el |  4 ++--
 lisp/gnus/gnus-start.el  | 11 ++++++++---
 lisp/gnus/gnus-sum.el    |  4 ++--
 lisp/gnus/nnbabyl.el     |  4 ++--
 lisp/gnus/nnfolder.el    |  4 ++--
 lisp/gnus/nnmh.el        |  2 ++
 lisp/gnus/nnrss.el       |  5 ++---
 8 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/lisp/gnus/gnus-kill.el b/lisp/gnus/gnus-kill.el
index b0e6cb5..f73627a 100644
--- a/lisp/gnus/gnus-kill.el
+++ b/lisp/gnus/gnus-kill.el
@@ -337,7 +337,7 @@ Returns the number of articles marked as read."
                           (gnus-newsgroup-kill-file gnus-newsgroup-name)))
         (unreads (length gnus-newsgroup-unreads))
         (gnus-summary-inhibit-highlight t)
-        beg)
+        ) ;; beg
     (setq gnus-newsgroup-kill-headers nil)
     ;; If there are any previously scored articles, we remove these
     ;; from the `gnus-newsgroup-headers' list that the score functions
@@ -381,7 +381,7 @@ Returns the number of articles marked as read."
 
       (gnus-set-mode-line 'summary)
 
-      (if beg
+      (if nil ;; beg
          (let ((nunreads (- unreads (length gnus-newsgroup-unreads))))
            (or (eq nunreads 0)
                (gnus-message 6 "Marked %d articles as read" nunreads))
diff --git a/lisp/gnus/gnus-search.el b/lisp/gnus/gnus-search.el
index 339bff9..61a1d67 100644
--- a/lisp/gnus/gnus-search.el
+++ b/lisp/gnus/gnus-search.el
@@ -549,7 +549,7 @@ structure.
 
 In the simplest case, they are simply consed together.  String
 KEY is converted to a symbol."
-  (let (return)
+  (let () ;; return
     (cond
      ((member key gnus-search-date-keys)
       (when (string= "after" key)
@@ -559,7 +559,7 @@ KEY is converted to a symbol."
       (setq value (gnus-search-query-parse-mark value)))
      ((string= "message-id" key)
       (setq key "id")))
-    (or return
+    (or nil ;; return
        (cons (intern key) value))))
 
 (defun gnus-search-query-parse-date (value &optional rel-date)
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el
index a6b362e..44e97d5 100644
--- a/lisp/gnus/gnus-start.el
+++ b/lisp/gnus/gnus-start.el
@@ -1172,7 +1172,7 @@ for new groups, and subscribe the new groups as zombies."
                               gnus-check-new-newsgroups)
                          gnus-secondary-select-methods))))
         (groups 0)
-        group new-newsgroups got-new method hashtb
+        new-newsgroups got-new method hashtb ;; group
         gnus-override-subscribe-method)
     (unless gnus-killed-hashtb
       (gnus-make-hashtable-from-killed))
@@ -1203,14 +1203,14 @@ for new groups, and subscribe the new groups as 
zombies."
               (cond
                ((eq do-sub 'subscribe)
                 (cl-incf groups)
-                (puthash g-name group gnus-killed-hashtb)
+                (puthash g-name nil gnus-killed-hashtb) ;; group
                 (gnus-call-subscribe-functions
                  gnus-subscribe-options-newsgroup-method g-name))
                ((eq do-sub 'ignore)
                 nil)
                (t
                 (cl-incf groups)
-                (puthash g-name group gnus-killed-hashtb)
+                (puthash g-name nil gnus-killed-hashtb) ;; group
                 (if gnus-subscribe-hierarchical-interactive
                     (push g-name new-newsgroups)
                   (gnus-call-subscribe-functions
@@ -2378,6 +2378,11 @@ If FORCE is non-nil, the .newsrc file is read."
             (unless (gnus-yes-or-no-p (concat errmsg "; continue? "))
               (error "%s" errmsg)))))))))
 
+;; IIUC these 3 vars were used in older .newsrc files.
+(defvar gnus-killed-assoc)
+(defvar gnus-marked-assoc)
+(defvar gnus-newsrc-assoc)
+
 (defun gnus-read-newsrc-el-file (file)
   (let ((ding-file (concat file "d")))
     (when (file-exists-p ding-file)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index bf58cf4..97da550 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -6354,9 +6354,9 @@ The resulting hash table is returned, or nil if no Xrefs 
were found."
       ;; First peel off all invalid article numbers.
       (when active
        (let ((ids articles)
-             id first)
+             id) ;; first
          (while (setq id (pop ids))
-           (when (and first (> id (cdr active)))
+           (when nil ;; (and first (> id (cdr active)))
              ;; We'll end up in this situation in one particular
              ;; obscure situation.  If you re-scan a group and get
              ;; a new article that is cross-posted to a different
diff --git a/lisp/gnus/nnbabyl.el b/lisp/gnus/nnbabyl.el
index 3e6f9e8..5f486f4 100644
--- a/lisp/gnus/nnbabyl.el
+++ b/lisp/gnus/nnbabyl.el
@@ -323,7 +323,7 @@
   (nnbabyl-possibly-change-newsgroup group server)
   (nnmail-check-syntax)
   (let ((buf (current-buffer))
-       result beg)
+       result) ;; beg
     (and
      (nnmail-activate 'nnbabyl)
      (save-excursion
@@ -331,7 +331,7 @@
        (search-forward "\n\n" nil t)
        (forward-line -1)
        (save-excursion
-        (while (re-search-backward "^X-Gnus-Newsgroup: " beg t)
+        (while (re-search-backward "^X-Gnus-Newsgroup: " nil t) ;; beg
           (delete-region (point) (progn (forward-line 1) (point)))))
        (when nnmail-cache-accepted-message-ids
         (nnmail-cache-insert (nnmail-fetch-field "message-id")
diff --git a/lisp/gnus/nnfolder.el b/lisp/gnus/nnfolder.el
index 1dd784d..2de5b83 100644
--- a/lisp/gnus/nnfolder.el
+++ b/lisp/gnus/nnfolder.el
@@ -706,7 +706,7 @@ deleted.  Point is left where the deleted region was."
       (if dont-check
          (setq nnfolder-current-group group
                nnfolder-current-buffer nil)
-       (let (inf file)
+       (let (file) ;; inf
          ;; If we have to change groups, see if we don't already have
          ;; the folder in memory.  If we do, verify the modtime and
          ;; destroy the folder if needed so we can rescan it.
@@ -718,7 +718,7 @@ deleted.  Point is left where the deleted region was."
          ;; touched the file since last time.
          (when (and nnfolder-current-buffer
                     (not (gnus-buffer-live-p nnfolder-current-buffer)))
-           (setq nnfolder-buffer-alist (delq inf nnfolder-buffer-alist)
+           (setq nnfolder-buffer-alist (delq nil nnfolder-buffer-alist) ;; inf
                  nnfolder-current-buffer nil))
 
          (setq nnfolder-current-group group)
diff --git a/lisp/gnus/nnmh.el b/lisp/gnus/nnmh.el
index 231583f..0923b8e 100644
--- a/lisp/gnus/nnmh.el
+++ b/lisp/gnus/nnmh.el
@@ -503,6 +503,8 @@ as unread by Gnus.")
       (setcdr active (1+ (cdr active))))
     (cdr active)))
 
+(defvar nnmh-newsgroup-articles)
+
 (defun nnmh-update-gnus-unreads (group)
   ;; Go through the .nnmh-articles file and compare with the actual
   ;; articles in this folder.  The articles that are "new" will be
diff --git a/lisp/gnus/nnrss.el b/lisp/gnus/nnrss.el
index aa7c8e5..36b7af0 100644
--- a/lisp/gnus/nnrss.el
+++ b/lisp/gnus/nnrss.el
@@ -200,7 +200,7 @@ for decoding when the cdr that the data specify is not 
available.")
   (nnrss-possibly-change-group group server)
   (let ((e (assq article nnrss-group-data))
        (nntp-server-buffer (or buffer nntp-server-buffer))
-       err) ;; post
+       ) ;; err post
     (when e
       (with-current-buffer nntp-server-buffer
        (erase-buffer)
@@ -302,8 +302,7 @@ for decoding when the cdr that the data specify is not 
available.")
        (when nnrss-content-function
          (funcall nnrss-content-function e group article))))
     (cond
-     (err
-      (nnheader-report 'nnrss err))
+     ;; (err (nnheader-report 'nnrss err))
      ((not e)
       (nnheader-report 'nnrss "no such id: %d" article))
      (t



reply via email to

[Prev in Thread] Current Thread [Next in Thread]