annotate lisp/obsolete/rnewspost.el @ 102351:a11b9c55c39c

(clear-abbrev-table): Always return nil (Bug#2515).
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 01 Mar 2009 19:22:22 +0000
parents a9dc0e7c3f2b
children 395f430854da
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
1 ;;; rnewspost.el --- USENET news poster/mailer for GNU Emacs
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
2
74509
f7702c5f335d Update copyright years.
Glenn Morris <rgm@gnu.org>
parents: 68640
diff changeset
3 ;; Copyright (C) 1985, 1986, 1987, 1995, 2001, 2002, 2003, 2004,
100908
a9dc0e7c3f2b Add 2009 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 94667
diff changeset
4 ;; 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
5
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
6 ;; Maintainer: FSF
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
7 ;; Keywords: mail, news
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
8
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
10
94667
43d30a1ea764 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94000
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
94667
43d30a1ea764 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94000
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
43d30a1ea764 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94000
diff changeset
14 ;; (at your option) any later version.
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
15
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
20
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
94667
43d30a1ea764 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94000
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
23
94000
ee22366f2a68 Add a comment giving version of obsolescence.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
24 ;;; Commentary:
ee22366f2a68 Add a comment giving version of obsolescence.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
25
ee22366f2a68 Add a comment giving version of obsolescence.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
26 ;; This file has been obsolete since Emacs 22.1.
ee22366f2a68 Add a comment giving version of obsolescence.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
27
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
28 ;;; Change Log:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
29
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
30 ;; moved posting and mail code from rnews.el
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
31 ;; tower@gnu.org Wed Oct 29 1986
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
32 ;; brought posting code almost up to the revision of RFC 850 for News 2.11
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
33 ;; - couldn't see handling the special meaning of the Keyword: poster
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
34 ;; - not worth the code space to support the old A news Title: (which
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
35 ;; Subject: replaced) and Article-I.D.: (which Message-ID: replaced)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
36 ;; tower@gnu.org Nov 86
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
37 ;; changed C-c C-r key-binding due to rename of news-caesar-buffer-body
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
38 ;; tower@gnu.org 21 Nov 86
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
39 ;; added (require 'rnews) tower@gnu.org 22 Apr 87
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
40 ;; restricted call of news-show-all-headers in news-post-news & news-reply
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
41 ;; tower@gnu.org 28 Apr 87
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
42 ;; commented out Posting-Front-End to save USENET bytes tower@gnu.org Jul 31 87
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
43 ;; commented out -n and -t args in news-inews tower@gnu.org 15 Oct 87
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
44
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
45 ;Now in paths.el.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
46 ;(defvar news-inews-program "inews"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
47 ; "Function to post news.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
48
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
49 ;; Replying and posting news items are done by these functions.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
50 ;; imported from rmail and modified to work with rnews ...
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
51 ;; Mon Mar 25,1985 at 03:07:04 ads@mit-hermes.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
52 ;; this is done so that rnews can operate independently from rmail.el and
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
53 ;; sendmail and doesn't have to autoload these functions.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
54 ;;
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
55 ;;; >> Nuked by Mly to autoload those functions again, as the duplication of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
56 ;;; >> code was making maintenance too difficult.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
57
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
58 ;;; Code:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
59
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
60 (require 'sendmail)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
61 (require 'rnews)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
62
65188
7f49644777be (mail-reply-buffer): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 64751
diff changeset
63 (defvar mail-reply-buffer)
7f49644777be (mail-reply-buffer): Add defvar.
Juanma Barranquero <lekktu@gmail.com>
parents: 64751
diff changeset
64
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
65 (defvar news-reply-mode-map () "Mode map used by news-reply.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
66
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
67 (or news-reply-mode-map
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
68 (progn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
69 (setq news-reply-mode-map (make-keymap))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
70 (define-key news-reply-mode-map "\C-c\C-f\C-d" 'news-reply-distribution)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
71 (define-key news-reply-mode-map "\C-c\C-f\C-k" 'news-reply-keywords)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
72 (define-key news-reply-mode-map "\C-c\C-f\C-n" 'news-reply-newsgroups)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
73 (define-key news-reply-mode-map "\C-c\C-f\C-f" 'news-reply-followup-to)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
74 (define-key news-reply-mode-map "\C-c\C-f\C-s" 'mail-subject)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
75 (define-key news-reply-mode-map "\C-c\C-f\C-a" 'news-reply-summary)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
76 (define-key news-reply-mode-map "\C-c\C-t" 'mail-text)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
77 (define-key news-reply-mode-map "\C-c\C-r" 'news-caesar-buffer-body)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
78 (define-key news-reply-mode-map "\C-c\C-w" 'news-reply-signature)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
79 (define-key news-reply-mode-map "\C-c\C-y" 'news-reply-yank-original)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
80 (define-key news-reply-mode-map "\C-c\C-q" 'mail-fill-yanked-message)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
81 (define-key news-reply-mode-map "\C-c\C-c" 'news-inews)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
82 (define-key news-reply-mode-map "\C-c\C-s" 'news-inews)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
83 (define-key news-reply-mode-map [menu-bar] (make-sparse-keymap))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
84 (define-key news-reply-mode-map [menu-bar fields]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
85 (cons "Fields" (make-sparse-keymap "Fields")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
86 (define-key news-reply-mode-map [menu-bar fields news-reply-distribution]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
87 '("Distribution" . news-reply-distribution))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
88 (define-key news-reply-mode-map [menu-bar fields news-reply-keywords]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
89 '("Keywords" . news-reply-keywords))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
90 (define-key news-reply-mode-map [menu-bar fields news-reply-newsgroups]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
91 '("Newsgroups" . news-reply-newsgroups))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
92 (define-key news-reply-mode-map [menu-bar fields news-reply-followup-to]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
93 '("Followup-to" . news-reply-followup-to))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
94 (define-key news-reply-mode-map [menu-bar fields mail-subject]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
95 '("Subject" . mail-subject))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
96 (define-key news-reply-mode-map [menu-bar fields news-reply-summary]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
97 '("Summary" . news-reply-summary))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
98 (define-key news-reply-mode-map [menu-bar fields mail-text]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
99 '("Text" . mail-text))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
100 (define-key news-reply-mode-map [menu-bar news]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
101 (cons "News" (make-sparse-keymap "News")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
102 (define-key news-reply-mode-map [menu-bar news news-caesar-buffer-body]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
103 '("Rot13" . news-caesar-buffer-body))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
104 (define-key news-reply-mode-map [menu-bar news news-reply-yank-original]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
105 '("Yank Original" . news-reply-yank-original))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
106 (define-key news-reply-mode-map [menu-bar news mail-fill-yanked-message]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
107 '("Fill Yanked Messages" . mail-fill-yanked-message))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
108 (define-key news-reply-mode-map [menu-bar news news-inews]
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
109 '("Send" . news-inews))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
110
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
111 (defun news-reply-mode ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
112 "Major mode for editing news to be posted on USENET.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
113 First-time posters are asked to please read the articles in newsgroup:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
114 news.announce.newusers .
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
115 Like Text Mode but with these additional commands:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
116
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
117 C-c C-s news-inews (post the message) C-c C-c news-inews
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
118 C-c C-f move to a header field (and create it if there isn't):
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
119 C-c C-f C-n move to Newsgroups: C-c C-f C-s move to Subj:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
120 C-c C-f C-f move to Followup-To: C-c C-f C-k move to Keywords:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
121 C-c C-f C-d move to Distribution: C-c C-f C-a move to Summary:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
122 C-c C-y news-reply-yank-original (insert current message, in NEWS).
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
123 C-c C-q mail-fill-yanked-message (fill what was yanked).
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
124 C-c C-r caesar rotate all letters by 13 places in the article's body (rot13)."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
125 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
126 (kill-all-local-variables)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
127 (make-local-variable 'mail-reply-buffer)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
128 (setq mail-reply-buffer nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
129 (set-syntax-table text-mode-syntax-table)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
130 (use-local-map news-reply-mode-map)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
131 (setq local-abbrev-table text-mode-abbrev-table)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
132 (setq major-mode 'news-reply-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
133 (setq mode-name "News Reply")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
134 (make-local-variable 'paragraph-separate)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
135 (make-local-variable 'paragraph-start)
62769
a1fa16a75bde * obsolete/ooutline.el (outline-mode):
Lute Kamstra <lute@gnu.org>
parents: 52401
diff changeset
136 (run-mode-hooks 'text-mode-hook 'news-reply-mode-hook))
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
137
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
138 (defvar news-reply-yank-from ""
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
139 "Save `From:' field for `news-reply-yank-original'.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
140
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
141 (defvar news-reply-yank-message-id ""
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
142 "Save `Message-Id:' field for `news-reply-yank-original'.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
143
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
144 (defun news-reply-yank-original (arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
145 "Insert the message being replied to, if any (in Mail mode).
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
146 Puts point before the text and mark after.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
147 Indents each nonblank line ARG spaces (default 3).
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
148 Just \\[universal-argument] as argument means don't indent
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
149 and don't delete any header fields."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
150 (interactive "P")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
151 (mail-yank-original arg)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
152 (exchange-point-and-mark)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
153 (run-hooks 'news-reply-header-hook))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
154
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
155 (defvar news-reply-header-hook
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
156 (lambda ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
157 (insert "In article " news-reply-yank-message-id
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
158 " " news-reply-yank-from " writes:\n\n"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
159 "Hook for inserting a header at the top of a yanked message.")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
160
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
161 (defun news-reply-newsgroups ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
162 "Move point to end of `Newsgroups:' field.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
163 RFC 850 constrains the `Newsgroups:' field to be a comma-separated list
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
164 of valid newsgroup names at your site. For example,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
165 Newsgroups: news.misc,comp.misc,rec.misc"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
166 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
167 (expand-abbrev)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
168 (goto-char (point-min))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
169 (mail-position-on-field "Newsgroups"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
170
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
171 (defun news-reply-followup-to ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
172 "Move point to end of `Followup-To:' field. Create the field if none.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
173 One usually requests followups to only one newsgroup.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
174 RFC 850 constrains the `Followup-To:' field to be a comma-separated list
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
175 of valid newsgroups names at your site, and it must be a subset of the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
176 `Newsgroups:' field. For example:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
177 Newsgroups: news.misc,comp.misc,rec.misc,misc.misc,soc.misc
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
178 Followup-To: news.misc,comp.misc,rec.misc"
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
179 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
180 (expand-abbrev)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
181 (or (mail-position-on-field "Followup-To" t)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
182 (progn (mail-position-on-field "newsgroups")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
183 (insert "\nFollowup-To: ")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
184 ;; @@ could do a completing read based on the Newsgroups: field to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
185 ;; @@ fill in the Followup-To: field
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
186 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
187
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
188 (defun news-reply-distribution ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
189 "Move point to end of `Distribution:' optional field.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
190 Create the field if none. Without this field the posting goes to all of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
191 USENET. The field is used to restrict the posting to parts of USENET."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
192 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
193 (expand-abbrev)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
194 (mail-position-on-field "Distribution")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
195 ;; @@could do a completing read based on the news library file:
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
196 ;; @@ ../distributions to fill in the field.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
197 )
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
198
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
199 (defun news-reply-keywords ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
200 "Move point to end of `Keywords:' optional field. Create the field if none.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
201 Used as an aid to the news reader, it can contain a few, well selected keywords
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
202 identifying the message."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
203 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
204 (expand-abbrev)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
205 (mail-position-on-field "Keywords"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
206
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
207 (defun news-reply-summary ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
208 "Move point to end of `Summary:' optional field. Create the field if none.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
209 Used as an aid to the news reader, it can contain a succinct
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
210 summary (abstract) of the message."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
211 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
212 (expand-abbrev)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
213 (mail-position-on-field "Summary"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
214
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
215 (defun news-reply-signature ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
216 "The inews program appends `~/.signature' automatically."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
217 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
218 (message "Posting news will append your signature automatically."))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
219
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
220 (defun news-setup (to subject in-reply-to newsgroups replybuffer)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
221 "Set up the news reply or posting buffer with the proper headers and mode."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
222 (setq mail-reply-buffer replybuffer)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
223 (let ((mail-setup-hook nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
224 ;; Avoid inserting a signature.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
225 (mail-signature))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
226 (if (null to)
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 38412
diff changeset
227 ;; this hack is needed so that inews wont be confused by
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
228 ;; the fcc: and bcc: fields
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
229 (let ((mail-self-blind nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
230 (mail-archive-file-name nil))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
231 (mail-setup to subject in-reply-to nil replybuffer nil)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
232 (beginning-of-line)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
233 (delete-region (point) (progn (forward-line 1) (point)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
234 (goto-char (point-max)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
235 (mail-setup to subject in-reply-to nil replybuffer nil))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
236 ;;;(mail-position-on-field "Posting-Front-End")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
237 ;;;(insert (emacs-version))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
238 (goto-char (point-max))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
239 (if (let ((case-fold-search t))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
240 (re-search-backward "^Subject:" (point-min) t))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
241 (progn (beginning-of-line)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
242 (insert "Newsgroups: " (or newsgroups "") "\n")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
243 (if (not newsgroups)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
244 (backward-char 1)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
245 (goto-char (point-max)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
246 (let (actual-header-separator)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
247 (rfc822-goto-eoh)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
248 (setq actual-header-separator (buffer-substring
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
249 (point)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
250 (save-excursion (end-of-line) (point))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
251 (setq paragraph-start
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
252 (concat "^" actual-header-separator "$\\|" paragraph-start))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
253 (setq paragraph-separate
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
254 (concat "^" actual-header-separator "$\\|" paragraph-separate)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
255 (run-hooks 'news-setup-hook)))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 38412
diff changeset
256
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
257 (defun news-inews ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
258 "Send a news message using inews."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
259 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
260 (let* (newsgroups subject
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
261 (case-fold-search nil))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
262 (save-excursion
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
263 (save-restriction
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
264 (narrow-to-region (point-min) (mail-header-end))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
265 (setq newsgroups (mail-fetch-field "newsgroups")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
266 subject (mail-fetch-field "subject")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
267 (widen)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
268 (goto-char (point-min))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
269 (run-hooks 'news-inews-hook)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
270 (mail-sendmail-undelimit-header)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
271 (goto-char (point-max))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
272 ;; require a newline at the end for inews to append .signature to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
273 (or (= (preceding-char) ?\n)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
274 (insert ?\n))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
275 (message "Posting to USENET...")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
276 (unwind-protect
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 38412
diff changeset
277 (if (not (eq 0
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 38412
diff changeset
278 (call-process-region (point-min) (point-max)
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
279 news-inews-program nil 0 nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
280 "-h"))) ; take all header lines!
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
281 ;@@ setting of subject and newsgroups still needed?
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
282 ;"-t" subject
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
283 ;"-n" newsgroups
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
284 (error "Posting to USENET failed")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
285 (message "Posting to USENET... done"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
286 (mail-sendmail-delimit-header)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
287 (set-buffer-modified-p nil)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
288 (bury-buffer)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
289
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
290 ;@@ shares some code with news-reply and news-post-news
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
291 (defun news-mail-reply ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
292 "Mail a reply to the author of the current article.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
293 While composing the reply, use \\[news-reply-yank-original] to yank the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
294 original message into it."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
295 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
296 (let (from cc subject date to reply-to message-id
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
297 (buffer (current-buffer)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
298 (save-restriction
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
299 (narrow-to-region (point-min) (progn (goto-line (point-min))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
300 (search-forward "\n\n")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
301 (- (point) 1)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
302 (setq from (mail-fetch-field "from")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
303 subject (mail-fetch-field "subject")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
304 reply-to (mail-fetch-field "reply-to")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
305 date (mail-fetch-field "date")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
306 message-id (mail-fetch-field "message-id")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
307 (setq to from)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
308 (pop-to-buffer "*mail*")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
309 (mail nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
310 (if reply-to reply-to to)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
311 subject
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
312 (let ((stop-pos (string-match " *at \\| *@ \\| *(\\| *<" from)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
313 (concat (if stop-pos (substring from 0 stop-pos) from)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
314 "'s message "
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
315 (if message-id
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
316 (concat message-id " of ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
317 "of ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
318 date))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
319 nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
320 buffer)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
321
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
322 ;@@ the guts of news-reply and news-post-news should be combined. -tower
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
323 (defun news-reply ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
324 "Compose and post a reply (aka a followup) to the current article on USENET.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
325 While composing the followup, use \\[news-reply-yank-original] to yank the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
326 original message into it."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
327 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
328 (if (y-or-n-p "Are you sure you want to followup to all of USENET? ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
329 (let (from cc subject date to followup-to newsgroups message-of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
330 references distribution message-id
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
331 (buffer (current-buffer)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
332 (save-restriction
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
333 (and (not (= 0 (buffer-size))) ;@@real problem is non-existence of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
334 ;@@ of article file
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
335 (equal major-mode 'news-mode) ;@@ if rmail-mode,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
336 ;@@ should show full headers
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
337 (progn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
338 (news-show-all-headers) ;@@ should save/restore header state,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
339 ;@@ but rnews.el lacks support
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
340 (narrow-to-region (point-min) (progn (goto-char (point-min))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
341 (search-forward "\n\n")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
342 (- (point) 1)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
343 (setq from (mail-fetch-field "from")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
344 news-reply-yank-from from
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
345 ;; @@ not handling old Title: field
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
346 subject (mail-fetch-field "subject")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
347 date (mail-fetch-field "date")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
348 followup-to (mail-fetch-field "followup-to")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
349 newsgroups (or followup-to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
350 (mail-fetch-field "newsgroups"))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
351 references (mail-fetch-field "references")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
352 ;; @@ not handling old Article-I.D.: field
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
353 distribution (mail-fetch-field "distribution")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
354 message-id (mail-fetch-field "message-id")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
355 news-reply-yank-message-id message-id)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
356 (pop-to-buffer "*post-news*")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
357 (news-reply-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
358 (if (and (buffer-modified-p)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
359 (not
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
360 (y-or-n-p "Unsent article being composed; erase it? ")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
361 ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
362 (progn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
363 (erase-buffer)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
364 (and subject
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
365 (progn (if (string-match "\\`Re: " subject)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
366 (while (string-match "\\`Re: " subject)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
367 (setq subject (substring subject 4))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
368 (setq subject (concat "Re: " subject))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
369 (and from
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
370 (progn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
371 (let ((stop-pos
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
372 (string-match " *at \\| *@ \\| *(\\| *<" from)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
373 (setq message-of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
374 (concat
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
375 (if stop-pos (substring from 0 stop-pos) from)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
376 "'s message "
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
377 (if message-id
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
378 (concat message-id " of ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
379 "of ")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
380 date)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
381 (news-setup
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
382 nil
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
383 subject
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
384 message-of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
385 newsgroups
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
386 buffer)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
387 (if followup-to
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
388 (progn (news-reply-followup-to)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
389 (insert followup-to)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
390 (if distribution
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
391 (progn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
392 (mail-position-on-field "Distribution")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
393 (insert distribution)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
394 (mail-position-on-field "References")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
395 (if references
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
396 (insert references))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
397 (if (and references message-id)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
398 (insert " "))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
399 (if message-id
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
400 (insert message-id))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
401 (goto-char (point-max))))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
402 (message "")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
403
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
404 ;@@ the guts of news-reply and news-post-news should be combined. -tower
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
405 ;;;###autoload
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
406 (defun news-post-news (&optional noquery)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
407 "Begin editing a new USENET news article to be posted.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
408 Type \\[describe-mode] once editing the article to get a list of commands.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
409 If NOQUERY is non-nil, we do not query before doing the work."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
410 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
411 (if (or noquery
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
412 (y-or-n-p "Are you sure you want to post to all of USENET? "))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
413 (let ((buffer (current-buffer)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
414 (save-restriction
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
415 (and (not (= 0 (buffer-size))) ;@@real problem is non-existence of
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
416 ;@@ of article file
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
417 (equal major-mode 'news-mode) ;@@ if rmail-mode,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
418 ;@@ should show full headers
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
419 (progn
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
420 (news-show-all-headers) ;@@ should save/restore header state,
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
421 ;@@ but rnews.el lacks support
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
422 (narrow-to-region (point-min) (progn (goto-char (point-min))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
423 (search-forward "\n\n")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
424 (- (point) 1)))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
425 (setq news-reply-yank-from (mail-fetch-field "from")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
426 ;; @@ not handling old Article-I.D.: field
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
427 news-reply-yank-message-id (mail-fetch-field "message-id")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
428 (pop-to-buffer "*post-news*")
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
429 (news-reply-mode)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
430 (if (and (buffer-modified-p)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
431 (not (y-or-n-p "Unsent article being composed; erase it? ")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
432 () ;@@ not saving point from last time
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
433 (progn (erase-buffer)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
434 (news-setup () () () () buffer))))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
435 (message "")))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
436
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
437 (defun news-mail-other-window ()
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
438 "Send mail in another window.
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
439 While composing the message, use \\[news-reply-yank-original] to yank the
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
440 original message into it."
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
441 (interactive)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
442 (mail-other-window nil nil nil nil nil (current-buffer)))
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
443
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
444 (provide 'rnewspost)
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
445
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 79715
diff changeset
446 ;; arch-tag: 18f7b2af-cf9a-49e4-878b-71eb49913e00
35063
5c3a343fb1ce Obsolete.
Dave Love <fx@gnu.org>
parents:
diff changeset
447 ;;; rnewspost.el ends here