diff options
| author | Richard M. Stallman | 1998-04-30 06:37:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1998-04-30 06:37:04 +0000 |
| commit | 5acd84d52d6c32ef19ff36d97957479f8ec672bb (patch) | |
| tree | ad1e07307ad3723e16e326be505304deee91360a | |
| parent | 9e68869b10413b6794721d765081d45804159f42 (diff) | |
| download | emacs-5acd84d52d6c32ef19ff36d97957479f8ec672bb.tar.gz emacs-5acd84d52d6c32ef19ff36d97957479f8ec672bb.zip | |
(news-reply-mode): Don't load sendmail here.
Don't set paragraph-start or paragraph-separate.
(news-setup): Set them here.
(news-inews): Use mail-header-end, etc.
Use mail-sendmail-delmit-header at the end.
| -rw-r--r-- | lisp/mail/rnewspost.el | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/lisp/mail/rnewspost.el b/lisp/mail/rnewspost.el index cffc2fb03dc..ff4342dae8c 100644 --- a/lisp/mail/rnewspost.el +++ b/lisp/mail/rnewspost.el | |||
| @@ -118,8 +118,6 @@ C-c C-y news-reply-yank-original (insert current message, in NEWS). | |||
| 118 | C-c C-q mail-fill-yanked-message (fill what was yanked). | 118 | C-c C-q mail-fill-yanked-message (fill what was yanked). |
| 119 | C-c C-r caesar rotate all letters by 13 places in the article's body (rot13)." | 119 | C-c C-r caesar rotate all letters by 13 places in the article's body (rot13)." |
| 120 | (interactive) | 120 | (interactive) |
| 121 | ;; require... | ||
| 122 | (or (fboundp 'mail-setup) (load "sendmail")) | ||
| 123 | (kill-all-local-variables) | 121 | (kill-all-local-variables) |
| 124 | (make-local-variable 'mail-reply-buffer) | 122 | (make-local-variable 'mail-reply-buffer) |
| 125 | (setq mail-reply-buffer nil) | 123 | (setq mail-reply-buffer nil) |
| @@ -130,12 +128,6 @@ C-c C-r caesar rotate all letters by 13 places in the article's body (rot13)." | |||
| 130 | (setq mode-name "News Reply") | 128 | (setq mode-name "News Reply") |
| 131 | (make-local-variable 'paragraph-separate) | 129 | (make-local-variable 'paragraph-separate) |
| 132 | (make-local-variable 'paragraph-start) | 130 | (make-local-variable 'paragraph-start) |
| 133 | (setq paragraph-start | ||
| 134 | (concat "^" (regexp-quote mail-header-separator) "$\\|" | ||
| 135 | paragraph-start)) | ||
| 136 | (setq paragraph-separate | ||
| 137 | (concat "^" (regexp-quote mail-header-separator) "$\\|" | ||
| 138 | paragraph-separate)) | ||
| 139 | (run-hooks 'text-mode-hook 'news-reply-mode-hook)) | 131 | (run-hooks 'text-mode-hook 'news-reply-mode-hook)) |
| 140 | 132 | ||
| 141 | (defvar news-reply-yank-from "" | 133 | (defvar news-reply-yank-from "" |
| @@ -246,6 +238,15 @@ summary (abstract) of the message." | |||
| 246 | (if (not newsgroups) | 238 | (if (not newsgroups) |
| 247 | (backward-char 1) | 239 | (backward-char 1) |
| 248 | (goto-char (point-max))))) | 240 | (goto-char (point-max))))) |
| 241 | (let (actual-header-separator) | ||
| 242 | (rfc822-goto-eoh) | ||
| 243 | (setq actual-header-separator (buffer-substring | ||
| 244 | (point) | ||
| 245 | (save-excursion (end-of-line) (point)))) | ||
| 246 | (setq paragraph-start | ||
| 247 | (concat "^" actual-header-separator "$\\|" paragraph-start)) | ||
| 248 | (setq paragraph-separate | ||
| 249 | (concat "^" actual-header-separator "$\\|" paragraph-separate))) | ||
| 249 | (run-hooks 'news-setup-hook))) | 250 | (run-hooks 'news-setup-hook))) |
| 250 | 251 | ||
| 251 | (defun news-inews () | 252 | (defun news-inews () |
| @@ -255,17 +256,13 @@ summary (abstract) of the message." | |||
| 255 | (case-fold-search nil)) | 256 | (case-fold-search nil)) |
| 256 | (save-excursion | 257 | (save-excursion |
| 257 | (save-restriction | 258 | (save-restriction |
| 258 | (goto-char (point-min)) | 259 | (narrow-to-region (point-min) (mail-header-end)) |
| 259 | (search-forward (concat "\n" mail-header-separator "\n")) | ||
| 260 | (narrow-to-region (point-min) (point)) | ||
| 261 | (setq newsgroups (mail-fetch-field "newsgroups") | 260 | (setq newsgroups (mail-fetch-field "newsgroups") |
| 262 | subject (mail-fetch-field "subject"))) | 261 | subject (mail-fetch-field "subject"))) |
| 263 | (widen) | 262 | (widen) |
| 264 | (goto-char (point-min)) | 263 | (goto-char (point-min)) |
| 265 | (run-hooks 'news-inews-hook) | 264 | (run-hooks 'news-inews-hook) |
| 266 | (goto-char (point-min)) | 265 | (mail-sendmail-undelimit-header) |
| 267 | (search-forward (concat "\n" mail-header-separator "\n")) | ||
| 268 | (replace-match "\n\n") | ||
| 269 | (goto-char (point-max)) | 266 | (goto-char (point-max)) |
| 270 | ;; require a newline at the end for inews to append .signature to | 267 | ;; require a newline at the end for inews to append .signature to |
| 271 | (or (= (preceding-char) ?\n) | 268 | (or (= (preceding-char) ?\n) |
| @@ -281,9 +278,7 @@ summary (abstract) of the message." | |||
| 281 | ;"-n" newsgroups | 278 | ;"-n" newsgroups |
| 282 | (error "Posting to USENET failed") | 279 | (error "Posting to USENET failed") |
| 283 | (message "Posting to USENET... done")) | 280 | (message "Posting to USENET... done")) |
| 284 | (goto-char (point-min)) ;restore internal header separator | 281 | (mail-sendmail-delmit-header) |
| 285 | (search-forward "\n\n") | ||
| 286 | (replace-match (concat "\n" mail-header-separator "\n")) | ||
| 287 | (set-buffer-modified-p nil))) | 282 | (set-buffer-modified-p nil))) |
| 288 | (bury-buffer))) | 283 | (bury-buffer))) |
| 289 | 284 | ||