Xref: utzoo gnu.emacs.gnus:253 comp.emacs:6341 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bob From: bob@tut.cis.ohio-state.edu (Bob Sutterfield) Newsgroups: gnu.emacs.gnus,comp.emacs Subject: GNUS 3.12 (05 of 10) Message-ID: Date: 26 Jun 89 13:20:50 GMT Sender: bob@tut.cis.ohio-state.edu Reply-To: Bob Sutterfield Followup-To: gnu.emacs.gnus Organization: The Ohio State University Dept of Computer & Information Science Lines: 1427 #!/bin/sh # this is part 5 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # file gnus.el continued # CurArch=5 if test ! -r s2_seq_.tmp then echo "Please unpack part 1 first!" exit 1; fi ( read Scheck if test "$Scheck" != $CurArch then echo "Please unpack part $Scheck next!" exit 1; else exit 0; fi ) < s2_seq_.tmp || exit 1 sed 's/^X//' << 'SHAR_EOF' >> gnus.el X "Select newsgroup GROUP. XIf optional argument SHOW-ALL is non-nil, all of articles in the group Xare selected." X (if (gnus-request-group group) X (let ((articles nil)) X (setq gnus-newsgroup-name group) X (setq gnus-newsgroup-unreads X (gnus-uncompress-sequence X (nthcdr 2 (gnus-gethash group gnus-unread-hashtb)))) X (cond (show-all X ;; Select all active articles. X (setq articles X (gnus-uncompress-sequence X (nthcdr 2 (gnus-gethash group gnus-active-hashtb))))) X (t X ;; Select unread articles only. X (setq articles gnus-newsgroup-unreads))) X ;; Require confirmation if selecting large newsgroup. X (setq gnus-newsgroup-unselected nil) X (if (not (numberp gnus-large-newsgroup)) X nil X (let ((selected nil) X (number (length articles))) X (if (> number gnus-large-newsgroup) X (progn X (condition-case () X (let ((input X (read-string X (format X "How many articles from %s (default %d): " X gnus-newsgroup-name number)))) X (setq selected X (if (string-equal input "") X number (string-to-int input)))) X (quit X (setq selected 0))) X (cond ((and (> selected 0) X (< selected number)) X ;; Select last N articles. X (setq articles (nthcdr (- number selected) articles))) X ((and (< selected 0) X (< (- 0 selected) number)) X ;; Select first N articles. X (setq selected (- 0 selected)) X (setq articles (copy-sequence articles)) X (setcdr (nthcdr (1- selected) articles) nil)) X ((zerop selected) X (setq articles nil)) X ;; Otherwise select all. X ) X ;; Get unselected unread articles. X (setq gnus-newsgroup-unselected X (gnus-set-difference gnus-newsgroup-unreads articles)) X )) X )) X ;; Get headers list. X (setq gnus-newsgroup-headers (gnus-retrieve-headers articles)) X ;; UNREADS may contain expired articles, so we have to remove X ;; them from the list. X (setq gnus-newsgroup-unreads X (gnus-intersection gnus-newsgroup-unreads X (mapcar X (function X (lambda (header) X (nntp-header-number header))) X gnus-newsgroup-headers))) X ;; Marked article must be a subset of unread articles. X (setq gnus-newsgroup-marked X (gnus-intersection (append gnus-newsgroup-unselected X gnus-newsgroup-unreads) X (cdr (assoc group gnus-marked-assoc)))) X ;; First and last article in this newsgroup. X (setq gnus-newsgroup-begin X (if gnus-newsgroup-headers X (nntp-header-number (car gnus-newsgroup-headers)) X 0 X )) X (setq gnus-newsgroup-end X (if gnus-newsgroup-headers X (nntp-header-number X (gnus-last-element gnus-newsgroup-headers)) X 0 X )) X ;; File name that an article was saved last. X (setq gnus-newsgroup-last-rmail nil) X (setq gnus-newsgroup-last-mail nil) X (setq gnus-newsgroup-last-folder nil) X (setq gnus-newsgroup-last-file nil) X ;; Reset article pointer etc. X (setq gnus-current-article nil) X (setq gnus-current-headers nil) X (setq gnus-current-history nil) X (setq gnus-have-all-headers nil) X (setq gnus-last-article nil) X ;; GROUP is successfully selected. X t X ) X )) X X(defun gnus-mark-article-as-read (article) X "Remember that ARTICLE is marked as read." X ;; Remove from unread and marked list. X (setq gnus-newsgroup-unreads X (delq article gnus-newsgroup-unreads)) X (setq gnus-newsgroup-marked X (delq article gnus-newsgroup-marked))) X X(defun gnus-mark-article-as-unread (article &optional clear-mark) X "Remember that ARTICLE is marked as unread. XOptional argument CLEAR-MARK means ARTICLE should not be remembered Xthat it was marked as read once." X ;; Add to unread list. X (or (memq article gnus-newsgroup-unreads) X (setq gnus-newsgroup-unreads X (cons article gnus-newsgroup-unreads))) X ;; If CLEAR-MARK is non-nil, the article must be removed from marked X ;; list. Otherwise, it must be added to the list. X (if clear-mark X (setq gnus-newsgroup-marked X (delq article gnus-newsgroup-marked)) X (or (memq article gnus-newsgroup-marked) X (setq gnus-newsgroup-marked X (cons article gnus-newsgroup-marked))))) X X(defun gnus-clear-system () X "Clear all variables and buffer." X ;; Clear GNUS variables. X (let ((variables gnus-variable-list)) X (while variables X (set (car variables) nil) X (setq variables (cdr variables)))) X ;; Clear other internal variables. X (setq gnus-active-hashtb nil) X (setq gnus-unread-hashtb nil) X ;; Kill the startup file. X (and gnus-current-startup-file X (get-file-buffer gnus-current-startup-file) X (kill-buffer (get-file-buffer gnus-current-startup-file))) X (setq gnus-current-startup-file nil) X ;; Kill GNUS buffers. X (let ((buffers gnus-buffer-list)) X (while buffers X (if (get-buffer (car buffers)) X (kill-buffer (car buffers))) X (setq buffers (cdr buffers)) X )) X ) X X(defun gnus-configure-windows (action) X "Configure GNUS windows according to the next ACTION. XThe ACTION is one of `SelectNewsgroup', `SelectArticle', `ExitNewsgroup', Xand `ExpandSubject'. XWindow configuration is specified by the variable gnus-window-configuration." X (let* ((windows (car (cdr (assq action gnus-window-configuration)))) X (grpwin (get-buffer-window gnus-Group-buffer)) X (subwin (get-buffer-window gnus-Subject-buffer)) X (artwin (get-buffer-window gnus-Article-buffer)) X (winsum nil) X (height nil) X (grpheight 0) X (subheight 0) X (artheight 0)) X (if (or (null windows) ;No configuration is specified. X (and (eq (null grpwin) X (zerop (nth 0 windows))) X (eq (null subwin) X (zerop (nth 1 windows))) X (eq (null artwin) X (zerop (nth 2 windows))))) X ;; No need to change window configuration. X nil X (select-window (or grpwin subwin artwin (selected-window))) X ;; First of all, compute the height of each window. X (cond (gnus-use-full-window X ;; Take up the entire screen. X (delete-other-windows) X (setq height (window-height (selected-window)))) X (t X (setq height (+ (if grpwin (window-height grpwin) 0) X (if subwin (window-height subwin) 0) X (if artwin (window-height artwin) 0))))) X ;; The Newsgroup buffer exits always. So, use it to extend the X ;; Group window so as to get enough window space. X (switch-to-buffer gnus-Group-buffer) X (and (get-buffer gnus-Subject-buffer) X (delete-windows-on gnus-Subject-buffer)) X (and (get-buffer gnus-Article-buffer) X (delete-windows-on gnus-Article-buffer)) X ;; Compute expected window height. X (setq winsum (apply (function +) windows)) X (if (not (zerop (nth 0 windows))) X (setq grpheight (max window-min-height X (/ (* height (nth 0 windows)) winsum)))) X (if (not (zerop (nth 1 windows))) X (setq subheight (max window-min-height X (/ (* height (nth 1 windows)) winsum)))) X (if (not (zerop (nth 2 windows))) X (setq artheight (max window-min-height X (/ (* height (nth 2 windows)) winsum)))) X (setq height (+ grpheight subheight artheight)) X (enlarge-window (max 0 (- height (window-height (selected-window))))) X ;; Then split the window. X (and (not (zerop artheight)) X (or (not (zerop grpheight)) X (not (zerop subheight))) X (split-window-vertically (+ grpheight subheight))) X (and (not (zerop grpheight)) X (not (zerop subheight)) X (split-window-vertically grpheight)) X ;; Then select buffers in each window. X (and (not (zerop grpheight)) X (progn X (switch-to-buffer gnus-Group-buffer) X (other-window 1))) X (and (not (zerop subheight)) X (progn X ;; We have to prepare Article buffer first to prevent X ;; displaying subject buffer twice. X ;; Suggested by Juha Heinanen X ;;(or (zerop artheight) X ;; (gnus-Article-setup-buffer)) X (switch-to-buffer gnus-Subject-buffer) X (other-window 1))) X (and (not (zerop artheight)) X (progn X (gnus-Article-setup-buffer) X (switch-to-buffer gnus-Article-buffer))) X ) X )) X X(defun gnus-find-header-by-number (headers number) X "Return a header which is a element of HEADERS and has NUMBER." X (let ((found nil)) X (while (and headers (not found)) X ;; We cannot use `=' to accept non-numeric NUMBER. X (if (eq number (nntp-header-number (car headers))) X (setq found (car headers))) X (setq headers (cdr headers))) X found X )) X X(defun gnus-version () X "Version numbers of this version of GNUS." X (interactive) X (cond ((and (boundp 'mhspool-version) (boundp 'nnspool-version)) X (message "%s; %s; %s; %s" X gnus-version nntp-version nnspool-version mhspool-version)) X ((boundp 'mhspool-version) X (message "%s; %s; %s" X gnus-version nntp-version mhspool-version)) X ((boundp 'nnspool-version) X (message "%s; %s; %s" X gnus-version nntp-version nnspool-version)) X (t X (message "%s; %s" gnus-version nntp-version)))) X X(defun gnus-Info-find-node () X "Find Info documentation of GNUS." X (interactive) X (require 'info) X ;; Enlarge info window. X (if (eq major-mode 'gnus-Subject-mode) X (progn X (gnus-configure-windows 'ExpandSubject) X (pop-to-buffer gnus-Subject-buffer))) X (let ((Info-directory (expand-file-name gnus-Info-directory nil))) X (Info-goto-node (cdr (assq major-mode gnus-Info-nodes))))) X X(defun gnus-replace-functions () X "Replace some functions defined in rnews.el and rnewspost.el." X ;; Override news-inews function in rnewspost.el. X (fset 'news-inews 'gnus-inews-news) X ;; Override caesar-region function in rnews.el. X (fset 'caesar-region 'gnus-caesar-region)) X X(defun gnus-narrow-to-page (&optional arg) X "Make text outside current page invisible except for page delimiter. XA numeric arg specifies to move forward or backward by that many pages, Xthus showing a page other than the one point was originally in." X (interactive "P") X (setq arg (if arg (prefix-numeric-value arg) 0)) X (save-excursion X (forward-page -1) ;Beginning of current page. X (widen) X (if (> arg 0) X (forward-page arg) X (if (< arg 0) X (forward-page (1- arg)))) X ;; Find the end of the page. X (forward-page) X ;; If we stopped due to end of buffer, stay there. X ;; If we stopped after a page delimiter, put end of restriction X ;; at the beginning of that line. X ;; These are commented out. X ;; (if (save-excursion (beginning-of-line) X ;; (looking-at page-delimiter)) X ;; (beginning-of-line)) X (let ((end (point-max))) X (narrow-to-region (point) X (progn X ;; Find the top of the page. X (forward-page -1) X ;; If we found beginning of buffer, stay there. X ;; If extra text follows page delimiter on same line, X ;; include it. X ;; Otherwise, show text starting with following line. X (if (and (eolp) (not (bobp))) X (forward-line 1)) X (point))) X (if (and gnus-break-pages overlay-arrow-string) X ;; Show MORE message at end of the page except for last page. X (if (/= (point-max) end) X (set-marker overlay-arrow-position X (progn (goto-char (point-max)) X (beginning-of-line) X (point))) X (set-marker overlay-arrow-position nil))) X ))) X X(defun gnus-last-element (list) X "Return last element of LIST." X (let ((last nil)) X (while list X (if (null (cdr list)) X (setq last (car list))) X (setq list (cdr list))) X last X )) X X(defun gnus-set-difference (list1 list2) X "Return a list of elements of LIST1 that do not appear in LIST2." X (let ((list1 (copy-sequence list1))) X (while list2 X (setq list1 (delq (car list2) list1)) X (setq list2 (cdr list2))) X list1 X )) X X(defun gnus-intersection (list1 list2) X "Return a list of elements that appear in both LIST1 and LIST2." X (let ((result nil)) X (while list2 X (if (memq (car list2) list1) X (setq result (cons (car list2) result))) X (setq list2 (cdr list2))) X result X )) X X X;;; X;;; Get information about active articles, already read articles, and X;;; still unread articles. X;;; X X;; GNUS internal format of gnus-newsrc-assoc and gnus-killed-assoc: X;; (("general" t (1 . 1)) X;; ("misc" t (1 . 10) (12 . 15)) X;; ("test" nil (1 . 99)) ...) X;; GNUS internal format of gnus-marked-assoc: X;; (("general" 1 2 3) X;; ("misc" 2) ...) X;; GNUS internal format of gnus-active-hashtb: X;; (("general" t (1 . 1)) X;; ("misc" t (1 . 10)) X;; ("test" nil (1 . 99)) ...) X;; GNUS internal format of gnus-unread-hashtb: X;; (("general" 1 (1 . 1)) X;; ("misc" 14 (1 . 10) (12 . 15)) X;; ("test" 99 (1 . 99)) ...) X X(defun gnus-setup-news-info (&optional rawfile) X "Setup news information. XIf optional argument RAWFILE is non-nil, force to read raw startup file." X (let ((init (not (and gnus-newsrc-assoc X gnus-active-hashtb X gnus-unread-hashtb X (not rawfile) X )))) X ;; We have to clear some variables to re-initialize news info. X (if init X (setq gnus-newsrc-assoc nil X gnus-active-hashtb nil X gnus-unread-hashtb nil)) X (if init X (gnus-read-newsrc-file rawfile)) X (gnus-read-active-file) X (if init X (gnus-add-new-newsgroups)) X (gnus-expire-marked-articles) X (gnus-get-unread-articles) X )) X X(defun gnus-make-newsrc-file (file) X "Make server dependent file name by catenating FILE and server host name." X (let* ((file (expand-file-name file nil)) X (real-file (concat file "-" gnus-nntp-server))) X (if (file-exists-p real-file) X real-file file) X )) X X(defun gnus-get-unread-articles () X "Compute diffs between active and read articles." X (let ((read gnus-newsrc-assoc) X (group-info nil) X (group-name nil) X (active nil) X (range nil)) X (message "Checking new news...") X (or gnus-unread-hashtb X (setq gnus-unread-hashtb (gnus-make-hashtable))) X (while read X (setq group-info (car read)) ;About one newsgroup X (setq group-name (car group-info)) X (setq active (nth 2 (gnus-gethash group-name gnus-active-hashtb))) X (if (and gnus-octive-hashtb X ;; Is nothing changed? X (equal active X (nth 2 (gnus-gethash group-name gnus-octive-hashtb))) X ;; Is this newsgroup in the unread hash table? X (gnus-gethash group-name gnus-unread-hashtb) X ) X nil ;Nothing to do. X (setq range (gnus-difference-of-range active (nthcdr 2 group-info))) X (gnus-sethash group-name X (cons group-name ;Group name X (cons (gnus-number-of-articles range) X range)) ;Range of unread articles X gnus-unread-hashtb) X ) X (setq read (cdr read)) X ) X (message "Checking new news... done") X )) X X(defun gnus-expire-marked-articles () X "Check expired article which is marked as unread." X (let ((marked-assoc gnus-marked-assoc) X (updated-assoc nil) X (marked nil) ;Current marked info. X (articles nil) ;List of marked articles. X (updated nil) ;List of real marked. X (begin nil)) X (while marked-assoc X (setq marked (car marked-assoc)) X (setq articles (cdr marked)) X (setq updated nil) X (setq begin X (car (nth 2 (gnus-gethash (car marked) gnus-active-hashtb)))) X (while (and begin articles) X (if (>= (car articles) begin) X ;; This article is still active. X (setq updated (cons (car articles) updated))) X (setq articles (cdr articles))) X (if updated X (setq updated-assoc X (cons (cons (car marked) updated) updated-assoc))) X (setq marked-assoc (cdr marked-assoc))) X (setq gnus-marked-assoc updated-assoc) X )) X X(defun gnus-mark-as-read-by-xref (group headers unreads) X "Mark as read using cross reference info. of GROUP with HEADERS and UNREADS. XReturn list of updated newsgroup." X (let ((xref-list nil) X (header nil) X (xrefs nil) ;One Xref: field info. X (xref nil) ;(NEWSGROUP . ARTICLE) X (gname nil) ;Newsgroup name X (article nil)) ;Article number X (while headers X (setq header (car headers)) X (if (memq (nntp-header-number header) unreads) X ;; This article is not yet marked as read. X nil X (setq xrefs (gnus-parse-xref-field (nntp-header-xref header))) X ;; For each cross reference info. in one Xref: field. X (while xrefs X (setq xref (car xrefs)) X (setq gname (car xref)) ;Newsgroup name X (setq article (cdr xref)) ;Article number X (or (string-equal group gname) ;Ignore current group. X ;; Ignore article marked as unread. X (memq article (cdr (assoc gname gnus-marked-assoc))) X (let ((group-xref (assoc gname xref-list))) X (if group-xref X (if (memq article (cdr group-xref)) X nil ;Alread marked. X (setcdr group-xref (cons article (cdr group-xref)))) X ;; Create new assoc entry for GROUP. X (setq xref-list (cons (list gname article) xref-list))) X )) X (setq xrefs (cdr xrefs)) X )) X (setq headers (cdr headers))) X ;; Mark cross referenced articles as read. X (gnus-mark-xrefed-as-read xref-list) X ;;(message "%s %s" (prin1-to-string unreads) (prin1-to-string xref-list)) X ;; Return list of updated group name. X (mapcar (function car) xref-list) X )) X X(defun gnus-parse-xref-field (xref-value) X "Parse Xref: field value, and return list of `(group . article-id)'." X (let ((xref-list nil) X (xref-value (or xref-value ""))) X ;; Remove server host name. X (if (string-match "^[ \t]*[^ \t,]+[ \t,]+\\(.*\\)$" xref-value) X (setq xref-value (substring xref-value (match-beginning 1))) X (setq xref-value nil)) X ;; Process each xref info. X (while xref-value X (if (string-match X "^[ \t,]*\\([^ \t,]+\\):\\([0-9]+\\)[^0-9]*" xref-value) X (progn X (setq xref-list X (cons X (cons X ;; Group name X (substring xref-value (match-beginning 1) (match-end 1)) X ;; Article-ID X (string-to-int X (substring xref-value (match-beginning 2) (match-end 2)))) X xref-list)) X (setq xref-value (substring xref-value (match-end 2)))) X (setq xref-value nil))) X ;; Return alist. X xref-list X )) X X(defun gnus-mark-xrefed-as-read (xrefs) X "Update unread article information using XREFS alist." X (let ((group nil) X (idlist nil) X (unread nil)) X (while xrefs X (setq group (car (car xrefs))) X (setq idlist (cdr (car xrefs))) X (setq unread (gnus-uncompress-sequence X (nthcdr 2 (gnus-gethash group gnus-unread-hashtb)))) X (while idlist X (setq unread (delq (car idlist) unread)) X (setq idlist (cdr idlist))) X (gnus-update-unread-articles group unread 'ignore) X (setq xrefs (cdr xrefs)) X ))) X X(defun gnus-update-unread-articles (group unread-list marked-list) X "Update unread articles of GROUP using UNREAD-LIST and MARKED-LIST." X (let ((active (nth 2 (gnus-gethash group gnus-active-hashtb))) X (unread (gnus-gethash group gnus-unread-hashtb))) X (if (or (null active) (null unread)) X ;; Ignore unknown newsgroup. X nil X ;; Update gnus-unread-hashtb. X (if unread-list X (setcdr (cdr unread) X (gnus-compress-sequence unread-list)) X ;; All of the articles are read. X (setcdr (cdr unread) '((0 . 0)))) X ;; Number of unread articles. X (setcar (cdr unread) X (gnus-number-of-articles (nthcdr 2 unread))) X ;; Update gnus-newsrc-assoc. X (if (> (car active) 0) X ;; Articles from 1 to N are not active. X (setq active (cons 1 (cdr active)))) X (setcdr (cdr (assoc group gnus-newsrc-assoc)) X (gnus-difference-of-range active (nthcdr 2 unread))) X ;; Update .newsrc buffer. X (gnus-update-newsrc-buffer group) X ;; Update gnus-marked-assoc. X (if (listp marked-list) ;Includes NIL. X (let ((marked (assoc group gnus-marked-assoc))) X (cond (marked X (setcdr marked marked-list)) X (marked-list ;Non-NIL. X (setq gnus-marked-assoc X (cons (cons group marked-list) X gnus-marked-assoc))) X ))) X ))) X X(defun gnus-compress-sequence (numbers) X "Convert list of sorted numbers to ranges." X (let* ((numbers (sort (copy-sequence numbers) (function <))) X (first (car numbers)) X (last (car numbers)) X (result nil)) X (while numbers X (cond ((= last (car numbers)) nil) ;Omit duplicated number X ((= (1+ last) (car numbers)) ;Still in sequence X (setq last (car numbers))) X (t ;End of one sequence X (setq result (cons (cons first last) result)) X (setq first (car numbers)) X (setq last (car numbers))) X ) X (setq numbers (cdr numbers)) X ) X (nreverse (cons (cons first last) result)) X )) X X(defun gnus-uncompress-sequence (ranges) X "Expand compressed format of sequence." X (let ((first nil) X (last nil) X (result nil)) X (while ranges X (setq first (car (car ranges))) X (setq last (cdr (car ranges))) X (while (< first last) X (setq result (cons first result)) X (setq first (1+ first))) X (setq result (cons first result)) X (setq ranges (cdr ranges)) X ) X (nreverse result) X )) X X(defun gnus-number-of-articles (range) X "Compute number of articles from RANGE `((beg1 . end1) (beg2 . end2) ...)'." X (let ((count 0)) X (while range X (if (/= (cdr (car range)) 0) X ;; If end1 is 0, it must be skipped. Usually no articles in X ;; this group. X (setq count (+ count 1 (- (cdr (car range)) (car (car range)))))) X (setq range (cdr range)) X ) X count ;Result X )) X X(defun gnus-difference-of-range (src obj) X "Compute (SRC - OBJ) on range. XRange of SRC is expressed as `(beg . end)'. XRange of OBJ is expressed as `((beg1 . end1) (beg2 . end2) ...)." X (let ((beg (car src)) X (end (cdr src)) X (range nil)) ;This is result. X ;; Src may be nil. X (while (and src obj) X (let ((beg1 (car (car obj))) X (end1 (cdr (car obj)))) X (cond ((> beg end) X (setq obj nil)) ;Terminate loop X ((< beg beg1) X (setq range (cons (cons beg (min (1- beg1) end)) range)) X (setq beg (1+ end1))) X ((>= beg beg1) X (setq beg (max beg (1+ end1)))) X ) X (setq obj (cdr obj)) ;Next OBJ X )) X ;; Src may be nil. X (if (and src (<= beg end)) X (setq range (cons (cons beg end) range))) X ;; Result X (if range X (nreverse range) X (list (cons 0 0))) X )) X X(defun gnus-add-new-newsgroup (newsgroup) X "Add one new NEWSGROUP." X (and (null (assoc newsgroup gnus-newsrc-assoc)) ;Really new? X (gnus-gethash newsgroup gnus-active-hashtb) ;Really exist? X (gnus-insert-newsgroup (or (assoc newsgroup gnus-killed-assoc) X (list newsgroup t)) X (car (car gnus-newsrc-assoc))))) X X(defun gnus-add-new-newsgroups () X "Add new newsgroups to gnus-newsrc-assoc. X`-n' option of options line in .newsrc file is recognized." X (let ((group nil)) X (mapatoms X (function X (lambda (sym) X (setq group (symbol-name sym)) X ;; Taking account of `-n' option. X (and (or (null gnus-newsrc-options-n-no) X (not (string-match gnus-newsrc-options-n-no group)) X (and gnus-newsrc-options-n-yes X (string-match gnus-newsrc-options-n-yes group))) X (null (assoc group gnus-killed-assoc)) ;Ignore killed. X (null (assoc group gnus-newsrc-assoc)) ;Really new. X ;; Find new newsgroup. X (progn X (setq gnus-newsrc-assoc X (cons (list group t) gnus-newsrc-assoc)) X (gnus-update-newsrc-buffer group nil X (car (car (cdr gnus-newsrc-assoc)))) X (message "New newsgroup: %s is subscribed" group) X )) X )) X gnus-active-hashtb) X )) X X(defun gnus-kill-newsgroup (group) X "Kill GROUP from gnus-newsrc-assoc and .newsrc." X (let ((info (assoc group gnus-newsrc-assoc))) X (if (null info) X nil X ;; Delete from gnus-newsrc-assoc X (setq gnus-newsrc-assoc (delq info gnus-newsrc-assoc)) X ;; Add to gnus-killed-assoc. X (setq gnus-killed-assoc X (cons info X (delq (assoc group gnus-killed-assoc) gnus-killed-assoc))) X ;; Then delete from .newsrc X (gnus-update-newsrc-buffer group 'delete) X ;; Return the deleted newsrc entry. X info X ))) X X(defun gnus-insert-newsgroup (info &optional next) X "Insert newsrc INFO entry before NEXT. XIf optional argument NEXT is nil, appended to the last." X (if (null info) X (error "Invalid argument: %s" info)) X (let* ((group (car info)) ;Newsgroup name. X (range X (gnus-difference-of-range X (nth 2 (gnus-gethash group gnus-active-hashtb)) (nthcdr 2 info)))) X ;; Check duplication. X (if (assoc group gnus-newsrc-assoc) X (error "Dumplicated: %s" group)) X ;; Insert to gnus-newsrc-assoc. X (if (string-equal next (car (car gnus-newsrc-assoc))) X (setq gnus-newsrc-assoc X (cons info gnus-newsrc-assoc)) X (let ((found nil) X (rest gnus-newsrc-assoc) X (tail (cons nil gnus-newsrc-assoc))) X ;; Seach insertion point. X (while (and (not found) rest) X (if (string-equal next (car (car rest))) X (setq found t) X (setq rest (cdr rest)) X (setq tail (cdr tail)) X )) X ;; Find it. X (setcdr tail nil) X (setq gnus-newsrc-assoc X (append gnus-newsrc-assoc (cons info rest))) X )) X ;; Delete from gnus-killed-assoc. X (setq gnus-killed-assoc X (delq (assoc group gnus-killed-assoc) gnus-killed-assoc)) X ;; Then insert to .newsrc. X (gnus-update-newsrc-buffer group nil next) X ;; Add to gnus-unread-hashtb. X (gnus-sethash group X (cons group ;Newsgroup name. X (cons (gnus-number-of-articles range) range)) X gnus-unread-hashtb) X )) X X(defun gnus-check-killed-newsgroups () X "Check consistency between gnus-newsrc-assoc and gnus-killed-assoc." X (let ((group nil) X (new-killed nil) X (old-killed gnus-killed-assoc)) X (while old-killed X (setq group (car (car old-killed))) X (and (or (null gnus-newsrc-options-n-no) X (not (string-match gnus-newsrc-options-n-no group)) X (and gnus-newsrc-options-n-yes X (string-match gnus-newsrc-options-n-yes group))) X (null (assoc group gnus-newsrc-assoc)) ;No duplication. X ;; Subscribed in options line and not in gnus-newsrc-assoc. X (setq new-killed X (cons (car old-killed) new-killed))) X (setq old-killed (cdr old-killed)) X ) X (setq gnus-killed-assoc (nreverse new-killed)) X )) X X(defun gnus-check-bogus-newsgroups (&optional confirm) X "Delete bogus newsgroups. XIf optional argument CONFIRM is non-nil, confirm deletion of newsgroups." X (let ((group nil) ;Newsgroup name temporary used. X (old-newsrc gnus-newsrc-assoc) X (new-newsrc nil) X (bogus nil) ;List of bogus newsgroups. X (old-killed gnus-killed-assoc) X (new-killed nil) X (old-marked gnus-marked-assoc) X (new-marked nil)) X (message "Checking bogus newsgroups...") X ;; Update gnus-newsrc-assoc. X (while old-newsrc X (setq group (car (car old-newsrc))) X (if (or (gnus-gethash group gnus-active-hashtb) X (and confirm X (not (y-or-n-p X (format "Delete bogus newsgroup: %s " group))))) X ;; Active newsgroup. X (setq new-newsrc (cons (car old-newsrc) new-newsrc)) X ;; Found a bogus newsgroup. X (setq bogus (cons group bogus))) X (setq old-newsrc (cdr old-newsrc)) X ) X (setq gnus-newsrc-assoc (nreverse new-newsrc)) X ;; Update gnus-killed-assoc. X ;; The killed newsgroups are deleted without any confirmations. X (while old-killed X (setq group (car (car old-killed))) X (and (gnus-gethash group gnus-active-hashtb) X (null (assoc group gnus-newsrc-assoc)) X ;; Active and really killed newsgroup. X (setq new-killed (cons (car old-killed) new-killed))) X (setq old-killed (cdr old-killed)) X ) X (setq gnus-killed-assoc (nreverse new-killed)) X ;; Remove BOGUS from .newsrc file. X (while bogus X (gnus-update-newsrc-buffer (car bogus) 'delete) X (setq bogus (cdr bogus))) X ;; Update gnus-marked-assoc. X (while old-marked X (setq group (car (car old-marked))) X (if (and (cdr (car old-marked)) ;Non-empty? X (assoc group gnus-newsrc-assoc)) ;Not bogus? X (setq new-marked (cons (car old-marked) new-marked))) X (setq old-marked (cdr old-marked))) X (setq gnus-marked-assoc new-marked) X (message "Checking bogus newsgroups... done") X )) X X(defun gnus-read-active-file () X "Get active file from NNTP server." X (message "Reading active file...") X (if (gnus-request-list) ;Get active file from server X (save-excursion X (set-buffer nntp-server-buffer) X ;; Save OLD active info. X (setq gnus-octive-hashtb gnus-active-hashtb) X (setq gnus-active-hashtb (gnus-make-hashtable)) X (gnus-active-to-gnus-format) X (message "Reading active file... done")) X (error "Cannot read active file from NNTP server."))) X X(defun gnus-active-to-gnus-format () X "Convert active file format to internal format." X ;; Delete unnecessary lines. X (goto-char (point-min)) X (delete-matching-lines "^to\\..*$") X ;; Store active file in hashtable. X (goto-char (point-min)) X (while X (re-search-forward X "^\\([^ \t]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([0-9]+\\)[ \t]+\\([ymn]\\).*$" X nil t) X (gnus-sethash X (buffer-substring (match-beginning 1) (match-end 1)) X (list (buffer-substring (match-beginning 1) (match-end 1)) X (string-equal X "y" (buffer-substring (match-beginning 4) (match-end 4))) X (cons (string-to-int X (buffer-substring (match-beginning 3) (match-end 3))) X (string-to-int X (buffer-substring (match-beginning 2) (match-end 2))))) X gnus-active-hashtb) X )) X X(defun gnus-read-newsrc-file (&optional rawfile) X "Read startup FILE. XIf optional argument RAWFILE is non-nil, the raw startup file is read." X (setq gnus-current-startup-file (gnus-make-newsrc-file gnus-startup-file)) X ;; Reset variables which may be included in the quick startup file. X (let ((variables gnus-variable-list)) X (while variables X (set (car variables) nil) X (setq variables (cdr variables)))) X (let* ((newsrc-file gnus-current-startup-file) X (quick-file (concat newsrc-file ".el")) X (quick-loaded nil) X (newsrc-mod (nth 5 (file-attributes newsrc-file))) X (quick-mod (nth 5 (file-attributes quick-file)))) X (save-excursion X ;; Prepare .newsrc buffer. X (set-buffer (find-file-noselect newsrc-file)) X ;; It is not so good idea turning off undo. X ;;(buffer-flush-undo (current-buffer)) X ;; Load quick .newsrc to restore gnus-marked-assoc and X ;; gnus-killed-assoc even if gnus-newsrc-assoc is out of date. X (condition-case nil X (setq quick-loaded (load quick-file t t t)) X (error nil)) X (cond ((and (not rawfile) ;Not forced to read the raw file. X (or (and (fboundp 'file-newer-than-file-p) X (file-newer-than-file-p quick-file newsrc-file)) X (and newsrc-mod quick-mod X ;; .newsrc.el is newer than .newsrc. X ;; Some older version does not support function X ;; `file-newer-than-file-p'. X (or (< (car newsrc-mod) (car quick-mod)) X (and (= (car newsrc-mod) (car quick-mod)) X (<= (nth 1 newsrc-mod) (nth 1 quick-mod)))) X )) X quick-loaded X gnus-newsrc-assoc ;Really loaded? X ) X ;; We don't have to read the raw startup file. X ) X (t X ;; Since .newsrc file is newer than quick file, read it. X (message "Reading %s..." newsrc-file) X (gnus-newsrc-to-gnus-format) X (gnus-check-killed-newsgroups) X (message "Reading %s... Done" newsrc-file))) X ))) X X(defun gnus-newsrc-to-gnus-format () X "Parse current buffer as .newsrc file." X (let ((newsgroup nil) X (subscribe nil) X (ranges nil) X (subrange nil) X (read-list nil)) X ;; We have to re-initialize these variable (except for X ;; gnus-marked-assoc and gnus-killed-assoc) because quick startup X ;; file may contain bogus values. X (setq gnus-newsrc-options nil) X (setq gnus-newsrc-options-n-yes nil) X (setq gnus-newsrc-options-n-no nil) X (setq gnus-newsrc-assoc nil) X ;; Save options line to variable. X (goto-char (point-min)) X (if (re-search-forward "^[ \t]*options[ \t]*\\(.*[^ \t\n]\\)[ \t]*$" nil t) X (progn X (setq gnus-newsrc-options X (buffer-substring (match-beginning 1) (match-end 1))) X ;; Compile "-n" option. X (if (string-match "\\(^\\|[ \t]\\)-n" gnus-newsrc-options) X (let ((options (substring gnus-newsrc-options (match-end 0))) X (yes nil) (no nil) X (yes-or-no nil) X (newsgroup nil)) X (while X (string-match X "^[ \t]*\\(!?\\)\\([^--- \t][^ \t]*\\)" options) X (setq yes-or-no X (substring options (match-beginning 1) (match-end 1))) X (setq newsgroup X (regexp-quote X (substring options X (match-beginning 2) (match-end 2)))) X (setq options (substring options (match-end 2))) X (cond ((and (string-equal yes-or-no "!") X (string-equal newsgroup "all")) X (setq no (cons ".*" no))) X ((string-equal yes-or-no "!") X (setq no (cons newsgroup no))) X ((string-equal newsgroup "all")) ;Ignore `all'. X (t X (setq yes (cons newsgroup yes))) X )) X (if yes X (setq gnus-newsrc-options-n-yes X (concat "^\\(" X (apply (function concat) X (mapcar X (function X (lambda (newsgroup) X (concat newsgroup "\\|"))) X (cdr yes))) X (car yes) "\\)"))) X (if no X (setq gnus-newsrc-options-n-no X (concat "^\\(" X (apply (function concat) X (mapcar X (function X (lambda (newsgroup) X (concat newsgroup "\\|"))) X (cdr no))) X (car no) "\\)"))) X )) X )) X ;; Parse body of .newsrc file X (goto-char (point-min)) X (while (re-search-forward X "^[ \t]*\\([^!: \t]+\\)[ \t]*\\([!:]\\)[ \t]*\\(.*\\)$" nil t) X (setq newsgroup (buffer-substring (match-beginning 1) (match-end 1))) X ;; Check duplications of newsgroups. X ;; Note: Checking the duplications takes very long time. X (if (assoc newsgroup gnus-newsrc-assoc) X (message "Ignore duplicated newsgroup: %s" newsgroup) X (setq subscribe X (string-equal X ":" (buffer-substring (match-beginning 2) (match-end 2)))) X (setq ranges (buffer-substring (match-beginning 3) (match-end 3))) X (setq read-list nil) X (while (string-match "^[, \t]*\\([0-9-]+\\)" ranges) X (setq subrange (substring ranges (match-beginning 1) (match-end 1))) X (setq ranges (substring ranges (match-end 1))) X (cond ((string-match "^\\([0-9]+\\)-\\([0-9]+\\)$" subrange) X (setq read-list X (cons X (cons (string-to-int X (substring subrange X (match-beginning 1) (match-end 1))) X (string-to-int X (substring subrange X (match-beginning 2) (match-end 2)))) X read-list))) X ((string-match "^[0-9]+$" subrange) X (setq read-list X (cons (cons (string-to-int subrange) X (string-to-int subrange)) X read-list))) X (t X (ding) (message "Ignoring bogus lines of %s" newsgroup) X (sit-for 0)) X )) X (setq gnus-newsrc-assoc X (cons (cons newsgroup (cons subscribe (nreverse read-list))) X gnus-newsrc-assoc)) X )) X (setq gnus-newsrc-assoc X (nreverse gnus-newsrc-assoc)) X )) X X(defun gnus-save-newsrc-file () X "Save to .newsrc FILE." X ;; Note: We cannot save .newsrc file if all newsgroups are removed X ;; from the variable gnus-newsrc-assoc. X (and (or gnus-newsrc-assoc gnus-killed-assoc) X gnus-current-startup-file X (save-excursion X ;; A buffer containing .newsrc file may be deleted. X (set-buffer (find-file-noselect gnus-current-startup-file)) X (if (not (buffer-modified-p)) X (message "(No changes need to be saved)") X (message "Saving %s..." gnus-current-startup-file) X (let ((make-backup-files t) X (version-control nil) X (require-final-newline t)) ;Don't ask even if requested. X ;; Make backup file of master newsrc. X ;; You can stop or change version control of backup file. X ;; Suggested by jason@violet.berkeley.edu. X (run-hooks 'gnus-Save-newsrc-hook) X (save-buffer)) X ;; Quickly loadable .newsrc. X (set-buffer (get-buffer-create " *GNUS-newsrc*")) X (buffer-flush-undo (current-buffer)) X (erase-buffer) X (gnus-gnus-to-quick-newsrc-format) X (let ((make-backup-files nil) X (version-control nil) X (require-final-newline t)) ;Don't ask even if requested. X (write-file (concat gnus-current-startup-file ".el"))) X (kill-buffer (current-buffer)) X (message "Saving %s... Done" gnus-current-startup-file) X )) X )) X X(defun gnus-update-newsrc-buffer (group &optional delete next) X "Incrementally update .newsrc buffer about GROUP. XIf optional 1st argument DELETE is non-nil, delete the group. XIf optional 2nd argument NEXT is non-nil, inserted before it." X (save-excursion X ;; Taking account of the killed startup file. X ;; Suggested by tale@pawl.rpi.edu. X (set-buffer (or (get-file-buffer gnus-current-startup-file) X (find-file-noselect gnus-current-startup-file))) X (let ((deleted nil) X (buffer-read-only nil)) ;May be not modifiable. X ;; Delete ALL entries which match for GROUP. X (goto-char (point-min)) X (while (re-search-forward X (concat "^[ \t]*" (regexp-quote group) "[ \t]*[:!]") nil t) X (beginning-of-line) X (delete-region (point) (progn (forward-line 1) (point))) X (setq deleted t) ;Old entry is deleted. X ) X (if delete X nil X ;; Insert group entry. X (let ((newsrc (assoc group gnus-newsrc-assoc))) X (if (null newsrc) X nil X ;; Find insertion point. X (cond (deleted nil) ;Insert here. X ((and (stringp next) X (progn X (goto-char (point-min)) X (re-search-forward X (concat "^[ \t]*" X (regexp-quote next) "[ \t]*[:!]") nil t))) X (beginning-of-line)) X (t X (goto-char (point-max)) X (or (bolp) X (insert "\n")))) X ;; Insert after options line. X (if (looking-at "^[ \t]*options[ \t]") X (forward-line 1)) X (insert group ;Group name X (if (nth 1 newsrc) ": " "! ")) ;Subscribed? X (gnus-ranges-to-newsrc-format (nthcdr 2 newsrc)) ;Read articles X (insert "\n") X ))) X ))) X X(defun gnus-gnus-to-quick-newsrc-format () X "Insert GNUS variables such as gnus-newsrc-assoc in lisp format." X (insert ";; GNUS internal format of .newsrc.\n") X (insert ";; Touch .newsrc instead if you think to remove this file.\n") X (let ((variable nil) X (variables gnus-variable-list) X ;; Temporary rebind to make changes invisible. X (gnus-killed-assoc gnus-killed-assoc)) X ;; Remove duplicated or unsubscribed newsgroups in gnus-killed-assoc. X (gnus-check-killed-newsgroups) X ;; Then, insert lisp expressions. X (while variables X (setq variable (car variables)) X (and (boundp variable) X (symbol-value variable) X (insert "(setq " (symbol-name variable) " '" X (prin1-to-string (symbol-value variable)) X ")\n")) X (setq variables (cdr variables))) X )) X X(defun gnus-ranges-to-newsrc-format (ranges) X "Insert ranges of read articles." X (let ((range nil)) ;Range is a pair of BEGIN and END. X (while ranges X (setq range (car ranges)) X (setq ranges (cdr ranges)) X (cond ((= (car range) (cdr range)) X (if (= (car range) 0) X (setq ranges nil) ;No unread articles. X (insert (int-to-string (car range))) X (if ranges (insert ",")) X )) X (t X (insert (int-to-string (car range)) X "-" X (int-to-string (cdr range))) X (if ranges (insert ",")) X )) X ))) X X X;;Local variables: X;;eval: (put 'gnus-eval-in-buffer-window 'lisp-indent-hook 1) X;;end: SHAR_EOF chmod 0644 gnus.el || echo "restore of gnus.el fails" set `wc -c gnus.el`;Sum=$1 if test "$Sum" != "198973" then echo original size 198973, current size $Sum;fi sed 's/^X//' << 'SHAR_EOF' > gnusmisc.el && X;;; Miscellaneous commands for GNUS newsreader X;; Copyright (C) 1989 Fujitsu Laboratories LTD. X;; Copyright (C) 1989 Masanobu UMEDA X;; $Header: gnusmisc.el,v 1.1 89/06/19 13:37:20 umerin Exp $ X X;; This file is part of GNU Emacs. X X;; GNU Emacs is distributed in the hope that it will be useful, X;; but WITHOUT ANY WARRANTY. No author or distributor X;; accepts responsibility to anyone for the consequences of using it X;; or for whether it serves any particular purpose or works at all, X;; unless he says so in writing. Refer to the GNU Emacs General Public X;; License for full details. X X;; Everyone is granted permission to copy, modify and redistribute X;; GNU Emacs, but only under the conditions described in the X;; GNU Emacs General Public License. A copy of this license is X;; supposed to have been given to you along with GNU Emacs so you X;; can know your rights and responsibilities. It should be in a X;; file named COPYING. Among other things, the copyright notice X;; and this notice must be preserved on all copies. X X(provide 'gnusmisc) X(require 'gnus) X X;;; X;;; GNUS Browse-Killed Mode X;;; X X;; Some ideas are due to roland@wheaties.ai.mit.edu (Roland McGrath). X;; I'd like to thank him very much. X X(defvar gnus-Browse-killed-mode-hook nil X "*A hook for GNUS Browse-Killed Mode.") X X(defvar gnus-Browse-killed-buffer "*Killed Newsgroup*") X(defvar gnus-Browse-killed-mode-map nil) X X(put 'gnus-Browse-killed-mode 'mode-class 'special) X X;; Make the buffer to be managed by GNUS. X X(or (memq gnus-Browse-killed-buffer gnus-buffer-list) X (setq gnus-buffer-list X (cons gnus-Browse-killed-buffer gnus-buffer-list))) X X(if gnus-Browse-killed-mode-map X nil X (setq gnus-Browse-killed-mode-map (make-keymap)) X (suppress-keymap gnus-Browse-killed-mode-map t) X (define-key gnus-Browse-killed-mode-map " " 'gnus-Group-next-group) X (define-key gnus-Browse-killed-mode-map "\177" 'gnus-Group-prev-group) X (define-key gnus-Browse-killed-mode-map "\C-n" 'gnus-Group-next-group) X (define-key gnus-Browse-killed-mode-map "\C-p" 'gnus-Group-prev-group) X (define-key gnus-Browse-killed-mode-map "n" 'gnus-Group-next-group) X (define-key gnus-Browse-killed-mode-map "p" 'gnus-Group-prev-group) X (define-key gnus-Browse-killed-mode-map "y" 'gnus-Browse-killed-yank) X (define-key gnus-Browse-killed-mode-map "\C-y" 'gnus-Browse-killed-yank) X (define-key gnus-Browse-killed-mode-map "l" 'gnus-Browse-killed-groups) X (define-key gnus-Browse-killed-mode-map "q" 'gnus-Browse-killed-exit) X (define-key gnus-Browse-killed-mode-map "\C-c\C-c" 'gnus-Browse-killed-exit) X (define-key gnus-Browse-killed-mode-map "\C-c\C-i" 'gnus-Info-find-node)) X X(defun gnus-Browse-killed-mode () X "Major mode for browsing the killed newsgroups. XAll normal editing commands are turned off. XInstead, these commands are available: X\\{gnus-Browse-killed-mode-map} X XThe killed newsgroups are saved in the quick startup file (.newsrc.el) Xunless it against the options line in the startup file (.newsrc). X XEntry to this mode calls gnus-Browse-killed-mode-hook with no arguments, Xif that value is non-nil." X (interactive) X (kill-all-local-variables) X ;; Gee. Why don't you upgrade? X (cond ((boundp 'mode-line-modified) X (setq mode-line-modified "--- ")) X ((listp (default-value 'mode-line-format)) X (setq mode-line-format X (cons "--- " (cdr (default-value 'mode-line-format))))) X (t X (setq mode-line-format X "--- GNUS: Killed Newsgroups %[(%m)%]----%3p-%-"))) X (setq major-mode 'gnus-Browse-killed-mode) X (setq mode-name "Browse-Killed") X (setq mode-line-buffer-identification "GNUS: Killed Newsgroups") X (use-local-map gnus-Browse-killed-mode-map) X (buffer-flush-undo (current-buffer)) X (setq buffer-read-only t) ;Disable modification X (run-hooks 'gnus-Browse-killed-mode-hook)) X X(defun gnus-Browse-killed-groups () X "Browse the killed newsgroups. XThe keys y and C-y yank the newsgroup on the current line into the XNewsgroups buffer." X (interactive) X (or gnus-killed-assoc X (error "No killed newsgroups")) X (pop-to-buffer (get-buffer-create gnus-Browse-killed-buffer)) X (gnus-Browse-killed-mode) X (let ((buffer-read-only nil) X (killed-assoc gnus-killed-assoc)) X (erase-buffer) X (while killed-assoc X (insert (gnus-Group-prepare-line (car killed-assoc))) X (setq killed-assoc (cdr killed-assoc))) X (goto-char (point-min)) X )) X X(defun gnus-Browse-killed-yank () X "Yank current newsgroup to Newsgroup buffer." X (interactive) X (let ((group (gnus-Group-group-name))) X (if group X (let* ((buffer-read-only nil) X (killed (assoc group gnus-killed-assoc))) X (pop-to-buffer gnus-Group-buffer) ;Needed to adjust point. X (if killed X (gnus-Group-insert-group killed)) X (pop-to-buffer gnus-Browse-killed-buffer) X (beginning-of-line) X (delete-region (point) X (progn (forward-line 1) (point))) X ))) X (gnus-Browse-killed-check-buffer)) X X(defun gnus-Browse-killed-check-buffer () X "Exit if the buffer is empty by deleting the window and killing the buffer." X (and (null gnus-killed-assoc) X (get-buffer gnus-Browse-killed-buffer) X (gnus-Browse-killed-exit))) X X(defun gnus-Browse-killed-exit () X "Exit this mode by deleting the window and killing the buffer." X (interactive) X (and (get-buffer-window gnus-Browse-killed-buffer) X (delete-window (get-buffer-window gnus-Browse-killed-buffer))) X (kill-buffer gnus-Browse-killed-buffer)) X X X;;; X;;; kill/yank newsgroup commands of GNUS Group Mode X;;; X X(defun gnus-Group-kill-group (n) X "Kill newsgroup on current line, repeated prefix argument N times. XThe killed newsgroups can be yanked by using \\[gnus-Group-yank-group]." X (interactive "p") X (let ((buffer-read-only nil) X (group nil)) X (while (> n 0) X (setq group (gnus-Group-group-name)) X (or group X (signal 'end-of-buffer nil)) X (beginning-of-line) X (delete-region (point) X (progn (forward-line 1) (point))) X (gnus-kill-newsgroup group) X (setq n (1- n)) X ;; Add to killed newsgroups in the buffer if exists. X (if (get-buffer gnus-Browse-killed-buffer) X (save-excursion X (set-buffer gnus-Browse-killed-buffer) X (let ((buffer-read-only nil)) X (goto-char (point-min)) X (insert (gnus-Group-prepare-line (car gnus-killed-assoc))) X ))) X ) X (search-forward ":" nil t) X )) X X(defun gnus-Group-yank-group () X "Yank the last newsgroup killed with \\[gnus-Group-kill-group], Xinserting it before the newsgroup on the line containging point." X (interactive) X (gnus-Group-insert-group (car gnus-killed-assoc)) X ;; Remove killed newsgroups from the buffer if exists. X (if (get-buffer gnus-Browse-killed-buffer) X (save-excursion X (set-buffer gnus-Browse-killed-buffer) X (let ((buffer-read-only nil)) X (goto-char (point-min)) X (delete-region (point-min) X (progn (forward-line 1) (point))) X ))) X (gnus-Browse-killed-check-buffer)) X X(defun gnus-Group-insert-group (info) X "Insert newsgroup at current line using gnus-newsrc-assoc INFO." X (if (null gnus-killed-assoc) X (error "No killed newsgroups")) X (if (not gnus-have-all-newsgroups) X (error X (substitute-command-keys X "Not all newsgroups are displayed. Type \\[gnus-Group-list-all-groups] to display all newsgroups."))) X (let ((buffer-read-only nil) X (group (gnus-Group-group-name))) X (gnus-insert-newsgroup info group) X (beginning-of-line) X (insert (gnus-Group-prepare-line info)) X (forward-line -1) X (search-forward ":" nil t) X )) SHAR_EOF chmod 0644 gnusmisc.el || echo "restore of gnusmisc.el fails" set `wc -c gnusmisc.el`;Sum=$1 if test "$Sum" != "7496" then echo original size 7496, current size $Sum;fi sed 's/^X//' << 'SHAR_EOF' > gnuspost.el && X;;; Post news commands for GNUS newsreader X;; Copyright (C) 1989 Fujitsu Laboratories LTD. X;; Copyright (C) 1989 Masanobu UMEDA X;; $Header: gnuspost.el,v 1.1 89/06/19 13:38:01 umerin Exp $ X X;; This file is part of GNU Emacs. X X;; GNU Emacs is distributed in the hope that it will be useful, X;; but WITHOUT ANY WARRANTY. No author or distributor X;; accepts responsibility to anyone for the consequences of using it X;; or for whether it serves any particular purpose or works at all, X;; unless he says so in writing. Refer to the GNU Emacs General Public X;; License for full details. X X;; Everyone is granted permission to copy, modify and redistribute X;; GNU Emacs, but only under the conditions described in the X;; GNU Emacs General Public License. A copy of this license is X;; supposed to have been given to you along with GNU Emacs so you X;; can know your rights and responsibilities. It should be in a X;; file named COPYING. Among other things, the copyright notice X;; and this notice must be preserved on all copies. X X(provide 'gnuspost) X(require 'gnus) X X(defvar gnus-organization-file "/usr/lib/news/organization" X "*Local news organization file.") X X(autoload 'news-reply-mode "rnewspost") X X;;; X;;; Post a News using NNTP X;;; X X(defun gnus-post-news () X "Begin editing a new USENET news article to be posted. XType \\[describe-mode] once editing the article to get a list of commands." X (interactive) X (if (or (not gnus-novice-user) SHAR_EOF echo "End of part 5, continue with part 6" echo "6" > s2_seq_.tmp exit 0