;;; gnus-group.el --- group mode commands for Gnus
;; Copyright (C) 1996,97,98 Free Software Foundation, Inc.
-;; Author: Lars Magne Ingebrigtsen <larsi@ifi.uio.no>
+;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news
;; This file is part of GNU Emacs.
(require 'gnus-undo)
(defcustom gnus-group-archive-directory
- "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/"
+ "*ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list/"
"*The address of the (ding) archives."
:group 'gnus-group-foreign
:type 'directory)
(defcustom gnus-group-recent-archive-directory
- "/ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list-recent/"
+ "*ftp@ftp.hpc.uh.edu:/pub/emacs/ding-list-recent/"
"*The address of the most recent (ding) articles."
:group 'gnus-group-foreign
:type 'directory)
:type 'string)
(defcustom gnus-group-mode-hook nil
- "*Hook for Gnus group mode."
+ "Hook for Gnus group mode."
:group 'gnus-group-various
:options '(gnus-topic-mode)
:type 'hook)
(defcustom gnus-group-menu-hook nil
- "*Hook run after the creation of the group mode menu."
+ "Hook run after the creation of the group mode menu."
:group 'gnus-group-various
:type 'hook)
(defcustom gnus-group-catchup-group-hook nil
- "*Hook run when catching up a group from the group buffer."
+ "Hook run when catching up a group from the group buffer."
:group 'gnus-group-various
:link '(custom-manual "(gnus)Group Data")
:type 'hook)
(defcustom gnus-group-update-group-hook nil
- "*Hook called when updating group lines."
+ "Hook called when updating group lines."
:group 'gnus-group-visual
:type 'hook)
:type 'function)
(defcustom gnus-group-prepare-hook nil
- "*Hook called after the group buffer has been generated.
+ "Hook called after the group buffer has been generated.
If you want to modify the group buffer, you can use this hook."
:group 'gnus-group-listing
:type 'hook)
(defcustom gnus-suspend-gnus-hook nil
- "*Hook called when suspending (not exiting) Gnus."
+ "Hook called when suspending (not exiting) Gnus."
:group 'gnus-exit
:type 'hook)
(defcustom gnus-exit-gnus-hook nil
- "*Hook called when exiting Gnus."
+ "Hook called when exiting Gnus."
:group 'gnus-exit
:type 'hook)
(defcustom gnus-after-exiting-gnus-hook nil
- "*Hook called after exiting Gnus."
+ "Hook called after exiting Gnus."
:group 'gnus-exit
:type 'hook)
(defcustom gnus-group-update-hook '(gnus-group-highlight-line)
- "*Hook called when a group line is changed.
+ "Hook called when a group line is changed.
The hook will not be called if `gnus-visual' is nil.
The default function `gnus-group-highlight-line' will
:type 'hook)
(defcustom gnus-useful-groups
- `(("(ding) mailing list mirrored at sunsite.auc.dk"
+ '(("(ding) mailing list mirrored at sunsite.auc.dk"
"emacs.ding"
(nntp "sunsite.auc.dk"
(nntp-address "sunsite.auc.dk")))
:type '(repeat (cons (sexp :tag "Form") face)))
(defcustom gnus-new-mail-mark ?%
- "*Mark used for groups with new mail."
+ "Mark used for groups with new mail."
:group 'gnus-group-visual
:type 'character)
(fboundp 'gnus-soup-pack-packet)]
["Pack packet" gnus-soup-pack-packet (fboundp 'gnus-soup-pack-packet)]
["Save areas" gnus-soup-save-areas (fboundp 'gnus-soup-pack-packet)]
- ["Brew SOUP" gnus-soup-brew-soup (fboundp 'gnus-soup-pack-packet)])
+ ["Brew SOUP" gnus-group-brew-soup (fboundp 'gnus-soup-pack-packet)])
["Send a bug report" gnus-bug t]
["Send a mail" gnus-group-mail t]
["Post an article..." gnus-group-post-news t]
["Read manual" gnus-info-find-node t]
["Flush score cache" gnus-score-flush-cache t]
["Toggle topics" gnus-topic-mode t]
+ ["Send a bug report" gnus-bug t]
["Exit from Gnus" gnus-group-exit t]
["Exit without saving" gnus-group-quit t]))
(defun gnus-update-group-mark-positions ()
(save-excursion
- (let ((gnus-process-mark 128)
+ (let ((gnus-process-mark ?\200)
(gnus-group-marked '("dummy.group"))
(gnus-active-hashtb (make-vector 10 0))
(topic ""))
(setq list (cdr list)))
(let ((face (cdar list)))
(unless (eq face (get-text-property beg 'face))
- (gnus-put-text-property
+ (gnus-put-text-property-excluding-characters-with-faces
beg end 'face
(setq face (if (boundp face) (symbol-value face) face)))
(gnus-extent-start-open beg)))
(defun gnus-group-group-name ()
"Get the name of the newsgroup on the current line."
(let ((group (get-text-property (gnus-point-at-bol) 'gnus-group)))
- (and group (symbol-name group))))
+ (when group
+ (symbol-name group))))
(defun gnus-group-group-level ()
"Get the level of the newsgroup on the current line."
(save-selected-window
(save-excursion
(funcall ,function ,group)))))))))
-
+
(put 'gnus-group-iterate 'lisp-indent-function 1)
;; Selecting groups.
-(defun gnus-group-read-group (&optional all no-article group)
+(defun gnus-group-read-group (&optional all no-article group select-articles)
"Read news in this newsgroup.
If the prefix argument ALL is non-nil, already read articles become
readable. IF ALL is a number, fetch this number of articles. If the
(cdr (assq 'tick marked)))
(gnus-range-length
(cdr (assq 'dormant marked)))))))
- no-article nil no-display)))
+ no-article nil no-display nil select-articles)))
(defun gnus-group-select-group (&optional all)
"Select this newsgroup.
gnus-summary-mode-hook gnus-select-group-hook
(group (gnus-group-group-name))
(method (gnus-find-method-for-group group)))
- (setq method
- `(,(car method) ,(concat (cadr method) "-ephemeral")
- (,(intern (format "%s-address" (car method))) ,(cadr method))
- ,@(cddr method)))
(gnus-group-read-ephemeral-group
(gnus-group-prefixed-name group method) method)))
;; Enter a group that is not in the group buffer. Non-nil is returned
;; if selection was successful.
(defun gnus-group-read-ephemeral-group (group method &optional activate
- quit-config request-only)
+ quit-config request-only
+ select-articles)
"Read GROUP from METHOD as an ephemeral group.
If ACTIVATE, request the group first.
If QUIT-CONFIG, use that window configuration when exiting from the
ephemeral group.
If REQUEST-ONLY, don't actually read the group; just request it.
+If SELECT-ARTICLES, only select those articles.
Return the name of the group is selection was successful."
;; Transform the select method into a unique server.
(when (stringp method)
(setq method (gnus-server-to-method method)))
- (let ((saddr (intern (format "%s-address" (car method)))))
- (setq method (gnus-copy-sequence method))
- (require (car method))
- (when (boundp saddr)
- (unless (assq saddr method)
- (nconc method `((,saddr ,(cadr method))))
- (setf (cadr method) (format "%s-%d" (cadr method)
- (incf gnus-ephemeral-group-server))))))
+ (setq method
+ `(,(car method) ,(concat (cadr method) "-ephemeral")
+ (,(intern (format "%s-address" (car method))) ,(cadr method))
+ ,@(cddr method)))
(let ((group (if (gnus-group-foreign-p group) group
(gnus-group-prefixed-name group method))))
(gnus-sethash
(if request-only
group
(condition-case ()
- (when (gnus-group-read-group t t group)
+ (when (gnus-group-read-group t t group select-articles)
group)
;;(error nil)
(quit nil)))))
(gnus-read-group "Group name: ")
(gnus-read-method "From method: ")))
+ (when (stringp method)
+ (setq method (gnus-server-to-method method)))
(let* ((meth (when (and method
(not (gnus-server-equal method gnus-select-method)))
(if address (list (intern method) address)
(gnus-set-active new-name (gnus-active group))
(gnus-message 6 "Renaming group %s to %s...done" group new-name)
new-name)
+ (setq gnus-killed-list (delete group gnus-killed-list))
+ (gnus-set-active group nil)
(gnus-dribble-touch)
(gnus-group-position-point)))
(delq (assoc group gnus-newsrc-alist)
gnus-newsrc-alist))
(when gnus-group-change-level-function
- (funcall gnus-group-change-level-function group gnus-level-killed 3))
+ (funcall gnus-group-change-level-function
+ group gnus-level-killed 3))
(cond
((setq entry (gnus-gethash group gnus-newsrc-hashtb))
(push (cons (car entry) (nth 2 entry))
(if (< (length out) 2) (car out) (nreverse out))))
(defun gnus-group-yank-group (&optional arg)
- "Yank the last newsgroups killed with \\[gnus-group-kill-group],
-inserting it before the current newsgroup. The numeric ARG specifies
-how many newsgroups are to be yanked. The name of the newsgroup yanked
-is returned, or (if several groups are yanked) a list of yanked groups
-is returned."
+ "Yank the last newsgroups killed with \\[gnus-group-kill-group], inserting it before the current newsgroup.
+The numeric ARG specifies how many newsgroups are to be yanked. The
+name of the newsgroup yanked is returned, or (if several groups are
+yanked) a list of yanked groups is returned."
(interactive "p")
(setq arg (or arg 1))
(let (info group prev out)
(while (and (not found)
(setq dir (pop dirs)))
(let ((name (gnus-group-real-name group)))
- (while (string-match "\\." name)
- (setq name (replace-match "/" t t name)))
(setq file (concat (file-name-as-directory dir) name)))
(if (not (file-exists-p file))
(gnus-message 1 "No such file: %s" file)
(lambda (group)
(and (symbol-name group)
(string-match regexp (symbol-name group))
+ (symbol-value group)
(push (symbol-name group) groups)))
gnus-active-hashtb)
;; Also go through all descriptions that are known to Gnus.
(defun gnus-group-find-new-groups (&optional arg)
"Search for new groups and add them.
Each new group will be treated with `gnus-subscribe-newsgroup-method.'
-If ARG (the prefix), use the `ask-server' method to query
-the server for new groups."
- (interactive "P")
- (gnus-find-new-newsgroups arg)
+With 1 C-u, use the `ask-server' method to query the server for new
+groups.
+With 2 C-u's, use most complete method possible to query the server
+for new groups, and subscribe the new groups as zombies."
+ (interactive "p")
+ (gnus-find-new-newsgroups (or arg 1))
(gnus-group-list-groups))
-
+
(defun gnus-group-edit-global-kill (&optional article group)
"Edit the global kill file.
If GROUP, edit that local kill file instead."
(if force
(if (null articles)
(setcar (nthcdr 3 info)
- (delq (assq type (car marked)) (car marked)))
+ (gnus-delete-alist type (car marked)))
(setcdr m (gnus-compress-sequence articles t)))
(setcdr m (gnus-compress-sequence
(sort (nconc (gnus-uncompress-range (cdr m))
(defsubst gnus-group-timestamp (group)
"Return the timestamp for GROUP."
- (gnus-group-get-parameter group 'timestamp))
+ (gnus-group-get-parameter group 'timestamp t))
(defun gnus-group-timestamp-delta (group)
"Return the offset in seconds from the timestamp for GROUP to the current time, as a floating point number."