From aaca3d945e2056faed0e115e7e3bd585748586de Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Tue, 4 Mar 1997 08:33:34 +0000 Subject: [PATCH] *** empty log message *** --- lisp/ChangeLog | 44 ++++++++++++++++++++++ lisp/gnus-ems.el | 1 + lisp/gnus-msg.el | 2 +- lisp/gnus-xmas.el | 4 +- lisp/gnus.el | 27 +++++++------ lisp/message.el | 96 ++++++++++++++++++++++++++++++++--------------- 6 files changed, 130 insertions(+), 44 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a864daef7..da95c311e 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,49 @@ +Thu Mar 28 06:12:28 1996 Lars Magne Ingebrigtsen + + * message.el (message-send-mail): Remove Gcc header. + (message-setup): Would insert default headers in the body. + +Wed Mar 27 11:25:41 1996 Jack Vinson + + * message.el: Lots of small typos corrected. + (message-goto-signature): Added missing function. + (message-mode): Updated the description. + (message-send): Corrected format for first y-or-n-p. + (message-forward): Added description. + +Thu Mar 28 05:31:48 1996 Lars Magne Ingebrigtsen + + * message.el (message-send-mail): Make sure point is in the right + buffer. + (message-send-mail): Would remove Bcc headers. + (message-insert-courtesy-copy): Would bug out in non-news + buffers. + (message-send-news): Don't remove Gcc headers from the message + buffer. + (message-ignored-mail-headers): New variable. + +Thu Mar 28 05:30:02 1996 Lars Magne Ingebrigtsen + + * gnus-xmas.el (gnus-xmas-copy-article-buffer): Return the proper + value. + + * message.el (message-mode-map): Would make XEmacs barf. + +Thu Mar 28 03:49:32 1996 Lars Magne Ingebrigtsen + + * gnus.el (gnus-group-make-group): Wouldn't allow usage of virtual + server names. + + * message.el (message-cite-hook): New variable. + +Thu Mar 28 03:48:54 1996 Kai Grossjohann + + * message.el (message-yank-original): Run `message-cite-hook'. + Wed Mar 27 05:06:16 1996 Lars Magne Ingebrigtsen + * gnus.el: September Gnus v0.59 is released. + * message.el (message-remove-header): Allow reverse removal. (message-news-p): Narrow to headers first. (message-checksum): New function. diff --git a/lisp/gnus-ems.el b/lisp/gnus-ems.el index 34ef6c4d9..1508375ae 100644 --- a/lisp/gnus-ems.el +++ b/lisp/gnus-ems.el @@ -40,6 +40,7 @@ (defalias 'gnus-set-text-properties 'set-text-properties) (defalias 'gnus-appt-select-lowest-window 'appt-select-lowest-window) (defalias 'gnus-mail-strip-quoted-names 'mail-strip-quoted-names) +(defalias 'gnus-make-local-hook 'make-local-hook) (eval-and-compile (autoload 'gnus-xmas-define "gnus-xmas") diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index f76041d49..5706f00fb 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -137,7 +137,7 @@ the group.") (gnus-configure-windows ,config t)))) (defun gnus-inews-add-send-actions (winconf buffer article) - (make-local-hook 'message-sent-hook) + (gnus-make-local-hook 'message-sent-hook) (add-hook 'message-sent-hook 'gnus-inews-do-gcc) (setq message-post-method `(lambda (arg) diff --git a/lisp/gnus-xmas.el b/lisp/gnus-xmas.el index 4cc1c9b52..733bdd95a 100644 --- a/lisp/gnus-xmas.el +++ b/lisp/gnus-xmas.el @@ -165,7 +165,8 @@ It is provided only to ease porting of broken FSF Emacs programs." (setq buf (buffer-substring (point-min) (point-max))) (set-buffer gnus-article-copy) (erase-buffer) - (insert (format "%s" buf)))))) + (insert (format "%s" buf)))) + gnus-article-copy)) (defun gnus-xmas-article-push-button (event) "Check text under the mouse pointer for a callback function. @@ -422,6 +423,7 @@ pounce directly on the real variables themselves.") (fset 'gnus-appt-select-lowest-window 'gnus-xmas-appt-select-lowest-window) (fset 'gnus-mail-strip-quoted-names 'gnus-xmas-mail-strip-quoted-names) + (fset 'gnus-make-local-hook 'make-local-variable) (add-hook 'gnus-group-mode-hook 'gnus-xmas-group-menu-add) (add-hook 'gnus-summary-mode-hook 'gnus-xmas-summary-menu-add) diff --git a/lisp/gnus.el b/lisp/gnus.el index be7bbf8d3..8fe5446c0 100644 --- a/lisp/gnus.el +++ b/lisp/gnus.el @@ -1688,7 +1688,7 @@ variable (string, integer, character, etc).") "gnus-bug@ifi.uio.no (The Gnus Bugfixing Girls + Boys)" "The mail address of the Gnus maintainers.") -(defconst gnus-version "September Gnus v0.59" +(defconst gnus-version "September Gnus v0.60" "Version number for this version of Gnus.") (defvar gnus-info-nodes @@ -5367,20 +5367,23 @@ ADDRESS." (completing-read "Method: " (append gnus-valid-select-methods gnus-server-alist) nil t))) - (if (assoc method gnus-valid-select-methods) - (list method - (if (memq 'prompt-address - (assoc method gnus-valid-select-methods)) - (read-string "Address: ") - "")) - (list method ""))))) + (cond ((assoc method gnus-valid-select-methods) + (list method + (if (memq 'prompt-address + (assoc method gnus-valid-select-methods)) + (read-string "Address: ") + ""))) + ((assoc method gnus-server-alist) + (list method)) + (t + (list method "")))))) (save-excursion (set-buffer gnus-group-buffer) (let* ((meth (and method (if address (list (intern method) address) method))) (nname (if method (gnus-group-prefixed-name name meth) name)) - info) + backend info) (and (gnus-gethash nname gnus-newsrc-hashtb) (error "Group %s already exists" nname)) (gnus-group-change-level @@ -5396,8 +5399,10 @@ ADDRESS." (concat "(gnus-group-set-info '" (prin1-to-string (cdr info)) ")"))) (gnus-group-insert-group-line-info nname) - (when (assoc (symbol-name (car meth)) gnus-valid-select-methods) - (require (car meth))) + (when (assoc (symbol-name (setq backend (car (gnus-server-get-method + nil meth)))) + gnus-valid-select-methods) + (require backend)) (gnus-check-server meth) (and (gnus-check-backend-function 'request-create-group nname) (gnus-request-create-group nname)) diff --git a/lisp/message.el b/lisp/message.el index ba691fc88..394084f52 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -35,7 +35,7 @@ (defvar message-fcc-handler-function 'rmail-output "*A function called to save outgoing articles. -This function will be called with the same of the file to store the +This function will be called with the name of the file to store the article in. The default function is `rmail-output' which saves in Unix mailbox format.") @@ -83,12 +83,15 @@ RFC822 required that From, Date, To, Subject and Message-ID be included. Organization, Lines and X-Mailer are optional.") (defvar message-deletable-headers '(Message-ID Date) - "*Headers to be deleted if they already exists and were generated by message previously.") + "*Headers to be deleted if they already exist and were generated by message previously.") (defvar message-ignored-news-headers "^NNTP-Posting-Host:\\|^Xref:\\|^Bcc:\\|^Gcc:" "*Regexp of headers to be removed unconditionally before posting.") +(defvar message-ignored-mail-headers "^Gcc:" + "*Regexp of headers to be removed unconditionally before mailing.") + (defvar message-ignored-supersedes-headers "^Path:\\|^Date\\|^NNTP-Posting-Host:\\|^Xref:\\|^Lines:\\|^Received:\\|^X-From-Line:\\|Return-Path:" "*Header lines matching this regexp will be deleted before posting. @@ -199,6 +202,9 @@ This file need not actually exist.") "Normal hook, run each time a new outgoing message is initialized. The function `message-setup' runs this hook.") +(defvar message-cite-hook nil + "Hook run when yanking articles.") + (defvar message-header-setup-hook nil "Hook called narrowed to the headers when setting up a message buffer.") @@ -317,7 +323,7 @@ actually occur.") (let ((table (copy-syntax-table text-mode-syntax-table))) (modify-syntax-entry ?% ". " table) table) - "Syntax table used while in message mode.") + "Syntax table used while in Message mode.") (defvar message-font-lock-keywords (let* ((cite-prefix "A-Za-z") (cite-suffix (concat cite-prefix "0-9_.@-"))) @@ -333,7 +339,7 @@ actually occur.") 'font-lock-reference-face) '("^\\(X-[A-Za-z0-9-]+\\|In-reply-to\\):.*" . font-lock-string-face))) - "Additional expressions to highlight in Mail mode.") + "Additional expressions to highlight in Message mode.") (defvar message-send-hook nil "Hook run before sending messages.") @@ -512,7 +518,7 @@ Return the number of headers removed." (defvar message-mode-map nil) (unless message-mode-map - (setq message-mode-map (nconc (make-sparse-keymap) text-mode-map)) + (setq message-mode-map (copy-keymap text-mode-map)) (define-key message-mode-map "\C-c?" 'describe-mode) (define-key message-mode-map "\C-c\C-f\C-t" 'message-goto-to) @@ -540,25 +546,34 @@ Return the number of headers removed." (define-key message-mode-map "\C-c\C-c" 'message-send-and-exit) (define-key message-mode-map "\C-c\C-s" 'message-send)) -(easy-menu-define - message-menu message-mode-map "" - '("Mail" - ["Fill Citation" message-fill-yanked-message t])) +(defun message-make-menu-bar () + (unless (boundp 'message-menu) + (easy-menu-define + message-menu message-mode-map "" + '("Message" + ["Fill Citation" message-fill-yanked-message t])))) ;;;###autoload (defun message-mode () - "Major mode for editing mail to be sent. + "Major mode for editing mail and news to be sent. Like Text Mode but with these additional commands: C-c C-s message-send (send the message) C-c C-c message-send-and-exit C-c C-f move to a header field (and create it if there isn't): C-c C-f C-t move to To: C-c C-f C-s move to Subject: C-c C-f C-c move to CC: C-c C-f C-b move to BCC: - C-c C-f C-f move to FCC: -C-c C-t message-text (move to beginning of message text). -C-c C-w message-signature (insert `message-signature-file' file). -C-c C-y message-yank-original (insert current message, in Rmail). + C-c C-f C-f move to FCC: C-c C-f C-r move to Reply-To: + C-c C-f C-u move to Summary: C-c C-f C-n move to Newsgroups: + C-c C-f C-k move to Kewords: C-c C-f C-d move to Distribution: + C-c C-f C-o move to Followup-To: +C-c C-t message-insert-to (add a To: header to a news followup) +C-c C-n message-insert-newsgroups (add a Newsgroup: header to a news reply) +C-c C-b message-goto-text (move to beginning of message text). +C-c C-s message-goto-signature (move to the beginning of the signature). +C-c C-w message-insert-signature (insert `message-signature-file' file). +C-c C-y message-yank-original (insert current message, if any). C-c C-q message-fill-yanked-message (fill what was yanked). -C-c C-v message-sent-via (add a Sent-via field for each To or CC)." +C-c C-v message-sent-via (add a Sent-via field for each To or CC). +C-c C-r message-ceasar-buffer-body (rot13 the message body)." (interactive) (kill-all-local-variables) (make-local-variable 'message-reply-buffer) @@ -660,10 +675,17 @@ C-c C-v message-sent-via (add a Sent-via field for each To or CC)." (goto-char (point-min)) (search-forward (concat "\n" message-header-separator "\n") nil t)) +(defun message-goto-signature () + "Move point to the beginning of the message signature, +or the line sollowing `message-signature-separator'." + (interactive) + (goto-char (point-min)) + (search-forward (concat "\n" message-signature-separator "\n") nil t)) + (defun message-insert-to () - "Insert a To header that points to the author of the message being replied to." + "Insert a To header that points to the author of the article being replied to." (interactive) (message-position-on-field "To") (insert (or (message-fetch-reply-field "reply-to") @@ -680,7 +702,7 @@ C-c C-v message-sent-via (add a Sent-via field for each To or CC)." ;;; Various commands (defun message-insert-signature () - "Insert a signature." + "Insert a signature. See documentation for the `message-signature' variable." (interactive) (let* ((signature (cond ((message-functionp message-signature) @@ -802,7 +824,7 @@ However, if `message-yank-prefix' is non-nil, insert that prefix on each line." (goto-char start)))) (defun message-yank-original (&optional arg) - "Insert the message being replied to, if any (in rmail). + "Insert the message being replied to, if any. Puts point before the text and mark after. Normally indents each nonblank line ARG spaces (default 3). However, if `message-yank-prefix' is non-nil, insert that prefix on each line. @@ -842,7 +864,8 @@ prefix, and don't delete any headers." (unless (bolp) (insert ?\n)) (unless modified - (setq message-checksum (message-checksum)))))) + (setq message-checksum (message-checksum))) + (run-hooks 'message-cite-hook)))) (defun message-insert-citation-line () "Function that inserts a simple citation line." @@ -940,7 +963,7 @@ the user from the mailer." (when (if buffer-file-name (y-or-n-p (format "Send buffer contents as %s message? " (if (message-mail-p) - (if (message-news-p) "main and news" "news") + (if (message-news-p) "mail and news" "mail") "news"))) (or (buffer-modified-p) (y-or-n-p "No changes in the buffer; really send? "))) @@ -986,8 +1009,6 @@ the user from the mailer." (mailbuf (current-buffer))) (save-restriction (message-narrow-to-headers) - ;; Remove some headers. - (message-remove-header message-ignored-news-headers t) ;; Insert some headers. (message-generate-headers message-required-mail-headers) ;; Let the user do all of the above. @@ -997,6 +1018,11 @@ the user from the mailer." (set-buffer tembuf) (erase-buffer) (insert-buffer-substring mailbuf) + ;; Remove some headers. + (save-restriction + (message-narrow-to-headers) + ;; Remove some headers. + (message-remove-header message-ignored-news-headers t)) (goto-char (point-max)) ;; require one newline at the end. (or (= (preceding-char) ?\n) @@ -1059,6 +1085,7 @@ the user from the mailer." (kill-buffer tembuf) (when (bufferp errbuf) (kill-buffer errbuf))) + (set-buffer mailbuf) (push 'mail message-sent-message-via))) (defun message-send-news (&optional arg) @@ -1070,8 +1097,6 @@ the user from the mailer." (messbuf (current-buffer))) (save-restriction (message-narrow-to-headers) - ;; Remove some headers. - (message-remove-header message-ignored-news-headers t) ;; Insert some headers. (message-generate-headers message-required-news-headers) ;; Let the user do all of the above. @@ -1081,8 +1106,13 @@ the user from the mailer." (save-excursion (set-buffer tembuf) (buffer-disable-undo (current-buffer)) - (erase-buffer) + (erase-buffer) (insert-buffer-substring messbuf) + ;; Remove some headers. + (save-restriction + (message-narrow-to-headers) + ;; Remove some headers. + (message-remove-header message-ignored-news-headers t)) (goto-char (point-max)) ;; require one newline at the end. (or (= (preceding-char) ?\n) @@ -1100,6 +1130,7 @@ the user from the mailer." (funcall (intern (format "%s-request-post" (car method))))) (kill-buffer tembuf)) + (set-buffer messbuf) (push 'news message-sent-message-via)))) ;;; @@ -1301,7 +1332,7 @@ the user from the mailer." list file) (save-excursion (save-restriction - (nnheader-narrow-to-headers) + (message-narrow-to-headers) (while (setq file (mail-fetch-field "fcc")) (push file list) (message-remove-header "fcc" nil t)) @@ -1335,7 +1366,7 @@ the user from the mailer." ;; Correct Newsgroups and Followup-To headers: change sequence of ;; spaces to comma and eliminate spaces around commas. Eliminate - ;; imbedded line breaks. + ;; embedded line breaks. (goto-char (point-min)) (while (re-search-forward "^\\(Newsgroups\\|Followup-To\\): +" nil t) (save-restriction @@ -1702,8 +1733,9 @@ Headers already prepared in the buffer are not modified." (save-restriction (message-narrow-to-headers) (let ((newsgroups (mail-fetch-field "newsgroups"))) - (goto-char (point-max)) - (insert "Posted-To: " newsgroups "\n"))) + (when newsgroups + (goto-char (point-max)) + (insert "Posted-To: " newsgroups "\n")))) (forward-line 1) (insert message-courtesy-message))) @@ -1780,6 +1812,7 @@ Headers already prepared in the buffer are not modified." (pop h)) alist) headers) + (forward-line -1) (when message-default-headers (insert message-default-headers)) (when (and (message-news-p) @@ -1792,7 +1825,6 @@ Headers already prepared in the buffer are not modified." (when message-generate-headers-first (message-generate-headers message-required-mail-headers)) (insert message-default-mail-headers)) - (forward-line -1) (insert message-header-separator "\n") (message-insert-signature) (message-set-auto-save-file-name) @@ -1863,7 +1895,7 @@ Headers already prepared in the buffer are not modified." (if (message-functionp message-reply-to-function) (setq follow-to (funcall message-reply-to-function))) ;; This is a followup. - (if (gnus-functionp message-wide-reply-to-function) + (if (message-functionp message-wide-reply-to-function) (save-excursion (setq follow-to (funcall message-wide-reply-to-function))))) @@ -2111,6 +2143,8 @@ header line with the old Message-ID." ;;;###autoload (defun message-forward (&optional news) + "Forward the current message via mail. +Optional NEWS will use news to forward instead of mail." (interactive "P") (let ((cur (current-buffer)) (subject (message-make-forward-subject))) -- 2.34.1