X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=lisp%2Fgnus-msg.el;h=5ca0e78d5e4069db9e238a7b62dcade9a2e77a0f;hb=e3e1d7efc8df0f0140d9e531fb49e9b692d0a9ef;hp=1991c5214982494ae19d1c5205d705e74b9ceb4b;hpb=8103bf58f5b1be8cdd775bf19a0675b013821e28;p=elisp%2Fgnus.git- diff --git a/lisp/gnus-msg.el b/lisp/gnus-msg.el index 1991c52..5ca0e78 100644 --- a/lisp/gnus-msg.el +++ b/lisp/gnus-msg.el @@ -5,6 +5,8 @@ ;; Lars Magne Ingebrigtsen ;; MORIOKA Tomohiko ;; Shuhei KOBAYASHI +;; Katsumi Yamaoka +;; Kiyokazu SUTO ;; Keywords: mail, news, MIME ;; This file is part of GNU Emacs. @@ -93,7 +95,7 @@ Thank you. The first %s will be replaced by the Newsgroups header; the second with the current group name.") -(defvar gnus-message-setup-hook nil +(defvar gnus-message-setup-hook '(gnus-maybe-setup-default-charset) "Hook run after setting up a message buffer.") (defvar gnus-bug-create-help-buffer t @@ -230,8 +232,9 @@ Thank you for your help in stamping out bugs. `(lambda (arg) (gnus-post-method arg ,gnus-newsgroup-name))) (setq message-user-agent (gnus-extended-version)) - (message-add-action - `(set-window-configuration ,winconf) 'exit 'postpone 'kill) + (when (not message-use-multi-frames) + (message-add-action + `(set-window-configuration ,winconf) 'exit 'postpone 'kill)) (message-add-action `(when (gnus-buffer-exists-p ,buffer) (save-excursion @@ -306,13 +309,26 @@ If prefix argument YANK is non-nil, original article is yanked automatically." (gnus-summary-followup (gnus-summary-work-articles arg) t)) (defun gnus-inews-yank-articles (articles) - (let (beg article) + (let* ((more-than-one (cdr articles)) + (frame (when (and message-use-multi-frames more-than-one) + (window-frame (get-buffer-window (current-buffer))))) + refs beg article) (message-goto-body) (while (setq article (pop articles)) (save-window-excursion (set-buffer gnus-summary-buffer) (gnus-summary-select-article nil nil nil article) (gnus-summary-remove-process-mark article)) + (when frame + (select-frame frame)) + + ;; Gathering references. + (when more-than-one + (setq refs (message-list-references + refs + (mail-header-references gnus-current-headers) + (mail-header-message-id gnus-current-headers)))) + (gnus-copy-article-buffer) (let ((message-reply-buffer gnus-article-copy) (message-reply-headers gnus-current-headers)) @@ -321,6 +337,25 @@ If prefix argument YANK is non-nil, original article is yanked automatically." (when articles (insert "\n"))) (push-mark) + + ;; Replace with the gathered references. + (when refs + (push-mark beg) + (save-restriction + (message-narrow-to-headers) + (let ((case-fold-search t)) + (if (re-search-forward "^References:\\([\t ]+.+\n\\)+" nil t) + (replace-match "") + (goto-char (point-max)))) + (mail-header-format + (list (or (assq 'References message-header-format-alist) + '(References . message-fill-references))) + (list (cons 'References + (mapconcat 'identity (nreverse refs) " ")))) + (backward-delete-char 1)) + (setq beg (mark t)) + (pop-mark)) + (goto-char beg))) (defun gnus-summary-cancel-article (&optional n symp) @@ -350,7 +385,8 @@ post using the current select method." This is done simply by taking the old article and adding a Supersedes header line with the old Message-ID." (interactive) - (let ((article (gnus-summary-article-number))) + (let ((article (gnus-summary-article-number)) + (gnus-message-setup-hook '(gnus-maybe-setup-default-charset))) (gnus-setup-message 'reply-yank (gnus-summary-select-article t) (set-buffer gnus-original-article-buffer) @@ -542,11 +578,6 @@ If SILENT, don't prompt the user." -;; Dummy to avoid byte-compile warning. -;;(defvar nnspool-rejected-article-hook) -;;(defvar xemacs-codename) - -;;; Since the User-Agent is ``vanity'' headers. (defun gnus-extended-version () "Stringified gnus version." (interactive) @@ -667,16 +698,20 @@ If FULL-HEADERS (the prefix), include full headers when forwarding." (interactive "P") (let ((subject "Digested Articles") (articles (gnus-summary-work-articles n)) - article) + article frame) (gnus-setup-message 'forward (gnus-summary-select-article) (if post (message-news nil subject) (message-mail nil subject)) + (when (and message-use-multi-frames (cdr articles)) + (setq frame (window-frame (get-buffer-window (current-buffer))))) (message-goto-body) (while (setq article (pop articles)) (save-window-excursion (set-buffer gnus-summary-buffer) (gnus-summary-select-article nil nil nil article) (gnus-summary-remove-process-mark article)) + (when frame + (select-frame frame)) (insert (mime-make-tag "message" "rfc822") "\n") (insert-buffer-substring gnus-original-article-buffer)) (push-mark) @@ -687,7 +722,7 @@ If FULL-HEADERS (the prefix), include full headers when forwarding." "Digest and forwards all articles in this series to a newsgroup." (interactive "P") (gnus-summary-mail-digest n t)) - + (defun gnus-summary-resend-message (address n) "Resend the current article to ADDRESS." (interactive "sResend message(s) to: \nP") @@ -953,7 +988,7 @@ this is a reply." (interactive "P") (gnus-summary-select-article t) (set-buffer gnus-original-article-buffer) - (let (gnus-message-setup-hook) + (let ((gnus-message-setup-hook '(gnus-maybe-setup-default-charset))) (gnus-setup-message 'compose-bounce (let* ((references (mail-fetch-field "references")) (parent (and references (gnus-parent-id references))))