*** empty log message ***
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 5 Mar 1997 05:29:49 +0000 (05:29 +0000)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Wed, 5 Mar 1997 05:29:49 +0000 (05:29 +0000)
lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-group.el
lisp/gnus-topic.el
lisp/gnus.el
lisp/nnmh.el
lisp/nnweb.el

index 3a534d6..1ad251d 100644 (file)
@@ -1,3 +1,32 @@
+Tue Jan 28 22:11:36 1997  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
+
+       * gnus.el: Gnus v5.4.7 is released.
+
+Tue Jan 28 19:48:54 1997  Lars Magne Ingebrigtsen  <larsi@ifi.uio.no>
+
+       * nnmh.el (nnmh-deletable-article-p): Never allow deleting the
+       last article in the group.
+
+       * nnweb.el (nnweb-definition): Accept an optional noerror
+       argument. 
+       (nnweb-request-article): Don't bug out when requesting by MsgId. 
+
+       * gnus-topic.el (gnus-group-prepare-topics): Return the number of
+       unread articles in the buffer.
+
+       * gnus-group.el (gnus-group-list-groups): On empty buffers, let
+       point go to the beginning.
+       (gnus-group-list-groups): Give "No news" message when using
+       topics. 
+
+       * gnus-topic.el (gnus-topic-goto-next-group): Let point remain
+       at the end of the buffer.
+
+       * gnus-group.el (gnus-group-rename-group): Check group name
+       syntax. 
+
+       * gnus.el (gnus-read-group): Accept an optional default.
+
 Tue Jan 28 18:11:54 1997  Lars Magne Ingebrigtsen  <larsi@menja.ifi.uio.no>
 
        * gnus.el: Gnus v5.4.6 is released.
