+2000-05-17 02:25:11 Shenghuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus-group.el (gnus-group-mark-line-p): New function.
+ (gnus-group-goto-group): New parameter.
+ (gnus-group-remove-mark): Use it.
+ * gnus-topic.el (gnus-topic-move-group): Ditto.
+ (gnus-topic-remove-group): Ditto.
+
+2000-05-17 00:49:09 Shenghuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus-group.el (gnus-group-list-dormant): New function.
+
+2000-05-16 23:20:42 Shenghuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus-agent.el (gnus-agent-synchronize): Use
+ nnheader-insert-file-contents.
+ (gnus-agent-save-active-1): Ditto.
+ (gnus-agent-write-active): Ditto.
+ (gnus-agent-expire): Ditto.
+ * gnus-cache.el (gnus-cache-read-active): Ditto.
+ * gnus-start.el (gnus-master-read-slave-newsrc): Ditto.
+ * gnus-sum.el (gnus-summary-import-article): Ditto.
+
+ * gnus-agent.el (gnus-agent-write-servers): Bind coding-system.
+ (gnus-agent-save-group-info): Ditto.
+ (gnus-agent-save-alist): Ditto.
+ * gnus-util.el (gnus-make-directory): Ditto.
+
+ * gnus-agent.el (gnus-agent-save-group-info): Disable multibyte.
+
2000-05-16 21:13:24 Shenghuo ZHU <zsh@cs.rochester.edu>
* mml.el (mml-generate-mime-preprocess-function): New variable.
(when (file-exists-p (gnus-agent-lib-file "flags"))
(set-buffer (get-buffer-create " *Gnus Agent flag synchronize*"))
(erase-buffer)
- (insert-file-contents (gnus-agent-lib-file "flags"))
+ (nnheader-insert-file-contents (gnus-agent-lib-file "flags"))
(if (null (gnus-check-server gnus-command-method))
(message "Couldn't open server %s" (nth 1 gnus-command-method))
(while (not (eobp))
(defun gnus-agent-write-servers ()
"Write the alist of covered servers."
(gnus-make-directory (nnheader-concat gnus-agent-directory "lib"))
- (with-temp-file (nnheader-concat gnus-agent-directory "lib/servers")
- (prin1 gnus-agent-covered-methods (current-buffer))))
+ (let ((coding-system-for-write nnheader-file-coding-system)
+ (output-coding-system nnheader-file-coding-system)
+ (file-name-coding-system nnmail-pathname-coding-system)
+ (pathname-coding-system nnmail-pathname-coding-system))
+ (with-temp-file (nnheader-concat gnus-agent-directory "lib/servers")
+ (prin1 gnus-agent-covered-methods (current-buffer)))))
;;;
;;; Summary commands
(defun gnus-agent-save-group-info (method group active)
(when (gnus-agent-method-p method)
(let* ((gnus-command-method method)
+ (coding-system-for-write nnheader-file-coding-system)
+ (output-coding-system nnheader-file-coding-system)
+ (file-name-coding-system nnmail-pathname-coding-system)
+ (pathname-coding-system nnmail-pathname-coding-system)
(file (gnus-agent-lib-file "active"))
oactive)
(gnus-make-directory (file-name-directory file))
(defun gnus-agent-save-alist (group &optional articles state dir)
"Save the article-state alist for GROUP."
- (with-temp-file (if dir
- (concat dir ".agentview")
- (gnus-agent-article-name ".agentview" group))
- (princ (setq gnus-agent-article-alist
- (nconc gnus-agent-article-alist
- (mapcar (lambda (article) (cons article state))
- articles)))
- (current-buffer))
- (insert "\n")))
+ (let ((file-name-coding-system nnmail-pathname-coding-system)
+ (pathname-coding-system nnmail-pathname-coding-system))
+ (with-temp-file (if dir
+ (concat dir ".agentview")
+ (gnus-agent-article-name ".agentview" group))
+ (princ (setq gnus-agent-article-alist
+ (nconc gnus-agent-article-alist
+ (mapcar (lambda (article) (cons article state))
+ articles)))
+ (current-buffer))
+ (insert "\n"))))
(defun gnus-agent-article-name (article group)
(concat (gnus-agent-directory) (gnus-agent-group-path group) "/"
"m" gnus-group-list-matching
"M" gnus-group-list-all-matching
"l" gnus-group-list-level
- "c" gnus-group-list-cached)
+ "c" gnus-group-list-cached
+ "?" gnus-group-list-dormant)
(gnus-define-keys (gnus-group-score-map "W" gnus-group-mode-map)
"f" gnus-score-flush-cache)
["List groups matching..." gnus-group-list-matching t]
["List all groups matching..." gnus-group-list-all-matching t]
["List active file" gnus-group-list-active t]
- ["List groups with cached" gnus-group-list-cached t])
+ ["List groups with cached" gnus-group-list-cached t]
+ ["List groups with dormant" gnus-group-list-dormant t])
("Sort"
["Default sort" gnus-group-sort-groups t]
["Sort by method" gnus-group-sort-groups-by-method t]
;; Group marking.
+(defun gnus-group-mark-line-p ()
+ (save-excursion
+ (beginning-of-line)
+ (forward-char (or (cdr (assq 'process gnus-group-mark-positions)) 2))
+ (eq (char-after) gnus-process-mark)))
+
(defun gnus-group-mark-group (n &optional unmark no-advance)
"Mark the current group."
(interactive "p")
(gnus-group-set-mark group))))
(gnus-group-position-point))
-(defun gnus-group-remove-mark (group)
+(defun gnus-group-remove-mark (group &optional test-marked)
"Remove the process mark from GROUP and move point there.
Return nil if the group isn't displayed."
- (if (gnus-group-goto-group group)
+ (if (gnus-group-goto-group group nil test-marked)
(save-excursion
(gnus-group-mark-group 1 'unmark t)
t)
(eval
`(defun gnus-group-iterate (arg ,function)
"Iterate FUNCTION over all process/prefixed groups.
-FUNCTION will be called with the group name as the paremeter
+FUNCTION will be called with the group name as the parameter
and with point over the group in question."
(let ((,groups (gnus-group-process-prefix arg))
(,window (selected-window))
;; Adjust cursor point.
(gnus-group-position-point))
-(defun gnus-group-goto-group (group &optional far)
+(defun gnus-group-goto-group (group &optional far test-marked)
"Goto to newsgroup GROUP.
-If FAR, it is likely that the group is not on the current line."
+If FAR, it is likely that the group is not on the current line.
+If TEST-MARKED, the line must be marked."
(when group
- (if far
- (gnus-goto-char
- (text-property-any
- (point-min) (point-max)
- 'gnus-group (gnus-intern-safe group gnus-active-hashtb)))
- (beginning-of-line)
- (cond
- ;; It's quite likely that we are on the right line, so
- ;; we check the current line first.
- ((eq (get-text-property (point) 'gnus-group)
- (gnus-intern-safe group gnus-active-hashtb))
- (point))
- ;; Previous and next line are also likely, so we check them as well.
- ((save-excursion
- (forward-line -1)
- (eq (get-text-property (point) 'gnus-group)
- (gnus-intern-safe group gnus-active-hashtb)))
- (forward-line -1)
- (point))
- ((save-excursion
- (forward-line 1)
- (eq (get-text-property (point) 'gnus-group)
- (gnus-intern-safe group gnus-active-hashtb)))
- (forward-line 1)
- (point))
- (t
- ;; Search through the entire buffer.
- (gnus-goto-char
- (text-property-any
- (point-min) (point-max)
- 'gnus-group (gnus-intern-safe group gnus-active-hashtb))))))))
+ (beginning-of-line)
+ (cond
+ ;; It's quite likely that we are on the right line, so
+ ;; we check the current line first.
+ ((and (not far)
+ (eq (get-text-property (point) 'gnus-group)
+ (gnus-intern-safe group gnus-active-hashtb))
+ (or (not test-marked) (gnus-group-mark-line-p)))
+ (point))
+ ;; Previous and next line are also likely, so we check them as well.
+ ((and (not far)
+ (save-excursion
+ (forward-line -1)
+ (and (eq (get-text-property (point) 'gnus-group)
+ (gnus-intern-safe group gnus-active-hashtb))
+ (or (not test-marked) (gnus-group-mark-line-p)))))
+ (forward-line -1)
+ (point))
+ ((and (not far)
+ (save-excursion
+ (forward-line 1)
+ (and (eq (get-text-property (point) 'gnus-group)
+ (gnus-intern-safe group gnus-active-hashtb))
+ (or (not test-marked) (gnus-group-mark-line-p)))))
+ (forward-line 1)
+ (point))
+ (test-marked
+ (goto-char (point-min))
+ (let (found)
+ (while (and (not found)
+ (gnus-goto-char
+ (text-property-any
+ (point) (point-max)
+ 'gnus-group
+ (gnus-intern-safe group gnus-active-hashtb))))
+ (if (gnus-group-mark-line-p)
+ (setq found t)
+ (forward-line 1)))
+ found))
+ (t
+ ;; Search through the entire buffer.
+ (gnus-goto-char
+ (text-property-any
+ (point-min) (point-max)
+ 'gnus-group (gnus-intern-safe group gnus-active-hashtb)))))))
(defun gnus-group-next-group (n &optional silent)
"Go to next N'th newsgroup.
(goto-char (point-min))
(gnus-group-position-point))
+(defun gnus-group-list-dormant (level &optional lowest)
+ "List all groups with dormant articles.
+If the prefix LEVEL is non-nil, it should be a number that says which
+level to cut off listing groups.
+If LOWEST, don't list groups with level lower than LOWEST.
+
+This command may read the active file."
+ (interactive "P")
+ (when level
+ (setq level (prefix-numeric-value level)))
+ (when (or (not level) (>= level gnus-level-zombie))
+ (gnus-cache-open))
+ (gnus-group-prepare-flat-predicate (or level gnus-level-subscribed)
+ #'(lambda (info)
+ (let ((marks (gnus-info-marks info)))
+ (assq 'dormant marks)))
+ lowest)
+ (goto-char (point-min))
+ (gnus-group-position-point))
+
(provide 'gnus-group)
;;; gnus-group.el ends here
(while slave-files
(erase-buffer)
(setq file (nth 1 (car slave-files)))
- (insert-file-contents file)
+ (nnheader-insert-file-contents file)
(when (condition-case ()
(progn
(eval-buffer (current-buffer))
(gnus-group-list-groups)
(gnus-topic-goto-topic topic))
+;; FIXME:
+;; 1. When the marked groups are overlapped with the process
+;; region, the behavior of move or remove is not right.
+;; 2. Can't process on several marked groups with a same name,
+;; because gnus-group-marked only keeps one copy.
+
(defun gnus-topic-move-group (n topic &optional copyp)
"Move the next N groups to TOPIC.
If COPYP, copy the groups instead."
(interactive
(list current-prefix-arg
(completing-read "Move to topic: " gnus-topic-alist nil t)))
- (let ((groups (gnus-group-process-prefix n))
+ (let ((use-marked (and (not n) (not (gnus-region-active-p))
+ gnus-group-marked t))
+ (groups (gnus-group-process-prefix n))
(topicl (assoc topic gnus-topic-alist))
(start-topic (gnus-group-topic-name))
(start-group (progn (forward-line 1) (gnus-group-group-name)))
(gnus-topic-move start-topic topic)
(mapcar
(lambda (g)
- (gnus-group-remove-mark g)
+ (gnus-group-remove-mark g use-marked)
(when (and
(setq entry (assoc (gnus-current-topic) gnus-topic-alist))
(not copyp))
(gnus-topic-goto-topic start-topic))
(gnus-group-list-groups))))
-(defun gnus-topic-remove-group (&optional arg)
+(defun gnus-topic-remove-group (&optional n)
"Remove the current group from the topic."
(interactive "P")
- (gnus-group-iterate arg
- (lambda (group)
- (let ((topicl (assoc (gnus-current-topic) gnus-topic-alist))
- (buffer-read-only nil))
- (when (and topicl group)
- (gnus-delete-line)
- (gnus-delete-first group topicl))
- (gnus-topic-update-topic)
- (gnus-group-position-point)))))
+ (let ((use-marked (and (not n) (not (gnus-region-active-p))
+ gnus-group-marked t))
+ (groups (gnus-group-process-prefix n)))
+ (mapcar
+ (lambda (group)
+ (gnus-group-remove-mark group use-marked)
+ (let ((topicl (assoc (gnus-current-topic) gnus-topic-alist))
+ (buffer-read-only nil))
+ (when (and topicl group)
+ (gnus-delete-line)
+ (gnus-delete-first group topicl))
+ (gnus-topic-update-topic)))
+ groups)
+ (gnus-topic-enter-dribble)
+ (gnus-group-position-point)))
(defun gnus-topic-copy-group (n topic)
"Copy the current group to a topic."
(defun gnus-make-directory (directory)
"Make DIRECTORY (and all its parents) if it doesn't exist."
- (when (and directory
- (not (file-exists-p directory)))
- (make-directory directory t))
+ (let ((file-name-coding-system nnmail-pathname-coding-system)
+ (pathname-coding-system nnmail-pathname-coding-system))
+ (when (and directory
+ (not (file-exists-p directory)))
+ (make-directory directory t)))
t)
(defun gnus-write-buffer (file)
+2000-05-17 00:50:29 Shenghuo ZHU <zsh@cs.rochester.edu>
+
+ * gnus.texi (Listing Groups): Addition.
+
2000-05-16 21:46:40 Shenghuo ZHU <zsh@cs.rochester.edu>
* gnus.texi (Misc Group Stuff): Addition.
\e$(B%-%c%C%7%e5-;v$r;}$D%0%k!<%W$rA4$FI=<($9$k\e(B
(@code{gnus-group-list-cached})\e$(B!#\e(B
+@item A ?
+@kindex A ? (Group)
+@findex gnus-group-list-dormant
+\e$(BJ]N15-;v$r;}$D%0%k!<%W$rA4$FI=<($9$k\e(B (@code{gnus-group-list-dormant})\e$(B!#\e(B
+
@end table
@vindex gnus-permanently-visible-groups
@findex gnus-group-list-cached
List all groups with cached articles (@code{gnus-group-list-cached}).
+@item A ?
+@kindex A ? (Group)
+@findex gnus-group-list-dormant
+List all groups with dormant articles (@code{gnus-group-list-dormant}).
+
@end table
@vindex gnus-permanently-visible-groups