+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.
"\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
(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))))
(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
(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"))
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.
(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.
(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
: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)
(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 "")
(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))
(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)
(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))