index 0e07b48..2053dae 100644 (file)
@@ -1676,6 +1676,7 @@ If variable `gnus-use-long-file-name' is non-nil, it is
     "\C-d" gnus-article-read-summary-keys
     "\M-*" gnus-article-read-summary-keys
     "\M-#" gnus-article-read-summary-keys
+    "\M-^" gnus-article-read-summary-keys
     "\M-g" gnus-article-read-summary-keys)
 
   (substitute-key-definition
index 5229797..e26482f 100644 (file)
@@ -834,42 +834,52 @@ listed."
     (setq level (car gnus-group-list-mode)
          unread (cdr gnus-group-list-mode)))
   (setq level (gnus-group-default-level level))
-  (gnus-group-setup-buffer)            ;May call from out of group buffer
+  (gnus-group-setup-buffer)
   (gnus-update-format-specifications nil 'group 'group-mode)
   (let ((case-fold-search nil)
        (props (text-properties-at (gnus-point-at-bol)))
-       (group (gnus-group-group-name)))
+       (empty (= (point-min) (point-max)))
+       (group (gnus-group-group-name))
+       number)
     (set-buffer gnus-group-buffer)
-    (funcall gnus-group-prepare-function level unread lowest)
-    (if (zerop (buffer-size))
-       (gnus-message 5 gnus-no-groups-message)
-      (goto-char (point-max))
-      (when (or (not gnus-group-goto-next-group-function)
-               (not (funcall gnus-group-goto-next-group-function 
-                             group props)))
-       (if (not group)
-           ;; Go to the first group with unread articles.
-           (gnus-group-search-forward t)
-         ;; Find the right group to put point on.  If the current group
-         ;; has disappeared in the new listing, try to find the next
-         ;; one.        If no next one can be found, just leave point at the
-         ;; first newsgroup in the buffer.
-         (when (not (gnus-goto-char
-                     (text-property-any
-                      (point-min) (point-max)
-                      'gnus-group (gnus-intern-safe
-                                   group gnus-active-hashtb))))
-           (let ((newsrc (cdddr (gnus-gethash group gnus-newsrc-hashtb))))
-             (while (and newsrc
-                         (not (gnus-goto-char
-                               (text-property-any
-                                (point-min) (point-max) 'gnus-group
-                                (gnus-intern-safe
-                                 (caar newsrc) gnus-active-hashtb)))))
-               (setq newsrc (cdr newsrc)))
-             (unless newsrc
-               (goto-char (point-max))
-               (forward-line -1))))))
+    (setq number (funcall gnus-group-prepare-function level unread lowest))
+    (when (or (and (numberp number)
+                  (zerop number))
+             (zerop (buffer-size)))
+      ;; No groups in the buffer.
+      (gnus-message 5 gnus-no-groups-message))
+    ;; We have some groups displayed.
+    (goto-char (point-max))
+    (when (or (not gnus-group-goto-next-group-function)
+             (not (funcall gnus-group-goto-next-group-function 
+                           group props)))
+      (cond
+       (empty
+       (goto-char (point-min)))
+       ((not group)
+       ;; Go to the first group with unread articles.
+       (gnus-group-search-forward t))
+       (t
+       ;; Find the right group to put point on.  If the current group
+       ;; has disappeared in the new listing, try to find the next
+       ;; one.  If no next one can be found, just leave point at the
+       ;; first newsgroup in the buffer.
+       (when (not (gnus-goto-char
+                   (text-property-any
+                    (point-min) (point-max)
+                    'gnus-group (gnus-intern-safe
+                                 group gnus-active-hashtb))))
+         (let ((newsrc (cdddr (gnus-gethash group gnus-newsrc-hashtb))))
+           (while (and newsrc
+                       (not (gnus-goto-char
+                             (text-property-any
+                              (point-min) (point-max) 'gnus-group
+                              (gnus-intern-safe
+                               (caar newsrc) gnus-active-hashtb)))))
+             (setq newsrc (cdr newsrc)))
+           (unless newsrc
+             (goto-char (point-max))
+             (forward-line -1))))))
       ;; Adjust cursor point.
       (gnus-group-position-point))))
 
@@ -933,7 +943,8 @@ If REGEXP, only list groups matching REGEXP."
 
     (gnus-group-set-mode-line)
     (setq gnus-group-list-mode (cons level all))
-    (run-hooks 'gnus-group-prepare-hook)))
+    (run-hooks 'gnus-group-prepare-hook)
+    t))
 
 (defun gnus-group-prepare-flat-list-dead (groups level mark regexp)
   ;; List zombies and killed lists somewhat faster, which was
@@ -1816,7 +1827,7 @@ and NEW-NAME will be prompted for."
       (unless (gnus-check-backend-function
               'request-rename-group (gnus-group-group-name))
        (error "This backend does not support renaming groups"))
-      (read-string "Rename group to: " (gnus-group-group-name)))))
+      (gnus-read-group "Rename group to: " (gnus-group-group-name)))))
 
   (unless (gnus-check-backend-function 'request-rename-group group)
     (error "This backend does not support renaming groups"))
index f8e941f..4f22227 100644 (file)
@@ -371,17 +371,18 @@ If LOWEST is non-nil, list all newsgroups of level LOWEST or higher."
        regexp))
 
     ;; Use topics.
-    (when (< lowest gnus-level-zombie)
-      (if list-topic
-         (let ((top (gnus-topic-find-topology list-topic)))
-           (gnus-topic-prepare-topic (cdr top) (car top)
-                                     (or topic-level level) all))
-       (gnus-topic-prepare-topic gnus-topic-topology 0
-                                 (or topic-level level) all))))
-
-  (gnus-group-set-mode-line)
-  (setq gnus-group-list-mode (cons level all))
-  (run-hooks 'gnus-group-prepare-hook))
+    (prog1
+       (when (< lowest gnus-level-zombie)
+         (if list-topic
+             (let ((top (gnus-topic-find-topology list-topic)))
+               (gnus-topic-prepare-topic (cdr top) (car top)
+                                         (or topic-level level) all))
+           (gnus-topic-prepare-topic gnus-topic-topology 0
+                                     (or topic-level level) all)))
+      
+      (gnus-group-set-mode-line)
+      (setq gnus-group-list-mode (cons level all))
+      (run-hooks 'gnus-group-prepare-hook))))
 
 (defun gnus-topic-prepare-topic (topicl level &optional list-level all silent)
   "Insert TOPIC into the group buffer.
@@ -743,8 +744,10 @@ articles in the topic and its subtopics."
 
 (defun gnus-topic-goto-next-group (group props)
   "Go to group or the next group after group."
-  (if (null group)
-      (gnus-topic-goto-topic (symbol-name (cadr (memq 'gnus-topic props))))
+  (if (not group)
+      (if (not (memq 'gnus-topic props))
+         (goto-char (point-max))
+       (gnus-topic-goto-topic (symbol-name (cadr (memq 'gnus-topic props)))))
     (if (gnus-group-goto-group group)
        t
       ;; The group is no longer visible.
@@ -761,9 +764,11 @@ articles in the topic and its subtopics."
                      (not (gnus-group-goto-group (car after))))
            (setq after (cdr after))))
        ;; Finally, just put point on the topic.
-       (unless after
-         (gnus-topic-goto-topic (car list))
-         (setq after nil))
+       (if (not (car list))
+           (goto-char (point-min))
+         (unless after
+           (gnus-topic-goto-topic (car list))
+           (setq after nil)))
        t))))
 
 ;;; Topic-active functions
index 304d05f..609074d 100644 (file)
   :link '(custom-manual "(gnus)Various Various")
   :group 'gnus)
 
-(defconst gnus-version-number "5.4.5"
+(defconst gnus-version-number "5.4.7" 
   "Version number for this version of Gnus.")
 
 (defconst gnus-version (format "Gnus v%s" gnus-version-number)
@@ -2384,7 +2384,7 @@ GROUP can either be a string (a group name) or a select method."
       (setq valids (cdr valids)))
     outs))
 
-(defun gnus-read-group (prompt)
+(defun gnus-read-group (prompt &optional default)
   "Prompt the user for a group name.
 Disallow illegal group names."
   (let ((prefix "")
@@ -2393,7 +2393,8 @@ Disallow illegal group names."
       (when (string-match
             "[: `'\"/]\\|^$"
             (setq group (read-string (concat prefix prompt)
-                                     "" 'gnus-group-history)))
+                                     (or default "")
+                                     'gnus-group-history)))
        (setq prefix (format "Illegal group name: \"%s\".  " group)
              group nil)))
     group))
