annotate lisp/=gnusmail.el @ 4872:628cbf7e7005

(comint-after-partial-file-name-command): Renamed from comint-after-partial-pathname-command. (comint-match-partial-file-name, comint-after-partial-file-name): Renamed from comint-match-partial-pathname, etc. (comint-last-output-start): New variable to record where most recent process output started from. (comint-mode): Initialise it. (comint-output-filter): Set it. (comint-previous-matching-input-string): Moved to comint-previous-matching-input-position. (comint-previous-matching-input-string): Use it. (comint-search-arg, comint-search-start, comint-previous-input-string): New subroutines. (comint-previous-input, comint-next-input, comint-previous-matching-input, comint-next-matching-input, comint-previous-matching-input-from-input, comint-next-matching-input-from-input): Use them. (comint-mode-map): Added signal menu-bar. Moved comint-backward/forward-matching-input to output menu-bar, since they move within the buffer rather than do input. (comint-send-input, comint-after-pmark-p, comint-kill-input, comint-proc-query): Removed serialisation of obtaining the process mark's marker-position. Commented out comint-load-hooks. (comint-dynamic-simple-complete): New subroutine. (comint-dynamic-complete-filename-command): New variable. (comint-after-partial-pathname-command): New variable. (comint-after-partial-pathname): New subroutine. (comint-dynamic-complete): Use them. (comint-mode): Make them local. Renamed comint-dynamic-complete-command to comint-dynamic-complete-command-command for consistency. Renamed comint-file-name-addsuffix/autolist/recexact to comint-completion-addsuffix/autolist/recexact for consistency. (comint-replace-by-expanded-history): Check if input ring size is not big enough for relative reference. (comint-read-input-ring, comint-input-ring-file-name): From shell.el. (shell-write-input-ring): New subroutine. (comint-file-name-prefix): New variable. (comint-directory): New inline subroutine. (comint-dynamic-complete-filename, comint-dynamic-complete-variable, comint-dynamic-list-filename-completions): Use it. (comint-dynamic-complete-filename, comint-dynamic-complete-variable, comint-dynamic-list-filename-completions): Make sure local completion-ignore-case is nil. (comint-next-prompt, comint-previous-prompt): Use paragraph-start and paragraph motion commands rather than re-search-forward and re-search-backward commands. (comint-dynamic-list-input-ring, comint-previous-matching-input-string): Use ring-empty-p rather than zerop and ring-length. (comint-input-ignoredups): New variable. (comint-send-input, shell-read-input-ring): Use it. (comint-mode): Make comint-input-ignoredups local. Doc fix. (comint-scroll-to-bottom-on-input): New variable. (comint-scroll-to-bottom-on-output): New variable. (comint-scroll-show-maximum-output): New variable. (comint-output-filter-hook): New variable, defaults to comint-postoutput-scroll-to-bottom. (comint-output-filter): Renamed from comint-filter for consistency. Now calls comint-output-filter-hook. (comint-preinput-scroll-to-bottom): New subroutine. (comint-postoutput-scroll-to-bottom): New subroutine. (comint-show-maximum-output): New command. (comint-copy-old-input): New command. (comint-send-input): Run comint-output-filter-hook if necessary as a kludge to prevent messy redisplays. (comint-mode-map): Added comint-show-maximum-output to C-c C-e and menu-bar output, and comint-copy-old-input to C-c C-i and menu-bar input. (comint-mode): Make local variables comint-scroll-to-bottom-on-input, before-change-function, comint-scroll-to-bottom-on-output, comint-scroll-show-maximum-output, and comint-output-filter-hook. (comint-version): Deleted--no need for separate version. (comint-input-ring-index): Make this a permanent local. (comint-mode): Don't alter comint-input-ring-index or comint-input-ring if already set meaningfully. (comint-mode-map): Added keys M-R/S for comint-previous/next-matching-input-from-input and to completion menu-bar. Added comint-forward/backward-matching-input and comint-previous/next-matching-input to completion menu-bar. (comint-mode): Doc fix for functionality. (comint-exec-1): Uses setenv. (comint-update-env): Removed. (comint-input-ring-size): Incremented to 32, as with command history. (comint-dynamic-list-input-ring): Check for zero length ring. Use ring length, not ring size, when generating list. Use buffer " *Input History*". (comint-previous-matching-input-string): Check for zero-length ring. Check last item in case at end of cycle and it's a match. (comint-searching-input-ring): New subroutine. (comint-regexp-arg): New subroutine. (comint-previous-matching-input-from-input): New command. (comint-next-matching-input-from-input): New command. (comint-replace-by-expanded-history): Fix for matching inside quotes. Fix to allow argument subrange specifiers. Fix to identify and reject absolute input number references. (comint-within-quotes): New subroutine. (comint-how-many-region): New subroutine. (comint-args): New subroutine. (comint-delim-arg): New subroutine. (comint-arguments): New subroutine. (comint-delimiter-argument-list): New variable. (comint-send-input): Inserts input arguments into ring separated by single spaces. (comint-filter): Checks the buffer's process to make sure it's still there. Otherwise, set-buffer will fail. (comint-backward-matching-input): New command. (comint-forward-matching-input): New command. (comint-next-prompt, comint-previous-prompt): Error if reach beg/end of buffer. (comint-dynamic-complete): Fix for absolute input number references. (comint-dynamic-complete-filename): Changed listings function to comint-dynamic-list-filename-completions. Uses file-directory-p rather than string-match to test for directories. (comint-dynamic-list-completions): Changed to list the list of completions supplied as the function argument. Use buffer " *Completions*". (comint-match-partial-pathname): New subroutine. (comint-dynamic-complete-variable): New command. (comint-dynamic-list-filename-completions): New function. (comint-previous-input): Don't use replace-match; just insert before deleting. (comint-magic-space): Use self-insert command. (comint-history-file-name): New variable. (comint-mode): Initialize comint-input-ring before running comint-mode-hook. (comint-input-autoexpand): New variable. (comint-dynamic-complete-command): New variable. (comint-get-current-command): New variable. (comint-read-input-ring): New function. (comint-send-input): Handle history expansion. (comint-input-sentinel): Doc fix. (comint-mode-map): Added key binding for C-c C-h. Added menu bars for completion, input and output. (comint-dynamic-list-input-ring): New function. (comint-previous-input-string): New subroutine. (comint-previous-input): Use it. (comint-previous-matching-input-string): New subroutine. (comint-previous-matching-input): Use it. (comint-replace-by-expanded-history): New command. (comint-magic-space): New command. (comint-replace-by-expanded-filename): Now replaces expanded match for a filename, and then calls filename completion comint-dynamic-complete-filename to do file name completion. (comint-kill-output): Don't kill prompt. (comint-show-output): Don't move point if it's visible where it is, and if point is moved, put it after prompt. (comint-dynamic-complete): Totally new definition. (comint-dynamic-complete-filename): New name for old function comint-dynamic-complete, completes files and lists candidates, souped up for configurability. (comint-dynamic-complete-variable): New command. (comint-file-name-autolist): New variable. (comint-file-name-addsuffix): New variable, (comint-file-name-recexact): New variable.
author Richard M. Stallman <rms@gnu.org>
date Fri, 22 Oct 1993 02:57:36 +0000
parents cd90d49526ae
children eaaf6c8933b2
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
660
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 584
diff changeset
1 ;;; gnusmail.el --- mail reply commands for GNUS newsreader
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 584
diff changeset
2
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
3 ;; Copyright (C) 1990, 1993 Free Software Foundation, Inc.
846
20674ae6bf52 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 811
diff changeset
4
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 711
diff changeset
5 ;; Author: Masanobu UMEDA <umerin@flab.flab.fujitsu.junet>
811
e694e0879463 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 807
diff changeset
6 ;; Keywords: news
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 711
diff changeset
7
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
9
710
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 711
diff changeset
12 ;; the Free Software Foundation; either version 2, or (at your option)
710
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
13 ;; any later version.
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
14
710
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
18 ;; GNU General Public License for more details.
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
19
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
20 ;; You should have received a copy of the GNU General Public License
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
21 ;; along with GNU Emacs; see the file COPYING. If not, write to
d18c8feb66bd *** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents: 660
diff changeset
22 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
23
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 711
diff changeset
24 ;;; Commentary:
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
25
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
26 ;; Provides mail reply and mail other window command using usual mail
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
27 ;; interface and mh-e interface.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
28 ;;
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
29 ;; To use MAIL: set the variables gnus-mail-reply-method and
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
30 ;; gnus-mail-other-window-method to gnus-mail-reply-using-mail and
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
31 ;; gnus-mail-other-window-using-mail, respectively.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
32 ;;
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
33 ;; To use MH-E: set the variables gnus-mail-reply-method and
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
34 ;; gnus-mail-other-window-method to gnus-mail-reply-using-mhe and
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
35 ;; gnus-mail-other-window-using-mhe, respectively.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
36
807
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 711
diff changeset
37 ;;; Code:
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 711
diff changeset
38
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 711
diff changeset
39 (require 'gnus)
4f28bd14272c *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 711
diff changeset
40
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
41 (autoload 'news-mail-reply "rnewspost")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
42 (autoload 'news-mail-other-window "rnewspost")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
43
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
44 (autoload 'mh-send "mh-e")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
45 (autoload 'mh-send-other-window "mh-e")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
46 (autoload 'mh-find-path "mh-e")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
47 (autoload 'mh-yank-cur-msg "mh-e")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
48
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
49 ;;; Mail reply commands of GNUS Summary Mode
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
50
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
51 (defun gnus-summary-reply (yank)
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
52 "Reply mail to news author.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
53 If prefix argument YANK is non-nil, original article is yanked automatically.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
54 Customize the variable gnus-mail-reply-method to use another mailer."
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
55 (interactive "P")
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
56 ;; Bug fix by jbw@bigbird.bu.edu (Joe Wells)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
57 ;; Stripping headers should be specified with mail-yank-ignored-headers.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
58 (gnus-summary-select-article t t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
59 (switch-to-buffer gnus-article-buffer)
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
60 (widen)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
61 (delete-other-windows)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
62 (bury-buffer gnus-article-buffer)
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
63 (funcall gnus-mail-reply-method yank))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
64
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
65 (defun gnus-summary-reply-with-original ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
66 "Reply mail to news author with original article.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
67 Customize the variable gnus-mail-reply-method to use another mailer."
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
68 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
69 (gnus-summary-reply t))
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
70
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
71 (defun gnus-summary-mail-forward ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
72 "Forward the current message to another user.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
73 Customize the variable gnus-mail-forward-method to use another mailer."
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
74 (interactive)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
75 (gnus-summary-select-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
76 (switch-to-buffer gnus-article-buffer)
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
77 (widen)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
78 (delete-other-windows)
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
79 (bury-buffer gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
80 (funcall gnus-mail-forward-method))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
81
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
82 (defun gnus-summary-mail-other-window ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
83 "Compose mail in other window.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
84 Customize the variable gnus-mail-other-window-method to use another mailer."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
85 (interactive)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
86 (gnus-summary-select-article)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
87 (switch-to-buffer gnus-article-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
88 (widen)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
89 (delete-other-windows)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
90 (bury-buffer gnus-article-buffer)
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
91 (funcall gnus-mail-other-window-method))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
92
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
93
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
94 ;;; Send mail using sendmail mail mode.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
95
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
96 (defun gnus-mail-reply-using-mail (&optional yank)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
97 "Compose reply mail using mail.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
98 Optional argument YANK means yank original article."
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
99 (news-mail-reply)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
100 (gnus-overload-functions)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
101 (if yank
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
102 (let ((last (point)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
103 (goto-char (point-max))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
104 (mail-yank-original nil)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
105 (goto-char last)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
106 )))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
107
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
108 (defun gnus-mail-forward-using-mail ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
109 "Forward the current message to another user using mail."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
110 ;; This is almost a carbon copy of rmail-forward in rmail.el.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
111 (let ((forward-buffer (current-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
112 (subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
113 (concat "[" gnus-newsgroup-name "] "
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
114 ;;(mail-strip-quoted-names (gnus-fetch-field "From")) ": "
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
115 (or (gnus-fetch-field "Subject") ""))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
116 ;; If only one window, use it for the mail buffer.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
117 ;; Otherwise, use another window for the mail buffer
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
118 ;; so that the Rmail buffer remains visible
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
119 ;; and sending the mail will get back to it.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
120 (if (if (one-window-p t)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
121 (mail nil nil subject)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
122 (mail-other-window nil nil subject))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
123 (save-excursion
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
124 (goto-char (point-max))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
125 (insert "------- Start of forwarded message -------\n")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
126 (insert-buffer forward-buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
127 (goto-char (point-max))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
128 (insert "------- End of forwarded message -------\n")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
129 ;; You have a chance to arrange the message.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
130 (run-hooks 'gnus-mail-forward-hook)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
131 ))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
132
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
133 (defun gnus-mail-other-window-using-mail ()
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
134 "Compose mail other window using mail."
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
135 (news-mail-other-window)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
136 (gnus-overload-functions))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
137
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
138
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
139 ;;; Send mail using mh-e.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
140
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
141 ;; The following mh-e interface is all cooperative works of
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
142 ;; tanaka@flab.fujitsu.CO.JP (TANAKA Hiroshi), kawabe@sra.CO.JP
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
143 ;; (Yoshikatsu Kawabe), and shingu@casund.cpr.canon.co.jp (Toshiaki
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
144 ;; SHINGU).
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
145
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
146 (defun gnus-mail-reply-using-mhe (&optional yank)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
147 "Compose reply mail using mh-e.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
148 Optional argument YANK means yank original article.
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
149 The command \\[mh-yank-cur-msg] yank the original message into current buffer."
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
150 ;; First of all, prepare mhe mail buffer.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
151 (let (from cc subject date to reply-to (buffer (current-buffer)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
152 (save-restriction
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
153 (gnus-article-show-all-headers) ;I don't think this is really needed.
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
154 (setq from (gnus-fetch-field "from")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
155 subject (let ((subject (gnus-fetch-field "subject")))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
156 (if (and subject
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
157 (not (string-match "^[Rr][Ee]:.+$" subject)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
158 (concat "Re: " subject) subject))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
159 reply-to (gnus-fetch-field "reply-to")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
160 cc (gnus-fetch-field "cc")
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
161 date (gnus-fetch-field "date"))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
162 (setq mh-show-buffer buffer)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
163 (setq to (or reply-to from))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
164 (mh-find-path)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
165 (mh-send to (or cc "") subject)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
166 (save-excursion
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
167 (mh-insert-fields
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
168 "In-reply-to:"
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
169 (concat
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
170 (substring from 0 (string-match " *at \\| *@ \\| *(\\| *<" from))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
171 "'s message of " date)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
172 (setq mh-sent-from-folder buffer)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
173 (setq mh-sent-from-msg 1)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
174 ))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
175 ;; Then, yank original article if requested.
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
176 (if yank
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
177 (let ((last (point)))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
178 (mh-yank-cur-msg)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
179 (goto-char last)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
180 )))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
181
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
182 ;; gnus-mail-forward-using-mhe is contributed by Jun-ichiro Itoh
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
183 ;; <itojun@ingram.mt.cs.keio.ac.jp>
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
184
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
185 (defun gnus-mail-forward-using-mhe ()
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
186 "Forward the current message to another user using mh-e."
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
187 ;; First of all, prepare mhe mail buffer.
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
188 (let ((to (read-string "To: "))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
189 (cc (read-string "Cc: "))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
190 (buffer (current-buffer))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
191 subject)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
192 ;;(gnus-article-show-all-headers)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
193 (setq subject
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
194 (concat "[" gnus-newsgroup-name "] "
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
195 ;;(mail-strip-quoted-names (gnus-fetch-field "From")) ": "
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
196 (or (gnus-fetch-field "subject") "")))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
197 (setq mh-show-buffer buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
198 (mh-find-path)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
199 (mh-send to (or cc "") subject)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
200 (save-excursion
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
201 (goto-char (point-max))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
202 (insert "\n------- Forwarded Message\n\n")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
203 (insert-buffer buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
204 (goto-char (point-max))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
205 (insert "\n------- End of Forwarded Message\n")
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
206 (setq mh-sent-from-folder buffer)
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
207 (setq mh-sent-from-msg 1))))
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
208
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
209 (defun gnus-mail-other-window-using-mhe ()
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
210 "Compose mail other window using mh-e."
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
211 (let ((to (read-string "To: "))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
212 (cc (read-string "Cc: "))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
213 (subject (read-string "Subject: " (gnus-fetch-field "subject"))))
2843
cd90d49526ae Version 3.15 from Umeda.
Richard M. Stallman <rms@gnu.org>
parents: 851
diff changeset
214 (gnus-article-show-all-headers) ;I don't think this is really needed.
205
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
215 (setq mh-show-buffer (current-buffer))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
216 (mh-find-path)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
217 (mh-send-other-window to cc subject)
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
218 (setq mh-sent-from-folder (current-buffer))
d3e764a552a5 Initial revision
Jim Blandy <jimb@redhat.com>
parents:
diff changeset
219 (setq mh-sent-from-msg 1)))
584
4cd7543be581 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 205
diff changeset
220
4cd7543be581 *** empty log message ***
Jim Blandy <jimb@redhat.com>
parents: 205
diff changeset
221 (provide 'gnusmail)
660
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 584
diff changeset
222
08eb386dd0f3 *** empty log message ***
Eric S. Raymond <esr@snark.thyrsus.com>
parents: 584
diff changeset
223 ;;; gnusmail.el ends here