summaryrefslogtreecommitdiff
path: root/lisp/mail
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/binhex.el7
-rw-r--r--lisp/mail/blessmail.el5
-rw-r--r--lisp/mail/emacsbug.el228
-rw-r--r--lisp/mail/feedmail.el101
-rw-r--r--lisp/mail/footnote.el4
-rw-r--r--lisp/mail/hashcash.el19
-rw-r--r--lisp/mail/mail-extr.el53
-rw-r--r--lisp/mail/mail-hist.el5
-rw-r--r--lisp/mail/mail-utils.el80
-rw-r--r--lisp/mail/mailabbrev.el4
-rw-r--r--lisp/mail/mailalias.el10
-rw-r--r--lisp/mail/mailclient.el9
-rw-r--r--lisp/mail/mailheader.el11
-rw-r--r--lisp/mail/mailpost.el1
-rw-r--r--lisp/mail/metamail.el5
-rw-r--r--lisp/mail/mspools.el42
-rw-r--r--lisp/mail/reporter.el4
-rw-r--r--lisp/mail/rfc2368.el11
-rw-r--r--lisp/mail/rfc822.el4
-rw-r--r--lisp/mail/rmail-spam-filter.el5
-rw-r--r--lisp/mail/rmail.el105
-rw-r--r--lisp/mail/rmailedit.el5
-rw-r--r--lisp/mail/rmailkwd.el5
-rw-r--r--lisp/mail/rmailmm.el18
-rw-r--r--lisp/mail/rmailmsc.el5
-rw-r--r--lisp/mail/rmailout.el6
-rw-r--r--lisp/mail/rmailsort.el5
-rw-r--r--lisp/mail/rmailsum.el5
-rw-r--r--lisp/mail/sendmail.el259
-rw-r--r--lisp/mail/smtpmail.el3
-rw-r--r--lisp/mail/supercite.el40
-rw-r--r--lisp/mail/uce.el4
-rw-r--r--lisp/mail/undigest.el5
-rw-r--r--lisp/mail/unrmail.el4
-rw-r--r--lisp/mail/uudecode.el6
35 files changed, 564 insertions, 519 deletions
diff --git a/lisp/mail/binhex.el b/lisp/mail/binhex.el
index 13738f0c0a9..5332c0f14ba 100644
--- a/lisp/mail/binhex.el
+++ b/lisp/mail/binhex.el
@@ -1,7 +1,6 @@
;;; binhex.el --- decode BinHex-encoded text
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2011 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
;; Keywords: binhex news
@@ -226,7 +225,8 @@ If HEADER-ONLY is non-nil only decode header and return filename."
(goto-char start)
(when (re-search-forward binhex-begin-line end t)
(setq work-buffer (generate-new-buffer " *binhex-work*"))
- (with-current-buffer work-buffer (set-buffer-multibyte nil))
+ (unless (featurep 'xemacs)
+ (with-current-buffer work-buffer (set-buffer-multibyte nil)))
(beginning-of-line)
(setq bits 0 counter 0)
(while tmp
@@ -332,5 +332,4 @@ If HEADER-ONLY is non-nil only decode header and return filename."
(provide 'binhex)
-;; arch-tag: 8476badd-1e76-4f1d-a640-f9a38c72eed8
;;; binhex.el ends here
diff --git a/lisp/mail/blessmail.el b/lisp/mail/blessmail.el
index 3e58205d47d..b614fffb69d 100644
--- a/lisp/mail/blessmail.el
+++ b/lisp/mail/blessmail.el
@@ -1,10 +1,10 @@
;;; blessmail.el --- decide whether movemail needs special privileges -*- no-byte-compile: t -*-
-;; Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: internal
+;; Package: emacs
;; This file is part of GNU Emacs.
@@ -65,5 +65,4 @@
(write-region (point-min) (point-max) "blessmail")
(kill-emacs)
-;; arch-tag: c3329fe2-f945-41a9-8b00-b4b038ff182f
;;; blessmail.el ends here
diff --git a/lisp/mail/emacsbug.el b/lisp/mail/emacsbug.el
index 926d3e91af5..a621647bcf1 100644
--- a/lisp/mail/emacsbug.el
+++ b/lisp/mail/emacsbug.el
@@ -1,12 +1,12 @@
;;; emacsbug.el --- command to report Emacs bugs to appropriate mailing list
-;; Copyright (C) 1985, 1994, 1997, 1998, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Copyright (C) 1985, 1994, 1997-1998, 2000-2011
;; Free Software Foundation, Inc.
;; Author: K. Shane Hartman
;; Maintainer: FSF
;; Keywords: maint mail
+;; Package: emacs
;; This file is part of GNU Emacs.
@@ -32,22 +32,21 @@
;;; Code:
+(require 'url-util)
+
(defgroup emacsbug nil
"Sending Emacs bug reports."
:group 'maint
:group 'mail)
+(define-obsolete-variable-alias 'report-emacs-bug-pretest-address
+ 'report-emacs-bug-address "24.1")
+
(defcustom report-emacs-bug-address "bug-gnu-emacs@gnu.org"
"Address of mailing list for GNU Emacs bugs."
:group 'emacsbug
:type 'string)
-(defcustom report-emacs-bug-pretest-address "bug-gnu-emacs@gnu.org"
- "Address of mailing list for GNU Emacs pretest bugs."
- :group 'emacsbug
- :type 'string
- :version "23.2") ; emacs-pretest-bug -> bug-gnu-emacs
-
(defcustom report-emacs-bug-no-confirmation nil
"If non-nil, suppress the confirmations asked for the sake of novice users."
:group 'emacsbug
@@ -60,6 +59,9 @@
;; User options end here.
+(defvar report-emacs-bug-tracker-url "http://debbugs.gnu.org/cgi/"
+ "Base URL of the GNU bugtracker.
+Used for querying duplicates and linking to existing bugs.")
(defvar report-emacs-bug-orig-text nil
"The automatically-created initial text of the bug report.")
@@ -75,6 +77,63 @@
(declare-function x-server-vendor "xfns.c" (&optional terminal))
(declare-function x-server-version "xfns.c" (&optional terminal))
(declare-function message-sort-headers "message" ())
+(defvar message-strip-special-text-properties)
+
+(defun report-emacs-bug-can-use-osx-open ()
+ "Check if OSX open can be used to insert bug report into mailer"
+ (and (featurep 'ns)
+ (equal (executable-find "open") "/usr/bin/open")
+ (memq system-type '(darwin))))
+
+(defun report-emacs-bug-can-use-xdg-email ()
+ "Check if xdg-email can be used, i.e. we are on Gnome, KDE or xfce4."
+ (and (getenv "DISPLAY")
+ (executable-find "xdg-email")
+ (or (getenv "GNOME_DESKTOP_SESSION_ID")
+ ;; GNOME_DESKTOP_SESSION_ID is deprecated, check on Dbus also.
+ (condition-case nil
+ (eq 0 (call-process
+ "dbus-send" nil nil nil
+ "--dest=org.gnome.SessionManager"
+ "--print-reply"
+ "/org/gnome/SessionManager"
+ "org.gnome.SessionManager.CanShutdown"))
+ (error nil))
+ (equal (getenv "KDE_FULL_SESSION") "true")
+ (condition-case nil
+ (eq 0 (call-process
+ "/bin/sh" nil nil nil
+ "-c"
+ "xprop -root _DT_SAVE_MODE|grep xfce4"))
+ (error nil)))))
+
+(defun report-emacs-bug-insert-to-mailer ()
+ (interactive)
+ (save-excursion
+ (let* ((to (progn
+ (goto-char (point-min))
+ (forward-line)
+ (and (looking-at "^To: \\(.*\\)")
+ (match-string-no-properties 1))))
+ (subject (progn
+ (forward-line)
+ (and (looking-at "^Subject: \\(.*\\)")
+ (match-string-no-properties 1))))
+ (body (progn
+ (forward-line 2)
+ (if (> (point-max) (point))
+ (buffer-substring-no-properties (point) (point-max))))))
+ (if (and to subject body)
+ (if (report-emacs-bug-can-use-osx-open)
+ (start-process "/usr/bin/open" nil "open"
+ (concat "mailto:" to
+ "?subject=" (url-hexify-string subject)
+ "&body=" (url-hexify-string body)))
+ (start-process "xdg-email" nil "xdg-email"
+ "--subject" subject
+ "--body" body
+ (concat "mailto:" to)))
+ (error "Subject, To or body not found")))))
;;;###autoload
(defun report-emacs-bug (topic &optional recent-keys)
@@ -89,32 +148,27 @@ Prompts for bug subject. Leaves you in a mail buffer."
(setq topic (concat emacs-version "; " topic))
(when (string-match "^\\(\\([.0-9]+\\)*\\)\\.[0-9]+$" emacs-version)
(setq topic (concat (match-string 1 emacs-version) "; " topic))))
- ;; If there are four numbers in emacs-version (three for MS-DOS),
- ;; this is a pretest version.
- (let* ((pretest-p (string-match (if (eq system-type 'ms-dos)
- "\\..*\\."
- "\\..*\\..*\\.")
- emacs-version))
- (from-buffer (current-buffer))
- (reporting-address (if pretest-p
- report-emacs-bug-pretest-address
- report-emacs-bug-address))
- ;; Put these properties on semantically-void text.
- ;; report-emacs-bug-hook deletes these regions before sending.
- (prompt-properties '(field emacsbug-prompt
- intangible but-helpful
- rear-nonsticky t))
- user-point message-end-point)
+ (let ((from-buffer (current-buffer))
+ ;; Put these properties on semantically-void text.
+ ;; report-emacs-bug-hook deletes these regions before sending.
+ (prompt-properties '(field emacsbug-prompt
+ intangible but-helpful
+ rear-nonsticky t))
+ (can-insert-mail (or (report-emacs-bug-can-use-xdg-email)
+ (report-emacs-bug-can-use-osx-open)))
+ user-point message-end-point)
(setq message-end-point
(with-current-buffer (get-buffer-create "*Messages*")
(point-max-marker)))
- (compose-mail reporting-address topic)
+ (compose-mail report-emacs-bug-address topic)
;; The rest of this does not execute if the user was asked to
;; confirm and said no.
- ;; Message-mode sorts the headers before sending. We sort now so
- ;; that report-emacs-bug-orig-text remains valid. (Bug#5178)
- (if (eq major-mode 'message-mode)
- (message-sort-headers))
+ (when (eq major-mode 'message-mode)
+ ;; Message-mode sorts the headers before sending. We sort now so
+ ;; that report-emacs-bug-orig-text remains valid. (Bug#5178)
+ (message-sort-headers)
+ ;; Stop message-mode stealing the properties we will add.
+ (set (make-local-variable 'message-strip-special-text-properties) nil))
(rfc822-goto-eoh)
(forward-line 1)
(let ((signature (buffer-substring (point) (point-max))))
@@ -123,7 +177,7 @@ Prompts for bug subject. Leaves you in a mail buffer."
(backward-char (length signature)))
(unless report-emacs-bug-no-explanations
;; Insert warnings for novice users.
- (when (string-match "@gnu\\.org$" reporting-address)
+ (when (string-match "@gnu\\.org$" report-emacs-bug-address)
(insert "This bug report will be sent to the Free Software Foundation,\n")
(let ((pos (point)))
(insert "not to your local site managers!")
@@ -135,17 +189,12 @@ Prompts for bug subject. Leaves you in a mail buffer."
(insert " if possible, because the Emacs maintainers
usually do not have translators to read other languages for them.\n\n")
(insert (format "Your report will be posted to the %s mailing list"
- reporting-address))
- ;; Nowadays all bug reports end up there.
-;;; (if pretest-p (insert ".\n\n")
- (insert "\nand the gnu.emacs.bug news group, and at http://debbugs.gnu.org.\n\n"))
+ report-emacs-bug-address))
+ (insert "\nand the gnu.emacs.bug news group, and at http://debbugs.gnu.org.\n\n"))
(insert "Please describe exactly what actions triggered the bug\n"
"and the precise symptoms of the bug. If you can, give\n"
"a recipe starting from `emacs -Q':\n\n")
- ;; Stop message-mode stealing the properties we are about to add.
- (if (boundp 'message-strip-special-text-properties)
- (set (make-local-variable 'message-strip-special-text-properties) nil))
(add-text-properties (save-excursion
(rfc822-goto-eoh)
(line-beginning-position 2))
@@ -240,16 +289,14 @@ usually do not have translators to read other languages for them.\n\n")
;; This is so the user has to type something in order to send easily.
(use-local-map (nconc (make-sparse-keymap) (current-local-map)))
(define-key (current-local-map) "\C-c\C-i" 'report-emacs-bug-info)
- ;; Could test major-mode instead.
- (cond ((memq mail-user-agent '(message-user-agent gnus-user-agent))
- (setq report-emacs-bug-send-command "message-send-and-exit"
- report-emacs-bug-send-hook 'message-send-hook))
- ((eq mail-user-agent 'sendmail-user-agent)
- (setq report-emacs-bug-send-command "mail-send-and-exit"
- report-emacs-bug-send-hook 'mail-send-hook))
- ((eq mail-user-agent 'mh-e-user-agent)
- (setq report-emacs-bug-send-command "mh-send-letter"
- report-emacs-bug-send-hook 'mh-before-send-letter-hook)))
+ (if can-insert-mail
+ (define-key (current-local-map) "\C-cm"
+ 'report-emacs-bug-insert-to-mailer))
+ (setq report-emacs-bug-send-command (get mail-user-agent 'sendfunc)
+ report-emacs-bug-send-hook (get mail-user-agent 'hookvar))
+ (if report-emacs-bug-send-command
+ (setq report-emacs-bug-send-command
+ (symbol-name report-emacs-bug-send-command)))
(unless report-emacs-bug-no-explanations
(with-output-to-temp-buffer "*Bug Help*"
(princ "While in the mail buffer:\n\n")
@@ -259,6 +306,9 @@ usually do not have translators to read other languages for them.\n\n")
report-emacs-bug-send-command))))
(princ (substitute-command-keys
" Type \\[kill-buffer] RET to cancel (don't send it).\n"))
+ (if can-insert-mail
+ (princ (substitute-command-keys
+ " Type \\[report-emacs-bug-insert-to-mailer] to insert text to you preferred mail program.\n")))
(terpri)
(princ (substitute-command-keys
" Type \\[report-emacs-bug-info] to visit in Info the Emacs Manual section
@@ -335,6 +385,90 @@ and send the mail again%s."
'field 'emacsbug-prompt))
(delete-region pos (field-end (1+ pos)))))))
+
+;; Querying the bug database
+
+(defvar report-emacs-bug-bug-alist nil)
+(make-variable-buffer-local 'report-emacs-bug-bug-alist)
+(defvar report-emacs-bug-choice-widget nil)
+(make-variable-buffer-local 'report-emacs-bug-choice-widget)
+
+(defun report-emacs-bug-create-existing-bugs-buffer (bugs keywords)
+ (switch-to-buffer (get-buffer-create "*Existing Emacs Bugs*"))
+ (setq buffer-read-only t)
+ (let ((inhibit-read-only t))
+ (erase-buffer)
+ (setq report-emacs-bug-bug-alist bugs)
+ (widget-insert (propertize (concat "Already known bugs ("
+ keywords "):\n\n")
+ 'face 'bold))
+ (if bugs
+ (setq report-emacs-bug-choice-widget
+ (apply 'widget-create 'radio-button-choice
+ :value (caar bugs)
+ (let (items)
+ (dolist (bug bugs)
+ (push (list
+ 'url-link
+ :format (concat "Bug#" (number-to-string (nth 2 bug))
+ ": " (cadr bug) "\n %[%v%]\n")
+ ;; FIXME: Why is only the link of the
+ ;; active item clickable?
+ (car bug))
+ items))
+ (nreverse items))))
+ (widget-insert "No bugs maching your keywords found.\n"))
+ (widget-insert "\n")
+ (widget-create 'push-button
+ :notify (lambda (&rest ignore)
+ ;; TODO: Do something!
+ (message "Reporting new bug!"))
+ "Report new bug")
+ (when bugs
+ (widget-insert " ")
+ (widget-create 'push-button
+ :notify (lambda (&rest ignore)
+ (let ((val (widget-value report-emacs-bug-choice-widget)))
+ ;; TODO: Do something!
+ (message "Appending to bug %s!"
+ (nth 2 (assoc val report-emacs-bug-bug-alist)))))
+ "Append to chosen bug"))
+ (widget-insert " ")
+ (widget-create 'push-button
+ :notify (lambda (&rest ignore)
+ (kill-buffer))
+ "Quit reporting bug")
+ (widget-insert "\n"))
+ (use-local-map widget-keymap)
+ (widget-setup)
+ (goto-char (point-min)))
+
+(defun report-emacs-bug-parse-query-results (status keywords)
+ (goto-char (point-min))
+ (let (buglist)
+ (while (re-search-forward "<a href=\"bugreport\\.cgi\\?bug=\\([[:digit:]]+\\)\">\\([^<]+\\)</a>" nil t)
+ (let ((number (match-string 1))
+ (subject (match-string 2)))
+ (when (not (string-match "^#" subject))
+ (push (list
+ ;; first the bug URL
+ (concat report-emacs-bug-tracker-url
+ "bugreport.cgi?bug=" number)
+ ;; then the subject and number
+ subject (string-to-number number))
+ buglist))))
+ (report-emacs-bug-create-existing-bugs-buffer (nreverse buglist) keywords)))
+
+(defun report-emacs-bug-query-existing-bugs (keywords)
+ "Query for KEYWORDS at `report-emacs-bug-tracker-url', and return the result.
+The result is an alist with items of the form (URL SUBJECT NO)."
+ (interactive "sBug keywords (comma separated): ")
+ (url-retrieve (concat report-emacs-bug-tracker-url
+ "pkgreport.cgi?include=subject%3A"
+ (replace-regexp-in-string "[[:space:]]+" "+" keywords)
+ ";package=emacs")
+ 'report-emacs-bug-parse-query-results (list keywords)))
+
(provide 'emacsbug)
;;; emacsbug.el ends here
diff --git a/lisp/mail/feedmail.el b/lisp/mail/feedmail.el
index 77d82f6076f..597344fb88a 100644
--- a/lisp/mail/feedmail.el
+++ b/lisp/mail/feedmail.el
@@ -314,7 +314,7 @@
(defcustom feedmail-confirm-outgoing nil
- "*If non-nil, give a y-or-n confirmation prompt before sending mail.
+ "If non-nil, give a y-or-n confirmation prompt before sending mail.
This is done after the message is completely prepped, and you'll be
looking at the top of the message in a buffer when you get the prompt.
If set to the symbol 'queued, give the confirmation prompt only while
@@ -330,7 +330,7 @@ cases. You can give a timeout for the prompt; see variable
(defcustom feedmail-confirm-outgoing-timeout nil
- "*If non-nil, a timeout in seconds at the send confirmation prompt.
+ "If non-nil, a timeout in seconds at the send confirmation prompt.
If a positive number, it's a timeout before sending. If a negative
number, it's a timeout before not sending. This will not work if your
version of Emacs doesn't include the function `y-or-n-p-with-timeout'
@@ -341,7 +341,7 @@ version of Emacs doesn't include the function `y-or-n-p-with-timeout'
(defcustom feedmail-nuke-bcc t
- "*If non-nil remove Bcc: lines from the message headers.
+ "If non-nil remove Bcc: lines from the message headers.
In any case, the Bcc: lines do participate in the composed address
list. You may want to leave them in if you're using sendmail
\(see `feedmail-buffer-eating-function'\)."
@@ -351,7 +351,7 @@ list. You may want to leave them in if you're using sendmail
(defcustom feedmail-nuke-resent-bcc t
- "*If non-nil remove Resent-Bcc: lines from the message headers.
+ "If non-nil remove Resent-Bcc: lines from the message headers.
In any case, the Resent-Bcc: lines do participate in the composed
address list. You may want to leave them in if you're using sendmail
\(see `feedmail-buffer-eating-function'\)."
@@ -361,7 +361,7 @@ address list. You may want to leave them in if you're using sendmail
(defcustom feedmail-deduce-bcc-where nil
- "*Where Bcc:/Resent-Bcc: addresses should appear in the envelope list.
+ "Where Bcc:/Resent-Bcc: addresses should appear in the envelope list.
Addresses for the message envelope are deduced by examining
appropriate address headers in the message. Generally, they will show
up in the list of deduced addresses in the order that the headers
@@ -387,7 +387,7 @@ delivery agent that processes the addresses backwards."
(defcustom feedmail-fill-to-cc t
- "*If non-nil do smart filling of addressee header lines.
+ "If non-nil do smart filling of addressee header lines.
Smart filling means breaking long lines at appropriate points and
making continuation lines. Despite the function name, it includes
To:, Cc:, Bcc: (and their Resent-* forms), as well as From: and
@@ -399,14 +399,14 @@ as-is. The filling is done after mail address alias expansion."
(defcustom feedmail-fill-to-cc-fill-column default-fill-column
- "*Fill column used by `feedmail-fill-to-cc'."
+ "Fill column used by `feedmail-fill-to-cc'."
:group 'feedmail-headers
:type 'integer
)
(defcustom feedmail-nuke-bcc-in-fcc nil
- "*If non-nil remove [Resent-]Bcc: lines in message copies saved via Fcc:.
+ "If non-nil remove [Resent-]Bcc: lines in message copies saved via Fcc:.
This is independent of whether the Bcc: header lines are actually sent
with the message (see feedmail-nuke-bcc). Though not implied in the name,
the same Fcc: treatment applies to both Bcc: and Resent-Bcc: lines."
@@ -416,7 +416,7 @@ the same Fcc: treatment applies to both Bcc: and Resent-Bcc: lines."
(defcustom feedmail-nuke-body-in-fcc nil
- "*If non-nil remove body of message in copies saved via Fcc:.
+ "If non-nil remove body of message in copies saved via Fcc:.
If a positive integer value, leave (up to) that many lines of the
beginning of the body intact. The result is that the Fcc: copy will
consist only of the message headers, serving as a sort of an outgoing
@@ -427,7 +427,7 @@ message log."
(defcustom feedmail-force-expand-mail-aliases nil
- "*If non-nil, force the calling of `expand-mail-aliases'.
+ "If non-nil, force the calling of `expand-mail-aliases'.
Normally, feedmail tries to figure out if you're using mailalias or
mailabbrevs and only calls `expand-mail-aliases' if it thinks you're
using the mailalias package. This user option can be used to force
@@ -439,7 +439,7 @@ out."
(defcustom feedmail-nuke-empty-headers t
- "*If non-nil, remove header lines which have no contents.
+ "If non-nil, remove header lines which have no contents.
A completely empty Subject: header is always removed, regardless of
the setting of this variable. The only time you would want them left
in would be if you used some headers whose presence indicated
@@ -457,7 +457,7 @@ but common in some proprietary systems."
;; RFC-822 and RFC-1123, but are you *really* one of those cases
;; they're talking about? I doubt it.)
(defcustom feedmail-sender-line nil
- "*If non-nil and the email has no Sender: header, use this value.
+ "If non-nil and the email has no Sender: header, use this value.
May be nil, in which case nothing in particular is done with respect
to Sender: lines. By design, will not replace an existing Sender:
line, but you can achieve that with a fiddle-plex 'replace action.
@@ -484,7 +484,7 @@ header is fiddled after the From: header is fiddled."
(defcustom feedmail-force-binary-write t
- "*If non-nil, force writing file as binary (this applies to queues and Fcc:).
+ "If non-nil, force writing file as binary (this applies to queues and Fcc:).
On systems where there is a difference between binary and text files,
feedmail will temporarily manipulate the value of `buffer-file-type'
to make the writing as binary. If nil, writing will be in text mode.
@@ -496,7 +496,7 @@ variables or other means, this option has no effect."
(defcustom feedmail-from-line t
- "*If non-nil and the email has no From: header, use this value.
+ "If non-nil and the email has no From: header, use this value.
May be t, in which case a default is computed (and you probably won't
be happy with it). May be nil, in which case nothing in particular is
done with respect to From: lines. By design, will not replace an
@@ -526,7 +526,7 @@ to arrange for the message to get a From: line."
(defcustom feedmail-deduce-envelope-from t
- "*If non-nil, deduce message envelope \"from\" from header From: or Sender:.
+ "If non-nil, deduce message envelope \"from\" from header From: or Sender:.
In other words, if there is a Sender: header in the message, temporarily
change the value of `user-mail-address' to be the same while the message
is being sent. If there is no Sender: header, use the From: header,
@@ -555,14 +555,14 @@ influence what they will use as the envelope."
(defcustom feedmail-x-mailer-line-user-appendage nil
- "*See feedmail-x-mailer-line."
+ "See feedmail-x-mailer-line."
:group 'feedmail-headers
:type '(choice (const nil) (const t) string)
)
(defcustom feedmail-x-mailer-line t
- "*Control the form of an X-Mailer: header in an outgoing message.
+ "Control the form of an X-Mailer: header in an outgoing message.
Moderately useful for debugging, keeping track of your correspondents'
mailer preferences, or just wearing your MUA on your sleeve. You
should probably know that some people are fairly emotional about the
@@ -592,7 +592,7 @@ by feedmail to either \"X-Mailer\" or \"X-Resent-Mailer\"."
(defcustom feedmail-message-id-generator t
- "*Specifies the creation of a Message-Id: header field.
+ "Specifies the creation of a Message-Id: header field.
If nil, nothing is done about Message-Id:.
@@ -622,7 +622,7 @@ in the saved message if you use Fcc:."
(defcustom feedmail-message-id-suffix nil
- "*If non-nil, used as a suffix for generating unique Message-Id: headers.
+ "If non-nil, used as a suffix for generating unique Message-Id: headers.
The function `feedmail-default-message-id-generator' creates its work based
on a formatted date-time string, a random number, and a domain-looking suffix.
You can control the suffix used by assigning a string value to this variable.
@@ -637,7 +637,7 @@ automatically."
;; this was suggested in various forms by several people; first was
;; Tony DeSimone in Oct 1992; sorry to be so tardy
(defcustom feedmail-date-generator t
- "*Specifies the creation of a Date: header field.
+ "Specifies the creation of a Date: header field.
If nil, nothing is done about Date:.
@@ -671,7 +671,7 @@ in the saved message if you use Fcc:."
(defcustom feedmail-fiddle-headers-upwardly t
- "*Non-nil means fiddled header fields should go at the top of the header.
+ "Non-nil means fiddled header fields should go at the top of the header.
nil means insert them at the bottom. This is mostly a novelty issue since
the standards define the ordering of header fields to be immaterial and it's
fairly likely that some MTA along the way will have its own idea of what the
@@ -777,7 +777,7 @@ you are at accomplishing inherently inefficient things."
(defcustom feedmail-enable-queue nil
- "*If non-nil, provide for stashing outgoing messages in a queue.
+ "If non-nil, provide for stashing outgoing messages in a queue.
This is the master on/off switch for feedmail message queuing.
Queuing is quite handy for laptop-based users. It's also handy if you
get a lot of mail and process it more or less sequentially. For
@@ -804,7 +804,7 @@ To transmit all the messages in the queue, invoke the command
(defcustom feedmail-queue-runner-confirm-global nil
- "*If non-nil, give a y-or-n confirmation prompt before running the queue.
+ "If non-nil, give a y-or-n confirmation prompt before running the queue.
Prompt even if the queue is about to be processed as a result of a call to
`feedmail-run-the-queue-no-prompts'. This gives you a way to bail out
without having to answer no to the individual message prompts."
@@ -814,7 +814,7 @@ without having to answer no to the individual message prompts."
(defcustom feedmail-queue-directory
(concat (getenv "HOME") "/mail/q")
- "*Name of a directory where messages will be queued.
+ "Name of a directory where messages will be queued.
Directory will be created if necessary. Should be a string that
doesn't end with a slash. Default is \"$HOME/mail/q\"."
:group 'feedmail-queue
@@ -824,7 +824,7 @@ doesn't end with a slash. Default is \"$HOME/mail/q\"."
(defcustom feedmail-queue-draft-directory
(concat (getenv "HOME") "/mail/draft")
- "*Name of a directory where draft messages will be queued.
+ "Name of a directory where draft messages will be queued.
Directory will be created if necessary. Should be a string that
doesn't end with a slash. Default is \"$HOME/mail/draft\"."
:group 'feedmail-queue
@@ -833,7 +833,7 @@ doesn't end with a slash. Default is \"$HOME/mail/draft\"."
(defcustom feedmail-ask-before-queue t
- "*If non-nil, feedmail will ask what you want to do with the message.
+ "If non-nil, feedmail will ask what you want to do with the message.
Default choices for the message action prompt will include sending it
immediately, putting it in the main queue, putting it in the draft
queue, or returning to the buffer to continue editing. Only matters if
@@ -845,7 +845,7 @@ without a prompt."
(defcustom feedmail-ask-before-queue-prompt "FQM: Message action (q, i, d, e, ?)? [%s]: "
- "*A string which will be used for the message action prompt.
+ "A string which will be used for the message action prompt.
If it contains a \"%s\", that will be replaced with the value of
`feedmail-ask-before-queue-default'."
:group 'feedmail-queue
@@ -854,7 +854,7 @@ If it contains a \"%s\", that will be replaced with the value of
(defcustom feedmail-ask-before-queue-reprompt "FQM: Please type q, i, d, or e; or ? for help [%s]: "
- "*A string which will be used for repompting after invalid input.
+ "A string which will be used for repompting after invalid input.
If it contains a \"%s\", that will be replaced with the value of
`feedmail-ask-before-queue-default'."
:group 'feedmail-queue
@@ -863,7 +863,7 @@ If it contains a \"%s\", that will be replaced with the value of
(defcustom feedmail-ask-before-queue-default "queue"
- "*Meaning if user hits return in response to the message action prompt.
+ "Meaning if user hits return in response to the message action prompt.
Should be a character or a string; if a string, only the first
character is significant. Useful values are those described in
the help for the message action prompt."
@@ -947,7 +947,7 @@ It may contain embedded line breaks. It will be printed via `princ'."
(defcustom feedmail-queue-chatty t
- "*If non-nil, blat a few status messages and such in the mini-buffer.
+ "If non-nil, blat a few status messages and such in the mini-buffer.
If nil, just do the work and don't pester people about what's going on.
In some cases, though, specific options inspire mini-buffer prompting.
That's not affected by this variable setting. Also does not control
@@ -958,7 +958,7 @@ reporting of error/abnormal conditions."
(defcustom feedmail-queue-chatty-sit-for 2
- "*Duration of pause after most queue-related messages.
+ "Duration of pause after most queue-related messages.
After some messages are divulged, it is prudent to pause before
something else obliterates them. This value controls the duration of
the pause."
@@ -968,7 +968,7 @@ the pause."
(defcustom feedmail-queue-run-orderer nil
- "*If non-nil, name a function which will sort the queued messages.
+ "If non-nil, name a function which will sort the queued messages.
The function is called during a running of the queue for sending, and
takes one argument, a list of the files in the queue directory. It
may contain the names of non-message files, and it's okay to leave
@@ -982,7 +982,7 @@ they were placed in the queue."
(defcustom feedmail-queue-use-send-time-for-date nil
- "*If non-nil, use send time for the Date: header value.
+ "If non-nil, use send time for the Date: header value.
This variable is used by the default date generating function,
feedmail-default-date-generator. If nil, the default, the
last-modified timestamp of the queue file is used to create the
@@ -994,7 +994,7 @@ used."
(defcustom feedmail-queue-use-send-time-for-message-id nil
- "*If non-nil, use send time for the Message-Id: header value.
+ "If non-nil, use send time for the Message-Id: header value.
This variable is used by the default Message-Id: generating function,
`feedmail-default-message-id-generator'. If nil, the default, the
last-modified timestamp of the queue file is used to create the
@@ -1006,7 +1006,7 @@ used."
(defcustom feedmail-ask-for-queue-slug nil
- "*If non-nil, prompt user for part of the queue file name.
+ "If non-nil, prompt user for part of the queue file name.
The file will automatically get the FQM suffix and an embedded
sequence number for uniqueness, so don't specify that. feedmail will
get rid of all characters other than alphanumeric and hyphen in the
@@ -1023,7 +1023,7 @@ based on the subjects of the messages."
(defcustom feedmail-queue-slug-maker 'feedmail-queue-subject-slug-maker
- "*If non-nil, a function which creates part of the queued file name.
+ "If non-nil, a function which creates part of the queued file name.
Takes a single argument giving the name of the directory into
which the message will be queued. The returned string should be just
the non-directory filename part, without FQM suffix or uniquifying
@@ -1036,7 +1036,7 @@ any."
(defcustom feedmail-queue-default-file-slug t
- "*Indicates what to use for subject-less messages when forming a file name.
+ "Indicates what to use for subject-less messages when forming a file name.
When feedmail queues a message, it creates a unique file name. By default,
the file name is based in part on the subject of the message being queued.
If there is no subject, consult this variable. See documentation for the
@@ -1059,7 +1059,7 @@ it's not expected to be a complete filename."
(defcustom feedmail-queue-fqm-suffix ".fqm"
- "*The FQM suffix used to distinguish feedmail queued message files.
+ "The FQM suffix used to distinguish feedmail queued message files.
You probably want this to be a period followed by some letters and/or
digits. The distinction is to be able to tell them from other random
files that happen to be in the `feedmail-queue-directory' or
@@ -1071,7 +1071,7 @@ queued message."
(defcustom feedmail-nuke-buffer-after-queue nil
- "*If non-nil, silently kill the buffer after a message is queued.
+ "If non-nil, silently kill the buffer after a message is queued.
You might like that since a side-effect of queueing the message is
that its buffer name gets changed to the filename. That means that
the buffer won't be reused for the next message you compose. If you
@@ -1084,7 +1084,7 @@ message buffers."
(defcustom feedmail-queue-auto-file-nuke nil
- "*If non-nil, automatically delete queue files when a message is sent.
+ "If non-nil, automatically delete queue files when a message is sent.
Normally, feedmail will notice such files when you send a message in
immediate mode (i.e., not when you're running the queue) and will ask if
you want to delete them. Since the answer is usually yes, setting this
@@ -1154,7 +1154,7 @@ It shows the simple addresses and gets a confirmation. Use as:
(defcustom feedmail-last-chance-hook nil
- "*User's last opportunity to modify the message on its way out.
+ "User's last opportunity to modify the message on its way out.
It has already had all the header prepping from the standard package.
The next step after running the hook will be to push the buffer into a
subprocess that mails the mail. The hook might be interested in
@@ -1172,7 +1172,7 @@ reused and things will get confused."
(defcustom feedmail-before-fcc-hook nil
- "*User's last opportunity to modify the message before Fcc action.
+ "User's last opportunity to modify the message before Fcc action.
It has already had all the header prepping from the standard package.
The next step after running the hook will be to save the message via
Fcc: processing. The hook might be interested in these: (1)
@@ -1189,7 +1189,7 @@ internal buffers will be reused and things will get confused."
(defcustom feedmail-queue-runner-mode-setter
'(lambda (&optional arg) (mail-mode))
- "*A function to set the proper mode of a message file.
+ "A function to set the proper mode of a message file.
Called when the message is read back out of the queue directory with a single
argument, the optional argument used in the call to
`feedmail-run-the-queue' or `feedmail-run-the-queue-no-prompts'.
@@ -1204,7 +1204,7 @@ Called with funcall, not `call-interactively'."
(defcustom feedmail-queue-alternative-mail-header-separator nil
- "*Alternative header demarcation for queued messages.
+ "Alternative header demarcation for queued messages.
If you sometimes get alternative values for `mail-header-separator' in
queued messages, set the value of this variable to whatever it is.
For example, `rmail-resend' uses a `mail-header-separator' value of empty
@@ -1221,7 +1221,7 @@ set `mail-header-separator' to the value of
(defcustom feedmail-queue-runner-message-sender 'mail-send-and-exit
- "*Function to initiate sending a message file.
+ "Function to initiate sending a message file.
Called for each message read back out of the queue directory with a
single argument, the optional argument used in the call to
`feedmail-run-the-queue' or `feedmail-run-the-queue-no-prompts'.
@@ -1238,7 +1238,7 @@ your chance to have something different. Called with `funcall', not
'(lambda (fqm-file &optional arg)
(delete-file fqm-file)
(if (and arg feedmail-queue-chatty) (message "FQM: Nuked %s" fqm-file)))
- "*Function that will be called after a message has been sent.
+ "Function that will be called after a message has been sent.
Not called in the case of errors. This function is called with two
arguments: the name of the message queue file for the message just sent,
and the optional argument used in the call to `feedmail-run-the-queue'
@@ -1265,7 +1265,7 @@ variable, but may depend on its value as described here.")
(defcustom feedmail-buffer-eating-function 'feedmail-buffer-to-binmail
- "*Function used to send the prepped buffer to a subprocess.
+ "Function used to send the prepped buffer to a subprocess.
The function's three (mandatory) arguments are: (1) the buffer
containing the prepped message; (2) a buffer where errors should be
directed; and (3) a list containing the addresses individually as
@@ -1281,7 +1281,7 @@ to nil. If you use the binmail form, check the value of
(defcustom feedmail-binmail-template (if mail-interactive "/bin/mail %s" "/bin/rmail %s")
- "*Command template for the subprocess which will get rid of the mail.
+ "Command template for the subprocess which will get rid of the mail.
It can result in any command understandable by /bin/sh. Might not
work at all in non-Unix environments. The single '%s', if present,
gets replaced by the space-separated, simplified list of addressees.
@@ -1446,7 +1446,7 @@ with various lower-level mechanisms to provide features such as queueing."
;; From a VM mailing list discussion and some suggestions from Samuel Mikes <smikes@alumni.hmc.edu>
(defun feedmail-queue-express-to-queue ()
- "*Send message directly to the queue, with a minimum of fuss and bother."
+ "Send message directly to the queue, with a minimum of fuss and bother."
(interactive)
(let ((feedmail-enable-queue t)
(feedmail-ask-before-queue nil)
@@ -1458,7 +1458,7 @@ with various lower-level mechanisms to provide features such as queueing."
(defun feedmail-queue-express-to-draft ()
- "*Send message directly to the draft queue, with a minimum of fuss and bother."
+ "Send message directly to the draft queue, with a minimum of fuss and bother."
(interactive)
(let ((feedmail-queue-directory feedmail-queue-draft-directory))
(feedmail-queue-express-to-queue)
@@ -2662,5 +2662,4 @@ been weeded out."
(provide 'feedmail)
-;; arch-tag: ec27b380-11c0-4dfd-8436-f636cf2bb992
;;; feedmail.el ends here
diff --git a/lisp/mail/footnote.el b/lisp/mail/footnote.el
index 82928642f3f..4a4ded22886 100644
--- a/lisp/mail/footnote.el
+++ b/lisp/mail/footnote.el
@@ -1,7 +1,6 @@
;;; footnote.el --- footnote support for message mode -*- coding: iso-latin-1;-*-
-;; Copyright (C) 1997, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2000-2011 Free Software Foundation, Inc.
;; Author: Steven L Baur <steve@xemacs.org>
;; Keywords: mail, news
@@ -797,5 +796,4 @@ started, play around with the following keys:
(provide 'footnote)
-;; arch-tag: 9bcfb6d7-2161-4caf-8793-700f62400398
;;; footnote.el ends here
diff --git a/lisp/mail/hashcash.el b/lisp/mail/hashcash.el
index e6902d88ccf..8343cd086b1 100644
--- a/lisp/mail/hashcash.el
+++ b/lisp/mail/hashcash.el
@@ -1,6 +1,6 @@
;;; hashcash.el --- Add hashcash payments to email
-;; Copyright (C) 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2011 Free Software Foundation
+;; Copyright (C) 2003-2005, 2007-2011 Free Software Foundation, Inc.
;; Written by: Paul Foley <mycroft@actrix.gen.nz> (1997-2002)
;; Maintainer: Paul Foley <mycroft@actrix.gen.nz>
@@ -47,6 +47,7 @@
;;; Code:
+;; For Emacs <22.2 and XEmacs.
(eval-and-compile
(unless (fboundp 'declare-function) (defmacro declare-function (&rest r))))
@@ -115,8 +116,6 @@ For example, you may want to set this to '(\"-Z2\") to reduce header length."
(require 'mail-utils)
(eval-and-compile
- (unless (fboundp 'declare-function) (defmacro declare-function (&rest r)))
-
(if (fboundp 'point-at-bol)
(defalias 'hashcash-point-at-bol 'point-at-bol)
(defalias 'hashcash-point-at-bol 'line-beginning-position))
@@ -131,10 +130,10 @@ For example, you may want to set this to '(\"-Z2\") to reduce header length."
(concat (match-string 1 addr) (match-string 2 addr))
addr))
-(declare-function message-narrow-to-headers-or-head "message" ())
-(declare-function message-fetch-field "message" (header &optional not-all))
-(declare-function message-goto-eoh "message" ())
-(declare-function message-narrow-to-headers "message" ())
+(declare-function message-narrow-to-headers-or-head "message" ())
+(declare-function message-fetch-field "message" (header &optional not-all))
+(declare-function message-goto-eoh "message" ())
+(declare-function message-narrow-to-headers "message" ())
(defun hashcash-token-substring ()
(save-excursion
@@ -277,7 +276,7 @@ BUFFER defaults to the current buffer."
(unless buffer (setq buffer (current-buffer)))
(let (entry)
(while (setq entry (rassq buffer hashcash-process-alist))
- (accept-process-output (car entry)))))
+ (accept-process-output (car entry) 1))))
(defun hashcash-processes-running-p (buffer)
"Return non-nil if hashcash processes in BUFFER are still running."
@@ -287,7 +286,7 @@ BUFFER defaults to the current buffer."
"Ask user whether to wait for hashcash processes to finish."
(interactive)
(when (hashcash-processes-running-p (current-buffer))
- (if (y-or-n-p
+ (if (y-or-n-p
"Hashcash process(es) still running; wait for them to finish? ")
(hashcash-wait-async)
(hashcash-cancel-async))))
@@ -376,4 +375,4 @@ Prefix arg sets default accept amount temporarily."
(provide 'hashcash)
-;; arch-tag: 0e7fe983-a124-4392-9788-0dbcbd2c4d62
+;;; hashcash.el ends here
diff --git a/lisp/mail/mail-extr.el b/lisp/mail/mail-extr.el
index 18bbb60e3a0..c3a7da41823 100644
--- a/lisp/mail/mail-extr.el
+++ b/lisp/mail/mail-extr.el
@@ -1,11 +1,11 @@
;;; mail-extr.el --- extract full name and address from RFC 822 mail header -*- coding: utf-8 -*-
-;; Copyright (C) 1991, 1992, 1993, 1994, 1997, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1991-1994, 1997, 2001-2011 Free Software Foundation, Inc.
;; Author: Joe Wells <jbw@cs.bu.edu>
;; Maintainer: FSF
;; Keywords: mail
+;; Package: mail-utils
;; This file is part of GNU Emacs.
@@ -690,8 +690,8 @@ Unless NO-REPLACE is true, at each of the positions in LIST-SYMBOL
;;
(defvar disable-initial-guessing-flag) ; dynamic assignment
-(defvar cbeg) ; dynamic assignment
-(defvar cend) ; dynamic assignment
+(defvar mailextr-cbeg) ; dynamic assignment
+(defvar mailextr-cend) ; dynamic assignment
(defvar mail-extr-all-top-level-domains) ; Defined below.
;;;###autoload
@@ -761,7 +761,8 @@ consing a string.)"
record-pos-symbol
first-real-pos last-real-pos
phrase-beg phrase-end
- cbeg cend ; dynamically set from -voodoo
+ ;; Dynamically set in mail-extr-voodoo.
+ mailextr-cbeg mailextr-cend
quote-beg quote-end
atom-beg atom-end
mbox-beg mbox-end
@@ -795,19 +796,19 @@ consing a string.)"
((eq char ?\()
(set-syntax-table mail-extr-address-comment-syntax-table)
;; only record the first non-empty comment's position
- (if (and (not cbeg)
+ (if (and (not mailextr-cbeg)
(save-excursion
(forward-char 1)
(mail-extr-skip-whitespace-forward)
(not (eq ?\) (char-after (point))))))
- (setq cbeg (point)))
+ (setq mailextr-cbeg (point)))
;; TODO: don't record if unbalanced
(or (mail-extr-safe-move-sexp 1)
(forward-char 1))
(set-syntax-table mail-extr-address-syntax-table)
- (if (and cbeg
- (not cend))
- (setq cend (point))))
+ (if (and mailextr-cbeg
+ (not mailextr-cend))
+ (setq mailextr-cend (point))))
;; quoted text
((eq char ?\")
;; only record the first non-empty quote's position
@@ -993,10 +994,10 @@ consing a string.)"
(> last-real-pos (1+ group-\;-pos))
(setq last-real-pos (1+ group-\;-pos)))
;; *** This may be wrong:
- (and cend
- (> cend group-\;-pos)
- (setq cend nil
- cbeg nil))
+ (and mailextr-cend
+ (> mailextr-cend group-\;-pos)
+ (setq mailextr-cend nil
+ mailextr-cbeg nil))
(and quote-end
(> quote-end group-\;-pos)
(setq quote-end nil
@@ -1227,8 +1228,8 @@ consing a string.)"
(narrow-to-region phrase-beg phrase-end))
;; Example: fml@foo.bar.dom (First M. Last)
- (cbeg
- (narrow-to-region (1+ cbeg) (1- cend))
+ (mailextr-cbeg
+ (narrow-to-region (1+ mailextr-cbeg) (1- mailextr-cend))
(mail-extr-undo-backslash-quoting (point-min) (point-max))
;; Deal with spacing problems
@@ -1471,7 +1472,6 @@ place. It affects how `mail-extract-address-components' works."
(case-fold-search nil)
mixed-case-flag lower-case-flag ;;upper-case-flag
suffix-flag last-name-comma-flag
- ;;cbeg cend
initial
begin-again-flag
drop-this-word-if-trailing-flag
@@ -1617,7 +1617,7 @@ place. It affects how `mail-extract-address-components' works."
;; Delete parenthesized/quoted comment/nickname
((memq (following-char) '(?\( ?\{ ?\[ ?\" ?\' ?\`))
- (setq cbeg (point))
+ (setq mailextr-cbeg (point))
(set-syntax-table mail-extr-address-text-comment-syntax-table)
(cond ((memq (following-char) '(?\' ?\`))
(or (search-forward "'" nil t
@@ -1627,23 +1627,23 @@ place. It affects how `mail-extract-address-components' works."
(or (mail-extr-safe-move-sexp 1)
(goto-char (point-max)))))
(set-syntax-table mail-extr-address-text-syntax-table)
- (setq cend (point))
+ (setq mailextr-cend (point))
(cond
;; Handle case of entire name being quoted
((and (eq word-count 0)
(looking-at " *\\'")
- (>= (- cend cbeg) 2))
- (narrow-to-region (1+ cbeg) (1- cend))
+ (>= (- mailextr-cend mailextr-cbeg) 2))
+ (narrow-to-region (1+ mailextr-cbeg) (1- mailextr-cend))
(goto-char (point-min)))
(t
;; Handle case of quoted initial
- (if (and (or (= 3 (- cend cbeg))
- (and (= 4 (- cend cbeg))
- (eq ?. (char-after (+ 2 cbeg)))))
+ (if (and (or (= 3 (- mailextr-cend mailextr-cbeg))
+ (and (= 4 (- mailextr-cend mailextr-cbeg))
+ (eq ?. (char-after (+ 2 mailextr-cbeg)))))
(not (looking-at " *\\'")))
- (setq initial (char-after (1+ cbeg)))
+ (setq initial (char-after (1+ mailextr-cbeg)))
(setq initial nil))
- (delete-region cbeg cend)
+ (delete-region mailextr-cbeg mailextr-cend)
(if initial
(insert initial ". ")))))
@@ -2173,5 +2173,4 @@ place. It affects how `mail-extract-address-components' works."
(provide 'mail-extr)
-;; arch-tag: 7785fade-1073-4ed6-b4f6-28db34a7982d
;;; mail-extr.el ends here
diff --git a/lisp/mail/mail-hist.el b/lisp/mail/mail-hist.el
index fc7e041d179..d824c282805 100644
--- a/lisp/mail/mail-hist.el
+++ b/lisp/mail/mail-hist.el
@@ -1,11 +1,11 @@
;;; mail-hist.el --- headers and message body history for outgoing mail
-;; Copyright (C) 1994, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1994, 2001-2011 Free Software Foundation, Inc.
;; Author: Karl Fogel <kfogel@red-bean.com>
;; Created: March, 1994
;; Keywords: mail, history
+;; Package: mail-utils
;; This file is part of GNU Emacs.
@@ -292,5 +292,4 @@ received mail."
(provide 'mail-hist)
-;; arch-tag: 9ff9a07c-9dca-482d-ba87-54f42778559d
;;; mail-hist.el ends here
diff --git a/lisp/mail/mail-utils.el b/lisp/mail/mail-utils.el
index bbc94256fb7..cb9ee7e0317 100644
--- a/lisp/mail/mail-utils.el
+++ b/lisp/mail/mail-utils.el
@@ -1,7 +1,6 @@
;;; mail-utils.el --- utility functions used both by rmail and rnews
-;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail, news
@@ -28,10 +27,6 @@
;;; Code:
-;;; We require lisp-mode to make sure that lisp-mode-syntax-table has
-;;; been initialized.
-(require 'lisp-mode)
-
;;;###autoload
(defcustom mail-use-rfc822 nil
"If non-nil, use a full, hairy RFC822 parser on mail addresses.
@@ -186,56 +181,37 @@ Return a modified address list."
(mapconcat 'identity (rfc822-addresses address) ", "))
(let (pos)
- ;; Detect nested comments.
- (if (string-match "[ \t]*(\\([^)\\]\\|\\\\.\\|\\\\\n\\)*(" address)
- ;; Strip nested comments.
- (with-temp-buffer
- (insert address)
- (set-syntax-table lisp-mode-syntax-table)
- (goto-char 1)
- (while (search-forward "(" nil t)
- (forward-char -1)
- (skip-chars-backward " \t")
- (delete-region (point)
- (save-excursion
- (condition-case ()
- (forward-sexp 1)
- (error (goto-char (point-max))))
- (point))))
- (setq address (buffer-string)))
- ;; Strip non-nested comments an easier way.
- (while (setq pos (string-match
- ;; This doesn't hack rfc822 nested comments
- ;; `(xyzzy (foo) whinge)' properly. Big deal.
- "[ \t]*(\\([^)\\]\\|\\\\.\\|\\\\\n\\)*)"
- address))
- (setq address (replace-match "" nil nil address 0))))
+ ;; Strip comments.
+ (while (setq pos (string-match
+ "[ \t]*(\\([^()\\]\\|\\\\.\\|\\\\\n\\)*)"
+ address))
+ (setq address (replace-match "" nil nil address 0)))
- ;; strip surrounding whitespace
- (string-match "\\`[ \t\n]*" address)
- (setq address (substring address
- (match-end 0)
- (string-match "[ \t\n]*\\'" address
- (match-end 0))))
+ ;; strip surrounding whitespace
+ (string-match "\\`[ \t\n]*" address)
+ (setq address (substring address
+ (match-end 0)
+ (string-match "[ \t\n]*\\'" address
+ (match-end 0))))
- ;; strip `quoted' names (This is supposed to hack `"Foo Bar" <bar@host>')
- (setq pos 0)
- (while (setq pos (string-match
+ ;; strip `quoted' names (This is supposed to hack `"Foo Bar" <bar@host>')
+ (setq pos 0)
+ (while (setq pos (string-match
"\\([ \t]?\\)\\([ \t]*\"\\([^\"\\]\\|\\\\.\\|\\\\\n\\)*\"[ \t\n]*\\)"
address pos))
- ;; If the next thing is "@", we have "foo bar"@host. Leave it.
- (if (and (> (length address) (match-end 0))
- (= (aref address (match-end 0)) ?@))
- (setq pos (match-end 0))
- ;; Otherwise discard the "..." part.
- (setq address (replace-match "" nil nil address 2))))
- ;; If this address contains <...>, replace it with just
- ;; the part between the <...>.
- (while (setq pos (string-match "\\(,\\s-*\\|\\`\\)\\([^,]*<\\([^>,:]*\\)>[^,]*\\)\\(\\s-*,\\|\\'\\)"
- address))
- (setq address (replace-match (match-string 3 address)
- nil 'literal address 2)))
- address))))
+ ;; If the next thing is "@", we have "foo bar"@host. Leave it.
+ (if (and (> (length address) (match-end 0))
+ (= (aref address (match-end 0)) ?@))
+ (setq pos (match-end 0))
+ ;; Otherwise discard the "..." part.
+ (setq address (replace-match "" nil nil address 2))))
+ ;; If this address contains <...>, replace it with just
+ ;; the part between the <...>.
+ (while (setq pos (string-match "\\(,\\s-*\\|\\`\\)\\([^,]*<\\([^>,:]*\\)>[^,]*\\)\\(\\s-*,\\|\\'\\)"
+ address))
+ (setq address (replace-match (match-string 3 address)
+ nil 'literal address 2)))
+ address))))
;; The following piece of ugliness is legacy code. The name was an
;; unfortunate choice --- a flagrant violation of the Emacs Lisp
diff --git a/lisp/mail/mailabbrev.el b/lisp/mail/mailabbrev.el
index 0ec8f6dee2c..b4827cf10ba 100644
--- a/lisp/mail/mailabbrev.el
+++ b/lisp/mail/mailabbrev.el
@@ -1,7 +1,6 @@
;;; mailabbrev.el --- abbrev-expansion of mail aliases
-;; Copyright (C) 1985, 1986, 1987, 1992, 1993, 1996, 1997, 2000, 2001,
-;; 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Copyright (C) 1985-1987, 1992-1993, 1996-1997, 2000-2011
;; Free Software Foundation, Inc.
;; Author: Jamie Zawinski <jwz@lucid.com; now jwz@jwz.org>
@@ -609,5 +608,4 @@ In other respects, this behaves like `end-of-buffer', which see."
(provide 'mailabbrev)
-;; arch-tag: 5aa2d901-73f8-4ad7-b73c-4802282ad2ff
;;; mailabbrev.el ends here
diff --git a/lisp/mail/mailalias.el b/lisp/mail/mailalias.el
index 56d5c5cd4ba..fb6ee674b35 100644
--- a/lisp/mail/mailalias.el
+++ b/lisp/mail/mailalias.el
@@ -1,7 +1,7 @@
;;; mailalias.el --- expand and complete mailing address aliases
-;; Copyright (C) 1985, 1987, 1995, 1996, 1997, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1995-1997, 2001-2011
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
@@ -240,6 +240,11 @@ removed from alias expansions."
(defun build-mail-aliases (&optional file)
"Read mail aliases from personal aliases file and set `mail-aliases'.
By default, this is the file specified by `mail-personal-alias-file'."
+ (interactive
+ (list
+ (read-file-name (format "Read mail alias file (default %s): "
+ mail-personal-alias-file)
+ nil mail-personal-alias-file t)))
(setq file (expand-file-name (or file mail-personal-alias-file)))
;; In case mail-aliases is t, make sure define-mail-alias
;; does not recursively call build-mail-aliases.
@@ -562,5 +567,4 @@ See `mail-directory-stream'."
(provide 'mailalias)
-;; arch-tag: 1d6a0f87-eb34-4d45-8816-60c1b952cf46
;;; mailalias.el ends here
diff --git a/lisp/mail/mailclient.el b/lisp/mail/mailclient.el
index 1b3eef50015..ab9f3662745 100644
--- a/lisp/mail/mailclient.el
+++ b/lisp/mail/mailclient.el
@@ -1,6 +1,6 @@
;;; mailclient.el --- mail sending via system's mail client. -*- byte-compile-dynamic: t -*-
-;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation
+;; Copyright (C) 2005-2011 Free Software Foundation
;; Author: David Reitter <david.reitter@gmail.com>
;; Keywords: mail
@@ -46,6 +46,7 @@
(require 'sendmail) ;; for mail-sendmail-undelimit-header
(require 'mail-utils) ;; for mail-fetch-field
+(require 'browse-url)
(defcustom mailclient-place-body-on-clipboard-flag
(fboundp 'w32-set-clipboard-data)
@@ -122,7 +123,10 @@ The mail client is taken to be the handler of mailto URLs."
(while (and (re-search-forward "\n\n\n*" delimline t)
(< (point) delimline))
(replace-match "\n"))
- (let ((case-fold-search t))
+ (let ((case-fold-search t)
+ ;; Use the external browser function to send the
+ ;; message.
+ (browse-url-mailto-function nil))
;; initialize limiter
(setq mailclient-delim-static "?")
;; construct and call up mailto URL
@@ -170,5 +174,4 @@ The mail client is taken to be the handler of mailto URLs."
(provide 'mailclient)
-;; arch-tag: 35d10fc8-a1bc-4f29-a4e6-c288e53578ef
;;; mailclient.el ends here
diff --git a/lisp/mail/mailheader.el b/lisp/mail/mailheader.el
index e7b7a34fe6e..896400068cc 100644
--- a/lisp/mail/mailheader.el
+++ b/lisp/mail/mailheader.el
@@ -1,10 +1,10 @@
;;; mailheader.el --- mail header parsing, merging, formatting
-;; Copyright (C) 1996, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 2001-2011 Free Software Foundation, Inc.
;; Author: Erik Naggum <erik@naggum.no>
;; Keywords: tools, mail, news
+;; Package: mail-utils
;; This file is part of GNU Emacs.
@@ -48,9 +48,6 @@
(eval-when-compile
(require 'cl))
-;; Make the byte-compiler shut up.
-(defvar headers)
-
(defun mail-header-extract ()
"Extract headers from current buffer after point.
Returns a header alist, where each element is a cons cell (name . value),
@@ -104,6 +101,9 @@ value."
(cons (cdr header) (funcall (cdr rule) (cdr header))))))))
headers)
+;; Advertized part of the interface; see mail-header, mail-header-set.
+(defvar headers)
+
(defsubst mail-header (header &optional header-alist)
"Return the value associated with header HEADER in HEADER-ALIST.
If the value is a string, it is the original value of the header. If the
@@ -190,5 +190,4 @@ A key of nil has as its value a list of defaulted headers to ignore."
(provide 'mailheader)
-;; arch-tag: 6e7aa221-80b5-4b3d-b46f-fd66ab567be0
;;; mailheader.el ends here
diff --git a/lisp/mail/mailpost.el b/lisp/mail/mailpost.el
index 0790375388d..7c4bea830d8 100644
--- a/lisp/mail/mailpost.el
+++ b/lisp/mail/mailpost.el
@@ -102,5 +102,4 @@ site-init."
(provide 'mailpost)
-;; arch-tag: 1f8ca085-60a6-4eac-8efb-69ffec2fa124
;;; mailpost.el ends here
diff --git a/lisp/mail/metamail.el b/lisp/mail/metamail.el
index dbc3743e478..9269a24c4cb 100644
--- a/lisp/mail/metamail.el
+++ b/lisp/mail/metamail.el
@@ -1,7 +1,6 @@
;;; metamail.el --- Metamail interface for GNU Emacs
-;; Copyright (C) 1993, 1996, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1996, 2001-2011 Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp>
;; Keywords: mail, news, mime, multimedia
@@ -40,7 +39,6 @@
(defgroup metamail nil
"Metamail interface for Emacs."
:group 'mail
- :group 'hypermedia
:group 'processes)
(defcustom metamail-program-name "metamail"
@@ -201,5 +199,4 @@ redisplayed as output is inserted."
(provide 'metamail)
-;; arch-tag: 52c0cb6f-d800-4776-9789-f0275cb5490e
;;; metamail.el ends here
diff --git a/lisp/mail/mspools.el b/lisp/mail/mspools.el
index dc81a7f3cc3..862cb2a1eee 100644
--- a/lisp/mail/mspools.el
+++ b/lisp/mail/mspools.el
@@ -1,7 +1,6 @@
;;; mspools.el --- show mail spools waiting to be read
-;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1997, 2001-2011 Free Software Foundation, Inc.
;; Author: Stephen Eglen <stephen@gnu.org>
;; Maintainer: Stephen Eglen <stephen@gnu.org>
@@ -172,7 +171,17 @@ your primary spool is. If this fails, set it to something like
(defvar mspools-buffer "*spools*"
"Name of buffer for displaying spool info.")
-(defvar mspools-mode-map nil
+(defvar mspools-mode-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-c\C-c" 'mspools-visit-spool)
+ (define-key map "\C-m" 'mspools-visit-spool)
+ (define-key map " " 'mspools-visit-spool)
+ (define-key map "?" 'mspools-help)
+ (define-key map "q" 'mspools-quit)
+ (define-key map "n" 'next-line)
+ (define-key map "p" 'previous-line)
+ (define-key map "g" 'revert-buffer)
+ map)
"Keymap for the *spools* buffer.")
;;; Code
@@ -270,10 +279,7 @@ Buffer is not displayed if SHOW is non-nil."
))
(message "folder %s spool %s" folder-name spool-name)
- (if (eq (count-lines (point-min)
- (save-excursion
- (end-of-line)
- (point)))
+ (if (eq (count-lines (point-min) (point-at-eol))
mspools-files-len)
(forward-line (- 1 mspools-files-len)) ;back to top of list
;; else just on to next line
@@ -313,28 +319,9 @@ Buffer is not displayed if SHOW is non-nil."
(defun mspools-get-spool-name ()
"Return the name of the spool on the current line."
- (let ((line-num (1- (count-lines (point-min)
- (save-excursion
- (end-of-line)
- (point))
- ))))
+ (let ((line-num (1- (count-lines (point-min) (point-at-eol)))))
(car (nth line-num mspools-files))))
-;;; Keymap
-
-(if mspools-mode-map
- ()
- (setq mspools-mode-map (make-sparse-keymap))
-
- (define-key mspools-mode-map "\C-c\C-c" 'mspools-visit-spool)
- (define-key mspools-mode-map "\C-m" 'mspools-visit-spool)
- (define-key mspools-mode-map " " 'mspools-visit-spool)
- (define-key mspools-mode-map "?" 'mspools-help)
- (define-key mspools-mode-map "q" 'mspools-quit)
- (define-key mspools-mode-map "n" 'next-line)
- (define-key mspools-mode-map "p" 'previous-line)
- (define-key mspools-mode-map "g" 'revert-buffer))
-
;;; Spools mode functions
(defun mspools-revert-buffer (ignore noconfirm)
@@ -416,5 +403,4 @@ nil."
(provide 'mspools)
-;; arch-tag: 8990b3ee-68c8-4892-98f1-51a735c8bac6
;;; mspools.el ends here
diff --git a/lisp/mail/reporter.el b/lisp/mail/reporter.el
index ba5c8e337c5..45700d4d60d 100644
--- a/lisp/mail/reporter.el
+++ b/lisp/mail/reporter.el
@@ -1,7 +1,6 @@
;;; reporter.el --- customizable bug reporting of lisp programs
-;; Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1998, 2001-2011 Free Software Foundation, Inc.
;; Author: 1993-1998 Barry A. Warsaw
;; Maintainer: FSF
@@ -407,5 +406,4 @@ mail-sending package is used for editing and sending the message."
(provide 'reporter)
-;; arch-tag: 33612ff4-fbbc-4be2-b183-560ce9e0199b
;;; reporter.el ends here
diff --git a/lisp/mail/rfc2368.el b/lisp/mail/rfc2368.el
index 151e6f68037..d3f824fe50f 100644
--- a/lisp/mail/rfc2368.el
+++ b/lisp/mail/rfc2368.el
@@ -1,7 +1,6 @@
;;; rfc2368.el --- support for rfc2368
-;; Copyright (C) 1998, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1998, 2000-2011 Free Software Foundation, Inc.
;; Author: Sen Nagata <sen@eccosys.com>
;; Keywords: mail
@@ -92,13 +91,11 @@ Note: make sure MAILTO-URL has been 'unhtmlized' (e.g. &amp; -> &), before
calling this function."
(let ((case-fold-search t)
prequery query headers-alist)
-
+ (setq mailto-url (replace-regexp-in-string "\n" " " mailto-url))
(if (string-match rfc2368-mailto-regexp mailto-url)
(progn
-
(setq prequery
(match-string rfc2368-mailto-prequery-index mailto-url))
-
(setq query
(match-string rfc2368-mailto-query-index mailto-url))
@@ -131,10 +128,8 @@ calling this function."
headers-alist)
- (error "Failed to match a mailto: url"))
- ))
+ (error "Failed to match a mailto: url"))))
(provide 'rfc2368)
-;; arch-tag: ea804934-ad96-4f69-957b-857a76e4fd95
;;; rfc2368.el ends here
diff --git a/lisp/mail/rfc822.el b/lisp/mail/rfc822.el
index ddaf7625981..9e4e60e6806 100644
--- a/lisp/mail/rfc822.el
+++ b/lisp/mail/rfc822.el
@@ -1,7 +1,6 @@
;;; rfc822.el --- hairy rfc822 parser for mail and news and suchlike
-;; Copyright (C) 1986, 1987, 1990, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1986-1987, 1990, 2001-2011 Free Software Foundation, Inc.
;; Author: Richard Mlynarik <mly@eddie.mit.edu>
;; Maintainer: FSF
@@ -324,5 +323,4 @@
(provide 'rfc822)
-;; arch-tag: 5d388a24-e173-40fb-9b8e-85269de44b37
;;; rfc822.el ends here
diff --git a/lisp/mail/rmail-spam-filter.el b/lisp/mail/rmail-spam-filter.el
index a81cc3cbf14..70226b26965 100644
--- a/lisp/mail/rmail-spam-filter.el
+++ b/lisp/mail/rmail-spam-filter.el
@@ -1,9 +1,9 @@
;;; rmail-spam-filter.el --- spam filter for Rmail, the Emacs mail reader
-;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
-;; Free Software Foundation, Inc.
+;; Copyright (C) 2002-2011 Free Software Foundation, Inc.
;; Keywords: email, spam, filter, rmail
;; Author: Eli Tziperman <eli AT deas.harvard.edu>
+;; Package: rmail
;; This file is part of GNU Emacs.
@@ -554,5 +554,4 @@ checks to see if the old format is used, and updates it if necessary."
(provide 'rmail-spam-filter)
-;; arch-tag: 03e1d45d-b72f-4dd7-8f04-e7fd78249746
;;; rmail-spam-fitler ends here
diff --git a/lisp/mail/rmail.el b/lisp/mail/rmail.el
index 370999dabf8..7e1cbe4ea8d 100644
--- a/lisp/mail/rmail.el
+++ b/lisp/mail/rmail.el
@@ -1,7 +1,6 @@
;;; rmail.el --- main code of "RMAIL" mail reader for Emacs
-;; Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
-;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Copyright (C) 1985-1988, 1993-1998, 2000-2011
;; Free Software Foundation, Inc.
;; Maintainer: FSF
@@ -3441,30 +3440,62 @@ does not pop any summary buffer."
;;;; *** Rmail Mailing Commands ***
(defun rmail-start-mail (&optional noerase to subject in-reply-to cc
- replybuffer sendactions same-window others)
- (let (yank-action)
+ replybuffer sendactions same-window
+ other-headers)
+ (let ((switch-function
+ (cond (same-window nil)
+ (rmail-mail-new-frame 'switch-to-buffer-other-frame)
+ (t 'switch-to-buffer-other-window)))
+ yank-action)
(if replybuffer
;; The function used here must behave like insert-buffer wrt
;; point and mark (see doc of sc-cite-original).
(setq yank-action (list 'insert-buffer replybuffer)))
- (setq others (cons (cons "cc" cc) others))
- (setq others (cons (cons "in-reply-to" in-reply-to) others))
- (if same-window
- (compose-mail to subject others
- noerase nil
- yank-action sendactions)
- (if rmail-mail-new-frame
- (prog1
- (compose-mail to subject others
- noerase 'switch-to-buffer-other-frame
- yank-action sendactions)
- ;; This is not a standard frame parameter;
- ;; nothing except sendmail.el looks at it.
- (modify-frame-parameters (selected-frame)
- '((mail-dedicated-frame . t))))
- (compose-mail to subject others
- noerase 'switch-to-buffer-other-window
- yank-action sendactions)))))
+ (push (cons "cc" cc) other-headers)
+ (push (cons "in-reply-to" in-reply-to) other-headers)
+ (prog1
+ (compose-mail to subject other-headers noerase
+ switch-function yank-action sendactions
+ '(rmail-mail-return))
+ (if (eq switch-function 'switch-to-buffer-other-frame)
+ ;; This is not a standard frame parameter; nothing except
+ ;; sendmail.el looks at it.
+ (modify-frame-parameters (selected-frame)
+ '((mail-dedicated-frame . t)))))))
+
+(defun rmail-mail-return ()
+ (cond
+ ;; If there is only one visible frame with no special handling,
+ ;; consider deleting the mail window to return to Rmail.
+ ((or (null (delq (selected-frame) (visible-frame-list)))
+ (not (or (window-dedicated-p (frame-selected-window))
+ (and pop-up-frames (one-window-p))
+ (cdr (assq 'mail-dedicated-frame
+ (frame-parameters))))))
+ (let (rmail-flag summary-buffer)
+ (and (not (one-window-p))
+ (with-current-buffer
+ (window-buffer (next-window (selected-window) 'not))
+ (setq rmail-flag (eq major-mode 'rmail-mode))
+ (setq summary-buffer
+ (and (boundp 'mail-bury-selects-summary)
+ mail-bury-selects-summary
+ (boundp 'rmail-summary-buffer)
+ rmail-summary-buffer
+ (buffer-name rmail-summary-buffer)
+ (not (get-buffer-window rmail-summary-buffer))
+ rmail-summary-buffer))))
+ (if rmail-flag
+ ;; If the Rmail buffer has a summary, show that.
+ (if summary-buffer (switch-to-buffer summary-buffer)
+ (delete-window)))))
+ ;; If the frame was probably made for this buffer, the user
+ ;; probably wants to delete it now.
+ ((display-multi-frame-p)
+ (delete-frame (selected-frame)))
+ ;; The previous frame is where normally they have the Rmail buffer
+ ;; displayed.
+ (t (other-frame -1))))
(defun rmail-mail ()
"Send mail in another window.
@@ -3831,9 +3862,7 @@ The message should be narrowed to just the headers."
(1- (point))
(point-max)))))))
-(declare-function mail-sendmail-delimit-header "sendmail" ())
-(declare-function mail-header-end "sendmail" ())
-(declare-function mail-position-on-field "sendmail" (field &optional soft))
+(autoload 'mail-position-on-field "sendmail")
(defun rmail-retry-failure ()
"Edit a mail message which is based on the contents of the current message.
@@ -3919,18 +3948,19 @@ specifying headers which should not be copied into the new message."
;; Insert original text as initial text of new draft message.
;; Bind inhibit-read-only since the header delimiter
;; of the previous message was probably read-only.
- (let ((inhibit-read-only t))
+ (let ((inhibit-read-only t)
+ eoh)
(erase-buffer)
(insert-buffer-substring rmail-this-buffer
bounce-start bounce-end)
(goto-char (point-min))
(if bounce-indent
(indent-rigidly (point-min) (point-max) bounce-indent))
- ;; FIXME better to replace sendmail functions.
- (require 'sendmail)
- (mail-sendmail-delimit-header)
+ (rfc822-goto-eoh)
+ (setq eoh (point))
+ (insert mail-header-separator)
(save-restriction
- (narrow-to-region (point-min) (mail-header-end))
+ (narrow-to-region (point-min) eoh)
(rmail-delete-headers rmail-retry-ignored-headers)
(rmail-delete-headers "^\\(sender\\|return-path\\|received\\):")
(setq resending (mail-fetch-field "resent-to"))
@@ -4232,7 +4262,7 @@ encoded string (and the same mask) will decode the string."
;;; Start of automatically extracted autoloads.
;;;### (autoloads (rmail-edit-current-message) "rmailedit" "rmailedit.el"
-;;;;;; "ecd28d8d92983488673388eced6fbf50")
+;;;;;; "090ad9432c3bf9a6098bb9c3d7c71baf")
;;; Generated autoloads from rmailedit.el
(autoload 'rmail-edit-current-message "rmailedit" "\
@@ -4244,7 +4274,7 @@ Edit the contents of this message.
;;;### (autoloads (rmail-next-labeled-message rmail-previous-labeled-message
;;;;;; rmail-read-label rmail-kill-label rmail-add-label) "rmailkwd"
-;;;;;; "rmailkwd.el" "bc72ffe3652be6f4c72048ae8f226fce")
+;;;;;; "rmailkwd.el" "08c288c88cfe7be50830122c064e3884")
;;; Generated autoloads from rmailkwd.el
(autoload 'rmail-add-label "rmailkwd" "\
@@ -4287,7 +4317,7 @@ With prefix argument N moves forward N messages with these labels.
;;;***
-;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "7f6ad821b4543a18139fee9250beea5c")
+;;;### (autoloads (rmail-mime) "rmailmm" "rmailmm.el" "3e235bdf4c2e54da06abcdd72e7f7649")
;;; Generated autoloads from rmailmm.el
(autoload 'rmail-mime "rmailmm" "\
@@ -4313,7 +4343,7 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'.
;;;***
;;;### (autoloads (set-rmail-inbox-list) "rmailmsc" "rmailmsc.el"
-;;;;;; "9319e5b606ad5786c0c5994a307a38e8")
+;;;;;; "ca19b2f8a3e8aa01aa75ca7413f8a5ef")
;;; Generated autoloads from rmailmsc.el
(autoload 'set-rmail-inbox-list "rmailmsc" "\
@@ -4329,7 +4359,7 @@ This applies only to the current session.
;;;### (autoloads (rmail-sort-by-labels rmail-sort-by-lines rmail-sort-by-correspondent
;;;;;; rmail-sort-by-recipient rmail-sort-by-author rmail-sort-by-subject
-;;;;;; rmail-sort-by-date) "rmailsort" "rmailsort.el" "16144a77fdc880034875fd624e4d73e6")
+;;;;;; rmail-sort-by-date) "rmailsort" "rmailsort.el" "f297fd33c8f7fa74baf16d2da99acb35")
;;; Generated autoloads from rmailsort.el
(autoload 'rmail-sort-by-date "rmailsort" "\
@@ -4388,7 +4418,7 @@ If prefix argument REVERSE is non-nil, sorts in reverse order.
;;;### (autoloads (rmail-summary-by-senders rmail-summary-by-topic
;;;;;; rmail-summary-by-regexp rmail-summary-by-recipients rmail-summary-by-labels
-;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "6bcfd5937a56902944a929b89b33adaa")
+;;;;;; rmail-summary) "rmailsum" "rmailsum.el" "76a7ae570a4fa96a9233d0276f52f515")
;;; Generated autoloads from rmailsum.el
(autoload 'rmail-summary "rmailsum" "\
@@ -4436,7 +4466,7 @@ SENDERS is a string of regexps separated by commas.
;;;***
;;;### (autoloads (unforward-rmail-message undigestify-rmail-message)
-;;;;;; "undigest" "undigest.el" "2869c38a0051d0acab1a5968627fa57d")
+;;;;;; "undigest" "undigest.el" "41e6a48ea63224385c447a944528feb6")
;;; Generated autoloads from undigest.el
(autoload 'undigestify-rmail-message "undigest" "\
@@ -4459,5 +4489,4 @@ following the containing message.
(provide 'rmail)
-;; arch-tag: 65d257d3-c281-4a65-9c38-e61af95af2f0
;;; rmail.el ends here
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index 59c4e9a6804..868ca15923f 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -1,10 +1,10 @@
;;; rmailedit.el --- "RMAIL edit mode" Edit the current message
-;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1994, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
+;; Package: rmail
;; This file is part of GNU Emacs.
@@ -398,5 +398,4 @@ HEADER-DIFF should be a return value from `rmail-edit-diff-headers'."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 9524f335-12cc-4e95-9e9b-3208dc30550b
;;; rmailedit.el ends here
diff --git a/lisp/mail/rmailkwd.el b/lisp/mail/rmailkwd.el
index 2b5e856bdff..73542578bf6 100644
--- a/lisp/mail/rmailkwd.el
+++ b/lisp/mail/rmailkwd.el
@@ -1,10 +1,10 @@
;;; rmailkwd.el --- part of the "RMAIL" mail reader for Emacs
-;; Copyright (C) 1985, 1988, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
-;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1988, 1994, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
+;; Package: rmail
;; This file is part of GNU Emacs.
@@ -193,5 +193,4 @@ With prefix argument N moves forward N messages with these labels."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 1149979c-8e47-4333-9629-cf3dc887a6a7
;;; rmailkwd.el ends here
diff --git a/lisp/mail/rmailmm.el b/lisp/mail/rmailmm.el
index d6af925d461..127fd8ac350 100644
--- a/lisp/mail/rmailmm.el
+++ b/lisp/mail/rmailmm.el
@@ -1,11 +1,12 @@
;;; rmailmm.el --- MIME decoding and display stuff for RMAIL
-;; Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 2006-2011 Free Software Foundation, Inc.
;; Author: Alexander Pohoyda
;; Alex Schroeder
;; Maintainer: FSF
;; Keywords: mail
+;; Package: rmail
;; This file is part of GNU Emacs.
@@ -52,7 +53,7 @@
;;
;; rmail-mime
;; +- rmail-mime-show <----------------------------------+
-;; +- rmail-mime-process |
+;; +- rmail-mime-process |
;; +- rmail-mime-handle |
;; +- rmail-mime-text-handler |
;; +- rmail-mime-bulk-handler |
@@ -159,7 +160,7 @@ A MIME-entity is a vector of 9 elements:
[TYPE DISPOSITION TRANSFER-ENCODING DISPLAY HEADER TAGLINE BODY
CHILDREN HANDLER]
-
+
TYPE and DISPOSITION correspond to MIME headers Content-Type and
Cotent-Disposition respectively, and has this format:
@@ -326,7 +327,7 @@ The value is a vector [ INDEX HEADER TAGLINE BODY END], where
(aset new 2 (aref (rmail-mime-entity-body entity) 2)))
(dolist (child (rmail-mime-entity-children entity))
(rmail-mime-shown-mode child)))
-
+
(defun rmail-mime-hidden-mode (entity)
"Make MIME-entity ENTITY displayed in the hidden mode."
(let ((new (aref (rmail-mime-entity-display entity) 1)))
@@ -423,7 +424,7 @@ to the tag line."
(insert item)
(apply 'insert-button item))))
(insert "]\n"))
-
+
(defun rmail-mime-update-tagline (entity)
"Update the current tag line for MIME-entity ENTITY."
(let ((inhibit-read-only t)
@@ -1140,7 +1141,7 @@ modified."
;; Hide headers and handle the part.
(put-text-property (point-min) (point-max) 'rmail-mime-entity
- (rmail-mime-entity
+ (rmail-mime-entity
content-type content-disposition
content-transfer-encoding
(vector (vector 'raw nil 'raw) (vector 'raw nil 'raw))
@@ -1353,7 +1354,7 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'."
(re-search-forward "^$" nil 'move) (point)))
(body-end (point-max))
(entity (rmail-mime-parse)))
- (or
+ (or
;; At first, just search the headers.
(with-temp-buffer
(insert-buffer-substring rmail-mime-mbox-buffer nil header-end)
@@ -1364,7 +1365,7 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'."
(if (and entity
(let* ((content-type (rmail-mime-entity-type entity))
(charset (cdr (assq 'charset (cdr content-type)))))
- (or (not (string-match "text/.*" (car content-type)))
+ (or (not (string-match "text/.*" (car content-type)))
(and charset
(not (string= (downcase charset) "us-ascii"))))))
;; Search the decoded MIME message.
@@ -1384,5 +1385,4 @@ attachments as specfied by `rmail-mime-attachment-dirs-alist'."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 3f2c5e5d-1aef-4512-bc20-fd737c9d5dd9
;;; rmailmm.el ends here
diff --git a/lisp/mail/rmailmsc.el b/lisp/mail/rmailmsc.el
index de6c9018024..4519ab1505f 100644
--- a/lisp/mail/rmailmsc.el
+++ b/lisp/mail/rmailmsc.el
@@ -1,10 +1,10 @@
;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader
-;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
+;; Package: rmail
;; This file is part of GNU Emacs.
@@ -58,5 +58,4 @@ This applies only to the current session."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 94614a62-2a0a-4e25-bac9-06f461ed4c60
;;; rmailmsc.el ends here
diff --git a/lisp/mail/rmailout.el b/lisp/mail/rmailout.el
index 1688fb73897..3926b426a67 100644
--- a/lisp/mail/rmailout.el
+++ b/lisp/mail/rmailout.el
@@ -1,10 +1,11 @@
;;; rmailout.el --- "RMAIL" mail reader for Emacs: output message to a file
-;; Copyright (C) 1985, 1987, 1993, 1994, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1987, 1993-1994, 2001-2011
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
+;; Package: rmail
;; This file is part of GNU Emacs.
@@ -602,5 +603,4 @@ than appending to it. Deletes the message after writing if
(if rmail-delete-after-output
(rmail-delete-forward)))
-;; arch-tag: 4059abf0-f249-4be4-8e0d-602d370d01d1
;;; rmailout.el ends here
diff --git a/lisp/mail/rmailsort.el b/lisp/mail/rmailsort.el
index caa82cfd5d1..c9942f9c2f9 100644
--- a/lisp/mail/rmailsort.el
+++ b/lisp/mail/rmailsort.el
@@ -1,11 +1,11 @@
;;; rmailsort.el --- Rmail: sort messages
-;; Copyright (C) 1990, 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
-;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1990, 1993-1994, 2001-2011 Free Software Foundation, Inc.
;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp>
;; Maintainer: FSF
;; Keywords: mail
+;; Package: rmail
;; This file is part of GNU Emacs.
@@ -254,5 +254,4 @@ Numeric keys are sorted numerically, all others as strings."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 665da245-f6a7-4115-ad8c-ba19216988d5
;;; rmailsort.el ends here
diff --git a/lisp/mail/rmailsum.el b/lisp/mail/rmailsum.el
index 61dfc9e1c0b..e0f40afc0d1 100644
--- a/lisp/mail/rmailsum.el
+++ b/lisp/mail/rmailsum.el
@@ -1,10 +1,10 @@
;;; rmailsum.el --- make summary buffers for the mail reader
-;; Copyright (C) 1985, 1993, 1994, 1995, 1996, 2000, 2001, 2002, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 1993-1996, 2000-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
+;; Package: rmail
;; This file is part of GNU Emacs.
@@ -1846,5 +1846,4 @@ the summary is only showing a subset of messages."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 80b0a27a-a50d-4f37-9466-83d32d1e0ca8
;;; rmailsum.el ends here
diff --git a/lisp/mail/sendmail.el b/lisp/mail/sendmail.el
index 8cd650317b1..77ae87b5449 100644
--- a/lisp/mail/sendmail.el
+++ b/lisp/mail/sendmail.el
@@ -1,7 +1,6 @@
;;; sendmail.el --- mail sending commands for Emacs. -*- byte-compile-dynamic: t -*-
-;; Copyright (C) 1985, 1986, 1992, 1993, 1994, 1995, 1996, 1998, 2000,
-;; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011
+;; Copyright (C) 1985-1986, 1992-1996, 1998, 2000-2011
;; Free Software Foundation, Inc.
;; Maintainer: FSF
@@ -28,11 +27,7 @@
;; documented in the Emacs user's manual.
;;; Code:
-(eval-when-compile
- ;; Necessary to avoid recursive `require's.
- (provide 'sendmail)
- (require 'rmail)
- (require 'mailalias))
+(require 'mail-utils)
(autoload 'rfc2047-encode-string "rfc2047")
@@ -203,13 +198,14 @@ when you first send mail."
:type '(choice (const nil) string)
:group 'sendmail)
-;;;###autoload
(defcustom mail-alias-file nil
- "If non-nil, the name of a file to use instead of `/usr/lib/aliases'.
+ "If non-nil, the name of a file to use instead of the sendmail default.
This file defines aliases to be expanded by the mailer; this is a different
feature from that of defining aliases in `.mailrc' to be expanded in Emacs.
-This variable has no effect unless your system uses sendmail as its mailer."
- :type '(choice (const nil) file)
+This variable has no effect unless your system uses sendmail as its mailer.
+The default file is defined in sendmail's configuration file, e.g.
+`/etc/aliases'."
+ :type '(choice (const :tag "Sendmail default" nil) file)
:group 'sendmail)
;;;###autoload
@@ -285,14 +281,14 @@ regardless of what part of it (if any) is included in the cited text.")
;;;###autoload
(defcustom mail-citation-prefix-regexp
- (purecopy "\\([ \t]*\\(\\w\\|[_.]\\)+>+\\|[ \t]*[]>|}]\\)+")
+ (purecopy "\\([ \t]*\\(\\w\\|[_.]\\)+>+\\|[ \t]*[]>|]\\)+")
"Regular expression to match a citation prefix plus whitespace.
It should match whatever sort of citation prefixes you want to handle,
with whitespace before and after; it should also match just whitespace.
The default value matches citations like `foo-bar>' plus whitespace."
:type 'regexp
:group 'sendmail
- :version "20.3")
+ :version "24.1")
(defvar mail-abbrevs-loaded nil)
(defvar mail-mode-map
@@ -383,15 +379,8 @@ The default value matches citations like `foo-bar>' plus whitespace."
map))
(autoload 'build-mail-aliases "mailalias"
- "Read mail aliases from user's personal aliases file and set `mail-aliases'."
- nil)
-
-(autoload 'expand-mail-aliases "mailalias"
- "Expand all mail aliases in suitable header fields found between BEG and END.
-Suitable header fields are `To', `Cc' and `Bcc' and their `Resent-' variants.
-Optional second arg EXCLUDE may be a regular expression defining text to be
-removed from alias expansions."
- nil)
+ "Read mail aliases from personal aliases file and set `mail-aliases'.
+By default, this is the file specified by `mail-personal-alias-file'." t)
;;;###autoload
(defcustom mail-signature t
@@ -429,8 +418,7 @@ in `message-auto-save-directory'."
(defvar mail-reply-action nil)
(defvar mail-send-actions nil
"A list of actions to be performed upon successful sending of a message.")
-(put 'mail-reply-action 'permanent-local t)
-(put 'mail-send-actions 'permanent-local t)
+(defvar mail-return-action nil)
;;;###autoload
(defcustom mail-default-headers nil
@@ -440,8 +428,6 @@ before you edit the message, so you can edit or delete the lines."
:type '(choice (const nil) string)
:group 'sendmail)
-;; FIXME no need for autoload
-;;;###autoload
(defcustom mail-bury-selects-summary t
"If non-nil, try to show Rmail summary buffer after returning from mail.
The functions \\[mail-send-on-exit] or \\[mail-dont-send] select
@@ -450,8 +436,6 @@ is non-nil."
:type 'boolean
:group 'sendmail)
-;; FIXME no need for autoload
-;;;###autoload
(defcustom mail-send-nonascii 'mime
"Specify whether to allow sending non-ASCII characters in mail.
If t, that means do allow it. nil means don't allow it.
@@ -475,23 +459,16 @@ support Delivery Status Notification."
;; Note: could use /usr/ucb/mail instead of sendmail;
;; options -t, and -v if not interactive.
-(defvar mail-mailer-swallows-blank-line
- (if (and (string-match "sparc-sun-sunos\\(\\'\\|[^5]\\)" system-configuration)
- (file-readable-p "/etc/sendmail.cf")
- (with-temp-buffer
- (insert-file-contents "/etc/sendmail.cf")
- (goto-char (point-min))
- (let ((case-fold-search nil))
- (re-search-forward "^OR\\>" nil t))))
- ;; According to RFC822, "The field-name must be composed of printable
- ;; ASCII characters (i.e. characters that have decimal values between
- ;; 33 and 126, except colon)", i.e. any chars except ctl chars,
- ;; space, or colon.
- '(looking-at "[ \t]\\|[][!\"#$%&'()*+,-./0-9;<=>?@A-Z\\\\^_`a-z{|}~]+:"))
+(defvar mail-mailer-swallows-blank-line nil
"Set this non-nil if the system's mailer runs the header and body together.
-\(This problem exists on Sunos 4 when sendmail is run in remote mode.)
-The value should be an expression to test whether the problem will
-actually occur.")
+The actual value should be an expression to evaluate that returns
+non-nil if the problem will actually occur.
+\(As far as we know, this is not an issue on any system still supported
+by Emacs.)")
+
+(put 'mail-mailer-swallows-blank-line 'risky-local-variable t) ; gets evalled
+(make-obsolete-variable 'mail-mailer-swallows-blank-line
+ "no need to set this on any modern system." "24.1")
(defvar mail-mode-syntax-table
;; define-derived-mode will make it inherit from text-mode-syntax-table.
@@ -542,16 +519,54 @@ actually occur.")
(setq mail-alias-modtime modtime
mail-aliases t)))))
-(defun mail-setup (to subject in-reply-to cc replybuffer actions)
+
+;;;###autoload
+(define-mail-user-agent 'sendmail-user-agent
+ 'sendmail-user-agent-compose
+ 'mail-send-and-exit)
+
+;;;###autoload
+(defun sendmail-user-agent-compose (&optional to subject other-headers
+ continue switch-function yank-action
+ send-actions return-action
+ &rest ignored)
+ (if switch-function
+ (let ((special-display-buffer-names nil)
+ (special-display-regexps nil)
+ (same-window-buffer-names nil)
+ (same-window-regexps nil))
+ (funcall switch-function "*mail*")))
+ (let ((cc (cdr (assoc-string "cc" other-headers t)))
+ (in-reply-to (cdr (assoc-string "in-reply-to" other-headers t)))
+ (body (cdr (assoc-string "body" other-headers t))))
+ (or (mail continue to subject in-reply-to cc yank-action
+ send-actions return-action)
+ continue
+ (error "Message aborted"))
+ (save-excursion
+ (rfc822-goto-eoh)
+ (while other-headers
+ (unless (member-ignore-case (car (car other-headers))
+ '("in-reply-to" "cc" "body"))
+ (insert (car (car other-headers)) ": "
+ (cdr (car other-headers))
+ (if use-hard-newlines hard-newline "\n")))
+ (setq other-headers (cdr other-headers)))
+ (when body
+ (forward-line 1)
+ (insert body))
+ t)))
+
+(defun mail-setup (to subject in-reply-to cc replybuffer
+ actions return-action)
(or mail-default-reply-to
(setq mail-default-reply-to (getenv "REPLYTO")))
(sendmail-sync-aliases)
- (if (eq mail-aliases t)
- (progn
- (setq mail-aliases nil)
- (when mail-personal-alias-file
- (if (file-exists-p mail-personal-alias-file)
- (build-mail-aliases)))))
+ (when (eq mail-aliases t)
+ (setq mail-aliases nil)
+ (and mail-personal-alias-file
+ (file-exists-p mail-personal-alias-file)
+ (build-mail-aliases)))
;; Don't leave this around from a previous message.
(kill-local-variable 'buffer-file-coding-system)
;; This doesn't work for enable-multibyte-characters.
@@ -559,8 +574,12 @@ actually occur.")
(set-buffer-multibyte (default-value 'enable-multibyte-characters))
(if current-input-method
(inactivate-input-method))
+
+ ;; Local variables for Mail mode.
(setq mail-send-actions actions)
(setq mail-reply-action replybuffer)
+ (setq mail-return-action return-action)
+
(goto-char (point-min))
(if mail-setup-with-from
(mail-insert-from-field))
@@ -651,6 +670,7 @@ Turning on Mail mode runs the normal hooks `text-mode-hook' and
`mail-mode-hook' (in that order)."
(make-local-variable 'mail-reply-action)
(make-local-variable 'mail-send-actions)
+ (make-local-variable 'mail-return-action)
(setq buffer-offer-save t)
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults '(mail-font-lock-keywords t t))
@@ -718,7 +738,7 @@ Leave point at the start of the delimiter line."
"Carry out Auto Fill for Mail mode.
If within the headers, this makes the new lines into continuation lines."
(if (< (point) (mail-header-end))
- (let ((old-line-start (save-excursion (beginning-of-line) (point))))
+ (let ((old-line-start (line-beginning-position)))
(if (do-auto-fill)
(save-excursion
(beginning-of-line)
@@ -784,39 +804,9 @@ Prefix arg means don't delete this window."
"Bury this mail buffer."
(let ((newbuf (other-buffer (current-buffer))))
(bury-buffer (current-buffer))
- (if (and (or nil
- ;; In this case, we need to go to a different frame.
- (window-dedicated-p (frame-selected-window))
- ;; In this mode of operation, the frame was probably
- ;; made for this buffer, so the user probably wants
- ;; to delete it now.
- (and pop-up-frames (one-window-p))
- (cdr (assq 'mail-dedicated-frame (frame-parameters))))
- (not (null (delq (selected-frame) (visible-frame-list)))))
- (progn
- (if (display-multi-frame-p)
- (delete-frame (selected-frame))
- ;; The previous frame is where normally they have the
- ;; Rmail buffer displayed.
- (other-frame -1)))
- (let (rmail-flag summary-buffer)
- (and (not arg)
- (not (one-window-p))
- (with-current-buffer
- (window-buffer (next-window (selected-window) 'not))
- (setq rmail-flag (eq major-mode 'rmail-mode))
- (setq summary-buffer
- (and mail-bury-selects-summary
- (boundp 'rmail-summary-buffer)
- rmail-summary-buffer
- (buffer-name rmail-summary-buffer)
- (not (get-buffer-window rmail-summary-buffer))
- rmail-summary-buffer))))
- (if rmail-flag
- ;; If the Rmail buffer has a summary, show that.
- (if summary-buffer (switch-to-buffer summary-buffer)
- (delete-window))
- (switch-to-buffer newbuf))))))
+ (if (and (null arg) mail-return-action)
+ (apply (car mail-return-action) (cdr mail-return-action))
+ (switch-to-buffer newbuf))))
(defcustom mail-send-hook nil
"Hook run just before sending a message."
@@ -1096,23 +1086,23 @@ external program defined by `sendmail-program'."
;; Delete Resent-BCC ourselves
(if (save-excursion (beginning-of-line)
(looking-at "resent-bcc"))
- (delete-region (save-excursion (beginning-of-line) (point))
- (save-excursion (end-of-line) (1+ (point))))))
-;;; Apparently this causes a duplicate Sender.
-;;; ;; If the From is different than current user, insert Sender.
-;;; (goto-char (point-min))
-;;; (and (re-search-forward "^From:" delimline t)
-;;; (progn
-;;; (require 'mail-utils)
-;;; (not (string-equal
-;;; (mail-strip-quoted-names
-;;; (save-restriction
-;;; (narrow-to-region (point-min) delimline)
-;;; (mail-fetch-field "From")))
-;;; (user-login-name))))
-;;; (progn
-;;; (forward-line 1)
-;;; (insert "Sender: " (user-login-name) "\n")))
+ (delete-region (line-beginning-position)
+ (line-beginning-position 2))))
+ ;; Apparently this causes a duplicate Sender.
+ ;; ;; If the From is different than current user, insert Sender.
+ ;; (goto-char (point-min))
+ ;; (and (re-search-forward "^From:" delimline t)
+ ;; (progn
+ ;; (require 'mail-utils)
+ ;; (not (string-equal
+ ;; (mail-strip-quoted-names
+ ;; (save-restriction
+ ;; (narrow-to-region (point-min) delimline)
+ ;; (mail-fetch-field "From")))
+ ;; (user-login-name))))
+ ;; (progn
+ ;; (forward-line 1)
+ ;; (insert "Sender: " (user-login-name) "\n")))
;; Don't send out a blank subject line
(goto-char (point-min))
(if (re-search-forward "^Subject:\\([ \t]*\n\\)+\\b" delimline t)
@@ -1149,8 +1139,7 @@ external program defined by `sendmail-program'."
;; should override any specified in the message itself.
(when where-content-type
(goto-char where-content-type)
- (beginning-of-line)
- (delete-region (point)
+ (delete-region (point-at-bol)
(progn (forward-line 1) (point)))))))
;; Insert an extra newline if we need it to work around
;; Sun's bug that swallows newlines.
@@ -1179,9 +1168,9 @@ external program defined by `sendmail-program'."
nil errbuf nil "-oi")
(and envelope-from
(list "-f" envelope-from))
-;;; ;; Don't say "from root" if running under su.
-;;; (and (equal (user-real-login-name) "root")
-;;; (list "-f" (user-login-name)))
+ ;; ;; Don't say "from root" if running under su.
+ ;; (and (equal (user-real-login-name) "root")
+ ;; (list "-f" (user-login-name)))
(and mail-alias-file
(list (concat "-oA" mail-alias-file)))
(if mail-interactive
@@ -1663,9 +1652,11 @@ If the current line has `mail-yank-prefix', insert it on the new line."
;; in middle of loading the file.
;;;###autoload (add-hook 'same-window-buffer-names (purecopy "*mail*"))
+;;;###autoload (add-hook 'same-window-buffer-names (purecopy "*unsent mail*"))
;;;###autoload
-(defun mail (&optional noerase to subject in-reply-to cc replybuffer actions)
+(defun mail (&optional noerase to subject in-reply-to cc replybuffer
+ actions return-action)
"Edit a message to be sent. Prefix arg means resume editing (don't erase).
When this function returns, the buffer `*mail*' is selected.
The value is t if the message was newly initialized; otherwise, nil.
@@ -1713,49 +1704,6 @@ The seventh argument ACTIONS is a list of actions to take
when the message is sent, we apply FUNCTION to ARGS.
This is how Rmail arranges to mark messages `answered'."
(interactive "P")
-;;; This is commented out because I found it was confusing in practice.
-;;; It is easy enough to rename *mail* by hand with rename-buffer
-;;; if you want to have multiple mail buffers.
-;;; And then you can control which messages to save. --rms.
-;;; (let ((index 1)
-;;; buffer)
-;;; ;; If requested, look for a mail buffer that is modified and go to it.
-;;; (if noerase
-;;; (progn
-;;; (while (and (setq buffer
-;;; (get-buffer (if (= 1 index) "*mail*"
-;;; (format "*mail*<%d>" index))))
-;;; (not (buffer-modified-p buffer)))
-;;; (setq index (1+ index)))
-;;; (if buffer (switch-to-buffer buffer)
-;;; ;; If none exists, start a new message.
-;;; ;; This will never re-use an existing unmodified mail buffer
-;;; ;; (since index is not 1 anymore). Perhaps it should.
-;;; (setq noerase nil))))
-;;; ;; Unless we found a modified message and are happy, start a new message.
-;;; (if (not noerase)
-;;; (progn
-;;; ;; Look for existing unmodified mail buffer.
-;;; (while (and (setq buffer
-;;; (get-buffer (if (= 1 index) "*mail*"
-;;; (format "*mail*<%d>" index))))
-;;; (buffer-modified-p buffer))
-;;; (setq index (1+ index)))
-;;; ;; If none, make a new one.
-;;; (or buffer
-;;; (setq buffer (generate-new-buffer "*mail*")))
-;;; ;; Go there and initialize it.
-;;; (switch-to-buffer buffer)
-;;; (erase-buffer)
-;;; (setq default-directory (expand-file-name "~/"))
-;;; (auto-save-mode auto-save-default)
-;;; (mail-mode)
-;;; (mail-setup to subject in-reply-to cc replybuffer actions)
-;;; (if (and buffer-auto-save-file-name
-;;; (file-exists-p buffer-auto-save-file-name))
-;;; (message "Auto save file for draft message exists; consider M-x mail-recover"))
-;;; t))
-
(if (eq noerase 'new)
(pop-to-buffer (generate-new-buffer "*mail*"))
(and noerase
@@ -1775,7 +1723,7 @@ The seventh argument ACTIONS is a list of actions to take
(mail-mode)
;; Disconnect the buffer from its visited file
;; (in case the user has actually visited a file *mail*).
-;;; (set-visited-file-name nil)
+ ;; (set-visited-file-name nil)
(let (initialized)
(and (not (and noerase
(not (eq noerase 'new))))
@@ -1794,7 +1742,8 @@ The seventh argument ACTIONS is a list of actions to take
t))
(let ((inhibit-read-only t))
(erase-buffer)
- (mail-setup to subject in-reply-to cc replybuffer actions)
+ (mail-setup to subject in-reply-to cc replybuffer actions
+ return-action)
(setq initialized t)))
(if (and buffer-auto-save-file-name
(file-exists-p buffer-auto-save-file-name))
@@ -1824,6 +1773,9 @@ The seventh argument ACTIONS is a list of actions to take
;; names are normally ``trivial'', so Dired will set point after
;; all the files, at buffer bottom. We want it on the first
;; file instead.
+ ;; Require dired so that dired-trivial-filenames does not get
+ ;; unbound on exit from the let.
+ (require 'dired)
(let ((dired-trivial-filenames t))
(dired-other-window wildcard (concat dired-listing-switches "t")))
(rename-buffer "*Auto-saved Drafts*" t)
@@ -1954,5 +1906,4 @@ you can move to one of them and type C-c C-c to recover that one."
(provide 'sendmail)
-;; arch-tag: 48bc1025-d993-4d31-8d81-2a29491f0626
;;; sendmail.el ends here
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index f59e8b02cd0..f726304704b 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -1,7 +1,6 @@
;;; smtpmail.el --- simple SMTP protocol (RFC 821) for sending mail
-;; Copyright (C) 1995, 1996, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1995-1996, 2001-2011 Free Software Foundation, Inc.
;; Author: Tomoji Kagatani <kagatani@rbc.ncl.omron.co.jp>
;; Maintainer: Simon Josefsson <simon@josefsson.org>
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el
index 0dacfc3402d..084b623080a 100644
--- a/lisp/mail/supercite.el
+++ b/lisp/mail/supercite.el
@@ -1,7 +1,6 @@
;;; supercite.el --- minor mode for citing mail and news replies
-;; Copyright (C) 1993, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1993, 1997, 2001-2011 Free Software Foundation, Inc.
;; Author: 1993 Barry A. Warsaw <bwarsaw@python.org>
;; Maintainer: Glenn Morris <rgm@gnu.org>
@@ -34,7 +33,6 @@
(require 'regi)
-(require 'sendmail) ;; For mail-header-end.
;; start user configuration variables
;; vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
@@ -1484,18 +1482,22 @@ non-nil."
"Does nothing. Use this instead of nil to get a blank header."
())
-(defun sc-no-blank-line-or-header()
+(declare-function mh-in-header-p "mh-utils" ())
+
+(defun sc-no-blank-line-or-header ()
"Similar to `sc-no-header' except it removes the preceding blank line."
- (if (not (bobp))
- (if (and (eolp)
- (progn (forward-line -1)
- (or (= (point) (mail-header-end))
- (and (eq major-mode 'mh-letter-mode)
- (with-no-warnings
- (mh-in-header-p))))))
- (progn (forward-line)
- (let ((kill-lines-magic t))
- (kill-line))))))
+ (and (not (bobp))
+ (eolp)
+ (progn (forward-line -1)
+ (or (= (point)
+ (save-excursion
+ (rfc822-goto-eoh)
+ (line-beginning-position 2)))
+ (and (eq major-mode 'mh-letter-mode)
+ (mh-in-header-p))))
+ (progn
+ (forward-line)
+ (kill-line))))
(defun sc-header-on-said ()
"\"On <date>, <from> said:\" unless:
@@ -1616,21 +1618,20 @@ error occurs."
(cadr err) sc-eref-style)
(beep))))))
-(defun sc-electric-mode (&optional arg)
- "
-Mode for viewing Supercite reference headers. Commands are:
+(defun sc-electric-mode (&optional style)
+ "Mode for viewing Supercite reference headers. Commands are:
\n\\{sc-electric-mode-map}
`sc-electric-mode' is not intended to be run interactively, but rather
accessed through Supercite's electric reference feature. See
-`sc-insert-reference' for more details. Optional ARG is the initial
+`sc-insert-reference' for more details. Optional STYLE is the initial
header style to use, unless not supplied or invalid, in which case
`sc-preferred-header-style' is used."
(let ((info sc-mail-info))
(setq sc-eref-style
- (or (sc-valid-index-p arg)
+ (or (sc-valid-index-p style)
(sc-valid-index-p sc-preferred-header-style)
0))
@@ -1995,5 +1996,4 @@ version at point."
(provide 'supercite)
(run-hooks 'sc-load-hook)
-;; arch-tag: a5d5bfa6-3bd5-4414-8c65-0afc83e45cd3
;;; supercite.el ends here
diff --git a/lisp/mail/uce.el b/lisp/mail/uce.el
index e71dd9cea22..f1bd98af297 100644
--- a/lisp/mail/uce.el
+++ b/lisp/mail/uce.el
@@ -1,7 +1,6 @@
;;; uce.el --- facilitate reply to unsolicited commercial email
-;; Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2006,
-;; 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1996, 1998, 2000-2011 Free Software Foundation, Inc.
;; Author: stanislav shalunov <shalunov@mccme.ru>
;; Created: 10 Dec 1996
@@ -375,5 +374,4 @@ You might need to set `uce-mail-reader' before using this."
(provide 'uce)
-;; arch-tag: 44b68c87-9b29-47bd-822c-3feee3883221
;;; uce.el ends here
diff --git a/lisp/mail/undigest.el b/lisp/mail/undigest.el
index 0403c4afc6c..04bb320a2ab 100644
--- a/lisp/mail/undigest.el
+++ b/lisp/mail/undigest.el
@@ -1,7 +1,7 @@
;;; undigest.el --- digest-cracking support for the RMAIL mail reader
-;; Copyright (C) 1985, 1986, 1994, 1996, 2001, 2002, 2003, 2004, 2005,
-;; 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1985-1986, 1994, 1996, 2001-2011
+;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
@@ -329,5 +329,4 @@ following the containing message."
;; generated-autoload-file: "rmail.el"
;; End:
-;; arch-tag: 3a28b9fb-c1f5-43ef-9278-285f3e4b874d
;;; undigest.el ends here
diff --git a/lisp/mail/unrmail.el b/lisp/mail/unrmail.el
index 4aa727f9f50..9ed2e90b456 100644
--- a/lisp/mail/unrmail.el
+++ b/lisp/mail/unrmail.el
@@ -1,7 +1,6 @@
;;; unrmail.el --- convert Rmail Babyl files to mailbox files
-;; Copyright (C) 1992, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-;; 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 2001-2011 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: mail
@@ -245,5 +244,4 @@ For example, invoke `emacs -batch -f batch-unrmail RMAIL'."
(provide 'unrmail)
-;; arch-tag: 14c6290d-60b2-456f-8909-5c2387de6acb
;;; unrmail.el ends here
diff --git a/lisp/mail/uudecode.el b/lisp/mail/uudecode.el
index 22b97b4b7bb..8652e67d3e1 100644
--- a/lisp/mail/uudecode.el
+++ b/lisp/mail/uudecode.el
@@ -1,7 +1,6 @@
;;; uudecode.el -- elisp native uudecode
-;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-;; 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+;; Copyright (C) 1998-2011 Free Software Foundation, Inc.
;; Author: Shenghuo Zhu <zsh@cs.rochester.edu>
;; Keywords: uudecode news
@@ -216,7 +215,7 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
(skip-chars-forward non-data-chars end))
(if file-name
(with-temp-file file-name
- (set-buffer-multibyte nil)
+ (unless (featurep 'xemacs) (set-buffer-multibyte nil))
(insert (apply 'concat (nreverse result))))
(or (markerp end) (setq end (set-marker (make-marker) end)))
(goto-char start)
@@ -236,5 +235,4 @@ If FILE-NAME is non-nil, save the result to FILE-NAME."
(provide 'uudecode)
-;; arch-tag: e1f09ed5-62b4-4677-9f13-4e81c4fe8ce3
;;; uudecode.el ends here