index 7929392..a036da6 100644 (file)
 (defun nnmh-deletable-article-p (group article)
   "Say whether ARTICLE in GROUP can be deleted."
   (let ((path (concat nnmh-current-directory (int-to-string article))))
-    (when (file-writable-p path)
-      (or (not nnmail-keep-last-article)
-         (not (eq (cdr (nth 1 (assoc group nnmh-group-alist)))
-                  article))))))
+    ;; Writable.
+    (and (file-writable-p path) 
+        ;; We can never delete the last article in the group.
+        (not (eq (cdr (nth 1 (assoc group nnmh-group-alist)))
+                 article)))))
 
 (provide 'nnmh)
 
index 099399b..5c59494 100644 (file)
       (when (or (and url
                     (nnweb-fetch-url url))
                (and (stringp article)
+                    (nnweb-definition 'id t)
                     (let ((fetch (nnweb-definition 'id))
                           art)
                       (when (string-match "^<\\(.*\\)>$" article)
   "Read the active file."
   (load (nnheader-concat nnweb-directory "active") t t t))
           
-(defun nnweb-definition (type)
+(defun nnweb-definition (type &optional noerror)
   "Return the definition of TYPE."
   (let ((def (cdr (assq type (assq nnweb-type nnweb-type-definition)))))
-    (unless def
+    (when (and (not def)
+              (not noerror))
       (error "Undefined definition %s" type))
     def))