Path: utzoo!attcan!uunet!kddlab!titcca!fgw!flab!umerin From: umerin@flab.flab.fujitsu.JUNET (Masanobu UMEDA) Newsgroups: comp.emacs,fj.editor.emacs Subject: GNUS: nntp-based news reader (again) (1 of 3) Message-ID: <3680@flab.flab.fujitsu.JUNET> Date: 16 Jun 88 05:46:54 GMT Reply-To: umerin@flab.flab.fujitsu.JUNET (Masanobu UMEDA) Organization: Fujitsu Laboratories Ltd., Kawasaki, Japan Lines: 1389 This is the latest version of GNUS. It seems me that there was news transmission error in GNUS posted a couple weeks ago. That's why GNUS 3.3 comes again. Sorry if you aren't interested in GNUS. GNUS is a network news reader for GNU Emacs. It is based on Network News Transfer Protocol (NNTP). You are able to read and post a news remotely inside Emacs. This release also support local news spool. If your host has a copy of news spool, GNUS won't use NNTP but go to the spool directly. I'd like to give much thanks to everyone who sends me valuable comments. Before staring gnus you have to define your environment as follows: (1) define news server host by setenv NNTPSERVER your-news-server-host-name (2) define your domain (do not include your host name!) by setenv DOMAINNAME your-domain-name (3) define your organization by setenv ORGANIZATION your-organization One known problem is that a large text posted remotely may be broken by unknown reason. This is why Emacs command `lisp-send-defun' uses external file to send function definitions to inferior lisp process. You'd better not post a so large news as gnus.el (:-). Masanobu UMEDA umerin%flab.flab.Fujitsu.JUNET@uunet.uu.NET ---- Cut Here and unpack ---- #!/bin/sh # shar: Shell Archiver (v1.22) # # This is part 1 of a multipart archive # do not concatenate these parts, unpack them in order with /bin/sh # # Run the following text with /bin/sh to create: # gnus.el # nntp.el # nnspool.el # if test -r s2_seq_.tmp then echo "Must unpack archives in sequence!" next=`cat s2_seq_.tmp`; echo "Please unpack part $next next" exit 1; fi echo "x - extracting gnus.el (Text)" sed 's/^X//' << 'SHAR_EOF' > gnus.el && X;;; GNUS: NNTP-based News Reader for GNU Emacs X;; Copyright (C) 1987, 1988 Fujitsu Laboratoris LTD. X;; Copyright (C) 1987, 1988 Masanobu UMEDA (umerin@flab.flab.Fujitsu.JUNET) X;; $Header: gnus.el,v 3.3 88/06/16 09:58:09 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;; TO DO: X;; (1) stop using replace-regexp in format conversion because it is X;; too slow. X;; (2) caesar article body (rot13). X;; (3) select article by references. X;; (4) select article by author. X X(provide 'gnus) X(require 'nntp) X(require 'mail-utils) X;; Function `news-inews' overrides the function defined in X;; `rnewspost.el'. So, rnewspost.el must be loaded before it is X;; defined. X(if (not (fboundp 'news-inews)) X (load-library "rnewspost")) X X(defvar gnus-server-host (getenv "NNTPSERVER") X "*Host the NNTP news server is running. XInitialized from the NNTPSERVER environment variable.") X X(defvar gnus-startup-file "~/.newsrc" X "*Your .newsrc file. Use `.newsrc-HOST' instead if it exists.") X X(defvar gnus-subject-lines-height 4 X "*Number of subject lines displayed at once.") X X(defvar gnus-author-copy-file (getenv "AUTHORCOPY") X "*File name saving copy of posted article. XIf the first character of the name is `|', the article is piped out to Xnamed program. XInitialized from the AUTHORCOPY environment variable.") X X(defvar gnus-article-save-directory (getenv "SAVEDIR") X "*Directory name to save article to. XInitialized from the SAVEDIR environment variable.") X X(defvar gnus-default-distribution "local" X "*Use the value as distribution if no distribution is specified.") X X(defvar gnus-novice-user t X "*A little bit verbose in posting mode if T. XAsk you news group name, subject, and distribution.") X X(defvar gnus-Group-mode-hook nil X "*Hooks for GNUS Group mode.") X X(defvar gnus-Subject-mode-hook nil X "*Hooks for GNUS Subject mode.") X X(defvar gnus-Article-mode-hook nil X "*Hooks for GNUS Article mode.") X X(defvar gnus-Save-newsrc-hook nil X "*Hooks for saving the newsrc file. XThis hook is called before writing to .newsrc file.") X X;; Site dependent variables. You have to define these variables in X;; site-init.el, default.el or your .emacs. X X(defvar gnus-your-domain "stars.flab.Fujitsu.JUNET" X "*Your domain name without your host name. XIf environment variable `DOMAINNAME' is defined, it's instead used.") X X(defvar gnus-your-organization "Fujitsu Laboratories Ltd., Kawasaki, Japan." X "*Your organization. XIf environment variable `ORGANIZATION' is defined, it's instead used.") X X(defvar gnus-your-time-zone -9 X "*Difference between GMT and your time zone.") X X;; Internal variables. X X(defvar gnus-ignored-headers X "^Path:\\|^Posting-Version:\\|^Article-I.D.:\\|^Expires:\\|^Date-Received:\\|^References:\\|^Control:\\|^Xref:\\|^Lines:\\|^Posted:\\|^Relay-Version:\\|^Message-ID:\\|^Nf-ID:\\|^Nf-From:\\|^Approved:\\|^Sender:" X "All random fields within the header of a message.") X X(defvar gnus-newsrc-options nil X "Options line in .newsrc file.") X X(defvar gnus-newsrc-assoc nil X "Assoc list of read articles.") X X(defvar gnus-unread-assoc nil X "Assoc list of unread articles.") X X(defvar gnus-active-assoc nil X "Assoc list of active articles.") X X(defvar gnus-octive-assoc nil X "Assoc list of OLD active articles.") X X(defvar gnus-Group-display-buffer "*Newsgroup*") X(defvar gnus-Subject-display-buffer "*Subject*") X(defvar gnus-Article-display-buffer "*Article*") X X(defvar gnus-current-startup-file nil) X(defvar gnus-current-news-group nil) X(defvar gnus-current-group-begin nil) X(defvar gnus-current-group-end nil) X X(defvar gnus-current-group-articles nil X "List of articles in current news group.") X X(defvar gnus-current-group-unread-articles nil X "List of unread articles in current news group.") X X(defvar gnus-current-group-headers nil X "List of (ARTICLE-NUMBER SUBJECT FROM XREF LINES) in current news group.") X X(defvar gnus-current-article nil X "Current article number.") X X(defvar gnus-previous-article nil X "Previous article number.") X X(defvar gnus-Group-mode-map nil) X(defvar gnus-Subject-mode-map nil) X(defvar gnus-Article-mode-map nil) X X(defvar rmail-last-file (expand-file-name "~/XMBOX")) X(defvar rmail-last-rmail-file (expand-file-name "~/XNEWS")) X X(autoload 'rmail-output "rmailout" X "Append this message to Unix mail file named FILE-NAME." t) X X(put 'gnus-Group-mode 'mode-class 'special) X(put 'gnus-Subject-mode 'mode-class 'special) X(put 'gnus-Article-mode 'mode-class 'special) X X;;(put 'eval-in-buffer-window 'lisp-indent-hook 1) X X(defmacro eval-in-buffer-window (buffer &rest forms) X "Pop to BUFFER, evaluate FORMS, and then returns to original window." X (` (let ((StartBufferWindow (selected-window))) X (unwind-protect X (progn X (pop-to-buffer (, buffer)) X (,@ forms)) X (select-window StartBufferWindow))))) X X X;;; X;;; GNUS Group display mode X;;; X X(if gnus-Group-mode-map X nil X (setq gnus-Group-mode-map (make-keymap)) X (suppress-keymap gnus-Group-mode-map) X (define-key gnus-Group-mode-map " " 'gnus-Group-select-group) X (define-key gnus-Group-mode-map "=" 'gnus-Group-select-group-without-reading) X (define-key gnus-Group-mode-map "j" 'gnus-Group-read-group) X (define-key gnus-Group-mode-map "n" 'gnus-Group-next-unread-group) X (define-key gnus-Group-mode-map "p" 'gnus-Group-prev-unread-group) X (define-key gnus-Group-mode-map "\177" 'gnus-Group-prev-unread-group) X (define-key gnus-Group-mode-map "N" 'gnus-Group-next-group) X (define-key gnus-Group-mode-map "P" 'gnus-Group-prev-group) X (define-key gnus-Group-mode-map "\C-n" 'gnus-Group-next-group) X (define-key gnus-Group-mode-map "\C-p" 'gnus-Group-prev-group) X (define-key gnus-Group-mode-map "/" 'isearch-forward) X (define-key gnus-Group-mode-map "<" 'beginning-of-buffer) X (define-key gnus-Group-mode-map ">" 'end-of-buffer) X (define-key gnus-Group-mode-map "u" 'gnus-Group-unsubscribe-current-group) X (define-key gnus-Group-mode-map "U" 'gnus-Group-unsubscribe-group) X (define-key gnus-Group-mode-map "c" 'gnus-Group-catch-up) X (define-key gnus-Group-mode-map "l" 'gnus-Group-list-groups) X (define-key gnus-Group-mode-map "L" 'gnus-Group-list-all-groups) X (define-key gnus-Group-mode-map "g" 'gnus-Group-get-new-news) X (define-key gnus-Group-mode-map "b" 'gnus-Group-check-bogus-groups) X (define-key gnus-Group-mode-map "a" 'gnus-post-news) X (define-key gnus-Group-mode-map "?" 'describe-mode) X (define-key gnus-Group-mode-map "x" 'gnus-Group-force-update) X (define-key gnus-Group-mode-map "s" 'gnus-Group-force-update) X (define-key gnus-Group-mode-map "q" 'gnus-Group-exit) X (define-key gnus-Group-mode-map "Q" 'gnus-Group-quit)) X X(defun gnus-Group-mode () X "Major mode for reading news using NNTP news server. XAll normal editing commands are turned off. XInstead, these commands are available: X X\\[gnus-Group-select-group] Select this news group. X\\[gnus-Group-select-group-without-reading] List subjects in this news group. X\\[gnus-Group-read-group] Jump to specified news group. X\\[gnus-Group-next-unread-group] Move to Next unread news group. X\\[gnus-Group-prev-unread-group] Move to Previous unread news group. X\\[gnus-Group-next-group] Move to Next news group. X\\[gnus-Group-prev-group] Move to Previous news group. X\\[isearch-forward] Do incremental search forward. X\\[beginning-of-buffer] Move point to beginning of this buffer. X\\[end-of-buffer] Move point to end of this buffer. X\\[gnus-Group-unsubscribe-current-group] Toggle this news group unsubscribe from/to subscribe. X\\[gnus-Group-unsubscribe-group] Toggle news group unsubscribe from/to subscribe. X\\[gnus-Group-catch-up] Mark all articles in this news group as read. X\\[gnus-Group-list-groups] Revert this buffer. X\\[gnus-Group-list-all-groups] List all of news groups. X\\[gnus-Group-get-new-news] Get new news. X\\[gnus-Group-check-bogus-groups] Check bogus news groups. X\\[gnus-post-news] Post an article to JUNET (USENET). X\\[describe-mode] Describe this mode. X\\[gnus-Group-force-update] Save .newsrc file. X\\[gnus-Group-exit] Quit reading news. X\\[gnus-Group-quit] Quit reading news without saving .newsrc file. X XThe following commands are available: X\\{gnus-Group-mode-map} X XIf there is a file named `~/.newsrc-HOST', it is used as startup file Xinstead of standard one when talking to a news server on HOST. You are Xable to talk to hosts more than one by using different startup files Xfor each. X XBy giving an argument to command `\\[gnus]', you can choose news server Xhost different from default one. X XIf there is a file named `~/.signature-DISTRIBUTION', it is used as Xsignature file instead of standard one when posting a news in XDISTRIBUTION. X XIf you are novice to network news, it is recommended to set variable X`gnus-novice-user' to non-NIL. You will be asked newsgroup, subject, Xand distribution when posting a new news if the value is set to Xnon-NIL (defalut). X XIf news server is your local host, GNUS won't use NNTP but go to local Xnews spool directly after loading `nnspool' by itself. X XEntry to this mode calls the value of gnus-Group-mode-hook with no arguments, Xif that value is non-nil." X (interactive) X (kill-all-local-variables) X (setq major-mode 'gnus-Group-mode) X (setq mode-name (concat "GNUS talking to " gnus-server-host)) X (setq mode-line-buffer-identification "GNUS: List of Newsgroups") X (use-local-map gnus-Group-mode-map) X (setq buffer-read-only t) ;Disable modification X (run-hooks 'gnus-Group-mode-hook)) X X(defun gnus (&optional ask-host) X "Read news using NNTP news server. XIf optional argument ASK-HOST is non-nil, ask news server host." X (interactive "P") X (gnus-start-news-server ask-host) X (switch-to-buffer (get-buffer-create gnus-Group-display-buffer)) X (gnus-Group-mode) X (let ((buffer-read-only nil)) X (erase-buffer) X (gnus-Group-startup-message) X (sit-for 0) X (gnus-setup-news-info) X (erase-buffer)) X (gnus-Group-list-groups nil) X (sit-for 0)) X X(defun gnus-Group-startup-message () X (insert "\n\n\n\n X GNUS Version 3.3 X X NNTP-based News Reader for GNU Emacs X X X If you have any troubles with this software, please let me X know. I would fix your problems in the next release. X X Any comment, suggestion, and bug fix are welcome. X X Masanobu UMEDA X umerin@flab.Fujitsu.JUNET")) X X(defun gnus-Group-list-groups (show-all) X "List news groups in group selection buffer. XIf argument SHOW-ALL is non-nil, unsubscribed groups are also listed." X (interactive "P") X (gnus-Group-prepare-list show-all) X (if (zerop (buffer-size)) X (message "No news is good news.") X ;; Adjust cursor point. X (goto-char (point-min)) X (search-forward ":" nil t) X )) X X(defun gnus-Group-prepare-list (&optional all) X "Prepare list of news groups in current buffer. XIf optional argument ALL is non-nil, unsubscribed groups are also listed." X (save-excursion X (let ((buffer-read-only nil) X (unread gnus-unread-assoc) X (group nil) X (group-name nil) X ;; This specifies format of Group display buffer. X (cntl "%s %5s: %s\n")) X (erase-buffer) X (goto-char (point-min)) X ;; List news groups. X (while unread X (setq group (car unread)) X (setq group-name (car group)) X (if (or all X (and (> (nth 1 group) 0) ;There are unread articles. X (nth 1 (assoc group-name gnus-newsrc-assoc)))) X (progn X (insert X (format cntl X ;; Subscribed or not. X (if (nth 1 (assoc group-name gnus-newsrc-assoc)) X " " "U") X ;; Number of unread articles. X (nth 1 group) X ;; News group name. X group-name)) X )) X (setq unread (cdr unread)) X )) X )) X X(defun gnus-Group-update-group (group &optional visible-only) X "Update news group info of GROUP. XIf optional argument VISIBLE-ONLY is non-nil, non displayed group is ignored." X (save-excursion X ;; At first update .newsrc buffer X (gnus-update-newsrc-buffer group) X ;; Then update group display buffer. X (set-buffer (get-buffer gnus-Group-display-buffer)) X (let ((buffer-read-only nil) X (visible nil) X (unread (assoc group gnus-unread-assoc)) X ;; This specifies format of Group display buffer. X (cntl "%s %5s: %s\n")) X ;; Search point to modify. X (goto-char (point-min)) X (if (re-search-forward (concat "^.+: " (regexp-quote group) "$") nil t) X ;; GROUP is listed in current buffer. X (progn X (setq visible t) X (beginning-of-line) X (kill-line 1) ;Delete old line. X )) X (if (or visible X (not visible-only)) X (insert X (format cntl X ;; Subscribed or not. X (if (nth 1 (assoc group gnus-newsrc-assoc)) X " " "U") X ;; Number of unread articles. X (nth 1 unread) X ;; News group name. X group)) X )) X )) X X;; GNUS Group mode command X X(defun gnus-Group-group-name () X "Get news group name around point." X (save-excursion X (beginning-of-line) X (if (re-search-forward "^.[ \t]*[0-9]+:[ \t]+\\([^ \t\n]+\\)$" nil t) X (buffer-substring (match-beginning 1) X (match-end 1)) X ))) X X(defun gnus-Group-select-group (all &optional no-article) X "Select news group to read at current line. XIf argument ALL is non-nil, already read articles become readable. XIf optional argument NO-ARTICLE is non-nil, no article body is displayed." X (interactive "P") X (let ((group (gnus-Group-group-name))) ;News group name to read. X (if group X (gnus-Subject-read-group X group X (or all X (not (nth 1 (assoc group gnus-newsrc-assoc))) ;Unsubscribed X (zerop (nth 1 (assoc group gnus-unread-assoc)))) ;No unread X no-article X )) X )) X X(defun gnus-Group-select-group-without-reading (all) X "Select news group to read at current line. XNo article is selected automatically. XIf argument ALL is non-nil, already read articles become readable." X (interactive "P") X (gnus-Group-select-group all t)) X X(defun gnus-Group-read-group (group &optional all) X "Start reading news in news GROUP. XIf argument ALL is non-nil, already read articles become readable." X (interactive (list (completing-read "News group: " gnus-unread-assoc) X current-prefix-arg)) X (gnus-Subject-read-group X group X (or all X (not (nth 1 (assoc group gnus-newsrc-assoc))) ;Unsubscribed X (zerop (nth 1 (assoc group gnus-unread-assoc)))) ;No unread article X )) X X(defun gnus-Group-search-forward (backward any-group) X "Search for news group forward. XIf 1st argument BACKWARD is non-nil, search backward instead. XIf 2nd argument ANY-GROUP is non-nil, unsubscribed or empty group Xmay be selected." X (let ((func (if backward 're-search-backward 're-search-forward)) X (regexp X (format "^%s[ \t]+\\(%s\\):" X (if any-group "." " ") X (if any-group "[0-9]+" "[1-9][0-9]*"))) X (found nil)) X (if backward X (beginning-of-line) X (end-of-line)) X (if (funcall func regexp nil t) X (setq found t)) X ;; Adjust cursor point. X (beginning-of-line) X (search-forward ":" nil t) X ;; Return T if found. X found X )) X X(defun gnus-Group-next-group () X "Go to next news group." X (interactive) X (if (gnus-Group-search-forward nil t) X nil X (message "No more news group."))) X X(defun gnus-Group-next-unread-group () X "Go to next unread news group." X (interactive) X (if (gnus-Group-search-forward nil nil) X nil X (message "No more news group."))) X X(defun gnus-Group-prev-group () X "Go to previous news group." X (interactive) X (gnus-Group-search-forward t t)) X X(defun gnus-Group-prev-unread-group () X "Go to previous unread news group." X (interactive) X (gnus-Group-search-forward t nil)) X X(defun gnus-Group-catch-up (no-confirm) X "Mark all articles in this news group as read. XIf argument NO-CONFIRM is non-nil, do without confirmations. XCross references (Xref: field) of articles are ignored." X (interactive "P") X (let ((group (gnus-Group-group-name))) X (if (and group X (or no-confirm X (y-or-n-p "Do you really want to mark everything as read? "))) X (progn X (gnus-update-unread-articles group nil) X (gnus-Group-update-group group) X (gnus-Group-next-unread-group)) X ))) X X(defun gnus-Group-unsubscribe-current-group () X "Toggle subscribe from/to unsubscribe this group." X (interactive) X (gnus-Group-unsubscribe-group (gnus-Group-group-name))) X X(defun gnus-Group-unsubscribe-group (group) X "Toggle subscribe from/to unsubscribe of GROUP." X (interactive (list (completing-read "News group: " gnus-newsrc-assoc))) X (let ((newsrc (assoc group gnus-newsrc-assoc))) X (if newsrc X (progn X (setcar (nthcdr 1 newsrc) X (not (nth 1 newsrc))) X (gnus-Group-update-group group) X (gnus-Group-next-group) X )) X )) X X(defun gnus-Group-list-all-groups () X "List all of news groups in group selection buffer." X (interactive) X (gnus-Group-list-groups t)) X X(defun gnus-Group-get-new-news (all) X "Re-read active file. XIf argument ALL is non-nil, unsubscribed or empty group is also listed." X (interactive "P") X (gnus-setup-news-info) X (gnus-Group-list-groups all)) X X(defun gnus-Group-check-bogus-groups () X "Check bogus news group." X (interactive) X (gnus-delete-bogus-news-group t) ;Require confirmation. X (gnus-Group-list-groups nil)) X X(defun gnus-Group-force-update () X "Update .newsrc file." X (interactive) X (gnus-save-newsrc-file)) X X(defun gnus-Group-exit () X "Quit reading news after updating .newsrc." X (interactive) X (if (y-or-n-p "Are you sure you want to quit reading news? ") X (progn X (gnus-save-newsrc-file) X (gnus-clear-system) X (nntp-close-server)) X )) X X(defun gnus-Group-quit () X "Quit reading news without updating .newsrc." X (interactive) X (if (yes-or-no-p "Quit reading news without saving .newsrc? ") X (progn X (gnus-clear-system) X (nntp-close-server)) X )) X X X;;; X;;; GNUS Subject display mode X;;; X X(if gnus-Subject-mode-map X nil X (setq gnus-Subject-mode-map (make-keymap)) X (suppress-keymap gnus-Subject-mode-map) X (define-key gnus-Subject-mode-map " " 'gnus-Subject-next-page) X (define-key gnus-Subject-mode-map "\177" 'gnus-Subject-prev-page) X (define-key gnus-Subject-mode-map "n" 'gnus-Subject-next-unread-article) X (define-key gnus-Subject-mode-map "p" 'gnus-Subject-prev-unread-article) X (define-key gnus-Subject-mode-map "N" 'gnus-Subject-next-article) X (define-key gnus-Subject-mode-map "P" 'gnus-Subject-prev-article) X (define-key gnus-Subject-mode-map "\e\C-n" 'gnus-Subject-next-same-subject) X (define-key gnus-Subject-mode-map "\e\C-p" 'gnus-Subject-prev-same-subject) X (define-key gnus-Subject-mode-map "\C-c\C-n" 'gnus-Subject-next-digest) X (define-key gnus-Subject-mode-map "\C-c\C-p" 'gnus-Subject-prev-digest) X (define-key gnus-Subject-mode-map "\C-n" 'gnus-Subject-next-subject) X (define-key gnus-Subject-mode-map "\C-p" 'gnus-Subject-prev-subject) X (define-key gnus-Subject-mode-map "\en" 'gnus-Subject-next-unread-subject) X (define-key gnus-Subject-mode-map "\ep" 'gnus-Subject-prev-unread-subject) X (define-key gnus-Subject-mode-map "." 'gnus-Subject-first-unread-article) X (define-key gnus-Subject-mode-map "/" 'isearch-forward) X (define-key gnus-Subject-mode-map "s" 'gnus-Subject-search-article-body) X (define-key gnus-Subject-mode-map "<" 'gnus-Subject-beginning-of-article) X (define-key gnus-Subject-mode-map ">" 'gnus-Subject-end-of-article) X (define-key gnus-Subject-mode-map "j" 'gnus-Subject-goto-article) X (define-key gnus-Subject-mode-map "l" 'gnus-Subject-goto-last-article) X (define-key gnus-Subject-mode-map "u" 'gnus-Subject-mark-unread-forward) X (define-key gnus-Subject-mode-map "U" 'gnus-Subject-mark-unread-backward) X (define-key gnus-Subject-mode-map "d" 'gnus-Subject-mark-read-forward) X (define-key gnus-Subject-mode-map "D" 'gnus-Subject-mark-read-backward) X (define-key gnus-Subject-mode-map "k" 'gnus-Subject-kill-same-subject) X (define-key gnus-Subject-mode-map "\C-k" 'gnus-Subject-kill-same-subject-without-reading) X (define-key gnus-Subject-mode-map "c" 'gnus-Subject-catch-up) X (define-key gnus-Subject-mode-map "\C-t" 'gnus-Subject-toggle-truncation) X (define-key gnus-Subject-mode-map "t" 'gnus-Subject-show-all-headers) X (define-key gnus-Subject-mode-map "v" 'gnus-Subject-show-all-headers) X (define-key gnus-Subject-mode-map "a" 'gnus-Subject-post-news) X (define-key gnus-Subject-mode-map "f" 'gnus-Subject-post-reply) X (define-key gnus-Subject-mode-map "C" 'gnus-Subject-cancel) X (define-key gnus-Subject-mode-map "r" 'gnus-Subject-mail-reply) X (define-key gnus-Subject-mode-map "m" 'gnus-Subject-mail-other-window) X (define-key gnus-Subject-mode-map "o" 'gnus-Subject-save-in-file) X (define-key gnus-Subject-mode-map "\C-o" 'gnus-Subject-rmail-output) X (define-key gnus-Subject-mode-map "|" 'gnus-Subject-pipe-output) X (define-key gnus-Subject-mode-map "?" 'describe-mode) X (define-key gnus-Subject-mode-map "q" 'gnus-Subject-exit) X (define-key gnus-Subject-mode-map "Q" 'gnus-Subject-quit)) X X(defun gnus-Subject-mode () X "Major mode for reading news in this news group. XAll normal editing commands are turned off. XInstead, these commands are available: X X\\[gnus-Subject-next-page] Scroll to next page of this article. (If end of the article,\n\tmove to next article.) X\\[gnus-Subject-prev-page] Scroll to previous page of this article. X\\[gnus-Subject-next-unread-article] Move to Next unread article. X\\[gnus-Subject-prev-unread-article] Move to Previous unread article. X\\[gnus-Subject-next-article] Move to Next article whether read or not. X\\[gnus-Subject-prev-article] Move to Previous article whether read or not. X\\[gnus-Subject-next-same-subject] Move to Next article which has same subject as this article. X\\[gnus-Subject-prev-same-subject] Move to Previous article which has same subject as this article. X\\[gnus-Subject-next-digest] Scroll to next digested message in this article. X\\[gnus-Subject-prev-digest] Scroll to previous digested message in this article. X\\[gnus-Subject-next-subject] Move to next subject line. X\\[gnus-Subject-prev-subject] Move to previous subject line. X\\[gnus-Subject-next-unread-subject] Move to next unread article's subject. X\\[gnus-Subject-prev-unread-subject] Move to previous unread article's subject. X\\[gnus-Subject-first-unread-article] Jump to first unread article in this news group. X\\[isearch-forward] Do incremental search forward. X\\[gnus-Subject-search-article-body] Do incremental search forward on this article body. X\\[gnus-Subject-beginning-of-article] Move point to beginning of this article. X\\[gnus-Subject-end-of-article] Move point to end of this article. X\\[gnus-Subject-goto-article] Jump to article specified by numeric article ID. X\\[gnus-Subject-goto-last-article] Jump to article you read last. X\\[gnus-Subject-mark-unread-forward] Mark this article as unread, and go forward. X\\[gnus-Subject-mark-unread-backward] Mark this article as unread, and go backward. X\\[gnus-Subject-mark-read-forward] Mark this article as read, and go forward. X\\[gnus-Subject-mark-read-backward] Mark this article as read, and go backward. X\\[gnus-Subject-kill-same-subject] Mark articles which has same subject as this article as read. X\\[gnus-Subject-kill-same-subject-without-reading] Mark articles which has same subject as this article as read. X Don't select article after that. X\\[gnus-Subject-catch-up] Mark all of articles in this news group as read. X\\[gnus-Subject-toggle-truncation] Toggle truncation of subject lines. X\\[gnus-Subject-show-all-headers] Show all headers of this article. X\\[gnus-Subject-post-news] Post an article. X\\[gnus-Subject-post-reply] Post a reply article. X\\[gnus-Subject-cancel] Cancel this article. (The article must be yours). X\\[gnus-Subject-mail-reply] Mail a message to the author. X\\[gnus-Subject-mail-other-window] Mail a message in other window. X\\[gnus-Subject-save-in-file] Append this article to file. X\\[gnus-Subject-rmail-output] Append this article to file in Unix mail format. X\\[gnus-Subject-pipe-output] Pipe this article to subprocess. X\\[describe-mode] Describe this mode. X\\[gnus-Subject-exit] Quit reading news in this news group. X\\[gnus-Subject-quit] Quit reading news without updating read articles information. X XThe following commands are available: X\\{gnus-Subject-mode-map} X XEntry to this mode calls the value of gnus-Subject-mode-hook with no arguments, Xif that value is non-nil." X (interactive) X (kill-all-local-variables) X (setq major-mode 'gnus-Subject-mode) X (setq mode-name (concat "GNUS " gnus-current-news-group)) X (gnus-Subject-set-mode-line) X (use-local-map gnus-Subject-mode-map) X (setq buffer-read-only t) ;Disable modification X (setq truncate-lines t) ;Stop folding of lines. X (run-hooks 'gnus-Subject-mode-hook)) X X(defun gnus-Subject-read-group (group &optional show-all no-article) X "Start reading news in news GROUP. XIf optional 1st argument SHOW-ALL is non-nil, already read articles are Xalso listed. XIf optional 2nd argument NO-ARTICLE is non-nil, no article body is displayed." X (message "Retrieving news group: %s..." group) X (if (gnus-select-news-group group show-all) X (progn X ;; Don't switch-to-buffer to prevent displaying old contents X ;; of the buffer. X ;; Suggested by Juha Heinanen X (set-buffer (get-buffer-create gnus-Subject-display-buffer)) X (gnus-Subject-mode) X (gnus-Subject-prepare-list) X (switch-to-buffer (current-buffer)) X (message "") ;Erase message. X (if (zerop (buffer-size)) X ;; This news group is empty. X (progn X (setq gnus-current-group-unread-articles nil) X (gnus-Subject-exit) X (message "No unread news.")) X ;; Show first unread article. X (goto-char (point-min)) X (if (not no-article) X (gnus-Subject-first-unread-article) X ;; Kill article display buffer because I sometime get X ;; confused by old article buffer. X (if (get-buffer gnus-Article-display-buffer) X (kill-buffer gnus-Article-display-buffer) X )) X ;; Adjust cursor point. X (beginning-of-line) X (search-forward ":" nil t) X )) X ;; Cannot select news GROUP. X (message "No such news group: %s" group) X (sit-for 0) X ;; Run checking bogus news groups. X (gnus-delete-bogus-news-group t) ;Confirm X )) X X(defun gnus-Subject-prepare-list () X "Prepare subject list of current news group in current buffer." X (save-excursion X (let* ((buffer-read-only nil) X (id 0) X (headers gnus-current-group-headers) X (header nil) X (unread (copy-sequence gnus-current-group-unread-articles)) X ;; These define format of subject display buffer. X (name-length (length "umerin@photon")) X (cntl X (format "%%s %%%ds: [%%3d:%%s] %%s\n" X (length (prin1-to-string gnus-current-group-end))))) X ;; News group must be selected before calling me. X (erase-buffer) X (while headers X (setq header (car headers)) X (setq id (nntp-headers-number header)) X (setq unread (delq id unread)) X (insert X (format cntl X (if (memq id gnus-current-group-unread-articles) X " " "D") ;Read or not. X id ;Article ID. X ;; Lines of the article. X ;; Suggested by dana@bellcore.com. X (nntp-headers-lines header) X ;; Its author. X (substring (concat (mail-strip-quoted-names X (nntp-headers-from header)) X (make-string name-length ? )) X 0 name-length) X ;; Its subject. X (nntp-headers-subject header))) X (setq headers (cdr headers)) X ) X ;; If unread is non-nil, there exists expired articles. In this X ;; case, these articles must be removed from unread articles. X (while unread X (setq gnus-current-group-unread-articles X (delq (car unread) gnus-current-group-unread-articles)) X (setq unread (cdr unread))) X ))) X X(defun gnus-Subject-set-mode-line () X "Set Subject mode line string." X (let ((subject (nntp-headers-subject X (assoc gnus-current-article X gnus-current-group-headers)))) X (setq mode-line-process X (concat " " X (if (integerp gnus-current-group-begin) X (int-to-string gnus-current-group-begin) X "?") X "-" X (if (integerp gnus-current-group-end) X (int-to-string gnus-current-group-end) X "?") X )) X (setq mode-line-buffer-identification X (concat "GNUS: " X subject X ;; Enough spaces to pad subject to 17 positions. X (substring " " X 0 (max 0 (- 17 (length subject)))))) X (set-buffer-modified-p t) X (sit-for 0) X )) X X;; GNUS Subject display mode command. X X(defun gnus-Subject-search-subject (backward unread subject) X "Search for article forward. XIf 1st argument BACKWARD is non-nil, search backward. XIf 2nd argument UNREAD is non-nil, only unread article is selected. XIf 3rd argument SUBJECT is non-nil, the article which has Xthe same subject will be searched for." X (let ((func (if backward 're-search-backward 're-search-forward)) X (article nil) X (case-fold-search nil) ;Don't ignore case. X (regexp X (format "^%s[ \t]+\\([0-9]+\\):[ \t]+\\[.*\\][ \t]+%s" X (if unread " " ".") X (if subject X (concat "\\([Rr][Ee]:[ \t]+\\)*" X (regexp-quote (gnus-simplify-subject subject)) X ;; Ignore words in parentheses. X "\\([ \t]*(.*)\\)*[ \t]*$") X "") X ))) X (if backward X (beginning-of-line) X (end-of-line)) X (if (funcall func regexp nil t) X (setq article X (string-to-int (buffer-substring (match-beginning 1) X (match-end 1)))) X ) X ;; Adjust cursor point. X (beginning-of-line) X (search-forward ":" nil t) X ;; Scroll window so as to cursor comes center of subject window X ;; only when article is displayed. X ;; Suggested by earle@mahendo.JPL.NASA.GOV (Greg Earle). X (if (and article X (get-buffer-window gnus-Article-display-buffer) X (< (/ (- (window-height) 1) 2) X (count-lines (point) (point-max)))) X (recenter (/ (- (window-height) 2) 2))) X ;; This is the result. X article X )) X X(defun gnus-Subject-search-forward (&optional unread subject) X "Search for article forward. XIf 1st optional argument UNREAD is non-nil, only unread article is selected. XIf 2nd optional argument SUBJECT is non-nil, the article which has Xthe same subject will be searched for." X (gnus-Subject-search-subject nil unread subject)) X X(defun gnus-Subject-search-backward (&optional unread subject) X "Search for article backward. XIf 1st optional argument UNREAD is non-nil, only unread article is selected. XIf 2nd optional argument SUBJECT is non-nil, the article which has Xthe same subject will be searched for." X (gnus-Subject-search-subject t unread subject)) X X(defun gnus-Subject-article-number () X "Article number around point." X (save-excursion X (beginning-of-line) X (if (re-search-forward "^.[ \t]+\\([0-9]+\\):" nil t) X (string-to-int X (buffer-substring (match-beginning 1) (match-end 1))) X ;; If search fail, return current article number. X gnus-current-article) X )) X X(defun gnus-Subject-subject-string () X "Return current subject string or nil if non." X (save-excursion X ;; It is possible to implement this function using X ;; `gnus-Subject-article-number' and `gnus-current-group-headers'. X (beginning-of-line) X (if (re-search-forward "^.[ \t]+[0-9]+:[ \t]+\\[.*\\][ \t]+\\(.*\\)$" X nil t) X (let ((subject (buffer-substring (match-beginning 1) (match-end 1)))) X ;; Trim spaces of subject. X (if (string-match "\\`[ \t]+\\([^ \t].*\\)\\'" subject) X (setq subject (substring subject (match-beginning 1)))) X ;; Return subject string. X subject X ) X nil X ))) X X(defun gnus-Subject-goto-subject (article) X "Move point to ARTICLE." X (interactive "NArticle ID: ") X (goto-char (point-min)) X (re-search-forward (format "^.[ \t]+%d:" article) nil t)) X X;; Walking around subject lines. X X(defun gnus-Subject-next-subject (unread) X "Go to next subject line. XIf argument UNREAD is non-nil, only unread article is selected." X (interactive "P") X (cond ((gnus-Subject-search-forward unread)) X (unread X (message "No more unread articles.")) X (t X (message "No more articles.")) X )) X X(defun gnus-Subject-next-unread-subject () X "Go to next unread subject line." X (interactive) X (gnus-Subject-next-subject t)) X X(defun gnus-Subject-prev-subject (unread) X "Go to previous subject line. XIf argument UNREAD is non-nil, only unread article is selected." X (interactive "P") X (cond ((gnus-Subject-search-backward unread)) X (unread X (message "No more unread articles.")) X (t X (message "No more articles.")) X )) X X(defun gnus-Subject-prev-unread-subject () X "Go to previous unread subject line." X (interactive) X (gnus-Subject-prev-subject t)) X X;; Walking around subject lines with displaying articles. X X(defun gnus-Subject-configure-window () X "Use two window mode. One is for reading subjects and the other is article." X (if (one-window-p t) X (progn X ;; We have to prepare article buffer first to prevent X ;; displaying subject buffer twice. X ;; Suggested by Juha Heinanen X (gnus-Article-setup-buffer) X (switch-to-buffer gnus-Subject-display-buffer) X (split-window-vertically (1+ gnus-subject-lines-height)) X (other-window 1) X (switch-to-buffer gnus-Article-display-buffer) X (other-window 1) X ))) X X(defun gnus-Subject-display-article (article &optional all-header) X "Display ARTICLE in article display buffer." X (if article X (progn X (gnus-Subject-configure-window) X (let ((window (selected-window))) X (gnus-Article-prepare article all-header) X (pop-to-buffer gnus-Article-display-buffer) X (select-window window) X (gnus-Subject-set-mode-line))) X )) X X(defun gnus-Subject-select-article (&optional all-headers force) X "Select current article. XOptional 1st argument ALL-HEADERS is non-nil, show all headers. XOptional 2nd argument FORCE is non-nil, force update." X (let ((article (gnus-Subject-article-number))) X (if (or force X (null gnus-current-article) X (/= article gnus-current-article)) X ;; Selected subject is different from current article's. X (gnus-Subject-display-article article all-headers) X (or (get-buffer-window gnus-Article-display-buffer) X (gnus-Subject-configure-window)) X ) X )) X X(defun gnus-Subject-next-article (unread &optional subject) X "Select article after current one. XIf argument UNREAD is non-nil, only unread article is selected." X (interactive "P") X (cond ((gnus-Subject-display-article X (gnus-Subject-search-forward unread subject))) X (unread X (message "No more unread articles.")) X (t X (message "No more articles.")) X )) X X(defun gnus-Subject-next-unread-article () X "Select unread article after current one." X (interactive) X (gnus-Subject-next-article t)) X X(defun gnus-Subject-prev-article (unread &optional subject) X "Select article before current one. XIf argument UNREAD is non-nil, only unread article is selected." X (interactive "P") X (cond ((gnus-Subject-display-article X (gnus-Subject-search-backward unread subject))) X (unread X (message "No more unread articles.")) X (t X (message "No more articles.")) X )) X X(defun gnus-Subject-prev-unread-article () X "Select unred article before current one." X (interactive) X (gnus-Subject-prev-article t)) X X(defun gnus-Subject-next-page () X "Show next page of selected article. XIf end of artile, select next article." X (interactive) X (let ((article (gnus-Subject-article-number)) X (endp nil)) X (if (or (null gnus-current-article) X (/= article gnus-current-article)) X ;; Selected subject is different from current article's. X (gnus-Subject-display-article article) X (gnus-Subject-configure-window) X (eval-in-buffer-window gnus-Article-display-buffer X (setq endp (gnus-Article-next-page))) X (if endp X (gnus-Subject-next-unread-article))) X )) X X(defun gnus-Subject-prev-page () X "Show previous page of selected article." X (interactive) X (let ((article (gnus-Subject-article-number))) X (if (or (null gnus-current-article) X (/= article gnus-current-article)) X ;; Selected subject is different from current article's. X (gnus-Subject-display-article article) X (gnus-Subject-configure-window) X (eval-in-buffer-window gnus-Article-display-buffer X (gnus-Article-prev-page)) X ))) X X(defun gnus-Subject-next-same-subject () X "Select next article which has the same subject as current one." X (interactive) X (gnus-Subject-next-article nil (gnus-Subject-subject-string))) X X(defun gnus-Subject-prev-same-subject () X "Select previous article which has the same subject as current one." X (interactive) X (gnus-Subject-prev-article nil (gnus-Subject-subject-string))) X X(defun gnus-Subject-next-digest () X "Move to head of next digested message." X (interactive) X (gnus-Subject-select-article) X (eval-in-buffer-window gnus-Article-display-buffer X (gnus-Article-next-digest) X )) X X(defun gnus-Subject-prev-digest () X "Move to head of previous digested message." X (interactive) X (gnus-Subject-select-article) X (eval-in-buffer-window gnus-Article-display-buffer X (gnus-Article-prev-digest) X )) X X(defun gnus-Subject-first-unread-article () X "Select first unread article." X (interactive) X (let ((begin (point))) X (goto-char (point-min)) X (if (re-search-forward "^ [ \t]+[0-9]+:" nil t) X (gnus-Subject-display-article (gnus-Subject-article-number)) X ;; If there is no unread articles, stay there. X (goto-char begin) X (gnus-Subject-display-article (gnus-Subject-article-number)) X ) X )) X X(defun gnus-Subject-search-article-body () X "Search on article body." X (interactive) X (gnus-Subject-select-article) X (eval-in-buffer-window gnus-Article-display-buffer X (call-interactively 'isearch-forward) X )) X X(defun gnus-Subject-beginning-of-article () X "Go to beginning of article body" X (interactive) X (gnus-Subject-select-article) X (eval-in-buffer-window gnus-Article-display-buffer X (beginning-of-buffer) X )) X X(defun gnus-Subject-end-of-article () X "Go to end of article body" X (interactive) X (gnus-Subject-select-article) X (eval-in-buffer-window gnus-Article-display-buffer X (end-of-buffer) X )) X X(defun gnus-Subject-goto-article (article) X "Go to ARTICLE." X (interactive (list X (string-to-int X (completing-read "Article number: " X (mapcar X '(lambda (headers) X (list (int-to-string X (nntp-headers-number headers)))) X gnus-current-group-headers))))) X (if (gnus-Subject-goto-subject article) X (gnus-Subject-display-article article))) X X(defun gnus-Subject-goto-last-article () X "Go to last subject line." X (interactive) X (if gnus-previous-article X (gnus-Subject-goto-article gnus-previous-article))) X X(defun gnus-Subject-show-all-headers () X "Show all article header." X (interactive) X (gnus-Subject-select-article t t)) X X(defun gnus-Subject-kill-same-subject (no-select) X "Mark articles which has the same subject as read. XIf argument NO-SELECT is non-nil, next unread article is not selected." X (interactive "P") X (let* ((article (gnus-Subject-article-number)) X (cntl (format "^.[ \t]+%d:" article)) X (subject nil) X (count 0)) X (save-excursion X (goto-char (point-min)) X (if (re-search-forward cntl nil t) X (progn X (setq subject (gnus-Subject-subject-string)) X (gnus-Subject-mark-read article) X (setq count (1+ count)) X (while (and subject X (gnus-Subject-search-forward t subject)) X (gnus-Subject-mark-read (gnus-Subject-article-number)) X (setq count (1+ count))) X )) X ) X (if no-select X (gnus-Subject-next-subject t) X (gnus-Subject-next-unread-article)) X (message "%d articles are marked as read." count) X )) X X(defun gnus-Subject-kill-same-subject-without-reading () X "Mark articles which has the same subject as read. XDon't select article after that." X (interactive) X (gnus-Subject-kill-same-subject t)) X X(defun gnus-Subject-mark-unread-forward (&optional article) X "Mark current subject as unread, and then go forward. XIf optional argument ARTICLE is non-nil, the ARTICLE rather than Xcurrent is marked as unread." X (interactive) X (gnus-Subject-mark-unread (or article X (gnus-Subject-article-number))) X (gnus-Subject-next-subject nil)) X X(defun gnus-Subject-mark-unread-backward (&optional article) X "Mark current subject as unread, and then go backward. XIf optional argument ARTICLE is non-nil, the ARTICLE rather than Xcurrent is marked as unread." X (interactive) X (gnus-Subject-mark-unread (or article X (gnus-Subject-article-number))) X (gnus-Subject-prev-subject nil)) X X(defun gnus-Subject-mark-unread (article) X "Mark ARTICLE's subject as unread." X (save-excursion X (set-buffer gnus-Subject-display-buffer) X (let ((buffer-read-only nil)) X (if (not (memq article gnus-current-group-unread-articles)) X (progn X ;; Add to list. X (setq gnus-current-group-unread-articles X (cons article gnus-current-group-unread-articles)) X (if (gnus-Subject-goto-subject article) X (progn X (beginning-of-line) X (delete-region (point) (1+ (point))) X (insert " "))) X )) X ))) X X(defun gnus-Subject-mark-read-forward (&optional article) X "Mark current subject as read, and then go forward. XIf optional argument ARTICLE is non-nil, the ARTICLE rather than Xcurrent is marked as read." X (interactive) X (gnus-Subject-mark-read (or article X (gnus-Subject-article-number))) X (gnus-Subject-next-subject t)) X X(defun gnus-Subject-mark-read-backward (&optional article) X "Mark current subject as read, and then go backward. XIf optional argument ARTICLE is non-nil, the ARTICLE rather than Xcurrent is marked as read." X (interactive) X (gnus-Subject-mark-read (or article X (gnus-Subject-article-number))) X (gnus-Subject-prev-subject t)) X X(defun gnus-Subject-mark-read (article) X "Mark ARTICLE's subject as read." X (save-excursion X (set-buffer gnus-Subject-display-buffer) X (let ((buffer-read-only nil)) X (if (memq article gnus-current-group-unread-articles) X (progn X ;; Remove from list. X (setq gnus-current-group-unread-articles X (delq article gnus-current-group-unread-articles)) X (if (gnus-Subject-goto-subject article) X (progn X (beginning-of-line) X (delete-region (point) (1+ (point))) X (insert "D"))) X )) X ))) X X(defun gnus-Subject-catch-up () X "Mark all articles in this news group as read." X (interactive) X (if (y-or-n-p "Do you really want to mark everything as read? ") X (progn X (setq gnus-current-group-unread-articles nil) X (gnus-Subject-exit)) X )) X X(defun gnus-Subject-toggle-truncation (arg) X "Toggle truncation of subject lines. XWith arg, turn line truncation on iff arg is positive." X (interactive "P") X (setq truncate-lines X (if (null arg) (not truncate-lines) X (> (prefix-numeric-value arg) 0))) X (redraw-display)) X X(defun gnus-Subject-post-news () X "Post a news article." X (interactive) X (gnus-Subject-select-article) X (switch-to-buffer gnus-Article-display-buffer) X (delete-other-windows) X (gnus-post-news)) X X(defun gnus-Subject-post-reply () X "Post a reply article." X (interactive) X (gnus-Subject-select-article) X (switch-to-buffer gnus-Article-display-buffer) X (delete-other-windows) X (gnus-news-reply)) X X(defun gnus-Subject-cancel () X "Cancel an article you posted." X (interactive) X (gnus-Subject-select-article) X (if (yes-or-no-p "Do you really want to cancel this article? ") X (eval-in-buffer-window gnus-Article-display-buffer X (gnus-inews-control-cancel)) X )) X X(defun gnus-Subject-mail-reply () X "Reply mail to news author." X (interactive) X (gnus-Subject-select-article) X (switch-to-buffer gnus-Article-display-buffer) X (delete-other-windows) X (news-mail-reply)) X X(defun gnus-Subject-mail-other-window () X "Reply mail to news author in other window." X (interactive) X (gnus-Subject-select-article) X (switch-to-buffer gnus-Article-display-buffer) X (delete-other-windows) X (news-mail-other-window)) X X(defun gnus-Subject-rmail-output () X "Append this article to Unix mail file." X (interactive) X (gnus-Subject-select-article) X (eval-in-buffer-window gnus-Article-display-buffer X (call-interactively 'rmail-output))) X X(defun gnus-Subject-save-in-file () X "Append this article to file. XDirectory to save to is default to `gnus-article-save-directory'." X (interactive) X (gnus-Subject-select-article) X (eval-in-buffer-window gnus-Article-display-buffer X (let ((buffer-read-only nil) X (file (read-file-name "Save article in file: " X (concat (file-name-directory X (or gnus-article-save-directory "~/")) X gnus-current-news-group)))) X (save-excursion X (unwind-protect X ;; Append newline at end of the buffer as separator, and X ;; then save it to file. After that, delete the newline X ;; safely. X (progn X (goto-char (point-max)) X (insert "\n") X (append-to-file (point-min) (point-max) file)) X (delete-region (1- (point-max)) (point-max)))) X ;; Remember the directory name to save articles. X (setq gnus-article-save-directory (file-name-directory file))) X )) X X(defun gnus-Subject-pipe-output () X "Pipe this article to command subprocess." X (interactive) X (gnus-Subject-select-article) X (eval-in-buffer-window gnus-Article-display-buffer X (shell-command-on-region (point-min) (point-max) X (read-string "Shell command on article: ") nil) X )) X X(defun gnus-Subject-exit () X "Exit reading current news group, and then return to group selection mode." X (interactive) X (let ((updated nil)) X (gnus-update-unread-articles gnus-current-news-group X gnus-current-group-unread-articles) X (setq updated X (gnus-mark-as-read-by-xref gnus-current-news-group X gnus-current-group-headers X gnus-current-group-unread-articles)) X ;; Return to Group selection mode. X (if (get-buffer gnus-Subject-display-buffer) X (bury-buffer gnus-Subject-display-buffer)) X (if (get-buffer gnus-Article-display-buffer) X (bury-buffer gnus-Article-display-buffer)) X (switch-to-buffer gnus-Group-display-buffer) X (delete-other-windows) X ;; Update cross referenced group info. X (while updated X (gnus-Group-update-group (car updated) t) ;Ignore non-visible group. X (setq updated (cdr updated))) X (gnus-Group-update-group gnus-current-news-group) X (gnus-Group-next-unread-group) X )) X X(defun gnus-Subject-quit () X "Quit reading current news group without updating read article info." X (interactive) X (if (y-or-n-p "Do you really wanna quit reading this group? ") X (progn X ;; Return to Group selection mode. X (if (get-buffer gnus-Subject-display-buffer) X (bury-buffer gnus-Subject-display-buffer)) X (if (get-buffer gnus-Article-display-buffer) SHAR_EOF echo "End of part 1" echo "File gnus.el is continued in part 2" echo "2" > s2_seq_.tmp exit 0 -- Masanobu UMEDA umerin@flab.flab.Fujitsu.JUNET umerin%flab.flab.Fujitsu.JUNET@uunet.uu.NET