aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Reilly2008-09-15 20:40:23 +0000
committerPaul Reilly2008-09-15 20:40:23 +0000
commit133fc7dcdba7fa30962bb548cbfcc6d055c304e6 (patch)
tree65ee2bd52f64792259a0e795265209321751a029
parent84a056f85eebb23763a9e502348f302f82b75fd4 (diff)
downloademacs-133fc7dcdba7fa30962bb548cbfcc6d055c304e6.tar.gz
emacs-133fc7dcdba7fa30962bb548cbfcc6d055c304e6.zip
Rmail/mbox merge abandoned. Remove stale files.
-rw-r--r--lisp/mail/mbox-trunk-annotations/rmail.el.annotation4286
-rw-r--r--lisp/mail/mbox-trunk-annotations/rmailedit.el.annotation164
-rw-r--r--lisp/mail/mbox-trunk-annotations/rmailkwd.el.annotation290
-rw-r--r--lisp/mail/mbox-trunk-annotations/rmailmsc.el.annotation67
-rw-r--r--lisp/mail/mbox-trunk-annotations/rmailout.el.annotation420
-rw-r--r--lisp/mail/mbox-trunk-annotations/rmailsort.el.annotation250
6 files changed, 0 insertions, 5477 deletions
diff --git a/lisp/mail/mbox-trunk-annotations/rmail.el.annotation b/lisp/mail/mbox-trunk-annotations/rmail.el.annotation
deleted file mode 100644
index ca937834658..00000000000
--- a/lisp/mail/mbox-trunk-annotations/rmail.el.annotation
+++ /dev/null
@@ -1,4286 +0,0 @@
11.348 (pj 15-Jul-01): ;;; rmail.el --- main code of "RMAIL" mail reader for Emacs
21.12 (eric 30-May-92):
31.407 (ttn 06-Aug-05): ;; Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
41.444 (miles 08-Jan-08): ;; 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
51.440 (gm 12-Oct-07): ;; Free Software Foundation, Inc.
61.18 (eric 22-Jul-92):
71.13 (eric 16-Jul-92): ;; Maintainer: FSF
81.15 (eric 17-Jul-92): ;; Keywords: mail
91.1 (roland 13-May-91):
101.1 (roland 13-May-91): ;; This file is part of GNU Emacs.
111.1 (roland 13-May-91):
121.454 (gm 06-May-08): ;; GNU Emacs is free software: you can redistribute it and/or modify
131.1 (roland 13-May-91): ;; it under the terms of the GNU General Public License as published by
141.454 (gm 06-May-08): ;; the Free Software Foundation, either version 3 of the License, or
151.454 (gm 06-May-08): ;; (at your option) any later version.
161.1 (roland 13-May-91):
171.1 (roland 13-May-91): ;; GNU Emacs is distributed in the hope that it will be useful,
181.1 (roland 13-May-91): ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
191.1 (roland 13-May-91): ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
201.1 (roland 13-May-91): ;; GNU General Public License for more details.
211.1 (roland 13-May-91):
221.1 (roland 13-May-91): ;; You should have received a copy of the GNU General Public License
231.454 (gm 06-May-08): ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
241.1 (roland 13-May-91):
251.348 (pj 15-Jul-01): ;;; Commentary:
261.348 (pj 15-Jul-01):
271.13 (eric 16-Jul-92): ;;; Code:
281.1 (roland 13-May-91):
291.1 (roland 13-May-91): ;; Souped up by shane@mit-ajax based on ideas of rlk@athena.mit.edu
301.1 (roland 13-May-91): ;; New features include attribute and keyword support, message
311.1 (roland 13-May-91): ;; selection by dispatch table, summary by attributes and keywords,
321.1 (roland 13-May-91): ;; expunging by dispatch table, sticky options for file commands.
331.1 (roland 13-May-91):
341.39 (rms 09-Mar-93): ;; Extended by Bob Weiner of Motorola
351.39 (rms 09-Mar-93): ;; New features include: rmail and rmail-summary buffers remain
361.39 (rms 09-Mar-93): ;; synchronized and key bindings basically operate the same way in both
371.39 (rms 09-Mar-93): ;; buffers, summary by topic or by regular expression, rmail-reply-prefix
381.39 (rms 09-Mar-93): ;; variable, and a bury rmail buffer (wipe) command.
391.39 (rms 09-Mar-93): ;;
401.39 (rms 09-Mar-93):
411.1 (roland 13-May-91): (require 'mail-utils)
421.349 (eliz 16-Sep-01): (eval-when-compile (require 'mule-util)) ; for detect-coding-with-priority
431.39 (rms 09-Mar-93):
441.414 (lektu 29-Aug-05): (defvar deleted-head)
451.414 (lektu 29-Aug-05): (defvar font-lock-fontified)
461.414 (lektu 29-Aug-05): (defvar mail-abbrev-syntax-table)
471.414 (lektu 29-Aug-05): (defvar mail-abbrevs)
481.414 (lektu 29-Aug-05): (defvar messages-head)
491.414 (lektu 29-Aug-05): (defvar rmail-use-spam-filter)
501.414 (lektu 29-Aug-05): (defvar rsf-beep)
511.414 (lektu 29-Aug-05): (defvar rsf-sleep-after-message)
521.414 (lektu 29-Aug-05): (defvar total-messages)
531.423 (eliz 25-Mar-06): (defvar tool-bar-map)
541.414 (lektu 29-Aug-05):
551.39 (rms 09-Mar-93): ; These variables now declared in paths.el.
561.1 (roland 13-May-91): ;(defvar rmail-spool-directory "/usr/spool/mail/"
571.1 (roland 13-May-91): ; "This is the name of the directory used by the system mailer for\n\
581.200 (rms 12-Oct-96): ;delivering new mail. Its name should end with a slash.")
591.1 (roland 13-May-91): ;(defvar rmail-file-name
601.1 (roland 13-May-91): ; (expand-file-name "~/RMAIL")
611.1 (roland 13-May-91): ; "")
621.1 (roland 13-May-91):
631.219 (rms 03-May-97): (defgroup rmail nil
641.219 (rms 03-May-97): "Mail reader for Emacs."
651.219 (rms 03-May-97): :group 'mail)
661.219 (rms 03-May-97):
671.219 (rms 03-May-97): (defgroup rmail-retrieve nil
681.219 (rms 03-May-97): "Rmail retrieval options."
691.219 (rms 03-May-97): :prefix "rmail-"
701.219 (rms 03-May-97): :group 'rmail)
711.219 (rms 03-May-97):
721.219 (rms 03-May-97): (defgroup rmail-files nil
731.219 (rms 03-May-97): "Rmail files."
741.219 (rms 03-May-97): :prefix "rmail-"
751.219 (rms 03-May-97): :group 'rmail)
761.219 (rms 03-May-97):
771.219 (rms 03-May-97): (defgroup rmail-headers nil
781.219 (rms 03-May-97): "Rmail header options."
791.219 (rms 03-May-97): :prefix "rmail-"
801.219 (rms 03-May-97): :group 'rmail)
811.219 (rms 03-May-97):
821.219 (rms 03-May-97): (defgroup rmail-reply nil
831.219 (rms 03-May-97): "Rmail reply options."
841.219 (rms 03-May-97): :prefix "rmail-"
851.219 (rms 03-May-97): :group 'rmail)
861.219 (rms 03-May-97):
871.219 (rms 03-May-97): (defgroup rmail-summary nil
881.219 (rms 03-May-97): "Rmail summary options."
891.219 (rms 03-May-97): :prefix "rmail-"
901.219 (rms 03-May-97): :prefix "rmail-summary-"
911.219 (rms 03-May-97): :group 'rmail)
921.219 (rms 03-May-97):
931.219 (rms 03-May-97): (defgroup rmail-output nil
941.219 (rms 03-May-97): "Output message to a file."
951.219 (rms 03-May-97): :prefix "rmail-output-"
961.219 (rms 03-May-97): :prefix "rmail-"
971.219 (rms 03-May-97): :group 'rmail)
981.219 (rms 03-May-97):
991.337 (gerd 07-May-01): (defgroup rmail-edit nil
1001.337 (gerd 07-May-01): "Rmail editing."
1011.337 (gerd 07-May-01): :prefix "rmail-edit-"
1021.337 (gerd 07-May-01): :group 'rmail)
1031.337 (gerd 07-May-01):
1041.395 (eliz 15-Jan-05): (defgroup rmail-obsolete nil
1051.395 (eliz 15-Jan-05): "Rmail obsolete customization variables."
1061.395 (eliz 15-Jan-05): :group 'rmail)
1071.219 (rms 03-May-97):
1081.259 (kwzh 08-Apr-98): (defcustom rmail-movemail-program nil
1091.397 (rms 18-Mar-05): "If non-nil, the file name of the `movemail' program."
1101.259 (kwzh 08-Apr-98): :group 'rmail-retrieve
1111.286 (schwab 18-Sep-98): :type '(choice (const nil) string))
1121.110 (rms 13-Jul-94):
1131.219 (rms 03-May-97): (defcustom rmail-pop-password nil
1141.397 (rms 18-Mar-05): "*Password to use when reading mail from POP server.
1151.397 (rms 18-Mar-05): Please use `rmail-remote-password' instead."
1161.219 (rms 03-May-97): :type '(choice (string :tag "Password")
1171.219 (rms 03-May-97): (const :tag "Not Required" nil))
1181.395 (eliz 15-Jan-05): :group 'rmail-obsolete)
1191.219 (rms 03-May-97):
1201.219 (rms 03-May-97): (defcustom rmail-pop-password-required nil
1211.407 (ttn 06-Aug-05): "*Non-nil if a password is required when reading mail from a POP server.
1221.397 (rms 18-Mar-05): Please use rmail-remote-password-required instead."
1231.219 (rms 03-May-97): :type 'boolean
1241.395 (eliz 15-Jan-05): :group 'rmail-obsolete)
1251.395 (eliz 15-Jan-05):
1261.395 (eliz 15-Jan-05): (defcustom rmail-remote-password nil
1271.397 (rms 18-Mar-05): "*Password to use when reading mail from a remote server.
1281.397 (rms 18-Mar-05): This setting is ignored for mailboxes whose URL already contains a password."
1291.395 (eliz 15-Jan-05): :type '(choice (string :tag "Password")
1301.395 (eliz 15-Jan-05): (const :tag "Not Required" nil))
1311.395 (eliz 15-Jan-05): :set-after '(rmail-pop-password)
1321.395 (eliz 15-Jan-05): :set #'(lambda (symbol value)
1331.396 (kfstorm 09-Feb-05): (set-default symbol
1341.395 (eliz 15-Jan-05): (if (and (not value)
1351.395 (eliz 15-Jan-05): (boundp 'rmail-pop-password)
1361.395 (eliz 15-Jan-05): rmail-pop-password)
1371.395 (eliz 15-Jan-05): rmail-pop-password
1381.395 (eliz 15-Jan-05): value))
1391.395 (eliz 15-Jan-05): (setq rmail-pop-password nil))
1401.395 (eliz 15-Jan-05): :group 'rmail-retrieve
1411.396 (kfstorm 09-Feb-05): :version "22.1")
1421.395 (eliz 15-Jan-05):
1431.395 (eliz 15-Jan-05): (defcustom rmail-remote-password-required nil
1441.395 (eliz 15-Jan-05): "*Non-nil if a password is required when reading mail from a remote server."
1451.395 (eliz 15-Jan-05): :type 'boolean
1461.395 (eliz 15-Jan-05): :set-after '(rmail-pop-password-required)
1471.395 (eliz 15-Jan-05): :set #'(lambda (symbol value)
1481.396 (kfstorm 09-Feb-05): (set-default symbol
1491.395 (eliz 15-Jan-05): (if (and (not value)
1501.395 (eliz 15-Jan-05): (boundp 'rmail-pop-password-required)
1511.395 (eliz 15-Jan-05): rmail-pop-password-required)
1521.395 (eliz 15-Jan-05): rmail-pop-password-required
1531.395 (eliz 15-Jan-05): value))
1541.395 (eliz 15-Jan-05): (setq rmail-pop-password-required nil))
1551.395 (eliz 15-Jan-05): :group 'rmail-retrieve
1561.396 (kfstorm 09-Feb-05): :version "22.1")
1571.183 (rms 26-Apr-96):
1581.256 (kwzh 06-Apr-98): (defcustom rmail-movemail-flags nil
1591.257 (kwzh 06-Apr-98): "*List of flags to pass to movemail.
1601.257 (kwzh 06-Apr-98): Most commonly used to specify `-g' to enable GSS-API authentication
1611.257 (kwzh 06-Apr-98): or `-k' to enable Kerberos authentication."
1621.260 (schwab 14-Apr-98): :type '(repeat string)
1631.262 (done 20-Apr-98): :group 'rmail-retrieve
1641.262 (done 20-Apr-98): :version "20.3")
1651.256 (kwzh 06-Apr-98):
1661.395 (eliz 15-Jan-05): (defvar rmail-remote-password-error "invalid usercode or password\\|
1671.395 (eliz 15-Jan-05): unknown user name or bad password\\|Authentication failed\\|MU_ERR_AUTH_FAILURE"
1681.395 (eliz 15-Jan-05): "Regular expression matching incorrect-password POP or IMAP server error
1691.395 (eliz 15-Jan-05): messages.
1701.230 (rms 25-Jul-97): If you get an incorrect-password error that this expression does not match,
1711.230 (rms 25-Jul-97): please report it with \\[report-emacs-bug].")
1721.230 (rms 25-Jul-97):
1731.395 (eliz 15-Jan-05): (defvar rmail-encoded-remote-password nil)
1741.284 (rms 05-Aug-98):
1751.219 (rms 03-May-97): (defcustom rmail-preserve-inbox nil
1761.397 (rms 18-Mar-05): "*Non-nil means leave incoming mail in the user's inbox--don't delete it."
1771.219 (rms 03-May-97): :type 'boolean
1781.219 (rms 03-May-97): :group 'rmail-retrieve)
1791.205 (rms 21-Jan-97):
1801.395 (eliz 15-Jan-05): (defcustom rmail-movemail-search-path nil
1811.395 (eliz 15-Jan-05): "*List of directories to search for movemail (in addition to `exec-path')."
1821.395 (eliz 15-Jan-05): :group 'rmail-retrieve
1831.395 (eliz 15-Jan-05): :type '(repeat (directory)))
1841.395 (eliz 15-Jan-05):
1851.442 (dann 25-Nov-07): (declare-function mail-position-on-field "sendmail" (field &optional soft))
1861.442 (dann 25-Nov-07): (declare-function mail-text-start "sendmail" ())
1871.442 (dann 25-Nov-07): (declare-function rmail-update-summary "rmailsum" (&rest ignore))
1881.442 (dann 25-Nov-07):
1891.395 (eliz 15-Jan-05): (defun rmail-probe (prog)
1901.397 (rms 18-Mar-05): "Determine what flavor of movemail PROG is.
1911.397 (rms 18-Mar-05): We do this by executing it with `--version' and analyzing its output."
1921.395 (eliz 15-Jan-05): (with-temp-buffer
1931.395 (eliz 15-Jan-05): (let ((tbuf (current-buffer)))
1941.395 (eliz 15-Jan-05): (buffer-disable-undo tbuf)
1951.395 (eliz 15-Jan-05): (call-process prog nil tbuf nil "--version")
1961.395 (eliz 15-Jan-05): (if (not (buffer-modified-p tbuf))
1971.395 (eliz 15-Jan-05): ;; Should not happen...
1981.395 (eliz 15-Jan-05): nil
1991.395 (eliz 15-Jan-05): (goto-char (point-min))
2001.395 (eliz 15-Jan-05): (cond
2011.395 (eliz 15-Jan-05): ((looking-at ".*movemail: invalid option")
2021.395 (eliz 15-Jan-05): 'emacs) ;; Possibly...
2031.395 (eliz 15-Jan-05): ((looking-at "movemail (GNU Mailutils .*)")
2041.395 (eliz 15-Jan-05): 'mailutils)
2051.395 (eliz 15-Jan-05): (t
2061.395 (eliz 15-Jan-05): ;; FIXME:
2071.395 (eliz 15-Jan-05): 'emacs))))))
2081.395 (eliz 15-Jan-05):
2091.395 (eliz 15-Jan-05): (defun rmail-autodetect ()
2101.438 (schwab 20-Aug-07): "Determine the file name of the `movemail' program and return its flavor.
2111.397 (rms 18-Mar-05): If `rmail-movemail-program' is non-nil, use it.
2121.397 (rms 18-Mar-05): Otherwise, look for `movemail' in the directories in
2131.397 (rms 18-Mar-05): `rmail-movemail-search-path', those in `exec-path', and `exec-directory'."
2141.395 (eliz 15-Jan-05): (if rmail-movemail-program
2151.395 (eliz 15-Jan-05): (rmail-probe rmail-movemail-program)
2161.395 (eliz 15-Jan-05): (catch 'scan
2171.395 (eliz 15-Jan-05): (dolist (dir (append rmail-movemail-search-path exec-path
2181.395 (eliz 15-Jan-05): (list exec-directory)))
2191.395 (eliz 15-Jan-05): (when (and dir (file-accessible-directory-p dir))
2201.452 (gm 20-Feb-08): ;; Previously, this didn't have to work on Windows, because
2211.452 (gm 20-Feb-08): ;; rmail-insert-inbox-text before r1.439 fell back to using
2221.452 (gm 20-Feb-08): ;; (expand-file-name "movemail" exec-directory) and just
2231.452 (gm 20-Feb-08): ;; assuming it would work.
2241.452 (gm 20-Feb-08): ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-02/msg00087.html
2251.452 (gm 20-Feb-08): (let ((progname (expand-file-name
2261.452 (gm 20-Feb-08): (concat "movemail"
2271.452 (gm 20-Feb-08): (if (memq system-type '(ms-dos windows-nt))
2281.452 (gm 20-Feb-08): ".exe")) dir)))
2291.395 (eliz 15-Jan-05): (when (and (not (file-directory-p progname))
2301.395 (eliz 15-Jan-05): (file-executable-p progname))
2311.395 (eliz 15-Jan-05): (let ((x (rmail-probe progname)))
2321.395 (eliz 15-Jan-05): (when x
2331.395 (eliz 15-Jan-05): (setq rmail-movemail-program progname)
2341.395 (eliz 15-Jan-05): (throw 'scan x))))))))))
2351.395 (eliz 15-Jan-05):
2361.395 (eliz 15-Jan-05): (defvar rmail-movemail-variant-in-use nil
2371.395 (eliz 15-Jan-05): "The movemail variant currently in use. Known variants are:
2381.395 (eliz 15-Jan-05):
2391.395 (eliz 15-Jan-05): `emacs' Means any implementation, compatible with the native Emacs one.
2401.395 (eliz 15-Jan-05): This is the default;
2411.395 (eliz 15-Jan-05): `mailutils' Means GNU mailutils implementation, capable of handling full
2421.435 (ttn 09-Jun-07): mail URLs as the source mailbox.")
2431.395 (eliz 15-Jan-05):
2441.395 (eliz 15-Jan-05): ;;;###autoload
2451.395 (eliz 15-Jan-05): (defun rmail-movemail-variant-p (&rest variants)
2461.395 (eliz 15-Jan-05): "Return t if the current movemail variant is any of VARIANTS.
2471.395 (eliz 15-Jan-05): Currently known variants are 'emacs and 'mailutils."
2481.395 (eliz 15-Jan-05): (when (not rmail-movemail-variant-in-use)
2491.395 (eliz 15-Jan-05): ;; Autodetect
2501.395 (eliz 15-Jan-05): (setq rmail-movemail-variant-in-use (rmail-autodetect)))
2511.395 (eliz 15-Jan-05): (not (null (member rmail-movemail-variant-in-use variants))))
2521.395 (eliz 15-Jan-05):
2531.439 (gm 22-Aug-07): ;; Call for effect, to set rmail-movemail-program (if not set by the
2541.439 (gm 22-Aug-07): ;; user), and rmail-movemail-variant-in-use. Used by various functions.
2551.439 (gm 22-Aug-07): ;; I'm not sure if M-x rmail is the only entry point to this package.
2561.439 (gm 22-Aug-07): ;; If so, this can be moved there.
2571.439 (gm 22-Aug-07): (rmail-movemail-variant-p)
2581.439 (gm 22-Aug-07):
2591.1 (roland 13-May-91): ;;;###autoload
2601.219 (rms 03-May-97): (defcustom rmail-dont-reply-to-names nil "\
2611.356 (pmr-sav 19-Mar-02): *A regexp specifying addresses to prune from a reply message.
2621.356 (pmr-sav 19-Mar-02): A value of nil means exclude your own email address as an address
2631.283 (rms 28-Jul-98): plus whatever is specified by `rmail-default-dont-reply-to-names'."
2641.219 (rms 03-May-97): :type '(choice regexp (const :tag "Your Name" nil))
2651.219 (rms 03-May-97): :group 'rmail-reply)
2661.1 (roland 13-May-91):
2671.1 (roland 13-May-91): ;;;###autoload
2681.384 (uid65627 16-Feb-04): (defvar rmail-default-dont-reply-to-names "\\`info-" "\
2691.384 (uid65627 16-Feb-04): A regular expression specifying part of the default value of the
2701.384 (uid65627 16-Feb-04): variable `rmail-dont-reply-to-names', for when the user does not set
2711.1 (roland 13-May-91): `rmail-dont-reply-to-names' explicitly. (The other part of the default
2721.356 (pmr-sav 19-Mar-02): value is the user's email address and name.)
2731.53 (rms 30-Jun-93): It is useful to set this variable in the site customization file.")
2741.1 (roland 13-May-91):
2751.1 (roland 13-May-91): ;;;###autoload
2761.328 (gerd 29-Jan-01): (defcustom rmail-ignored-headers
2771.399 (rms 17-Apr-05): (concat "^via:\\|^mail-from:\\|^origin:\\|^references:\\|^sender:"
2781.328 (gerd 29-Jan-01): "\\|^status:\\|^received:\\|^x400-originator:\\|^x400-recipients:"
2791.328 (gerd 29-Jan-01): "\\|^x400-received:\\|^x400-mts-identifier:\\|^x400-content-type:"
2801.328 (gerd 29-Jan-01): "\\|^\\(resent-\\|\\)message-id:\\|^summary-line:\\|^resent-date:"
2811.371 (jpw 15-May-03): "\\|^nntp-posting-host:\\|^path:\\|^x-char.*:\\|^x-face:\\|^face:"
2821.408 (rms 09-Aug-05): "\\|^x-mailer:\\|^delivered-to:\\|^lines:"
2831.328 (gerd 29-Jan-01): "\\|^content-transfer-encoding:\\|^x-coding-system:"
2841.328 (gerd 29-Jan-01): "\\|^return-path:\\|^errors-to:\\|^return-receipt-to:"
2851.328 (gerd 29-Jan-01): "\\|^precedence:\\|^list-help:\\|^list-post:\\|^list-subscribe:"
2861.328 (gerd 29-Jan-01): "\\|^list-id:\\|^list-unsubscribe:\\|^list-archive:"
2871.413 (rms 15-Aug-05): "\\|^content-length:\\|^nntp-posting-date:\\|^user-agent"
2881.413 (rms 15-Aug-05): "\\|^importance:\\|^envelope-to:\\|^delivery-date\\|^openpgp:"
2891.421 (rms 11-Mar-06): "\\|^mbox-line:\\|^cancel-lock:\\|^DomainKey-Signature:"
2901.413 (rms 15-Aug-05): "\\|^resent-face:\\|^resent-x.*:\\|^resent-organization:\\|^resent-openpgp:"
2911.413 (rms 15-Aug-05):
2921.413 (rms 15-Aug-05): "\\|^x-.*:")
2931.302 (rms 05-Apr-99): "*Regexp to match header fields that Rmail should normally hide.
2941.413 (rms 15-Aug-05): \(See also `rmail-nonignored-headers', which overrides this regexp.)
2951.413 (rms 15-Aug-05): This variable is used for reformatting the message header,
2961.413 (rms 15-Aug-05): which normally happens once for each message,
2971.413 (rms 15-Aug-05): when you view the message for the first time in Rmail.
2981.413 (rms 15-Aug-05): To make a change in this variable take effect
2991.413 (rms 15-Aug-05): for a message that you have already viewed,
3001.413 (rms 15-Aug-05): go to that message and type \\[rmail-toggle-header] twice."
3011.413 (rms 15-Aug-05): :type 'regexp
3021.413 (rms 15-Aug-05): :group 'rmail-headers)
3031.413 (rms 15-Aug-05):
3041.413 (rms 15-Aug-05): (defcustom rmail-nonignored-headers "^x-spam-status:"
3051.413 (rms 15-Aug-05): "*Regexp to match X header fields that Rmail should show.
3061.413 (rms 15-Aug-05): This regexp overrides `rmail-ignored-headers'; if both this regexp
3071.413 (rms 15-Aug-05): and that one match a certain header field, Rmail shows the field.
3081.448 (bastien1 10-Feb-08): If this is nil, ignore all header fields in `rmail-ignored-headers'.
3091.413 (rms 15-Aug-05):
3101.302 (rms 05-Apr-99): This variable is used for reformatting the message header,
3111.302 (rms 05-Apr-99): which normally happens once for each message,
3121.302 (rms 05-Apr-99): when you view the message for the first time in Rmail.
3131.302 (rms 05-Apr-99): To make a change in this variable take effect
3141.302 (rms 05-Apr-99): for a message that you have already viewed,
3151.302 (rms 05-Apr-99): go to that message and type \\[rmail-toggle-header] twice."
3161.448 (bastien1 10-Feb-08): :type '(choice (const nil) (regexp))
3171.219 (rms 03-May-97): :group 'rmail-headers)
3181.1 (roland 13-May-91):
3191.1 (roland 13-May-91): ;;;###autoload
3201.219 (rms 03-May-97): (defcustom rmail-displayed-headers nil
3211.150 (rms 14-Apr-95): "*Regexp to match Header fields that Rmail should display.
3221.150 (rms 14-Apr-95): If nil, display all header fields except those matched by
3231.219 (rms 03-May-97): `rmail-ignored-headers'."
3241.219 (rms 03-May-97): :type '(choice regexp (const :tag "All"))
3251.219 (rms 03-May-97): :group 'rmail-headers)
3261.150 (rms 14-Apr-95):
3271.150 (rms 14-Apr-95): ;;;###autoload
3281.330 (rms 06-Mar-01): (defcustom rmail-retry-ignored-headers "^x-authentication-warning:" "\
3291.219 (rms 03-May-97): *Headers that should be stripped when retrying a failed message."
3301.219 (rms 03-May-97): :type '(choice regexp (const nil :tag "None"))
3311.219 (rms 03-May-97): :group 'rmail-headers)
3321.128 (rms 23-Sep-94):
3331.128 (rms 23-Sep-94): ;;;###autoload
3341.219 (rms 03-May-97): (defcustom rmail-highlighted-headers "^From:\\|^Subject:" "\
3351.112 (rms 30-Jul-94): *Regexp to match Header fields that Rmail should normally highlight.
3361.451 (bastien1 13-Feb-08): A value of nil means don't highlight."
3371.219 (rms 03-May-97): :type 'regexp
3381.219 (rms 03-May-97): :group 'rmail-headers)
3391.97 (rms 23-Apr-94):
3401.421 (rms 11-Mar-06): (defface rmail-highlight
3411.446 (miles 01-Feb-08): '((t (:inherit highlight)))
3421.421 (rms 11-Mar-06): "Face to use for highlighting the most important header fields."
3431.421 (rms 11-Mar-06): :group 'rmail-headers
3441.421 (rms 11-Mar-06): :version "22.1")
3451.421 (rms 11-Mar-06):
3461.451 (bastien1 13-Feb-08): (defface rmail-header-name
3471.451 (bastien1 13-Feb-08): '((t (:inherit font-lock-function-name-face)))
3481.451 (bastien1 13-Feb-08): "Face to use for highlighting the header names."
3491.451 (bastien1 13-Feb-08): :group 'rmail-headers
3501.451 (bastien1 13-Feb-08): :version "23.1")
3511.112 (rms 30-Jul-94):
3521.112 (rms 30-Jul-94): ;;;###autoload
3531.219 (rms 03-May-97): (defcustom rmail-delete-after-output nil "\
3541.219 (rms 03-May-97): *Non-nil means automatically delete a message that is copied to a file."
3551.219 (rms 03-May-97): :type 'boolean
3561.219 (rms 03-May-97): :group 'rmail-files)
3571.1 (roland 13-May-91):
3581.1 (roland 13-May-91): ;;;###autoload
3591.219 (rms 03-May-97): (defcustom rmail-primary-inbox-list nil "\
3601.40 (rms 29-Mar-93): *List of files which are inboxes for user's primary mail file `~/RMAIL'.
3611.370 (lektu 06-May-03): nil means the default, which is (\"/usr/spool/mail/$USER\")
3621.40 (rms 29-Mar-93): \(the name varies depending on the operating system,
3631.219 (rms 03-May-97): and the value of the environment variable MAIL overrides it)."
3641.223 (rms 15-May-97): ;; Don't use backquote here, because we don't want to need it
3651.223 (rms 15-May-97): ;; at load time.
3661.223 (rms 15-May-97): :type (list 'choice '(const :tag "Default" nil)
3671.285 (kwzh 04-Sep-98): (list 'repeat ':value (list (or (getenv "MAIL")
3681.285 (kwzh 04-Sep-98): (concat "/var/spool/mail/"
3691.285 (kwzh 04-Sep-98): (getenv "USER"))))
3701.223 (rms 15-May-97): 'file))
3711.219 (rms 03-May-97): :group 'rmail-retrieve
3721.219 (rms 03-May-97): :group 'rmail-files)
3731.219 (rms 03-May-97):
3741.219 (rms 03-May-97): ;;;###autoload
3751.219 (rms 03-May-97): (defcustom rmail-mail-new-frame nil
3761.390 (eliz 24-Apr-04): "*Non-nil means Rmail makes a new frame for composing outgoing mail.
3771.390 (eliz 24-Apr-04): This is handy if you want to preserve the window configuration of
3781.390 (eliz 24-Apr-04): the frame where you have the RMAIL buffer displayed."
3791.219 (rms 03-May-97): :type 'boolean
3801.219 (rms 03-May-97): :group 'rmail-reply)
3811.219 (rms 03-May-97):
3821.219 (rms 03-May-97): ;;;###autoload
3831.219 (rms 03-May-97): (defcustom rmail-secondary-file-directory "~/"
3841.219 (rms 03-May-97): "*Directory for additional secondary Rmail files."
3851.219 (rms 03-May-97): :type 'directory
3861.219 (rms 03-May-97): :group 'rmail-files)
3871.219 (rms 03-May-97): ;;;###autoload
3881.219 (rms 03-May-97): (defcustom rmail-secondary-file-regexp "\\.xmail$"
3891.219 (rms 03-May-97): "*Regexp for which files are secondary Rmail files."
3901.219 (rms 03-May-97): :type 'regexp
3911.219 (rms 03-May-97): :group 'rmail-files)
3921.91 (rms 18-Mar-94):
3931.161 (rms 10-Nov-95): ;;;###autoload
3941.322 (gerd 22-Nov-00): (defcustom rmail-confirm-expunge 'y-or-n-p
3951.313 (gerd 24-Mar-00): "*Whether and how to ask for confirmation before expunging deleted messages."
3961.313 (gerd 24-Mar-00): :type '(choice (const :tag "No confirmation" nil)
3971.313 (gerd 24-Mar-00): (const :tag "Confirm with y-or-n-p" y-or-n-p)
3981.313 (gerd 24-Mar-00): (const :tag "Confirm with yes-or-no-p" yes-or-no-p))
3991.313 (gerd 24-Mar-00): :version "21.1"
4001.313 (gerd 24-Mar-00): :group 'rmail-files)
4011.313 (gerd 24-Mar-00):
4021.313 (gerd 24-Mar-00): ;;;###autoload
4031.161 (rms 10-Nov-95): (defvar rmail-mode-hook nil
4041.161 (rms 10-Nov-95): "List of functions to call when Rmail is invoked.")
4051.161 (rms 10-Nov-95):
4061.161 (rms 10-Nov-95): ;;;###autoload
4071.161 (rms 10-Nov-95): (defvar rmail-get-new-mail-hook nil
4081.161 (rms 10-Nov-95): "List of functions to call when Rmail has retrieved new mail.")
4091.161 (rms 10-Nov-95):
4101.161 (rms 10-Nov-95): ;;;###autoload
4111.315 (fx 14-May-00): (defcustom rmail-show-message-hook nil
4121.315 (fx 14-May-00): "List of functions to call when Rmail displays a message."
4131.315 (fx 14-May-00): :type 'hook
4141.360 (rms 19-May-02): :options '(goto-address)
4151.315 (fx 14-May-00): :group 'rmail)
4161.161 (rms 10-Nov-95):
4171.161 (rms 10-Nov-95): ;;;###autoload
4181.312 (gerd 02-Mar-00): (defvar rmail-quit-hook nil
4191.312 (gerd 02-Mar-00): "List of functions to call when quitting out of Rmail.")
4201.312 (gerd 02-Mar-00):
4211.312 (gerd 02-Mar-00): ;;;###autoload
4221.161 (rms 10-Nov-95): (defvar rmail-delete-message-hook nil
4231.161 (rms 10-Nov-95): "List of functions to call when Rmail deletes a message.
4241.161 (rms 10-Nov-95): When the hooks are called, the message has been marked deleted but is
4251.161 (rms 10-Nov-95): still the current message in the Rmail buffer.")
4261.161 (rms 10-Nov-95):
4271.39 (rms 09-Mar-93): ;; These may be altered by site-init.el to match the format of mmdf files
4281.39 (rms 09-Mar-93): ;; delimiting used on a given host (delim1 and delim2 from the config
4291.39 (rms 09-Mar-93): ;; files).
4301.1 (roland 13-May-91):
4311.226 (rms 01-Jun-97): (defvar rmail-mmdf-delim1 "^\001\001\001\001\n"
4321.368 (jpw 06-Jan-03): "Regexp marking the start of an mmdf message.")
4331.226 (rms 01-Jun-97): (defvar rmail-mmdf-delim2 "^\001\001\001\001\n"
4341.368 (jpw 06-Jan-03): "Regexp marking the end of an mmdf message.")
4351.1 (roland 13-May-91):
4361.259 (kwzh 08-Apr-98): (defcustom rmail-message-filter nil
4371.193 (rms 06-Aug-96): "If non-nil, a filter function for new messages in RMAIL.
4381.193 (rms 06-Aug-96): Called with region narrowed to the message, including headers,
4391.259 (kwzh 08-Apr-98): before obeying `rmail-ignored-headers'."
4401.259 (kwzh 08-Apr-98): :group 'rmail-headers
4411.432 (jpw 24-Feb-07): :type '(choice (const nil) function))
4421.1 (roland 13-May-91):
4431.317 (fx 24-May-00): (defcustom rmail-automatic-folder-directives nil
4441.317 (fx 24-May-00): "List of directives specifying where to put a message.
4451.317 (fx 24-May-00): Each element of the list is of the form:
4461.317 (fx 24-May-00):
4471.317 (fx 24-May-00): (FOLDERNAME FIELD REGEXP [ FIELD REGEXP ] ... )
4481.317 (fx 24-May-00):
4491.317 (fx 24-May-00): Where FOLDERNAME is the name of a BABYL format folder to put the
4501.317 (fx 24-May-00): message. If any of the field regexp's are nil, then it is ignored.
4511.317 (fx 24-May-00):
4521.317 (fx 24-May-00): If FOLDERNAME is \"/dev/null\", it is deleted.
4531.317 (fx 24-May-00): If FOLDERNAME is nil then it is deleted, and skipped.
4541.317 (fx 24-May-00):
4551.317 (fx 24-May-00): FIELD is the plain text name of a field in the message, such as
4561.317 (fx 24-May-00): \"subject\" or \"from\". A FIELD of \"to\" will automatically include
4571.317 (fx 24-May-00): all text from the \"cc\" field as well.
4581.317 (fx 24-May-00):
4591.317 (fx 24-May-00): REGEXP is an expression to match in the preceeding specified FIELD.
4601.317 (fx 24-May-00): FIELD/REGEXP pairs continue in the list.
4611.317 (fx 24-May-00):
4621.317 (fx 24-May-00): examples:
4631.317 (fx 24-May-00): (\"/dev/null\" \"from\" \"@spam.com\") ; delete all mail from spam.com
4641.323 (gerd 27-Nov-00): (\"RMS\" \"from\" \"rms@\") ; save all mail from RMS."
4651.323 (gerd 27-Nov-00): :group 'rmail
4661.323 (gerd 27-Nov-00): :version "21.1"
4671.323 (gerd 27-Nov-00): :type '(repeat (sexp :tag "Directive")))
4681.358 (pot 06-May-02):
4691.39 (rms 09-Mar-93): (defvar rmail-reply-prefix "Re: "
4701.39 (rms 09-Mar-93): "String to prepend to Subject line when replying to a message.")
4711.39 (rms 09-Mar-93):
4721.211 (kwzh 23-Feb-97): ;; Some mailers use "Re(2):" or "Re^2:" or "Re: Re:" or "Re[2]:".
4731.422 (rms 18-Mar-06): ;; This pattern should catch all the common variants.
4741.422 (rms 18-Mar-06): ;; rms: I deleted the change to delete tags in square brackets
4751.422 (rms 18-Mar-06): ;; because they mess up RT tags.
4761.422 (rms 18-Mar-06): (defvar rmail-reply-regexp "\\`\\(Re\\(([0-9]+)\\|\\[[0-9]+\\]\\|\\^[0-9]+\\)?: *\\)*"
4771.193 (rms 06-Aug-96): "Regexp to delete from Subject line before inserting `rmail-reply-prefix'.")
4781.143 (kwzh 03-Feb-95):
4791.259 (kwzh 08-Apr-98): (defcustom rmail-display-summary nil
4801.259 (kwzh 08-Apr-98): "*If non-nil, Rmail always displays the summary buffer."
4811.259 (kwzh 08-Apr-98): :group 'rmail-summary
4821.259 (kwzh 08-Apr-98): :type 'boolean)
4831.259 (kwzh 08-Apr-98):
4841.259 (kwzh 08-Apr-98): (defvar rmail-inbox-list nil)
4851.259 (kwzh 08-Apr-98): (put 'rmail-inbox-list 'permanent-local t)
4861.1 (roland 13-May-91):
4871.1 (roland 13-May-91): (defvar rmail-keywords nil)
4881.259 (kwzh 08-Apr-98): (put 'rmail-keywords 'permanent-local t)
4891.1 (roland 13-May-91):
4901.234 (rms 24-Aug-97): (defvar rmail-buffer nil
4911.234 (rms 24-Aug-97): "The RMAIL buffer related to the current buffer.
4921.234 (rms 24-Aug-97): In an RMAIL buffer, this holds the RMAIL buffer itself.
4931.234 (rms 24-Aug-97): In a summary buffer, this holds the RMAIL buffer it is a summary for.")
4941.234 (rms 24-Aug-97): (put 'rmail-buffer 'permanent-local t)
4951.234 (rms 24-Aug-97):
4961.1 (roland 13-May-91): ;; Message counters and markers. Deleted flags.
4971.1 (roland 13-May-91):
4981.1 (roland 13-May-91): (defvar rmail-current-message nil)
4991.259 (kwzh 08-Apr-98): (put 'rmail-current-message 'permanent-local t)
5001.259 (kwzh 08-Apr-98):
5011.1 (roland 13-May-91): (defvar rmail-total-messages nil)
5021.259 (kwzh 08-Apr-98): (put 'rmail-total-messages 'permanent-local t)
5031.259 (kwzh 08-Apr-98):
5041.1 (roland 13-May-91): (defvar rmail-message-vector nil)
5051.259 (kwzh 08-Apr-98): (put 'rmail-message-vector 'permanent-local t)
5061.259 (kwzh 08-Apr-98):
5071.1 (roland 13-May-91): (defvar rmail-deleted-vector nil)
5081.259 (kwzh 08-Apr-98): (put 'rmail-deleted-vector 'permanent-local t)
5091.259 (kwzh 08-Apr-98):
5101.218 (rms 02-May-97): (defvar rmail-msgref-vector nil
5111.218 (rms 02-May-97): "In an Rmail buffer, a vector whose Nth element is a list (N).
5121.218 (rms 02-May-97): When expunging renumbers messages, these lists are modified
5131.218 (rms 02-May-97): by substituting the new message number into the existing list.")
5141.259 (kwzh 08-Apr-98): (put 'rmail-msgref-vector 'permanent-local t)
5151.1 (roland 13-May-91):
5161.98 (rms 24-Apr-94): (defvar rmail-overlay-list nil)
5171.259 (kwzh 08-Apr-98): (put 'rmail-overlay-list 'permanent-local t)
5181.132 (rms 07-Oct-94):
5191.1 (roland 13-May-91): ;; These are used by autoloaded rmail-summary.
5201.1 (roland 13-May-91):
5211.1 (roland 13-May-91): (defvar rmail-summary-buffer nil)
5221.234 (rms 24-Aug-97): (put 'rmail-summary-buffer 'permanent-local t)
5231.1 (roland 13-May-91): (defvar rmail-summary-vector nil)
5241.234 (rms 24-Aug-97): (put 'rmail-summary-vector 'permanent-local t)
5251.1 (roland 13-May-91):
5261.259 (kwzh 08-Apr-98): (defvar rmail-view-buffer nil
5271.259 (kwzh 08-Apr-98): "Buffer which holds RMAIL message for MIME displaying.")
5281.259 (kwzh 08-Apr-98): (put 'rmail-view-buffer 'permanent-local t)
5291.259 (kwzh 08-Apr-98):
5301.1 (roland 13-May-91): ;; `Sticky' default variables.
5311.1 (roland 13-May-91):
5321.1 (roland 13-May-91): ;; Last individual label specified to a or k.
5331.1 (roland 13-May-91): (defvar rmail-last-label nil)
5341.259 (kwzh 08-Apr-98): (put 'rmail-last-label 'permanent-local t)
5351.259 (kwzh 08-Apr-98):
5361.39 (rms 09-Mar-93): ;; Last set of values specified to C-M-n, C-M-p, C-M-s or C-M-l.
5371.1 (roland 13-May-91): (defvar rmail-last-multi-labels nil)
5381.259 (kwzh 08-Apr-98):
5391.39 (rms 09-Mar-93): (defvar rmail-last-regexp nil)
5401.259 (kwzh 08-Apr-98): (put 'rmail-last-regexp 'permanent-local t)
5411.259 (kwzh 08-Apr-98):
5421.219 (rms 03-May-97): (defcustom rmail-default-file "~/xmail"
5431.219 (rms 03-May-97): "*Default file name for \\[rmail-output]."
5441.219 (rms 03-May-97): :type 'file
5451.219 (rms 03-May-97): :group 'rmail-files)
5461.219 (rms 03-May-97): (defcustom rmail-default-rmail-file "~/XMAIL"
5471.219 (rms 03-May-97): "*Default file name for \\[rmail-output-to-rmail-file]."
5481.219 (rms 03-May-97): :type 'file
5491.219 (rms 03-May-97): :group 'rmail-files)
5501.270 (rms 23-May-98): (defcustom rmail-default-body-file "~/mailout"
5511.270 (rms 23-May-98): "*Default file name for \\[rmail-output-body-to-file]."
5521.270 (rms 23-May-98): :type 'file
5531.270 (rms 23-May-98): :group 'rmail-files
5541.270 (rms 23-May-98): :version "20.3")
5551.10 (jimb 19-Apr-92):
5561.259 (kwzh 08-Apr-98): ;; Mule and MIME related variables.
5571.259 (kwzh 08-Apr-98):
5581.259 (kwzh 08-Apr-98): ;;;###autoload
5591.259 (kwzh 08-Apr-98): (defvar rmail-file-coding-system nil
5601.259 (kwzh 08-Apr-98): "Coding system used in RMAIL file.
5611.259 (kwzh 08-Apr-98):
5621.259 (kwzh 08-Apr-98): This is set to nil by default.")
5631.259 (kwzh 08-Apr-98):
5641.259 (kwzh 08-Apr-98): ;;;###autoload
5651.259 (kwzh 08-Apr-98): (defcustom rmail-enable-mime nil
5661.259 (kwzh 08-Apr-98): "*If non-nil, RMAIL uses MIME feature.
5671.259 (kwzh 08-Apr-98): If the value is t, RMAIL automatically shows MIME decoded message.
5681.259 (kwzh 08-Apr-98): If the value is neither t nor nil, RMAIL does not show MIME decoded message
5691.419 (handa 19-Jan-06): until a user explicitly requires it.
5701.419 (handa 19-Jan-06):
5711.419 (handa 19-Jan-06): Even if the value is non-nil, you can't use MIME feature
5721.419 (handa 19-Jan-06): if the feature specified by `rmail-mime-feature' is not available
5731.419 (handa 19-Jan-06): in your session."
5741.259 (kwzh 08-Apr-98): :type '(choice (const :tag "on" t)
5751.259 (kwzh 08-Apr-98): (const :tag "off" nil)
5761.278 (schwab 24-Jun-98): (other :tag "when asked" ask))
5771.259 (kwzh 08-Apr-98): :group 'rmail)
5781.259 (kwzh 08-Apr-98):
5791.350 (zsh 25-Nov-01): (defvar rmail-enable-mime-composing nil
5801.350 (zsh 25-Nov-01): "*If non-nil, RMAIL uses `rmail-insert-mime-forwarded-message-function' to forward.")
5811.350 (zsh 25-Nov-01):
5821.259 (kwzh 08-Apr-98): ;;;###autoload
5831.259 (kwzh 08-Apr-98): (defvar rmail-show-mime-function nil
5841.339 (gerd 08-May-01): "Function to show MIME decoded message of RMAIL file.
5851.339 (gerd 08-May-01): This function is called when `rmail-enable-mime' is non-nil.
5861.339 (gerd 08-May-01): It is called with no argument.")
5871.339 (gerd 08-May-01):
5881.339 (gerd 08-May-01): ;;;###autoload
5891.339 (gerd 08-May-01): (defvar rmail-insert-mime-forwarded-message-function nil
5901.339 (gerd 08-May-01): "Function to insert a message in MIME format so it can be forwarded.
5911.358 (pot 06-May-02): This function is called if `rmail-enable-mime' or
5921.350 (zsh 25-Nov-01): `rmail-enable-mime-composing' is non-nil.
5931.339 (gerd 08-May-01): It is called with one argument FORWARD-BUFFER, which is a
5941.339 (gerd 08-May-01): buffer containing the message to forward. The current buffer
5951.339 (gerd 08-May-01): is the outgoing mail buffer.")
5961.339 (gerd 08-May-01):
5971.339 (gerd 08-May-01): ;;;###autoload
5981.342 (gerd 31-May-01): (defvar rmail-insert-mime-resent-message-function nil
5991.342 (gerd 31-May-01): "Function to insert a message in MIME format so it can be resent.
6001.342 (gerd 31-May-01): This function is called if `rmail-enable-mime' is non-nil.
6011.342 (gerd 31-May-01): It is called with one argument FORWARD-BUFFER, which is a
6021.342 (gerd 31-May-01): buffer containing the message to forward. The current buffer
6031.342 (gerd 31-May-01): is the outgoing mail buffer.")
6041.342 (gerd 31-May-01):
6051.342 (gerd 31-May-01): ;;;###autoload
6061.339 (gerd 08-May-01): (defvar rmail-search-mime-message-function nil
6071.339 (gerd 08-May-01): "Function to check if a regexp matches a MIME message.
6081.339 (gerd 08-May-01): This function is called if `rmail-enable-mime' is non-nil.
6091.339 (gerd 08-May-01): It is called with two arguments MSG and REGEXP, where
6101.339 (gerd 08-May-01): MSG is the message number, REGEXP is the regular expression.")
6111.339 (gerd 08-May-01):
6121.339 (gerd 08-May-01): ;;;###autoload
6131.339 (gerd 08-May-01): (defvar rmail-search-mime-header-function nil
6141.339 (gerd 08-May-01): "Function to check if a regexp matches a header of MIME message.
6151.339 (gerd 08-May-01): This function is called if `rmail-enable-mime' is non-nil.
6161.362 (rms 17-Aug-02): It is called with three arguments MSG, REGEXP, and LIMIT, where
6171.339 (gerd 08-May-01): MSG is the message number,
6181.339 (gerd 08-May-01): REGEXP is the regular expression,
6191.339 (gerd 08-May-01): LIMIT is the position specifying the end of header.")
6201.259 (kwzh 08-Apr-98):
6211.259 (kwzh 08-Apr-98): ;;;###autoload
6221.259 (kwzh 08-Apr-98): (defvar rmail-mime-feature 'rmail-mime
6231.267 (rms 19-May-98): "Feature to require to load MIME support in Rmail.
6241.267 (rms 19-May-98): When starting Rmail, if `rmail-enable-mime' is non-nil,
6251.419 (handa 19-Jan-06): this feature is required with `require'.
6261.419 (handa 19-Jan-06):
6271.419 (handa 19-Jan-06): The default value is `rmail-mime'. This feature is provided by
6281.419 (handa 19-Jan-06): the rmail-mime package available at <http://www.m17n.org/rmail-mime/>.")
6291.295 (rms 28-Jan-99):
6301.295 (rms 28-Jan-99): ;;;###autoload
6311.295 (rms 28-Jan-99): (defvar rmail-decode-mime-charset t
6321.295 (rms 28-Jan-99): "*Non-nil means a message is decoded by MIME's charset specification.
6331.295 (rms 28-Jan-99): If this variable is nil, or the message has not MIME specification,
6341.295 (rms 28-Jan-99): the message is decoded as normal way.
6351.295 (rms 28-Jan-99):
6361.295 (rms 28-Jan-99): If the variable `rmail-enable-mime' is non-nil, this variables is
6371.295 (rms 28-Jan-99): ignored, and all the decoding work is done by a feature specified by
6381.295 (rms 28-Jan-99): the variable `rmail-mime-feature'.")
6391.295 (rms 28-Jan-99):
6401.295 (rms 28-Jan-99): ;;;###autoload
6411.295 (rms 28-Jan-99): (defvar rmail-mime-charset-pattern
6421.429 (eliz 07-Oct-06): (concat "^content-type:[ \t]*text/plain;"
6431.426 (eliz 20-May-06): "\\(?:[ \t\n]*\\(?:format\\|delsp\\)=\"?[-a-z0-9]+\"?;\\)*"
6441.424 (rms 10-Apr-06): "[ \t\n]*charset=\"?\\([^ \t\n\";]+\\)\"?")
6451.295 (rms 28-Jan-99): "Regexp to match MIME-charset specification in a header of message.
6461.295 (rms 28-Jan-99): The first parenthesized expression should match the MIME-charset name.")
6471.295 (rms 28-Jan-99):
6481.259 (kwzh 08-Apr-98):
6491.11 (jimb 24-Apr-92): ;;; Regexp matching the delimiter of messages in UNIX mail format
6501.11 (jimb 24-Apr-92): ;;; (UNIX From lines), minus the initial ^. Note that if you change
6511.11 (jimb 24-Apr-92): ;;; this expression, you must change the code in rmail-nuke-pinhead-header
6521.11 (jimb 24-Apr-92): ;;; that knows the exact ordering of the \\( \\) subexpressions.
6531.10 (jimb 19-Apr-92): (defvar rmail-unix-mail-delimiter
6541.24 (jimb 13-Sep-92): (let ((time-zone-regexp
6551.158 (rms 30-Jul-95): (concat "\\([A-Z]?[A-Z]?[A-Z][A-Z]\\( DST\\)?"
6561.24 (jimb 13-Sep-92): "\\|[-+]?[0-9][0-9][0-9][0-9]"
6571.24 (jimb 13-Sep-92): "\\|"
6581.24 (jimb 13-Sep-92): "\\) *")))
6591.24 (jimb 13-Sep-92): (concat
6601.24 (jimb 13-Sep-92): "From "
6611.24 (jimb 13-Sep-92):
6621.188 (rms 28-Jun-96): ;; Many things can happen to an RFC 822 mailbox before it is put into
6631.188 (rms 28-Jun-96): ;; a `From' line. The leading phrase can be stripped, e.g.
6641.188 (rms 28-Jun-96): ;; `Joe <@w.x:joe@y.z>' -> `<@w.x:joe@y.z>'. The <> can be stripped, e.g.
6651.188 (rms 28-Jun-96): ;; `<@x.y:joe@y.z>' -> `@x.y:joe@y.z'. Everything starting with a CRLF
6661.188 (rms 28-Jun-96): ;; can be removed, e.g.
6671.188 (rms 28-Jun-96): ;; From: joe@y.z (Joe K
6681.188 (rms 28-Jun-96): ;; User)
6691.188 (rms 28-Jun-96): ;; can yield `From joe@y.z (Joe K Fri Mar 22 08:11:15 1996', and
6701.188 (rms 28-Jun-96): ;; From: Joe User
6711.188 (rms 28-Jun-96): ;; <joe@y.z>
6721.188 (rms 28-Jun-96): ;; can yield `From Joe User Fri Mar 22 08:11:15 1996'.
6731.192 (eggert 03-Aug-96): ;; The mailbox can be removed or be replaced by white space, e.g.
6741.192 (eggert 03-Aug-96): ;; From: "Joe User"{space}{tab}
6751.192 (eggert 03-Aug-96): ;; <joe@y.z>
6761.192 (eggert 03-Aug-96): ;; can yield `From {space}{tab} Fri Mar 22 08:11:15 1996',
6771.192 (eggert 03-Aug-96): ;; where {space} and {tab} represent the Ascii space and tab characters.
6781.188 (rms 28-Jun-96): ;; We want to match the results of any of these manglings.
6791.188 (rms 28-Jun-96): ;; The following regexp rejects names whose first characters are
6801.188 (rms 28-Jun-96): ;; obviously bogus, but after that anything goes.
6811.192 (eggert 03-Aug-96): "\\([^\0-\b\n-\r\^?].*\\)? "
6821.24 (jimb 13-Sep-92):
6831.24 (jimb 13-Sep-92): ;; The time the message was sent.
6841.188 (rms 28-Jun-96): "\\([^\0-\r \^?]+\\) +" ; day of the week
6851.188 (rms 28-Jun-96): "\\([^\0-\r \^?]+\\) +" ; month
6861.188 (rms 28-Jun-96): "\\([0-3]?[0-9]\\) +" ; day of month
6871.188 (rms 28-Jun-96): "\\([0-2][0-9]:[0-5][0-9]\\(:[0-6][0-9]\\)?\\) *" ; time of day
6881.24 (jimb 13-Sep-92):
6891.24 (jimb 13-Sep-92): ;; Perhaps a time zone, specified by an abbreviation, or by a
6901.24 (jimb 13-Sep-92): ;; numeric offset.
6911.24 (jimb 13-Sep-92): time-zone-regexp
6921.24 (jimb 13-Sep-92):
6931.24 (jimb 13-Sep-92): ;; The year.
6941.188 (rms 28-Jun-96): " \\([0-9][0-9]+\\) *"
6951.24 (jimb 13-Sep-92):
6961.24 (jimb 13-Sep-92): ;; On some systems the time zone can appear after the year, too.
6971.24 (jimb 13-Sep-92): time-zone-regexp
6981.24 (jimb 13-Sep-92):
6991.96 (kwzh 23-Apr-94): ;; Old uucp cruft.
7001.96 (kwzh 23-Apr-94): "\\(remote from .*\\)?"
7011.24 (jimb 13-Sep-92):
7021.24 (jimb 13-Sep-92): "\n"))
7031.24 (jimb 13-Sep-92): nil)
7041.24 (jimb 13-Sep-92):
7051.450 (bastien1 12-Feb-08): (defvar rmail-font-lock-keywords
7061.367 (rms 06-Jan-03): ;; These are all matched case-insensitively.
7071.450 (bastien1 12-Feb-08): (eval-when-compile
7081.259 (kwzh 08-Apr-98): (let* ((cite-chars "[>|}]")
7091.367 (rms 06-Jan-03): (cite-prefix "a-z")
7101.259 (kwzh 08-Apr-98): (cite-suffix (concat cite-prefix "0-9_.@-`'\"")))
7111.367 (rms 06-Jan-03): (list '("^\\(From\\|Sender\\|Resent-From\\):"
7121.451 (bastien1 13-Feb-08): . 'rmail-header-name)
7131.451 (bastien1 13-Feb-08): '("^Reply-To:.*$" . 'rmail-header-name)
7141.451 (bastien1 13-Feb-08): '("^Subject:" . 'rmail-header-name)
7151.451 (bastien1 13-Feb-08): '("^X-Spam-Status:" . 'rmail-header-name)
7161.259 (kwzh 08-Apr-98): '("^\\(To\\|Apparently-To\\|Cc\\|Newsgroups\\):"
7171.451 (bastien1 13-Feb-08): . 'rmail-header-name)
7181.259 (kwzh 08-Apr-98): ;; Use MATCH-ANCHORED to effectively anchor the regexp left side.
7191.259 (kwzh 08-Apr-98): `(,cite-chars
7201.259 (kwzh 08-Apr-98): (,(concat "\\=[ \t]*"
7211.401 (rms 24-Apr-05): "\\(\\(\\([" cite-prefix "]+[" cite-suffix "]*\\)?"
7221.401 (rms 24-Apr-05): "\\(" cite-chars "[ \t]*\\)\\)+\\)"
7231.259 (kwzh 08-Apr-98): "\\(.*\\)")
7241.259 (kwzh 08-Apr-98): (beginning-of-line) (end-of-line)
7251.401 (rms 24-Apr-05): (1 font-lock-comment-delimiter-face nil t)
7261.401 (rms 24-Apr-05): (5 font-lock-comment-face nil t)))
7271.367 (rms 06-Jan-03): '("^\\(X-[a-z0-9-]+\\|In-reply-to\\|Date\\):.*\\(\n[ \t]+.*\\)*$"
7281.451 (bastien1 13-Feb-08): . 'rmail-header-name))))
7291.450 (bastien1 12-Feb-08): "Additional expressions to highlight in Rmail mode.")
7301.259 (kwzh 08-Apr-98):
7311.39 (rms 09-Mar-93): ;; Perform BODY in the summary buffer
7321.39 (rms 09-Mar-93): ;; in such a way that its cursor is properly updated in its own window.
7331.39 (rms 09-Mar-93): (defmacro rmail-select-summary (&rest body)
7341.309 (gerd 15-Nov-99): `(let ((total rmail-total-messages))
7351.309 (gerd 15-Nov-99): (if (rmail-summary-displayed)
7361.309 (gerd 15-Nov-99): (let ((window (selected-window)))
7371.309 (gerd 15-Nov-99): (save-excursion
7381.309 (gerd 15-Nov-99): (unwind-protect
7391.309 (gerd 15-Nov-99): (progn
7401.309 (gerd 15-Nov-99): (pop-to-buffer rmail-summary-buffer)
7411.309 (gerd 15-Nov-99): ;; rmail-total-messages is a buffer-local var
7421.309 (gerd 15-Nov-99): ;; in the rmail buffer.
7431.309 (gerd 15-Nov-99): ;; This way we make it available for the body
7441.309 (gerd 15-Nov-99): ;; even tho the rmail buffer is not current.
7451.309 (gerd 15-Nov-99): (let ((rmail-total-messages total))
7461.309 (gerd 15-Nov-99): ,@body))
7471.309 (gerd 15-Nov-99): (select-window window))))
7481.309 (gerd 15-Nov-99): (save-excursion
7491.309 (gerd 15-Nov-99): (set-buffer rmail-summary-buffer)
7501.309 (gerd 15-Nov-99): (let ((rmail-total-messages total))
7511.309 (gerd 15-Nov-99): ,@body)))
7521.309 (gerd 15-Nov-99): (rmail-maybe-display-summary)))
7531.1 (roland 13-May-91):
7541.1 (roland 13-May-91): ;;;; *** Rmail Mode ***
7551.1 (roland 13-May-91):
7561.340 (gerd 17-May-01): ;; This variable is dynamically bound. The defvar is here to placate
7571.340 (gerd 17-May-01): ;; the byte compiler.
7581.340 (gerd 17-May-01):
7591.247 (handa 20-Feb-98): (defvar rmail-enable-multibyte nil)
7601.247 (handa 20-Feb-98):
7611.340 (gerd 17-May-01):
7621.340 (gerd 17-May-01): (defun rmail-require-mime-maybe ()
7631.340 (gerd 17-May-01): "Require `rmail-mime-feature' if that is non-nil.
7641.340 (gerd 17-May-01): Signal an error and set `rmail-mime-feature' to nil if the feature
7651.340 (gerd 17-May-01): isn't provided."
7661.340 (gerd 17-May-01): (when rmail-enable-mime
7671.340 (gerd 17-May-01): (condition-case err
7681.340 (gerd 17-May-01): (require rmail-mime-feature)
7691.340 (gerd 17-May-01): (error
7701.419 (handa 19-Jan-06): (display-warning
7711.419 (handa 19-Jan-06): :warning
7721.419 (handa 19-Jan-06): (format "Although MIME support is requested
7731.419 (handa 19-Jan-06): by setting `rmail-enable-mime' to non-nil, the required feature
7741.419 (handa 19-Jan-06): `%s' (the value of `rmail-mime-feature')
7751.419 (handa 19-Jan-06): is not available in the current session.
7761.419 (handa 19-Jan-06): So, the MIME support is turned off for the moment."
7771.419 (handa 19-Jan-06): rmail-mime-feature))
7781.340 (gerd 17-May-01): (setq rmail-enable-mime nil)))))
7791.340 (gerd 17-May-01):
7801.340 (gerd 17-May-01):
7811.1 (roland 13-May-91): ;;;###autoload
7821.1 (roland 13-May-91): (defun rmail (&optional file-name-arg)
7831.1 (roland 13-May-91): "Read and edit incoming mail.
7841.68 (rms 09-Oct-93): Moves messages into file named by `rmail-file-name' (a babyl format file)
7851.1 (roland 13-May-91): and edits that file in RMAIL Mode.
7861.1 (roland 13-May-91): Type \\[describe-mode] once editing that file, for a list of RMAIL commands.
7871.1 (roland 13-May-91):
7881.73 (rms 23-Dec-93): May be called with file name as argument; then performs rmail editing on
7891.73 (rms 23-Dec-93): that file, but does not copy any new mail into the file.
7901.73 (rms 23-Dec-93): Interactively, if you supply a prefix argument, then you
7911.113 (rms 30-Jul-94): have a chance to specify a file name with the minibuffer.
7921.113 (rms 30-Jul-94):
7931.113 (rms 30-Jul-94): If `rmail-display-summary' is non-nil, make a summary for this RMAIL file."
7941.1 (roland 13-May-91): (interactive (if current-prefix-arg
7951.165 (rms 23-Dec-95): (list (read-file-name "Run rmail on RMAIL file: "))))
7961.340 (gerd 17-May-01): (rmail-require-mime-maybe)
7971.1 (roland 13-May-91): (let* ((file-name (expand-file-name (or file-name-arg rmail-file-name)))
7981.354 (eliz 03-Feb-02): ;; Use find-buffer-visiting, not get-file-buffer, for those users
7991.354 (eliz 03-Feb-02): ;; who have find-file-visit-truename set to t.
8001.354 (eliz 03-Feb-02): (existed (find-buffer-visiting file-name))
8011.349 (eliz 16-Sep-01): ;; This binding is necessary because we must decide if we
8021.248 (handa 20-Feb-98): ;; need code conversion while the buffer is unibyte
8031.248 (handa 20-Feb-98): ;; (i.e. enable-multibyte-characters is nil).
8041.280 (rms 09-Jul-98): (rmail-enable-multibyte
8051.358 (pot 06-May-02): (if existed
8061.280 (rms 09-Jul-98): (with-current-buffer existed enable-multibyte-characters)
8071.280 (rms 09-Jul-98): (default-value 'enable-multibyte-characters)))
8081.247 (handa 20-Feb-98): ;; Since the file may contain messages of different encodings
8091.247 (handa 20-Feb-98): ;; at the tail (non-BYBYL part), we can't decode them at once
8101.247 (handa 20-Feb-98): ;; on reading. So, at first, we read the file without text
8111.247 (handa 20-Feb-98): ;; code conversion, then decode the messages one by one by
8121.247 (handa 20-Feb-98): ;; rmail-decode-babyl-format or
8131.247 (handa 20-Feb-98): ;; rmail-convert-to-babyl-format.
8141.247 (handa 20-Feb-98): (coding-system-for-read (and rmail-enable-multibyte 'raw-text))
8151.237 (kwzh 15-Oct-97): run-mail-hook msg-shown)
8161.1 (roland 13-May-91): ;; Like find-file, but in the case where a buffer existed
8171.1 (roland 13-May-91): ;; and the file was reverted, recompute the message-data.
8181.263 (rms 22-Apr-98): ;; We used to bind enable-local-variables to nil here,
8191.263 (rms 22-Apr-98): ;; but that should not be needed now that rmail-mode
8201.263 (rms 22-Apr-98): ;; sets it locally to nil.
8211.263 (rms 22-Apr-98): ;; (Binding a variable locally with let is not safe if it has
8221.263 (rms 22-Apr-98): ;; buffer-local bindings.)
8231.1 (roland 13-May-91): (if (and existed (not (verify-visited-file-modtime existed)))
8241.1 (roland 13-May-91): (progn
8251.263 (rms 22-Apr-98): (find-file file-name)
8261.39 (rms 09-Mar-93): (if (and (verify-visited-file-modtime existed)
8271.39 (rms 09-Mar-93): (eq major-mode 'rmail-mode))
8281.1 (roland 13-May-91): (progn (rmail-forget-messages)
8291.1 (roland 13-May-91): (rmail-set-message-counters))))
8301.358 (pot 06-May-02): (switch-to-buffer
8311.276 (rms 13-Jun-98): (let ((enable-local-variables nil))
8321.276 (rms 13-Jun-98): (find-file-noselect file-name))))
8331.39 (rms 09-Mar-93): (if (eq major-mode 'rmail-edit-mode)
8341.243 (rms 19-Jan-98): (error "Exit Rmail Edit mode before getting new mail"))
8351.1 (roland 13-May-91): (if (and existed (> (buffer-size) 0))
8361.1 (roland 13-May-91): ;; Buffer not new and not empty; ensure in proper mode, but that's all.
8371.1 (roland 13-May-91): (or (eq major-mode 'rmail-mode)
8381.200 (rms 12-Oct-96): (progn (rmail-mode-2)
8391.200 (rms 12-Oct-96): (setq run-mail-hook t)))
8401.200 (rms 12-Oct-96): (setq run-mail-hook t)
8411.1 (roland 13-May-91): (rmail-mode-2)
8421.1 (roland 13-May-91): ;; Convert all or part to Babyl file if possible.
8431.1 (roland 13-May-91): (rmail-convert-file)
8441.274 (rms 06-Jun-98): (goto-char (point-max)))
8451.277 (rms 15-Jun-98): ;; As we have read a file by raw-text, the buffer is set to
8461.277 (rms 15-Jun-98): ;; unibyte. We must make it multibyte if necessary.
8471.277 (rms 15-Jun-98): (if (and rmail-enable-multibyte
8481.277 (rms 15-Jun-98): (not enable-multibyte-characters))
8491.277 (rms 15-Jun-98): (set-buffer-multibyte t))
8501.275 (rms 11-Jun-98): ;; If necessary, scan to find all the messages.
8511.275 (rms 11-Jun-98): (rmail-maybe-set-message-counters)
8521.242 (kwzh 18-Jan-98): (unwind-protect
8531.274 (rms 06-Jun-98): (unless (and (not file-name-arg)
8541.274 (rms 06-Jun-98): (rmail-get-new-mail))
8551.274 (rms 06-Jun-98): (rmail-show-message (rmail-first-unseen-message)))
8561.242 (kwzh 18-Jan-98): (progn
8571.242 (kwzh 18-Jan-98): (if rmail-display-summary (rmail-summary))
8581.242 (kwzh 18-Jan-98): (rmail-construct-io-menu)
8591.242 (kwzh 18-Jan-98): (if run-mail-hook
8601.242 (kwzh 18-Jan-98): (run-hooks 'rmail-mode-hook))))))
8611.1 (roland 13-May-91):
8621.1 (roland 13-May-91): ;; Given the value of MAILPATH, return a list of inbox file names.
8631.1 (roland 13-May-91): ;; This is turned off because it is not clear that the user wants
8641.1 (roland 13-May-91): ;; all these inboxes to feed into the primary rmail file.
8651.1 (roland 13-May-91): ; (defun rmail-convert-mailpath (string)
8661.1 (roland 13-May-91): ; (let (idx list)
8671.1 (roland 13-May-91): ; (while (setq idx (string-match "[%:]" string))
8681.1 (roland 13-May-91): ; (let ((this (substring string 0 idx)))
8691.1 (roland 13-May-91): ; (setq string (substring string (1+ idx)))
8701.1 (roland 13-May-91): ; (setq list (cons (if (string-match "%" this)
8711.1 (roland 13-May-91): ; (substring this 0 (string-match "%" this))
8721.1 (roland 13-May-91): ; this)
8731.1 (roland 13-May-91): ; list))))
8741.1 (roland 13-May-91): ; list))
8751.1 (roland 13-May-91):
8761.1 (roland 13-May-91): ; I have checked that adding "-*- rmail -*-" to the BABYL OPTIONS line
8771.1 (roland 13-May-91): ; will not cause emacs 18.55 problems.
8781.1 (roland 13-May-91):
8791.265 (rms 12-May-98): ;; This calls rmail-decode-babyl-format if the file is already Babyl.
8801.265 (rms 12-May-98):
8811.1 (roland 13-May-91): (defun rmail-convert-file ()
8821.1 (roland 13-May-91): (let (convert)
8831.1 (roland 13-May-91): (widen)
8841.1 (roland 13-May-91): (goto-char (point-min))
8851.1 (roland 13-May-91): ;; If file doesn't start like a Babyl file,
8861.1 (roland 13-May-91): ;; convert it to one, by adding a header and converting each message.
8871.1 (roland 13-May-91): (cond ((looking-at "BABYL OPTIONS:"))
8881.1 (roland 13-May-91): ((looking-at "Version: 5\n")
8891.1 (roland 13-May-91): ;; Losing babyl file made by old version of Rmail.
8901.1 (roland 13-May-91): ;; Just fix the babyl file header; don't make a new one,
8911.1 (roland 13-May-91): ;; so we don't lose the Labels: file attribute, etc.
8921.1 (roland 13-May-91): (let ((buffer-read-only nil))
8931.1 (roland 13-May-91): (insert "BABYL OPTIONS: -*- rmail -*-\n")))
8941.66 (bfox 21-Sep-93): ((equal (point-min) (point-max))
8951.66 (bfox 21-Sep-93): ;; Empty RMAIL file. Just insert the header.
8961.66 (bfox 21-Sep-93): (rmail-insert-rmail-file-header))
8971.1 (roland 13-May-91): (t
8981.66 (bfox 21-Sep-93): ;; Non-empty file in non-RMAIL format. Add header and convert.
8991.1 (roland 13-May-91): (setq convert t)
9001.1 (roland 13-May-91): (rmail-insert-rmail-file-header)))
9011.1 (roland 13-May-91): ;; If file was not a Babyl file or if there are
9021.1 (roland 13-May-91): ;; Unix format messages added at the end,
9031.1 (roland 13-May-91): ;; convert file as necessary.
9041.1 (roland 13-May-91): (if (or convert
9051.63 (rms 07-Sep-93): (save-excursion
9061.63 (rms 07-Sep-93): (goto-char (point-max))
9071.159 (rms 12-Aug-95): (search-backward "\n\^_")
9081.159 (rms 12-Aug-95): (forward-char 2)
9091.63 (rms 07-Sep-93): (looking-at "\n*From ")))
9101.1 (roland 13-May-91): (let ((buffer-read-only nil))
9111.1 (roland 13-May-91): (message "Converting to Babyl format...")
9121.63 (rms 07-Sep-93): ;; If file needs conversion, convert it all,
9131.63 (rms 07-Sep-93): ;; except for the BABYL header.
9141.63 (rms 07-Sep-93): ;; (rmail-convert-to-babyl-format would delete the header.)
9151.63 (rms 07-Sep-93): (goto-char (point-min))
9161.63 (rms 07-Sep-93): (search-forward "\n\^_" nil t)
9171.64 (rms 11-Sep-93): (narrow-to-region (point) (point-max))
9181.1 (roland 13-May-91): (rmail-convert-to-babyl-format)
9191.247 (handa 20-Feb-98): (message "Converting to Babyl format...done"))
9201.247 (handa 20-Feb-98): (if (and (not rmail-enable-mime)
9211.247 (handa 20-Feb-98): rmail-enable-multibyte)
9221.247 (handa 20-Feb-98): ;; We still have to decode BABYL part.
9231.247 (handa 20-Feb-98): (rmail-decode-babyl-format)))))
9241.1 (roland 13-May-91):
9251.1 (roland 13-May-91): (defun rmail-insert-rmail-file-header ()
9261.1 (roland 13-May-91): (let ((buffer-read-only nil))
9271.265 (rms 12-May-98): ;; -*-rmail-*- is here so that visiting the file normally
9281.265 (rms 12-May-98): ;; recognizes it as an Rmail file.
9291.1 (roland 13-May-91): (insert "BABYL OPTIONS: -*- rmail -*-
9301.1 (roland 13-May-91): Version: 5
9311.1 (roland 13-May-91): Labels:
9321.1 (roland 13-May-91): Note: This is the header of an rmail file.
9331.1 (roland 13-May-91): Note: If you are seeing it in rmail,
9341.1 (roland 13-May-91): Note: it means the file has no messages in it.\n\^_")))
9351.1 (roland 13-May-91):
9361.361 (lektu 02-Jul-02): ;; Decode Babyl formatted part at the head of current buffer by
9371.247 (handa 20-Feb-98): ;; rmail-file-coding-system, or if it is nil, do auto conversion.
9381.212 (handa 26-Feb-97):
9391.212 (handa 26-Feb-97): (defun rmail-decode-babyl-format ()
9401.212 (handa 26-Feb-97): (let ((modifiedp (buffer-modified-p))
9411.212 (handa 26-Feb-97): (buffer-read-only nil)
9421.265 (rms 12-May-98): (coding-system rmail-file-coding-system)
9431.247 (handa 20-Feb-98): from to)
9441.212 (handa 26-Feb-97): (goto-char (point-min))
9451.265 (rms 12-May-98): (search-forward "\n\^_" nil t) ; Skip BABYL header.
9461.247 (handa 20-Feb-98): (setq from (point))
9471.247 (handa 20-Feb-98): (goto-char (point-max))
9481.247 (handa 20-Feb-98): (search-backward "\n\^_" from 'mv)
9491.247 (handa 20-Feb-98): (setq to (point))
9501.265 (rms 12-May-98): (unless (and coding-system
9511.265 (rms 12-May-98): (coding-system-p coding-system))
9521.349 (eliz 16-Sep-01): (setq coding-system
9531.447 (miles 01-Feb-08): ;; If rmail-file-coding-system is nil, Emacs 21 writes
9541.447 (miles 01-Feb-08): ;; RMAIL files in emacs-mule, Emacs 22 in utf-8, but
9551.447 (miles 01-Feb-08): ;; earlier versions did that with the current buffer's
9561.447 (miles 01-Feb-08): ;; encoding. So we want to favor detection of emacs-mule
9571.447 (miles 01-Feb-08): ;; (whose normal priority is quite low) and utf-8, but
9581.447 (miles 01-Feb-08): ;; still allow detection of other encodings if they won't
9591.447 (miles 01-Feb-08): ;; fit. The call to with-coding-priority below achieves
9601.447 (miles 01-Feb-08): ;; that.
9611.447 (miles 01-Feb-08): (with-coding-priority '(emacs-mule utf-8)
9621.447 (miles 01-Feb-08): (detect-coding-region from to 'highest))))
9631.447 (miles 01-Feb-08): (unless (eq (coding-system-type coding-system) 'undecided)
9641.303 (rms 07-Apr-99): (set-buffer-modified-p t) ; avoid locking when decoding
9651.352 (rms 11-Jan-02): (let ((buffer-undo-list t))
9661.352 (rms 11-Jan-02): (decode-coding-region from to coding-system))
9671.303 (rms 07-Apr-99): (setq coding-system last-coding-system-used))
9681.265 (rms 12-May-98): (set-buffer-modified-p modifiedp)
9691.265 (rms 12-May-98): (setq buffer-file-coding-system nil)
9701.265 (rms 12-May-98): (setq save-buffer-coding-system
9711.265 (rms 12-May-98): (or coding-system 'undecided))))
9721.212 (handa 26-Feb-97):
9731.259 (kwzh 08-Apr-98): (defvar rmail-mode-map nil)
9741.1 (roland 13-May-91): (if rmail-mode-map
9751.1 (roland 13-May-91): nil
9761.1 (roland 13-May-91): (setq rmail-mode-map (make-keymap))
9771.1 (roland 13-May-91): (suppress-keymap rmail-mode-map)
9781.39 (rms 09-Mar-93): (define-key rmail-mode-map "a" 'rmail-add-label)
9791.39 (rms 09-Mar-93): (define-key rmail-mode-map "b" 'rmail-bury)
9801.39 (rms 09-Mar-93): (define-key rmail-mode-map "c" 'rmail-continue)
9811.39 (rms 09-Mar-93): (define-key rmail-mode-map "d" 'rmail-delete-forward)
9821.39 (rms 09-Mar-93): (define-key rmail-mode-map "\C-d" 'rmail-delete-backward)
9831.39 (rms 09-Mar-93): (define-key rmail-mode-map "e" 'rmail-edit-current-message)
9841.39 (rms 09-Mar-93): (define-key rmail-mode-map "f" 'rmail-forward)
9851.39 (rms 09-Mar-93): (define-key rmail-mode-map "g" 'rmail-get-new-mail)
9861.39 (rms 09-Mar-93): (define-key rmail-mode-map "h" 'rmail-summary)
9871.39 (rms 09-Mar-93): (define-key rmail-mode-map "i" 'rmail-input)
9881.39 (rms 09-Mar-93): (define-key rmail-mode-map "j" 'rmail-show-message)
9891.39 (rms 09-Mar-93): (define-key rmail-mode-map "k" 'rmail-kill-label)
9901.39 (rms 09-Mar-93): (define-key rmail-mode-map "l" 'rmail-summary-by-labels)
9911.1 (roland 13-May-91): (define-key rmail-mode-map "\e\C-h" 'rmail-summary)
9921.1 (roland 13-May-91): (define-key rmail-mode-map "\e\C-l" 'rmail-summary-by-labels)
9931.1 (roland 13-May-91): (define-key rmail-mode-map "\e\C-r" 'rmail-summary-by-recipients)
9941.1 (roland 13-May-91): (define-key rmail-mode-map "\e\C-s" 'rmail-summary-by-regexp)
9951.39 (rms 09-Mar-93): (define-key rmail-mode-map "\e\C-t" 'rmail-summary-by-topic)
9961.39 (rms 09-Mar-93): (define-key rmail-mode-map "m" 'rmail-mail)
9971.39 (rms 09-Mar-93): (define-key rmail-mode-map "\em" 'rmail-retry-failure)
9981.39 (rms 09-Mar-93): (define-key rmail-mode-map "n" 'rmail-next-undeleted-message)
9991.39 (rms 09-Mar-93): (define-key rmail-mode-map "\en" 'rmail-next-message)
10001.39 (rms 09-Mar-93): (define-key rmail-mode-map "\e\C-n" 'rmail-next-labeled-message)
10011.39 (rms 09-Mar-93): (define-key rmail-mode-map "o" 'rmail-output-to-rmail-file)
10021.39 (rms 09-Mar-93): (define-key rmail-mode-map "\C-o" 'rmail-output)
10031.39 (rms 09-Mar-93): (define-key rmail-mode-map "p" 'rmail-previous-undeleted-message)
10041.39 (rms 09-Mar-93): (define-key rmail-mode-map "\ep" 'rmail-previous-message)
10051.39 (rms 09-Mar-93): (define-key rmail-mode-map "\e\C-p" 'rmail-previous-labeled-message)
10061.39 (rms 09-Mar-93): (define-key rmail-mode-map "q" 'rmail-quit)
10071.39 (rms 09-Mar-93): (define-key rmail-mode-map "r" 'rmail-reply)
10081.35 (rms 21-Oct-92): ;; I find I can't live without the default M-r command -- rms.
10091.39 (rms 09-Mar-93): ;; (define-key rmail-mode-map "\er" 'rmail-search-backwards)
10101.39 (rms 09-Mar-93): (define-key rmail-mode-map "s" 'rmail-expunge-and-save)
10111.39 (rms 09-Mar-93): (define-key rmail-mode-map "\es" 'rmail-search)
10121.39 (rms 09-Mar-93): (define-key rmail-mode-map "t" 'rmail-toggle-header)
10131.39 (rms 09-Mar-93): (define-key rmail-mode-map "u" 'rmail-undelete-previous-message)
10141.216 (rms 05-Apr-97): (define-key rmail-mode-map "w" 'rmail-output-body-to-file)
10151.39 (rms 09-Mar-93): (define-key rmail-mode-map "x" 'rmail-expunge)
10161.39 (rms 09-Mar-93): (define-key rmail-mode-map "." 'rmail-beginning-of-message)
10171.410 (eliz 12-Aug-05): (define-key rmail-mode-map "/" 'rmail-end-of-message)
10181.39 (rms 09-Mar-93): (define-key rmail-mode-map "<" 'rmail-first-message)
10191.39 (rms 09-Mar-93): (define-key rmail-mode-map ">" 'rmail-last-message)
10201.39 (rms 09-Mar-93): (define-key rmail-mode-map " " 'scroll-up)
10211.39 (rms 09-Mar-93): (define-key rmail-mode-map "\177" 'scroll-down)
10221.39 (rms 09-Mar-93): (define-key rmail-mode-map "?" 'describe-mode)
10231.52 (rms 22-Jun-93): (define-key rmail-mode-map "\C-c\C-s\C-d" 'rmail-sort-by-date)
10241.52 (rms 22-Jun-93): (define-key rmail-mode-map "\C-c\C-s\C-s" 'rmail-sort-by-subject)
10251.52 (rms 22-Jun-93): (define-key rmail-mode-map "\C-c\C-s\C-a" 'rmail-sort-by-author)
10261.52 (rms 22-Jun-93): (define-key rmail-mode-map "\C-c\C-s\C-r" 'rmail-sort-by-recipient)
10271.52 (rms 22-Jun-93): (define-key rmail-mode-map "\C-c\C-s\C-c" 'rmail-sort-by-correspondent)
10281.52 (rms 22-Jun-93): (define-key rmail-mode-map "\C-c\C-s\C-l" 'rmail-sort-by-lines)
10291.338 (gerd 07-May-01): (define-key rmail-mode-map "\C-c\C-s\C-k" 'rmail-sort-by-labels)
10301.144 (rms 05-Feb-95): (define-key rmail-mode-map "\C-c\C-n" 'rmail-next-same-subject)
10311.144 (rms 05-Feb-95): (define-key rmail-mode-map "\C-c\C-p" 'rmail-previous-same-subject)
10321.39 (rms 09-Mar-93): )
10331.50 (rms 22-Jun-93):
10341.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar] (make-sparse-keymap))
10351.50 (rms 22-Jun-93):
10361.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar classify]
10371.50 (rms 22-Jun-93): (cons "Classify" (make-sparse-keymap "Classify")))
10381.50 (rms 22-Jun-93):
10391.92 (rms 23-Mar-94): (define-key rmail-mode-map [menu-bar classify input-menu]
10401.126 (rms 19-Sep-94): nil)
10411.92 (rms 23-Mar-94):
10421.92 (rms 23-Mar-94): (define-key rmail-mode-map [menu-bar classify output-menu]
10431.126 (rms 19-Sep-94): nil)
10441.216 (rms 05-Apr-97):
10451.216 (rms 05-Apr-97): (define-key rmail-mode-map [menu-bar classify output-body]
10461.216 (rms 05-Apr-97): '("Output body to file..." . rmail-output-body-to-file))
10471.92 (rms 23-Mar-94):
10481.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar classify output-inbox]
10491.117 (rms 02-Aug-94): '("Output (inbox)..." . rmail-output))
10501.50 (rms 22-Jun-93):
10511.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar classify output]
10521.117 (rms 02-Aug-94): '("Output (Rmail)..." . rmail-output-to-rmail-file))
10531.50 (rms 22-Jun-93):
10541.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar classify kill-label]
10551.117 (rms 02-Aug-94): '("Kill Label..." . rmail-kill-label))
10561.50 (rms 22-Jun-93):
10571.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar classify add-label]
10581.117 (rms 02-Aug-94): '("Add Label..." . rmail-add-label))
10591.50 (rms 22-Jun-93):
10601.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar summary]
10611.50 (rms 22-Jun-93): (cons "Summary" (make-sparse-keymap "Summary")))
10621.50 (rms 22-Jun-93):
10631.156 (rms 30-Jun-95): (define-key rmail-mode-map [menu-bar summary senders]
10641.156 (rms 30-Jun-95): '("By Senders..." . rmail-summary-by-senders))
10651.156 (rms 30-Jun-95):
10661.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar summary labels]
10671.117 (rms 02-Aug-94): '("By Labels..." . rmail-summary-by-labels))
10681.50 (rms 22-Jun-93):
10691.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar summary recipients]
10701.117 (rms 02-Aug-94): '("By Recipients..." . rmail-summary-by-recipients))
10711.50 (rms 22-Jun-93):
10721.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar summary topic]
10731.117 (rms 02-Aug-94): '("By Topic..." . rmail-summary-by-topic))
10741.50 (rms 22-Jun-93):
10751.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar summary regexp]
10761.117 (rms 02-Aug-94): '("By Regexp..." . rmail-summary-by-regexp))
10771.50 (rms 22-Jun-93):
10781.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar summary all]
10791.50 (rms 22-Jun-93): '("All" . rmail-summary))
10801.50 (rms 22-Jun-93):
10811.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar mail]
10821.50 (rms 22-Jun-93): (cons "Mail" (make-sparse-keymap "Mail")))
10831.50 (rms 22-Jun-93):
10841.116 (rms 02-Aug-94): (define-key rmail-mode-map [menu-bar mail rmail-get-new-mail]
10851.108 (rms 12-Jul-94): '("Get New Mail" . rmail-get-new-mail))
10861.108 (rms 12-Jul-94):
10871.108 (rms 12-Jul-94): (define-key rmail-mode-map [menu-bar mail lambda]
10881.109 (rms 13-Jul-94): '("----"))
10891.108 (rms 12-Jul-94):
10901.108 (rms 12-Jul-94): (define-key rmail-mode-map [menu-bar mail continue]
10911.50 (rms 22-Jun-93): '("Continue" . rmail-continue))
10921.114 (rms 31-Jul-94):
10931.114 (rms 31-Jul-94): (define-key rmail-mode-map [menu-bar mail resend]
10941.117 (rms 02-Aug-94): '("Re-send..." . rmail-resend))
10951.50 (rms 22-Jun-93):
10961.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar mail forward]
10971.50 (rms 22-Jun-93): '("Forward" . rmail-forward))
10981.50 (rms 22-Jun-93):
10991.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar mail retry]
11001.50 (rms 22-Jun-93): '("Retry" . rmail-retry-failure))
11011.50 (rms 22-Jun-93):
11021.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar mail reply]
11031.50 (rms 22-Jun-93): '("Reply" . rmail-reply))
11041.1 (roland 13-May-91):
11051.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar mail mail]
11061.50 (rms 22-Jun-93): '("Mail" . rmail-mail))
11071.50 (rms 22-Jun-93):
11081.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar delete]
11091.50 (rms 22-Jun-93): (cons "Delete" (make-sparse-keymap "Delete")))
11101.50 (rms 22-Jun-93):
11111.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar delete expunge/save]
11121.50 (rms 22-Jun-93): '("Expunge/Save" . rmail-expunge-and-save))
11131.50 (rms 22-Jun-93):
11141.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar delete expunge]
11151.50 (rms 22-Jun-93): '("Expunge" . rmail-expunge))
11161.50 (rms 22-Jun-93):
11171.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar delete undelete]
11181.50 (rms 22-Jun-93): '("Undelete" . rmail-undelete-previous-message))
11191.50 (rms 22-Jun-93):
11201.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar delete delete]
11211.50 (rms 22-Jun-93): '("Delete" . rmail-delete-forward))
11221.50 (rms 22-Jun-93):
11231.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar move]
11241.50 (rms 22-Jun-93): (cons "Move" (make-sparse-keymap "Move")))
11251.50 (rms 22-Jun-93):
11261.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar move search-back]
11271.140 (rms 18-Dec-94): '("Search Back..." . rmail-search-backwards))
11281.50 (rms 22-Jun-93):
11291.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar move search]
11301.117 (rms 02-Aug-94): '("Search..." . rmail-search))
11311.50 (rms 22-Jun-93):
11321.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar move previous]
11331.50 (rms 22-Jun-93): '("Previous Nondeleted" . rmail-previous-undeleted-message))
11341.50 (rms 22-Jun-93):
11351.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar move next]
11361.50 (rms 22-Jun-93): '("Next Nondeleted" . rmail-next-undeleted-message))
11371.50 (rms 22-Jun-93):
11381.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar move last]
11391.50 (rms 22-Jun-93): '("Last" . rmail-last-message))
11401.50 (rms 22-Jun-93):
11411.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar move first]
11421.50 (rms 22-Jun-93): '("First" . rmail-first-message))
11431.50 (rms 22-Jun-93):
11441.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar move previous]
11451.50 (rms 22-Jun-93): '("Previous" . rmail-previous-message))
11461.50 (rms 22-Jun-93):
11471.50 (rms 22-Jun-93): (define-key rmail-mode-map [menu-bar move next]
11481.50 (rms 22-Jun-93): '("Next" . rmail-next-message))
11491.423 (eliz 25-Mar-06):
11501.423 (eliz 25-Mar-06): ;; Rmail toolbar
11511.423 (eliz 25-Mar-06): (defvar rmail-tool-bar-map
11521.423 (eliz 25-Mar-06): (if (display-graphic-p)
11531.423 (eliz 25-Mar-06): (let ((map (make-sparse-keymap)))
11541.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-get-new-mail "mail/inbox"
11551.423 (eliz 25-Mar-06): map rmail-mode-map)
11561.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-next-undeleted-message "right-arrow"
11571.423 (eliz 25-Mar-06): map rmail-mode-map)
11581.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-previous-undeleted-message "left-arrow"
11591.423 (eliz 25-Mar-06): map rmail-mode-map)
11601.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-search "search"
11611.423 (eliz 25-Mar-06): map rmail-mode-map)
11621.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-input "open"
11631.423 (eliz 25-Mar-06): map rmail-mode-map)
11641.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-mail "mail/compose"
11651.423 (eliz 25-Mar-06): map rmail-mode-map)
11661.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-reply "mail/reply-all"
11671.423 (eliz 25-Mar-06): map rmail-mode-map)
11681.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-forward "mail/forward"
11691.423 (eliz 25-Mar-06): map rmail-mode-map)
11701.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-delete-forward "close"
11711.423 (eliz 25-Mar-06): map rmail-mode-map)
11721.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-output "mail/move"
11731.423 (eliz 25-Mar-06): map rmail-mode-map)
11741.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-output-body-to-file "mail/save"
11751.423 (eliz 25-Mar-06): map rmail-mode-map)
11761.423 (eliz 25-Mar-06): (tool-bar-local-item-from-menu 'rmail-expunge "delete"
11771.423 (eliz 25-Mar-06): map rmail-mode-map)
11781.423 (eliz 25-Mar-06): map)))
11791.423 (eliz 25-Mar-06):
11801.423 (eliz 25-Mar-06):
11811.50 (rms 22-Jun-93):
11821.1 (roland 13-May-91): ;; Rmail mode is suitable only for specially formatted data.
11831.1 (roland 13-May-91): (put 'rmail-mode 'mode-class 'special)
11841.1 (roland 13-May-91):
11851.127 (rms 21-Sep-94): (defun rmail-mode-kill-summary ()
11861.127 (rms 21-Sep-94): (if rmail-summary-buffer (kill-buffer rmail-summary-buffer)))
11871.127 (rms 21-Sep-94):
11881.34 (jimb 11-Oct-92): ;;;###autoload
11891.1 (roland 13-May-91): (defun rmail-mode ()
11901.1 (roland 13-May-91): "Rmail Mode is used by \\<rmail-mode-map>\\[rmail] for editing Rmail files.
11911.1 (roland 13-May-91): All normal editing commands are turned off.
11921.1 (roland 13-May-91): Instead, these commands are available:
11931.1 (roland 13-May-91):
11941.410 (eliz 12-Aug-05): \\[rmail-beginning-of-message] Move point to front of this message.
11951.410 (eliz 12-Aug-05): \\[rmail-end-of-message] Move point to bottom of this message.
11961.1 (roland 13-May-91): \\[scroll-up] Scroll to next screen of this message.
11971.1 (roland 13-May-91): \\[scroll-down] Scroll to previous screen of this message.
11981.1 (roland 13-May-91): \\[rmail-next-undeleted-message] Move to Next non-deleted message.
11991.1 (roland 13-May-91): \\[rmail-previous-undeleted-message] Move to Previous non-deleted message.
12001.1 (roland 13-May-91): \\[rmail-next-message] Move to Next message whether deleted or not.
12011.1 (roland 13-May-91): \\[rmail-previous-message] Move to Previous message whether deleted or not.
12021.1 (roland 13-May-91): \\[rmail-first-message] Move to the first message in Rmail file.
12031.1 (roland 13-May-91): \\[rmail-last-message] Move to the last message in Rmail file.
12041.1 (roland 13-May-91): \\[rmail-show-message] Jump to message specified by numeric position in file.
12051.1 (roland 13-May-91): \\[rmail-search] Search for string and show message it is found in.
12061.1 (roland 13-May-91): \\[rmail-delete-forward] Delete this message, move to next nondeleted.
12071.1 (roland 13-May-91): \\[rmail-delete-backward] Delete this message, move to previous nondeleted.
12081.1 (roland 13-May-91): \\[rmail-undelete-previous-message] Undelete message. Tries current message, then earlier messages
12091.1 (roland 13-May-91): till a deleted message is found.
12101.39 (rms 09-Mar-93): \\[rmail-edit-current-message] Edit the current message. \\[rmail-cease-edit] to return to Rmail.
12111.1 (roland 13-May-91): \\[rmail-expunge] Expunge deleted messages.
12121.1 (roland 13-May-91): \\[rmail-expunge-and-save] Expunge and save the file.
12131.1 (roland 13-May-91): \\[rmail-quit] Quit Rmail: expunge, save, then switch to another buffer.
12141.1 (roland 13-May-91): \\[save-buffer] Save without expunging.
12151.40 (rms 29-Mar-93): \\[rmail-get-new-mail] Move new mail from system spool directory into this file.
12161.1 (roland 13-May-91): \\[rmail-mail] Mail a message (same as \\[mail-other-window]).
12171.1 (roland 13-May-91): \\[rmail-continue] Continue composing outgoing message started before.
12181.39 (rms 09-Mar-93): \\[rmail-reply] Reply to this message. Like \\[rmail-mail] but initializes some fields.
12191.39 (rms 09-Mar-93): \\[rmail-retry-failure] Send this message again. Used on a mailer failure message.
12201.1 (roland 13-May-91): \\[rmail-forward] Forward this message to another user.
12211.1 (roland 13-May-91): \\[rmail-output-to-rmail-file] Output this message to an Rmail file (append it).
12221.1 (roland 13-May-91): \\[rmail-output] Output this message to a Unix-format mail file (append it).
12231.258 (stephen 07-Apr-98): \\[rmail-output-body-to-file] Save message body to a file. Default filename comes from Subject line.
12241.1 (roland 13-May-91): \\[rmail-input] Input Rmail file. Run Rmail on that file.
12251.1 (roland 13-May-91): \\[rmail-add-label] Add label to message. It will be displayed in the mode line.
12261.1 (roland 13-May-91): \\[rmail-kill-label] Kill label. Remove a label from current message.
12271.1 (roland 13-May-91): \\[rmail-next-labeled-message] Move to Next message with specified label
12281.1 (roland 13-May-91): (label defaults to last one specified).
12291.1 (roland 13-May-91): Standard labels: filed, unseen, answered, forwarded, deleted.
12301.39 (rms 09-Mar-93): Any other label is present only if you add it with \\[rmail-add-label].
12311.1 (roland 13-May-91): \\[rmail-previous-labeled-message] Move to Previous message with specified label
12321.1 (roland 13-May-91): \\[rmail-summary] Show headers buffer, with a one line summary of each message.
12331.39 (rms 09-Mar-93): \\[rmail-summary-by-labels] Summarize only messages with particular label(s).
12341.39 (rms 09-Mar-93): \\[rmail-summary-by-recipients] Summarize only messages with particular recipient(s).
12351.39 (rms 09-Mar-93): \\[rmail-summary-by-regexp] Summarize only messages with particular regexp(s).
12361.39 (rms 09-Mar-93): \\[rmail-summary-by-topic] Summarize only messages with subject line regexp(s).
12371.39 (rms 09-Mar-93): \\[rmail-toggle-header] Toggle display of complete header."
12381.1 (roland 13-May-91): (interactive)
12391.340 (gerd 17-May-01): (let ((finding-rmail-file (not (eq major-mode 'rmail-mode))))
12401.340 (gerd 17-May-01): (rmail-mode-2)
12411.340 (gerd 17-May-01): (when (and finding-rmail-file
12421.340 (gerd 17-May-01): (null coding-system-for-read)
12431.340 (gerd 17-May-01): default-enable-multibyte-characters)
12441.340 (gerd 17-May-01): (let ((rmail-enable-multibyte t))
12451.340 (gerd 17-May-01): (rmail-require-mime-maybe)
12461.340 (gerd 17-May-01): (rmail-convert-file)
12471.340 (gerd 17-May-01): (goto-char (point-max))
12481.340 (gerd 17-May-01): (set-buffer-multibyte t)))
12491.340 (gerd 17-May-01): (rmail-set-message-counters)
12501.340 (gerd 17-May-01): (rmail-show-message rmail-total-messages)
12511.340 (gerd 17-May-01): (when finding-rmail-file
12521.340 (gerd 17-May-01): (when rmail-display-summary
12531.340 (gerd 17-May-01): (rmail-summary))
12541.340 (gerd 17-May-01): (rmail-construct-io-menu))
12551.404 (lute 26-May-05): (run-mode-hooks 'rmail-mode-hook)))
12561.1 (roland 13-May-91):
12571.1 (roland 13-May-91): (defun rmail-mode-2 ()
12581.1 (roland 13-May-91): (kill-all-local-variables)
12591.1 (roland 13-May-91): (rmail-mode-1)
12601.259 (kwzh 08-Apr-98): (rmail-perm-variables)
12611.200 (rms 12-Oct-96): (rmail-variables))
12621.1 (roland 13-May-91):
12631.1 (roland 13-May-91): (defun rmail-mode-1 ()
12641.1 (roland 13-May-91): (setq major-mode 'rmail-mode)
12651.1 (roland 13-May-91): (setq mode-name "RMAIL")
12661.1 (roland 13-May-91): (setq buffer-read-only t)
12671.75 (rms 24-Dec-93): ;; No need to auto save RMAIL files in normal circumstances
12681.75 (rms 24-Dec-93): ;; because they contain no info except attribute changes
12691.75 (rms 24-Dec-93): ;; and deletion of messages.
12701.75 (rms 24-Dec-93): ;; The one exception is when messages are copied into an Rmail mode buffer.
12711.75 (rms 24-Dec-93): ;; rmail-output-to-rmail-file enables auto save when you do that.
12721.1 (roland 13-May-91): (setq buffer-auto-save-file-name nil)
12731.235 (rms 26-Aug-97): (setq mode-line-modified "--")
12741.1 (roland 13-May-91): (use-local-map rmail-mode-map)
12751.1 (roland 13-May-91): (set-syntax-table text-mode-syntax-table)
12761.1 (roland 13-May-91): (setq local-abbrev-table text-mode-abbrev-table))
12771.1 (roland 13-May-91):
12781.259 (kwzh 08-Apr-98): ;; Set up the permanent locals associated with an Rmail file.
12791.259 (kwzh 08-Apr-98): (defun rmail-perm-variables ()
12801.1 (roland 13-May-91): (make-local-variable 'rmail-last-label)
12811.39 (rms 09-Mar-93): (make-local-variable 'rmail-last-regexp)
12821.1 (roland 13-May-91): (make-local-variable 'rmail-deleted-vector)
12831.212 (handa 26-Feb-97): (make-local-variable 'rmail-buffer)
12841.212 (handa 26-Feb-97): (setq rmail-buffer (current-buffer))
12851.212 (handa 26-Feb-97): (make-local-variable 'rmail-view-buffer)
12861.212 (handa 26-Feb-97): (setq rmail-view-buffer rmail-buffer)
12871.1 (roland 13-May-91): (make-local-variable 'rmail-summary-buffer)
12881.1 (roland 13-May-91): (make-local-variable 'rmail-summary-vector)
12891.1 (roland 13-May-91): (make-local-variable 'rmail-current-message)
12901.1 (roland 13-May-91): (make-local-variable 'rmail-total-messages)
12911.98 (rms 24-Apr-94): (make-local-variable 'rmail-overlay-list)
12921.98 (rms 24-Apr-94): (setq rmail-overlay-list nil)
12931.1 (roland 13-May-91): (make-local-variable 'rmail-message-vector)
12941.218 (rms 02-May-97): (make-local-variable 'rmail-msgref-vector)
12951.1 (roland 13-May-91): (make-local-variable 'rmail-inbox-list)
12961.1 (roland 13-May-91): (setq rmail-inbox-list (rmail-parse-file-inboxes))
12971.47 (rms 07-Jun-93): ;; Provide default set of inboxes for primary mail file ~/RMAIL.
12981.47 (rms 07-Jun-93): (and (null rmail-inbox-list)
12991.54 (rms 06-Jul-93): (or (equal buffer-file-name (expand-file-name rmail-file-name))
13001.72 (rms 26-Nov-93): (equal buffer-file-truename
13011.72 (rms 26-Nov-93): (abbreviate-file-name (file-truename rmail-file-name))))
13021.47 (rms 07-Jun-93): (setq rmail-inbox-list
13031.47 (rms 07-Jun-93): (or rmail-primary-inbox-list
13041.47 (rms 07-Jun-93): (list (or (getenv "MAIL")
13051.47 (rms 07-Jun-93): (concat rmail-spool-directory
13061.86 (kwzh 11-Feb-94): (user-login-name)))))))
13071.1 (roland 13-May-91): (make-local-variable 'rmail-keywords)
13081.423 (eliz 25-Mar-06): (set (make-local-variable 'tool-bar-map) rmail-tool-bar-map)
13091.1 (roland 13-May-91): ;; this gets generated as needed
13101.104 (rms 19-May-94): (setq rmail-keywords nil))
13111.1 (roland 13-May-91):
13121.259 (kwzh 08-Apr-98): ;; Set up the non-permanent locals associated with Rmail mode.
13131.259 (kwzh 08-Apr-98): (defun rmail-variables ()
13141.265 (rms 12-May-98): (make-local-variable 'save-buffer-coding-system)
13151.265 (rms 12-May-98): ;; If we don't already have a value for save-buffer-coding-system,
13161.265 (rms 12-May-98): ;; get it from buffer-file-coding-system, and clear that
13171.265 (rms 12-May-98): ;; because it should be determined in rmail-show-message.
13181.265 (rms 12-May-98): (unless save-buffer-coding-system
13191.265 (rms 12-May-98): (setq save-buffer-coding-system (or buffer-file-coding-system 'undecided))
13201.265 (rms 12-May-98): (setq buffer-file-coding-system nil))
13211.259 (kwzh 08-Apr-98): ;; Don't let a local variables list in a message cause confusion.
13221.276 (rms 13-Jun-98): (make-local-variable 'local-enable-local-variables)
13231.276 (rms 13-Jun-98): (setq local-enable-local-variables nil)
13241.259 (kwzh 08-Apr-98): (make-local-variable 'revert-buffer-function)
13251.259 (kwzh 08-Apr-98): (setq revert-buffer-function 'rmail-revert)
13261.259 (kwzh 08-Apr-98): (make-local-variable 'font-lock-defaults)
13271.259 (kwzh 08-Apr-98): (setq font-lock-defaults
13281.265 (rms 12-May-98): '(rmail-font-lock-keywords
13291.367 (rms 06-Jan-03): t t nil nil
13301.265 (rms 12-May-98): (font-lock-maximum-size . nil)
13311.265 (rms 12-May-98): (font-lock-fontify-buffer-function . rmail-fontify-buffer-function)
13321.265 (rms 12-May-98): (font-lock-unfontify-buffer-function . rmail-unfontify-buffer-function)
13331.265 (rms 12-May-98): (font-lock-inhibit-thing-lock . (lazy-lock-mode fast-lock-mode))))
13341.259 (kwzh 08-Apr-98): (make-local-variable 'require-final-newline)
13351.259 (kwzh 08-Apr-98): (setq require-final-newline nil)
13361.259 (kwzh 08-Apr-98): (make-local-variable 'version-control)
13371.259 (kwzh 08-Apr-98): (setq version-control 'never)
13381.259 (kwzh 08-Apr-98): (make-local-variable 'kill-buffer-hook)
13391.259 (kwzh 08-Apr-98): (add-hook 'kill-buffer-hook 'rmail-mode-kill-summary)
13401.259 (kwzh 08-Apr-98): (make-local-variable 'file-precious-flag)
13411.391 (lh 26-Apr-04): (setq file-precious-flag t)
13421.391 (lh 26-Apr-04): (make-local-variable 'desktop-save-buffer)
13431.391 (lh 26-Apr-04): (setq desktop-save-buffer t))
13441.259 (kwzh 08-Apr-98):
13451.1 (roland 13-May-91): ;; Handle M-x revert-buffer done in an rmail-mode buffer.
13461.1 (roland 13-May-91): (defun rmail-revert (arg noconfirm)
13471.342 (gerd 31-May-01): (set-buffer rmail-buffer)
13481.280 (rms 09-Jul-98): (let* ((revert-buffer-function (default-value 'revert-buffer-function))
13491.280 (rms 09-Jul-98): (rmail-enable-multibyte enable-multibyte-characters)
13501.280 (rms 09-Jul-98): ;; See similar code in `rmail'.
13511.280 (rms 09-Jul-98): (coding-system-for-read (and rmail-enable-multibyte 'raw-text)))
13521.1 (roland 13-May-91): ;; Call our caller again, but this time it does the default thing.
13531.1 (roland 13-May-91): (if (revert-buffer arg noconfirm)
13541.1 (roland 13-May-91): ;; If the user said "yes", and we changed something,
13551.1 (roland 13-May-91): ;; reparse the messages.
13561.243 (rms 19-Jan-98): (progn
13571.342 (gerd 31-May-01): (set-buffer rmail-buffer)
13581.342 (gerd 31-May-01): (rmail-mode-2)
13591.280 (rms 09-Jul-98): ;; Convert all or part to Babyl file if possible.
13601.1 (roland 13-May-91): (rmail-convert-file)
13611.280 (rms 09-Jul-98): ;; We have read the file as raw-text, so the buffer is set to
13621.280 (rms 09-Jul-98): ;; unibyte. Make it multibyte if necessary.
13631.280 (rms 09-Jul-98): (if (and rmail-enable-multibyte
13641.280 (rms 09-Jul-98): (not enable-multibyte-characters))
13651.280 (rms 09-Jul-98): (set-buffer-multibyte t))
13661.1 (roland 13-May-91): (goto-char (point-max))
13671.280 (rms 09-Jul-98): (rmail-set-message-counters)
13681.280 (rms 09-Jul-98): (rmail-show-message rmail-total-messages)
13691.280 (rms 09-Jul-98): (run-hooks 'rmail-mode-hook)))))
13701.1 (roland 13-May-91):
13711.1 (roland 13-May-91): ;; Return a list of files from this buffer's Mail: option.
13721.1 (roland 13-May-91): ;; Does not assume that messages have been parsed.
13731.1 (roland 13-May-91): ;; Just returns nil if buffer does not look like Babyl format.
13741.1 (roland 13-May-91): (defun rmail-parse-file-inboxes ()
13751.1 (roland 13-May-91): (save-excursion
13761.1 (roland 13-May-91): (save-restriction
13771.1 (roland 13-May-91): (widen)
13781.1 (roland 13-May-91): (goto-char 1)
13791.1 (roland 13-May-91): (cond ((looking-at "BABYL OPTIONS:")
13801.1 (roland 13-May-91): (search-forward "\n\^_" nil 'move)
13811.1 (roland 13-May-91): (narrow-to-region 1 (point))
13821.1 (roland 13-May-91): (goto-char 1)
13831.1 (roland 13-May-91): (if (search-forward "\nMail:" nil t)
13841.1 (roland 13-May-91): (progn
13851.1 (roland 13-May-91): (narrow-to-region (point) (progn (end-of-line) (point)))
13861.1 (roland 13-May-91): (goto-char (point-min))
13871.1 (roland 13-May-91): (mail-parse-comma-list))))))))
13881.1 (roland 13-May-91):
13891.1 (roland 13-May-91): (defun rmail-expunge-and-save ()
13901.1 (roland 13-May-91): "Expunge and save RMAIL file."
13911.1 (roland 13-May-91): (interactive)
13921.1 (roland 13-May-91): (rmail-expunge)
13931.339 (gerd 08-May-01): (set-buffer rmail-buffer)
13941.85 (kwzh 09-Feb-94): (save-buffer)
13951.85 (kwzh 09-Feb-94): (if (rmail-summary-exists)
13961.85 (kwzh 09-Feb-94): (rmail-select-summary (set-buffer-modified-p nil))))
13971.1 (roland 13-May-91):
13981.1 (roland 13-May-91): (defun rmail-quit ()
13991.294 (rms 18-Jan-99): "Quit out of RMAIL.
14001.294 (rms 18-Jan-99): Hook `rmail-quit-hook' is run after expunging."
14011.1 (roland 13-May-91): (interactive)
14021.1 (roland 13-May-91): (rmail-expunge-and-save)
14031.294 (rms 18-Jan-99): (when (boundp 'rmail-quit-hook)
14041.294 (rms 18-Jan-99): (run-hooks 'rmail-quit-hook))
14051.1 (roland 13-May-91): ;; Don't switch to the summary buffer even if it was recently visible.
14061.251 (rms 08-Mar-98): (when rmail-summary-buffer
14071.251 (rms 08-Mar-98): (replace-buffer-in-windows rmail-summary-buffer)
14081.251 (rms 08-Mar-98): (bury-buffer rmail-summary-buffer))
14091.339 (gerd 08-May-01): (if rmail-enable-mime
14101.339 (gerd 08-May-01): (let ((obuf rmail-buffer)
14111.339 (gerd 08-May-01): (ovbuf rmail-view-buffer))
14121.339 (gerd 08-May-01): (set-buffer rmail-view-buffer)
14131.339 (gerd 08-May-01): (quit-window)
14141.339 (gerd 08-May-01): (replace-buffer-in-windows ovbuf)
14151.339 (gerd 08-May-01): (replace-buffer-in-windows obuf)
14161.339 (gerd 08-May-01): (bury-buffer obuf))
14171.339 (gerd 08-May-01): (let ((obuf (current-buffer)))
14181.339 (gerd 08-May-01): (quit-window)
14191.339 (gerd 08-May-01): (replace-buffer-in-windows obuf))))
14201.1 (roland 13-May-91):
14211.147 (rms 12-Mar-95): (defun rmail-bury ()
14221.147 (rms 12-Mar-95): "Bury current Rmail buffer and its summary buffer."
14231.147 (rms 12-Mar-95): (interactive)
14241.147 (rms 12-Mar-95): ;; This let var was called rmail-buffer, but that interfered
14251.147 (rms 12-Mar-95): ;; with the buffer-local var used in summary buffers.
14261.147 (rms 12-Mar-95): (let ((buffer-to-bury (current-buffer)))
14271.147 (rms 12-Mar-95): (if (rmail-summary-exists)
14281.147 (rms 12-Mar-95): (let (window)
14291.147 (rms 12-Mar-95): (while (setq window (get-buffer-window rmail-summary-buffer))
14301.251 (rms 08-Mar-98): (quit-window nil window))
14311.147 (rms 12-Mar-95): (bury-buffer rmail-summary-buffer)))
14321.251 (rms 08-Mar-98): (quit-window)))
14331.147 (rms 12-Mar-95):
14341.147 (rms 12-Mar-95): (defun rmail-duplicate-message ()
14351.147 (rms 12-Mar-95): "Create a duplicated copy of the current message.
14361.147 (rms 12-Mar-95): The duplicate copy goes into the Rmail file just after the
14371.147 (rms 12-Mar-95): original copy."
14381.147 (rms 12-Mar-95): (interactive)
14391.147 (rms 12-Mar-95): (widen)
14401.147 (rms 12-Mar-95): (let ((buffer-read-only nil)
14411.147 (rms 12-Mar-95): (number rmail-current-message)
14421.147 (rms 12-Mar-95): (string (buffer-substring (rmail-msgbeg rmail-current-message)
14431.147 (rms 12-Mar-95): (rmail-msgend rmail-current-message))))
14441.147 (rms 12-Mar-95): (goto-char (rmail-msgend rmail-current-message))
14451.147 (rms 12-Mar-95): (insert string)
14461.147 (rms 12-Mar-95): (rmail-forget-messages)
14471.147 (rms 12-Mar-95): (rmail-show-message number)
14481.147 (rms 12-Mar-95): (message "Message duplicated")))
14491.147 (rms 12-Mar-95):
14501.1 (roland 13-May-91): ;;;###autoload
14511.1 (roland 13-May-91): (defun rmail-input (filename)
14521.39 (rms 09-Mar-93): "Run Rmail on file FILENAME."
14531.1 (roland 13-May-91): (interactive "FRun rmail on RMAIL file: ")
14541.1 (roland 13-May-91): (rmail filename))
14551.1 (roland 13-May-91):
14561.198 (rms 19-Sep-96):
14571.198 (rms 19-Sep-96): ;; This used to scan subdirectories recursively, but someone pointed out
14581.198 (rms 19-Sep-96): ;; that if the user wants that, person can put all the files in one dir.
14591.198 (rms 19-Sep-96): ;; And the recursive scan was slow. So I took it out.
14601.198 (rms 19-Sep-96): ;; rms, Sep 1996.
14611.126 (rms 19-Sep-94): (defun rmail-find-all-files (start)
14621.198 (rms 19-Sep-96): "Return list of file in dir START that match `rmail-secondary-file-regexp'."
14631.126 (rms 19-Sep-94): (if (file-accessible-directory-p start)
14641.135 (rms 11-Oct-94): ;; Don't sort here.
14651.198 (rms 19-Sep-96): (let* ((case-fold-search t)
14661.198 (rms 19-Sep-96): (files (directory-files start t rmail-secondary-file-regexp)))
14671.135 (rms 11-Oct-94): ;; Sort here instead of in directory-files
14681.135 (rms 11-Oct-94): ;; because this list is usually much shorter.
14691.198 (rms 19-Sep-96): (sort files 'string<))))
14701.126 (rms 19-Sep-94):
14711.126 (rms 19-Sep-94): (defun rmail-list-to-menu (menu-name l action &optional full-name)
14721.126 (rms 19-Sep-94): (let ((menu (make-sparse-keymap menu-name)))
14731.440 (gm 12-Oct-07): (mapc
14741.126 (rms 19-Sep-94): (function (lambda (item)
14751.148 (rms 12-Mar-95): (let (command)
14761.148 (rms 12-Mar-95): (if (consp item)
14771.148 (rms 12-Mar-95): (progn
14781.148 (rms 12-Mar-95): (setq command
14791.358 (pot 06-May-02): (rmail-list-to-menu (car item) (cdr item)
14801.358 (pot 06-May-02): action
14811.148 (rms 12-Mar-95): (if full-name
14821.148 (rms 12-Mar-95): (concat full-name "/"
14831.148 (rms 12-Mar-95): (car item))
14841.148 (rms 12-Mar-95): (car item))))
14851.148 (rms 12-Mar-95): (setq name (car item)))
14861.126 (rms 19-Sep-94): (progn
14871.148 (rms 12-Mar-95): (setq name item)
14881.358 (pot 06-May-02): (setq command
14891.148 (rms 12-Mar-95): (list 'lambda () '(interactive)
14901.148 (rms 12-Mar-95): (list action
14911.358 (pot 06-May-02): (expand-file-name
14921.148 (rms 12-Mar-95): (if full-name
14931.148 (rms 12-Mar-95): (concat full-name "/" item)
14941.148 (rms 12-Mar-95): item)
14951.148 (rms 12-Mar-95): rmail-secondary-file-directory))))))
14961.148 (rms 12-Mar-95): (define-key menu (vector (intern name))
14971.148 (rms 12-Mar-95): (cons name command)))))
14981.135 (rms 11-Oct-94): (reverse l))
14991.126 (rms 19-Sep-94): menu))
15001.358 (pot 06-May-02):
15011.135 (rms 11-Oct-94): ;; This command is always "disabled" when it appears in a menu.
15021.135 (rms 11-Oct-94): (put 'rmail-disable-menu 'menu-enable ''nil)
15031.135 (rms 11-Oct-94):
15041.126 (rms 19-Sep-94): (defun rmail-construct-io-menu ()
15051.126 (rms 19-Sep-94): (let ((files (rmail-find-all-files rmail-secondary-file-directory)))
15061.135 (rms 11-Oct-94): (if files
15071.126 (rms 19-Sep-94): (progn
15081.126 (rms 19-Sep-94): (define-key rmail-mode-map [menu-bar classify input-menu]
15091.358 (pot 06-May-02): (cons "Input Rmail File"
15101.358 (pot 06-May-02): (rmail-list-to-menu "Input Rmail File"
15111.135 (rms 11-Oct-94): files
15121.126 (rms 19-Sep-94): 'rmail-input)))
15131.126 (rms 19-Sep-94): (define-key rmail-mode-map [menu-bar classify output-menu]
15141.358 (pot 06-May-02): (cons "Output Rmail File"
15151.358 (pot 06-May-02): (rmail-list-to-menu "Output Rmail File"
15161.135 (rms 11-Oct-94): files
15171.135 (rms 11-Oct-94): 'rmail-output-to-rmail-file))))
15181.135 (rms 11-Oct-94):
15191.135 (rms 11-Oct-94): (define-key rmail-mode-map [menu-bar classify input-menu]
15201.135 (rms 11-Oct-94): '("Input Rmail File" . rmail-disable-menu))
15211.135 (rms 11-Oct-94): (define-key rmail-mode-map [menu-bar classify output-menu]
15221.135 (rms 11-Oct-94): '("Output Rmail File" . rmail-disable-menu)))))
15231.102 (rms 04-May-94):
15241.1 (roland 13-May-91):
15251.1 (roland 13-May-91): ;;;; *** Rmail input ***
15261.1 (roland 13-May-91):
15271.443 (dann 27-Nov-07): (declare-function rmail-spam-filter "rmail-spam-filter" (msg))
15281.443 (dann 27-Nov-07): (declare-function rmail-summary-goto-msg "rmailsum" (&optional n nowarn skip-rmail))
15291.443 (dann 27-Nov-07): (declare-function rmail-summary-mark-undeleted "rmailsum" (n))
15301.443 (dann 27-Nov-07): (declare-function rmail-summary-mark-deleted "rmailsum" (&optional n undel))
15311.443 (dann 27-Nov-07): (declare-function rfc822-addresses "rfc822" (header-text))
15321.443 (dann 27-Nov-07): (declare-function mail-abbrev-make-syntax-table "mailabbrev.el" ())
15331.443 (dann 27-Nov-07): (declare-function mail-sendmail-delimit-header "sendmail" ())
15341.443 (dann 27-Nov-07): (declare-function mail-header-end "sendmail" ())
15351.443 (dann 27-Nov-07):
15361.1 (roland 13-May-91): ;; RLK feature not added in this version:
15371.1 (roland 13-May-91): ;; argument specifies inbox file or files in various ways.
15381.1 (roland 13-May-91):
15391.1 (roland 13-May-91): (defun rmail-get-new-mail (&optional file-name)
15401.1 (roland 13-May-91): "Move any new mail from this RMAIL file's inbox files.
15411.1 (roland 13-May-91): The inbox files can be specified with the file's Mail: option. The
15421.1 (roland 13-May-91): variable `rmail-primary-inbox-list' specifies the inboxes for your
15431.40 (rms 29-Mar-93): primary RMAIL file if it has no Mail: option. By default, this is
15441.40 (rms 29-Mar-93): your /usr/spool/mail/$USER.
15451.1 (roland 13-May-91):
15461.1 (roland 13-May-91): You can also specify the file to get new mail from. In this case, the
15471.1 (roland 13-May-91): file of new mail is not changed or deleted. Noninteractively, you can
15481.1 (roland 13-May-91): pass the inbox file name as an argument. Interactively, a prefix
15491.124 (rms 05-Sep-94): argument causes us to read a file name and use that file as the inbox.
15501.124 (rms 05-Sep-94):
15511.205 (rms 21-Jan-97): If the variable `rmail-preserve-inbox' is non-nil, new mail will
15521.205 (rms 21-Jan-97): always be left in inbox files rather than deleted.
15531.205 (rms 21-Jan-97):
15541.138 (rms 03-Dec-94): This function runs `rmail-get-new-mail-hook' before saving the updated file.
15551.138 (rms 03-Dec-94): It returns t if it got any new messages."
15561.1 (roland 13-May-91): (interactive
15571.1 (roland 13-May-91): (list (if current-prefix-arg
15581.1 (roland 13-May-91): (read-file-name "Get new mail from file: "))))
15591.190 (rms 28-Jun-96): (run-hooks 'rmail-before-get-new-mail-hook)
15601.152 (rms 24-Apr-95): ;; If the disk file has been changed from under us,
15611.152 (rms 24-Apr-95): ;; revert to it before we get new mail.
15621.1 (roland 13-May-91): (or (verify-visited-file-modtime (current-buffer))
15631.152 (rms 24-Apr-95): (find-file (buffer-file-name)))
15641.339 (gerd 08-May-01): (set-buffer rmail-buffer)
15651.1 (roland 13-May-91): (rmail-maybe-set-message-counters)
15661.1 (roland 13-May-91): (widen)
15671.1 (roland 13-May-91): ;; Get rid of all undo records for this buffer.
15681.1 (roland 13-May-91): (or (eq buffer-undo-list t)
15691.1 (roland 13-May-91): (setq buffer-undo-list nil))
15701.198 (rms 19-Sep-96): (let ((all-files (if file-name (list file-name)
15711.237 (kwzh 15-Oct-97): rmail-inbox-list))
15721.247 (handa 20-Feb-98): (rmail-enable-multibyte (default-value 'enable-multibyte-characters))
15731.237 (kwzh 15-Oct-97): found)
15741.198 (rms 19-Sep-96): (unwind-protect
15751.237 (kwzh 15-Oct-97): (progn
15761.206 (kwzh 25-Jan-97): (while all-files
15771.206 (kwzh 25-Jan-97): (let ((opoint (point))
15781.206 (kwzh 25-Jan-97): (new-messages 0)
15791.380 (uid65566 16-Jan-04): (rsf-number-of-spam 0)
15801.206 (kwzh 25-Jan-97): (delete-files ())
15811.206 (kwzh 25-Jan-97): ;; If buffer has not changed yet, and has not been saved yet,
15821.206 (kwzh 25-Jan-97): ;; don't replace the old backup file now.
15831.206 (kwzh 25-Jan-97): (make-backup-files (and make-backup-files (buffer-modified-p)))
15841.206 (kwzh 25-Jan-97): (buffer-read-only nil)
15851.206 (kwzh 25-Jan-97): ;; Don't make undo records for what we do in getting mail.
15861.206 (kwzh 25-Jan-97): (buffer-undo-list t)
15871.206 (kwzh 25-Jan-97): success
15881.206 (kwzh 25-Jan-97): ;; Files to insert this time around.
15891.206 (kwzh 25-Jan-97): files
15901.206 (kwzh 25-Jan-97): ;; Last names of those files.
15911.206 (kwzh 25-Jan-97): file-last-names)
15921.206 (kwzh 25-Jan-97): ;; Pull files off all-files onto files
15931.206 (kwzh 25-Jan-97): ;; as long as there is no name conflict.
15941.206 (kwzh 25-Jan-97): ;; A conflict happens when two inbox file names
15951.206 (kwzh 25-Jan-97): ;; have the same last component.
15961.206 (kwzh 25-Jan-97): (while (and all-files
15971.206 (kwzh 25-Jan-97): (not (member (file-name-nondirectory (car all-files))
15981.206 (kwzh 25-Jan-97): file-last-names)))
15991.206 (kwzh 25-Jan-97): (setq files (cons (car all-files) files)
16001.206 (kwzh 25-Jan-97): file-last-names
16011.206 (kwzh 25-Jan-97): (cons (file-name-nondirectory (car all-files)) files))
16021.206 (kwzh 25-Jan-97): (setq all-files (cdr all-files)))
16031.206 (kwzh 25-Jan-97): ;; Put them back in their original order.
16041.206 (kwzh 25-Jan-97): (setq files (nreverse files))
16051.198 (rms 19-Sep-96):
16061.206 (kwzh 25-Jan-97): (goto-char (point-max))
16071.206 (kwzh 25-Jan-97): (skip-chars-backward " \t\n") ; just in case of brain damage
16081.206 (kwzh 25-Jan-97): (delete-region (point) (point-max)) ; caused by require-final-newline
16091.206 (kwzh 25-Jan-97): (save-excursion
16101.206 (kwzh 25-Jan-97): (save-restriction
16111.206 (kwzh 25-Jan-97): (narrow-to-region (point) (point))
16121.206 (kwzh 25-Jan-97): ;; Read in the contents of the inbox files,
16131.206 (kwzh 25-Jan-97): ;; renaming them as necessary,
16141.206 (kwzh 25-Jan-97): ;; and adding to the list of files to delete eventually.
16151.206 (kwzh 25-Jan-97): (if file-name
16161.206 (kwzh 25-Jan-97): (rmail-insert-inbox-text files nil)
16171.206 (kwzh 25-Jan-97): (setq delete-files (rmail-insert-inbox-text files t)))
16181.206 (kwzh 25-Jan-97): ;; Scan the new text and convert each message to babyl format.
16191.206 (kwzh 25-Jan-97): (goto-char (point-min))
16201.206 (kwzh 25-Jan-97): (unwind-protect
16211.206 (kwzh 25-Jan-97): (save-excursion
16221.206 (kwzh 25-Jan-97): (setq new-messages (rmail-convert-to-babyl-format)
16231.206 (kwzh 25-Jan-97): success t))
16241.290 (rms 21-Oct-98): ;; Try to delete the garbage just inserted.
16251.290 (rms 21-Oct-98): (or success (delete-region (point-min) (point-max)))
16261.206 (kwzh 25-Jan-97): ;; If we could not convert the file's inboxes,
16271.206 (kwzh 25-Jan-97): ;; rename the files we tried to read
16281.206 (kwzh 25-Jan-97): ;; so we won't over and over again.
16291.206 (kwzh 25-Jan-97): (if (and (not file-name) (not success))
16301.206 (kwzh 25-Jan-97): (let ((delfiles delete-files)
16311.206 (kwzh 25-Jan-97): (count 0))
16321.206 (kwzh 25-Jan-97): (while delfiles
16331.206 (kwzh 25-Jan-97): (while (file-exists-p (format "RMAILOSE.%d" count))
16341.206 (kwzh 25-Jan-97): (setq count (1+ count)))
16351.206 (kwzh 25-Jan-97): (rename-file (car delfiles)
16361.206 (kwzh 25-Jan-97): (format "RMAILOSE.%d" count))
16371.206 (kwzh 25-Jan-97): (setq delfiles (cdr delfiles))))))
16381.206 (kwzh 25-Jan-97): (or (zerop new-messages)
16391.206 (kwzh 25-Jan-97): (let (success)
16401.206 (kwzh 25-Jan-97): (widen)
16411.206 (kwzh 25-Jan-97): (search-backward "\n\^_" nil t)
16421.206 (kwzh 25-Jan-97): (narrow-to-region (point) (point-max))
16431.206 (kwzh 25-Jan-97): (goto-char (1+ (point-min)))
16441.206 (kwzh 25-Jan-97): (rmail-count-new-messages)
16451.206 (kwzh 25-Jan-97): (run-hooks 'rmail-get-new-mail-hook)
16461.206 (kwzh 25-Jan-97): (save-buffer)))
16471.206 (kwzh 25-Jan-97): ;; Delete the old files, now that babyl file is saved.
16481.206 (kwzh 25-Jan-97): (while delete-files
16491.206 (kwzh 25-Jan-97): (condition-case ()
16501.206 (kwzh 25-Jan-97): ;; First, try deleting.
16511.206 (kwzh 25-Jan-97): (condition-case ()
16521.206 (kwzh 25-Jan-97): (delete-file (car delete-files))
16531.206 (kwzh 25-Jan-97): (file-error
16541.206 (kwzh 25-Jan-97): ;; If we can't delete it, truncate it.
16551.206 (kwzh 25-Jan-97): (write-region (point) (point) (car delete-files))))
16561.206 (kwzh 25-Jan-97): (file-error nil))
16571.206 (kwzh 25-Jan-97): (setq delete-files (cdr delete-files)))))
16581.206 (kwzh 25-Jan-97): (if (= new-messages 0)
16591.206 (kwzh 25-Jan-97): (progn (goto-char opoint)
16601.206 (kwzh 25-Jan-97): (if (or file-name rmail-inbox-list)
16611.206 (kwzh 25-Jan-97): (message "(No new mail has arrived)")))
16621.380 (uid65566 16-Jan-04): ;; check new messages to see if any of them is spam:
16631.385 (uid65627 17-Feb-04): (if (and (featurep 'rmail-spam-filter)
16641.385 (uid65627 17-Feb-04): rmail-use-spam-filter)
16651.380 (uid65566 16-Jan-04): (let*
16661.380 (uid65566 16-Jan-04): ((old-messages (- rmail-total-messages new-messages))
16671.380 (uid65566 16-Jan-04): (rsf-scanned-message-number (1+ old-messages))
16681.380 (uid65566 16-Jan-04): ;; save deletion flags of old messages: vector starts
16691.380 (uid65566 16-Jan-04): ;; at zero (is one longer that no of messages),
16701.380 (uid65566 16-Jan-04): ;; therefore take 1+ old-messages
16711.380 (uid65566 16-Jan-04): (save-deleted
16721.380 (uid65566 16-Jan-04): (substring rmail-deleted-vector 0 (1+
16731.380 (uid65566 16-Jan-04): old-messages))))
16741.380 (uid65566 16-Jan-04): ;; set all messages to undeleted
16751.380 (uid65566 16-Jan-04): (setq rmail-deleted-vector
16761.380 (uid65566 16-Jan-04): (make-string (1+ rmail-total-messages) ?\ ))
16771.380 (uid65566 16-Jan-04): (while (<= rsf-scanned-message-number
16781.380 (uid65566 16-Jan-04): rmail-total-messages)
16791.380 (uid65566 16-Jan-04): (progn
16801.380 (uid65566 16-Jan-04): (if (not (rmail-spam-filter rsf-scanned-message-number))
16811.380 (uid65566 16-Jan-04): (progn (setq rsf-number-of-spam (1+ rsf-number-of-spam)))
16821.380 (uid65566 16-Jan-04): )
16831.380 (uid65566 16-Jan-04): (setq rsf-scanned-message-number (1+ rsf-scanned-message-number))
16841.380 (uid65566 16-Jan-04): ))
16851.380 (uid65566 16-Jan-04): (if (> rsf-number-of-spam 0)
16861.380 (uid65566 16-Jan-04): (progn
16871.380 (uid65566 16-Jan-04): (when (rmail-expunge-confirmed)
16881.380 (uid65566 16-Jan-04): (rmail-only-expunge t))
16891.380 (uid65566 16-Jan-04): ))
16901.380 (uid65566 16-Jan-04): (setq rmail-deleted-vector
16911.380 (uid65566 16-Jan-04): (concat
16921.380 (uid65566 16-Jan-04): save-deleted
16931.380 (uid65566 16-Jan-04): (make-string (- rmail-total-messages old-messages)
16941.380 (uid65566 16-Jan-04): ?\ )))
16951.380 (uid65566 16-Jan-04): ))
16961.380 (uid65566 16-Jan-04): (if (rmail-summary-exists)
16971.206 (kwzh 25-Jan-97): (rmail-select-summary
16981.206 (kwzh 25-Jan-97): (rmail-update-summary)))
16991.380 (uid65566 16-Jan-04): (message "%d new message%s read%s"
17001.380 (uid65566 16-Jan-04): new-messages (if (= 1 new-messages) "" "s")
17011.380 (uid65566 16-Jan-04): ;; print out a message on number of spam messages found:
17021.385 (uid65627 17-Feb-04): (if (and (featurep 'rmail-spam-filter)
17031.385 (uid65627 17-Feb-04): rmail-use-spam-filter
17041.385 (uid65627 17-Feb-04): (> rsf-number-of-spam 0))
17051.427 (rms 08-Sep-06): (cond ((= 1 new-messages)
17061.427 (rms 08-Sep-06): ", and appears to be spam")
17071.427 (rms 08-Sep-06): ((= rsf-number-of-spam new-messages)
17081.427 (rms 08-Sep-06): ", and all appear to be spam")
17091.427 (rms 08-Sep-06): ((> rsf-number-of-spam 1)
17101.427 (rms 08-Sep-06): (format ", and %d appear to be spam"
17111.427 (rms 08-Sep-06): rsf-number-of-spam))
17121.427 (rms 08-Sep-06): (t
17131.427 (rms 08-Sep-06): ", and 1 appears to be spam"))
17141.380 (uid65566 16-Jan-04): ""))
17151.385 (uid65627 17-Feb-04): (if (and (featurep 'rmail-spam-filter)
17161.385 (uid65627 17-Feb-04): rmail-use-spam-filter
17171.385 (uid65627 17-Feb-04): (> rsf-number-of-spam 0))
17181.393 (eliz 12-Nov-04): (progn (if rsf-beep (beep t))
17191.393 (eliz 12-Nov-04): (sleep-for rsf-sleep-after-message)))
17201.380 (uid65566 16-Jan-04):
17211.206 (kwzh 25-Jan-97): ;; Move to the first new message
17221.206 (kwzh 25-Jan-97): ;; unless we have other unseen messages before it.
17231.206 (kwzh 25-Jan-97): (rmail-show-message (rmail-first-unseen-message))
17241.206 (kwzh 25-Jan-97): (run-hooks 'rmail-after-get-new-mail-hook)
17251.206 (kwzh 25-Jan-97): (setq found t))))
17261.206 (kwzh 25-Jan-97): found)
17271.198 (rms 19-Sep-96): ;; Don't leave the buffer screwed up if we get a disk-full error.
17281.237 (kwzh 15-Oct-97): (or found (rmail-show-message)))))
17291.1 (roland 13-May-91):
17301.395 (eliz 15-Jan-05): (defun rmail-parse-url (file)
17311.395 (eliz 15-Jan-05): "Parse the supplied URL. Return (list MAILBOX-NAME REMOTE PASSWORD GOT-PASSWORD)
17321.395 (eliz 15-Jan-05): WHERE MAILBOX-NAME is the name of the mailbox suitable as argument to the
17331.395 (eliz 15-Jan-05): actual version of `movemail', REMOTE is non-nil if MAILBOX-NAME refers to
17341.395 (eliz 15-Jan-05): a remote mailbox, PASSWORD is the password if it should be
17351.395 (eliz 15-Jan-05): supplied as a separate argument to `movemail' or nil otherwise, GOT-PASSWORD
17361.395 (eliz 15-Jan-05): is non-nil if the user has supplied the password interactively.
17371.395 (eliz 15-Jan-05): "
17381.398 (eliz 02-Apr-05): (cond
17391.398 (eliz 02-Apr-05): ((string-match "^\\([^:]+\\)://\\(\\([^:@]+\\)\\(:\\([^@]+\\)\\)?@\\)?.*" file)
17401.396 (kfstorm 09-Feb-05): (let (got-password supplied-password
17411.395 (eliz 15-Jan-05): (proto (match-string 1 file))
17421.395 (eliz 15-Jan-05): (user (match-string 3 file))
17431.395 (eliz 15-Jan-05): (pass (match-string 5 file))
17441.395 (eliz 15-Jan-05): (host (substring file (or (match-end 2)
17451.395 (eliz 15-Jan-05): (+ 3 (match-end 1))))))
17461.407 (ttn 06-Aug-05):
17471.395 (eliz 15-Jan-05): (if (not pass)
17481.395 (eliz 15-Jan-05): (when rmail-remote-password-required
17491.395 (eliz 15-Jan-05): (setq got-password (not (rmail-have-password)))
17501.395 (eliz 15-Jan-05): (setq supplied-password (rmail-get-remote-password
17511.395 (eliz 15-Jan-05): (string-equal proto "imap")))))
17521.396 (kfstorm 09-Feb-05):
17531.395 (eliz 15-Jan-05): (if (rmail-movemail-variant-p 'emacs)
17541.395 (eliz 15-Jan-05): (if (string-equal proto "pop")
17551.395 (eliz 15-Jan-05): (list (concat "po:" user ":" host)
17561.395 (eliz 15-Jan-05): t
17571.395 (eliz 15-Jan-05): (or pass supplied-password)
17581.395 (eliz 15-Jan-05): got-password)
17591.395 (eliz 15-Jan-05): (error "Emacs movemail does not support %s protocol" proto))
17601.395 (eliz 15-Jan-05): (list file
17611.395 (eliz 15-Jan-05): (or (string-equal proto "pop") (string-equal proto "imap"))
17621.395 (eliz 15-Jan-05): supplied-password
17631.398 (eliz 02-Apr-05): got-password))))
17641.407 (ttn 06-Aug-05):
17651.398 (eliz 02-Apr-05): ((string-match "^po:\\([^:]+\\)\\(:\\(.*\\)\\)?" file)
17661.398 (eliz 02-Apr-05): (let (got-password supplied-password
17671.398 (eliz 02-Apr-05): (proto "pop")
17681.398 (eliz 02-Apr-05): (user (match-string 1 file))
17691.398 (eliz 02-Apr-05): (host (match-string 3 file)))
17701.407 (ttn 06-Aug-05):
17711.398 (eliz 02-Apr-05): (when rmail-remote-password-required
17721.398 (eliz 02-Apr-05): (setq got-password (not (rmail-have-password)))
17731.398 (eliz 02-Apr-05): (setq supplied-password (rmail-get-remote-password nil)))
17741.398 (eliz 02-Apr-05):
17751.398 (eliz 02-Apr-05): (list file "pop" supplied-password got-password)))
17761.407 (ttn 06-Aug-05):
17771.398 (eliz 02-Apr-05): (t
17781.398 (eliz 02-Apr-05): (list file nil nil nil))))
17791.395 (eliz 15-Jan-05):
17801.1 (roland 13-May-91): (defun rmail-insert-inbox-text (files renamep)
17811.198 (rms 19-Sep-96): ;; Detect a locked file now, so that we avoid moving mail
17821.198 (rms 19-Sep-96): ;; out of the real inbox file. (That could scare people.)
17831.198 (rms 19-Sep-96): (or (memq (file-locked-p buffer-file-name) '(nil t))
17841.198 (rms 19-Sep-96): (error "RMAIL file %s is locked"
17851.198 (rms 19-Sep-96): (file-name-nondirectory buffer-file-name)))
17861.282 (rms 27-Jul-98): (let (file tofile delete-files movemail popmail got-password password)
17871.1 (roland 13-May-91): (while files
17881.395 (eliz 15-Jan-05): ;; Handle remote mailbox names specially; don't expand as filenames
17891.296 (andrewi 29-Jan-99): ;; in case the userid contains a directory separator.
17901.296 (andrewi 29-Jan-99): (setq file (car files))
17911.395 (eliz 15-Jan-05): (let ((url-data (rmail-parse-url file)))
17921.395 (eliz 15-Jan-05): (setq file (nth 0 url-data))
17931.395 (eliz 15-Jan-05): (setq popmail (nth 1 url-data))
17941.395 (eliz 15-Jan-05): (setq password (nth 2 url-data))
17951.395 (eliz 15-Jan-05): (setq got-password (nth 3 url-data)))
17961.395 (eliz 15-Jan-05):
17971.296 (andrewi 29-Jan-99): (if popmail
17981.296 (andrewi 29-Jan-99): (setq renamep t)
17991.296 (andrewi 29-Jan-99): (setq file (file-truename
18001.333 (handa 16-Mar-01): (substitute-in-file-name (expand-file-name file)))))
18011.296 (andrewi 29-Jan-99): (setq tofile (expand-file-name
18021.157 (rms 25-Jul-95): ;; Generate name to move to from inbox name,
18031.157 (rms 25-Jul-95): ;; in case of multiple inboxes that need moving.
18041.395 (eliz 15-Jan-05): (concat ".newmail-"
18051.396 (kfstorm 09-Feb-05): (file-name-nondirectory
18061.395 (eliz 15-Jan-05): (if (memq system-type '(windows-nt cygwin))
18071.395 (eliz 15-Jan-05): ;; cannot have "po:" in file name
18081.395 (eliz 15-Jan-05): (substring file 3)
18091.395 (eliz 15-Jan-05): file)))
18101.157 (rms 25-Jul-95): ;; Use the directory of this rmail file
18111.157 (rms 25-Jul-95): ;; because it's a nuisance to use the homedir
18121.157 (rms 25-Jul-95): ;; if that is on a full disk and this rmail
18131.157 (rms 25-Jul-95): ;; file isn't.
18141.157 (rms 25-Jul-95): (file-name-directory
18151.157 (rms 25-Jul-95): (expand-file-name buffer-file-name))))
18161.157 (rms 25-Jul-95): ;; Always use movemail to rename the file,
18171.157 (rms 25-Jul-95): ;; since there can be mailboxes in various directories.
18181.398 (eliz 02-Apr-05): (if (not popmail)
18191.1 (roland 13-May-91): (progn
18201.1 (roland 13-May-91): ;; On some systems, /usr/spool/mail/foo is a directory
18211.1 (roland 13-May-91): ;; and the actual inbox is /usr/spool/mail/foo/foo.
18221.1 (roland 13-May-91): (if (file-directory-p file)
18231.86 (kwzh 11-Feb-94): (setq file (expand-file-name (user-login-name)
18241.1 (roland 13-May-91): file)))))
18251.150 (rms 14-Apr-95): (cond (popmail
18261.395 (eliz 15-Jan-05): (message "Getting mail from the remote server ..."))
18271.150 (rms 14-Apr-95): ((and (file-exists-p tofile)
18281.150 (rms 14-Apr-95): (/= 0 (nth 7 (file-attributes tofile))))
18291.150 (rms 14-Apr-95): (message "Getting mail from %s..." tofile))
18301.150 (rms 14-Apr-95): ((and (file-exists-p file)
18311.150 (rms 14-Apr-95): (/= 0 (nth 7 (file-attributes file))))
18321.150 (rms 14-Apr-95): (message "Getting mail from %s..." file)))
18331.1 (roland 13-May-91): ;; Set TOFILE if have not already done so, and
18341.1 (roland 13-May-91): ;; rename or copy the file FILE to TOFILE if and as appropriate.
18351.1 (roland 13-May-91): (cond ((not renamep)
18361.1 (roland 13-May-91): (setq tofile file))
18371.39 (rms 09-Mar-93): ((or (file-exists-p tofile) (and (not popmail)
18381.39 (rms 09-Mar-93): (not (file-exists-p file))))
18391.1 (roland 13-May-91): nil)
18401.1 (roland 13-May-91): (t
18411.395 (eliz 15-Jan-05): (with-temp-buffer
18421.395 (eliz 15-Jan-05): (let ((errors (current-buffer)))
18431.395 (eliz 15-Jan-05): (buffer-disable-undo errors)
18441.395 (eliz 15-Jan-05): (let ((args
18451.395 (eliz 15-Jan-05): (append
18461.439 (gm 22-Aug-07): (list rmail-movemail-program nil errors nil)
18471.395 (eliz 15-Jan-05): (if rmail-preserve-inbox
18481.395 (eliz 15-Jan-05): (list "-p")
18491.395 (eliz 15-Jan-05): nil)
18501.395 (eliz 15-Jan-05): (if (rmail-movemail-variant-p 'mailutils)
18511.395 (eliz 15-Jan-05): (append (list "--emacs") rmail-movemail-flags)
18521.395 (eliz 15-Jan-05): rmail-movemail-flags)
18531.395 (eliz 15-Jan-05): (list file tofile)
18541.395 (eliz 15-Jan-05): (if password (list password) nil))))
18551.395 (eliz 15-Jan-05): (apply 'call-process args))
18561.395 (eliz 15-Jan-05): (if (not (buffer-modified-p errors))
18571.395 (eliz 15-Jan-05): ;; No output => movemail won
18581.395 (eliz 15-Jan-05): nil
18591.395 (eliz 15-Jan-05): (set-buffer errors)
18601.395 (eliz 15-Jan-05): (subst-char-in-region (point-min) (point-max)
18611.395 (eliz 15-Jan-05): ?\n ?\ )
18621.395 (eliz 15-Jan-05): (goto-char (point-max))
18631.395 (eliz 15-Jan-05): (skip-chars-backward " \t")
18641.395 (eliz 15-Jan-05): (delete-region (point) (point-max))
18651.395 (eliz 15-Jan-05): (goto-char (point-min))
18661.395 (eliz 15-Jan-05): (if (looking-at "movemail: ")
18671.395 (eliz 15-Jan-05): (delete-region (point-min) (match-end 0)))
18681.395 (eliz 15-Jan-05): (beep t)
18691.395 (eliz 15-Jan-05): ;; If we just read the password, most likely it is
18701.395 (eliz 15-Jan-05): ;; wrong. Otherwise, see if there is a specific
18711.395 (eliz 15-Jan-05): ;; reason to think that the problem is a wrong passwd.
18721.395 (eliz 15-Jan-05): (if (or got-password
18731.395 (eliz 15-Jan-05): (re-search-forward rmail-remote-password-error
18741.395 (eliz 15-Jan-05): nil t))
18751.395 (eliz 15-Jan-05): (rmail-set-remote-password nil))
18761.395 (eliz 15-Jan-05):
18771.395 (eliz 15-Jan-05): ;; If using Mailutils, remove initial error code
18781.395 (eliz 15-Jan-05): ;; abbreviation
18791.395 (eliz 15-Jan-05): (when (rmail-movemail-variant-p 'mailutils)
18801.395 (eliz 15-Jan-05): (goto-char (point-min))
18811.395 (eliz 15-Jan-05): (when (looking-at "[A-Z][A-Z0-9_]*:")
18821.395 (eliz 15-Jan-05): (delete-region (point-min) (match-end 0))))
18831.396 (kfstorm 09-Feb-05):
18841.395 (eliz 15-Jan-05): (message "movemail: %s"
18851.395 (eliz 15-Jan-05): (buffer-substring (point-min)
18861.395 (eliz 15-Jan-05): (point-max)))
18871.396 (kfstorm 09-Feb-05):
18881.395 (eliz 15-Jan-05): (sit-for 3)
18891.395 (eliz 15-Jan-05): nil)))))
18901.396 (kfstorm 09-Feb-05):
18911.1 (roland 13-May-91): ;; At this point, TOFILE contains the name to read:
18921.1 (roland 13-May-91): ;; Either the alternate name (if we renamed)
18931.1 (roland 13-May-91): ;; or the actual inbox (if not renaming).
18941.1 (roland 13-May-91): (if (file-exists-p tofile)
18951.212 (handa 26-Feb-97): (let ((coding-system-for-read 'no-conversion)
18961.212 (handa 26-Feb-97): size)
18971.1 (roland 13-May-91): (goto-char (point-max))
18981.212 (handa 26-Feb-97): (setq size (nth 1 (insert-file-contents tofile)))
18991.1 (roland 13-May-91): (goto-char (point-max))
19001.1 (roland 13-May-91): (or (= (preceding-char) ?\n)
19011.1 (roland 13-May-91): (zerop size)
19021.1 (roland 13-May-91): (insert ?\n))
19031.205 (rms 21-Jan-97): (if (not (and rmail-preserve-inbox (string= file tofile)))
19041.205 (rms 21-Jan-97): (setq delete-files (cons tofile delete-files)))))
19051.1 (roland 13-May-91): (message "")
19061.1 (roland 13-May-91): (setq files (cdr files)))
19071.1 (roland 13-May-91): delete-files))
19081.183 (rms 26-Apr-96):
19091.295 (rms 28-Jan-99): ;; Decode the region specified by FROM and TO by CODING.
19101.295 (rms 28-Jan-99): ;; If CODING is nil or an invalid coding system, decode by `undecided'.
19111.295 (rms 28-Jan-99): (defun rmail-decode-region (from to coding)
19121.295 (rms 28-Jan-99): (if (or (not coding) (not (coding-system-p coding)))
19131.295 (rms 28-Jan-99): (setq coding 'undecided))
19141.390 (eliz 24-Apr-04): ;; Use -dos decoding, to remove ^M characters left from base64 or
19151.390 (eliz 24-Apr-04): ;; rogue qp-encoded text.
19161.390 (eliz 24-Apr-04): (decode-coding-region from to
19171.390 (eliz 24-Apr-04): (coding-system-change-eol-conversion coding 1))
19181.390 (eliz 24-Apr-04): ;; Don't reveal the fact we used -dos decoding, as users generally
19191.390 (eliz 24-Apr-04): ;; will not expect the RMAIL buffer to use DOS EOL format.
19201.390 (eliz 24-Apr-04): (setq buffer-file-coding-system
19211.390 (eliz 24-Apr-04): (setq last-coding-system-used
19221.390 (eliz 24-Apr-04): (coding-system-change-eol-conversion coding 0))))
19231.295 (rms 28-Jan-99):
19241.1 (roland 13-May-91): ;; the rmail-break-forwarded-messages feature is not implemented
19251.1 (roland 13-May-91): (defun rmail-convert-to-babyl-format ()
19261.1 (roland 13-May-91): (let ((count 0) start
19271.5 (rms 18-Aug-91): (case-fold-search nil)
19281.427 (rms 08-Sep-06): (buffer-undo-list t)
19291.5 (rms 18-Aug-91): (invalid-input-resync
19301.5 (rms 18-Aug-91): (function (lambda ()
19311.5 (rms 18-Aug-91): (message "Invalid Babyl format in inbox!")
19321.198 (rms 19-Sep-96): (sit-for 3)
19331.5 (rms 18-Aug-91): ;; Try to get back in sync with a real message.
19341.5 (rms 18-Aug-91): (if (re-search-forward
19351.226 (rms 01-Jun-97): (concat rmail-mmdf-delim1 "\\|^From") nil t)
19361.5 (rms 18-Aug-91): (beginning-of-line)
19371.5 (rms 18-Aug-91): (goto-char (point-max)))))))
19381.1 (roland 13-May-91): (goto-char (point-min))
19391.1 (roland 13-May-91): (save-restriction
19401.1 (roland 13-May-91): (while (not (eobp))
19411.212 (handa 26-Feb-97): (setq start (point))
19421.445 (m061211 13-Jan-08): (cond ((looking-at "BABYL OPTIONS:") ;Babyl header
19431.5 (rms 18-Aug-91): (if (search-forward "\n\^_" nil t)
19441.5 (rms 18-Aug-91): ;; If we find the proper terminator, delete through there.
19451.5 (rms 18-Aug-91): (delete-region (point-min) (point))
19461.5 (rms 18-Aug-91): (funcall invalid-input-resync)
19471.7 (mib 20-Aug-91): (delete-region (point-min) (point))))
19481.1 (roland 13-May-91): ;; Babyl format message
19491.1 (roland 13-May-91): ((looking-at "\^L")
19501.1 (roland 13-May-91): (or (search-forward "\n\^_" nil t)
19511.5 (rms 18-Aug-91): (funcall invalid-input-resync))
19521.1 (roland 13-May-91): (setq count (1+ count))
19531.1 (roland 13-May-91): ;; Make sure there is no extra white space after the ^_
19541.1 (roland 13-May-91): ;; at the end of the message.
19551.1 (roland 13-May-91): ;; Narrowing will make sure that whatever follows the junk
19561.1 (roland 13-May-91): ;; will be treated properly.
19571.1 (roland 13-May-91): (delete-region (point)
19581.1 (roland 13-May-91): (save-excursion
19591.1 (roland 13-May-91): (skip-chars-forward " \t\n")
19601.1 (roland 13-May-91): (point)))
19611.445 (m061211 13-Jan-08): ;; The following let* form was wrapped in a `save-excursion'
19621.445 (m061211 13-Jan-08): ;; which in one case caused infinite looping, see:
19631.445 (m061211 13-Jan-08): ;; http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg00968.html
19641.445 (m061211 13-Jan-08): ;; Removing that form leaves `point' at the end of the
19651.445 (m061211 13-Jan-08): ;; region decoded by `rmail-decode-region' which should
19661.445 (m061211 13-Jan-08): ;; be correct.
19671.445 (m061211 13-Jan-08): (let* ((header-end
19681.445 (m061211 13-Jan-08): (progn
19691.372 (eliz 28-Aug-03): (save-excursion
19701.372 (eliz 28-Aug-03): (goto-char start)
19711.445 (m061211 13-Jan-08): (forward-line 1)
19721.445 (m061211 13-Jan-08): (if (looking-at "0")
19731.445 (m061211 13-Jan-08): (forward-line 1)
19741.445 (m061211 13-Jan-08): (forward-line 2))
19751.445 (m061211 13-Jan-08): (save-restriction
19761.445 (m061211 13-Jan-08): (narrow-to-region (point) (point-max))
19771.445 (m061211 13-Jan-08): (rfc822-goto-eoh)
19781.445 (m061211 13-Jan-08): (point)))))
19791.445 (m061211 13-Jan-08): (case-fold-search t)
19801.445 (m061211 13-Jan-08): (quoted-printable-header-field-end
19811.445 (m061211 13-Jan-08): (save-excursion
19821.445 (m061211 13-Jan-08): (goto-char start)
19831.445 (m061211 13-Jan-08): (re-search-forward
19841.445 (m061211 13-Jan-08): "^content-transfer-encoding:\\(\n?[\t ]\\)*quoted-printable\\(\n?[\t ]\\)*"
19851.445 (m061211 13-Jan-08): header-end t)))
19861.445 (m061211 13-Jan-08): (base64-header-field-end
19871.372 (eliz 28-Aug-03): (save-excursion
19881.445 (m061211 13-Jan-08): (goto-char start)
19891.445 (m061211 13-Jan-08): ;; Don't try to decode non-text data.
19901.445 (m061211 13-Jan-08): (and (re-search-forward
19911.445 (m061211 13-Jan-08): "^content-type:\\(\n?[\t ]\\)\\(text\\|message\\)/"
19921.445 (m061211 13-Jan-08): header-end t)
19931.445 (m061211 13-Jan-08): (goto-char start)
19941.445 (m061211 13-Jan-08): (re-search-forward
19951.445 (m061211 13-Jan-08): "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*"
19961.445 (m061211 13-Jan-08): header-end t)))))
19971.445 (m061211 13-Jan-08): (if quoted-printable-header-field-end
19981.445 (m061211 13-Jan-08): (save-excursion
19991.445 (m061211 13-Jan-08): (unless
20001.445 (m061211 13-Jan-08): (mail-unquote-printable-region header-end (point) nil t t)
20011.445 (m061211 13-Jan-08): (message "Malformed MIME quoted-printable message"))
20021.445 (m061211 13-Jan-08): ;; Change "quoted-printable" to "8bit",
20031.445 (m061211 13-Jan-08): ;; to reflect the decoding we just did.
20041.445 (m061211 13-Jan-08): (goto-char quoted-printable-header-field-end)
20051.445 (m061211 13-Jan-08): (delete-region (point) (search-backward ":"))
20061.445 (m061211 13-Jan-08): (insert ": 8bit")))
20071.445 (m061211 13-Jan-08): (if base64-header-field-end
20081.445 (m061211 13-Jan-08): (save-excursion
20091.445 (m061211 13-Jan-08): (when
20101.445 (m061211 13-Jan-08): (condition-case nil
20111.445 (m061211 13-Jan-08): (progn
20121.445 (m061211 13-Jan-08): (base64-decode-region (1+ header-end)
20131.445 (m061211 13-Jan-08): (- (point) 2))
20141.445 (m061211 13-Jan-08): t)
20151.445 (m061211 13-Jan-08): (error nil))
20161.445 (m061211 13-Jan-08): ;; Change "base64" to "8bit", to reflect the
20171.445 (m061211 13-Jan-08): ;; decoding we just did.
20181.445 (m061211 13-Jan-08): (goto-char base64-header-field-end)
20191.372 (eliz 28-Aug-03): (delete-region (point) (search-backward ":"))
20201.445 (m061211 13-Jan-08): (insert ": 8bit"))))
20211.445 (m061211 13-Jan-08): (setq last-coding-system-used nil)
20221.445 (m061211 13-Jan-08): (or rmail-enable-mime
20231.445 (m061211 13-Jan-08): (not rmail-enable-multibyte)
20241.445 (m061211 13-Jan-08): (let ((mime-charset
20251.445 (m061211 13-Jan-08): (if (and rmail-decode-mime-charset
20261.445 (m061211 13-Jan-08): (save-excursion
20271.445 (m061211 13-Jan-08): (goto-char start)
20281.445 (m061211 13-Jan-08): (search-forward "\n\n" nil t)
20291.445 (m061211 13-Jan-08): (let ((case-fold-search t))
20301.445 (m061211 13-Jan-08): (re-search-backward
20311.445 (m061211 13-Jan-08): rmail-mime-charset-pattern
20321.445 (m061211 13-Jan-08): start t))))
20331.445 (m061211 13-Jan-08): (intern (downcase (match-string 1))))))
20341.445 (m061211 13-Jan-08): (rmail-decode-region start (point) mime-charset))))
20351.265 (rms 12-May-98): ;; Add an X-Coding-System: header if we don't have one.
20361.265 (rms 12-May-98): (save-excursion
20371.265 (rms 12-May-98): (goto-char start)
20381.265 (rms 12-May-98): (forward-line 1)
20391.265 (rms 12-May-98): (if (looking-at "0")
20401.265 (rms 12-May-98): (forward-line 1)
20411.265 (rms 12-May-98): (forward-line 2))
20421.265 (rms 12-May-98): (or (save-restriction
20431.265 (rms 12-May-98): (narrow-to-region (point) (point-max))
20441.265 (rms 12-May-98): (rfc822-goto-eoh)
20451.265 (rms 12-May-98): (goto-char (point-min))
20461.265 (rms 12-May-98): (re-search-forward "^X-Coding-System:" nil t))
20471.265 (rms 12-May-98): (insert "X-Coding-System: "
20481.265 (rms 12-May-98): (symbol-name last-coding-system-used)
20491.265 (rms 12-May-98): "\n")))
20501.374 (eliz 16-Oct-03): (narrow-to-region (point) (point-max))
20511.374 (eliz 16-Oct-03): (and (= 0 (% count 10))
20521.375 (eliz 16-Oct-03): (message "Converting to Babyl format...%d" count)))
20531.1 (roland 13-May-91): ;;*** MMDF format
20541.1 (roland 13-May-91): ((let ((case-fold-search t))
20551.226 (rms 01-Jun-97): (looking-at rmail-mmdf-delim1))
20561.1 (roland 13-May-91): (let ((case-fold-search t))
20571.1 (roland 13-May-91): (replace-match "\^L\n0, unseen,,\n*** EOOH ***\n")
20581.226 (rms 01-Jun-97): (re-search-forward rmail-mmdf-delim2 nil t)
20591.1 (roland 13-May-91): (replace-match "\^_"))
20601.1 (roland 13-May-91): (save-excursion
20611.1 (roland 13-May-91): (save-restriction
20621.1 (roland 13-May-91): (narrow-to-region start (1- (point)))
20631.1 (roland 13-May-91): (goto-char (point-min))
20641.445 (m061211 13-Jan-08): (while (search-forward "\n\^_" nil t) ; single char "\^_"
20651.445 (m061211 13-Jan-08): (replace-match "\n^_")))) ; 2 chars: "^" and "_"
20661.265 (rms 12-May-98): (setq last-coding-system-used nil)
20671.212 (handa 26-Feb-97): (or rmail-enable-mime
20681.247 (handa 20-Feb-98): (not rmail-enable-multibyte)
20691.225 (handa 16-May-97): (decode-coding-region start (point) 'undecided))
20701.265 (rms 12-May-98): (save-excursion
20711.265 (rms 12-May-98): (goto-char start)
20721.265 (rms 12-May-98): (forward-line 3)
20731.265 (rms 12-May-98): (insert "X-Coding-System: "
20741.265 (rms 12-May-98): (symbol-name last-coding-system-used)
20751.265 (rms 12-May-98): "\n"))
20761.1 (roland 13-May-91): (narrow-to-region (point) (point-max))
20771.374 (eliz 16-Oct-03): (setq count (1+ count))
20781.374 (eliz 16-Oct-03): (and (= 0 (% count 10))
20791.375 (eliz 16-Oct-03): (message "Converting to Babyl format...%d" count)))
20801.1 (roland 13-May-91): ;;*** Mail format
20811.1 (roland 13-May-91): ((looking-at "^From ")
20821.1 (roland 13-May-91): (insert "\^L\n0, unseen,,\n*** EOOH ***\n")
20831.1 (roland 13-May-91): (rmail-nuke-pinhead-header)
20841.39 (rms 09-Mar-93): ;; If this message has a Content-Length field,
20851.39 (rms 09-Mar-93): ;; skip to the end of the contents.
20861.39 (rms 09-Mar-93): (let* ((header-end (save-excursion
20871.39 (rms 09-Mar-93): (and (re-search-forward "\n\n" nil t)
20881.77 (rms 06-Jan-94): (1- (point)))))
20891.39 (rms 09-Mar-93): (case-fold-search t)
20901.239 (kwzh 18-Nov-97): (quoted-printable-header-field-end
20911.239 (kwzh 18-Nov-97): (save-excursion
20921.239 (kwzh 18-Nov-97): (re-search-forward
20931.240 (kwzh 18-Nov-97): "^content-transfer-encoding:\\(\n?[\t ]\\)*quoted-printable\\(\n?[\t ]\\)*"
20941.239 (kwzh 18-Nov-97): header-end t)))
20951.372 (eliz 28-Aug-03): (base64-header-field-end
20961.433 (eliz 03-Apr-07): (and
20971.434 (eliz 14-May-07): ;; Don't decode non-text data.
20981.433 (eliz 03-Apr-07): (save-excursion
20991.433 (eliz 03-Apr-07): (re-search-forward
21001.434 (eliz 14-May-07): "^content-type:\\(\n?[\t ]\\)\\(text\\|message\\)/"
21011.433 (eliz 03-Apr-07): header-end t))
21021.433 (eliz 03-Apr-07): (save-excursion
21031.433 (eliz 03-Apr-07): (re-search-forward
21041.434 (eliz 14-May-07): "^content-transfer-encoding:\\(\n?[\t ]\\)*base64\\(\n?[\t ]\\)*"
21051.433 (eliz 03-Apr-07): header-end t))))
21061.39 (rms 09-Mar-93): (size
21071.39 (rms 09-Mar-93): ;; Get the numeric value from the Content-Length field.
21081.39 (rms 09-Mar-93): (save-excursion
21091.39 (rms 09-Mar-93): ;; Back up to end of prev line,
21101.39 (rms 09-Mar-93): ;; in case the Content-Length field comes first.
21111.39 (rms 09-Mar-93): (forward-char -1)
21121.39 (rms 09-Mar-93): (and (search-forward "\ncontent-length: "
21131.39 (rms 09-Mar-93): header-end t)
21141.39 (rms 09-Mar-93): (let ((beg (point))
21151.39 (rms 09-Mar-93): (eol (progn (end-of-line) (point))))
21161.402 (lektu 16-May-05): (string-to-number (buffer-substring beg eol)))))))
21171.90 (kwzh 17-Mar-94): (and size
21181.90 (kwzh 17-Mar-94): (if (and (natnump size)
21191.90 (kwzh 17-Mar-94): (<= (+ header-end size) (point-max))
21201.90 (kwzh 17-Mar-94): ;; Make sure this would put us at a position
21211.90 (kwzh 17-Mar-94): ;; that we could continue from.
21221.90 (kwzh 17-Mar-94): (save-excursion
21231.90 (kwzh 17-Mar-94): (goto-char (+ header-end size))
21241.90 (kwzh 17-Mar-94): (skip-chars-forward "\n")
21251.90 (kwzh 17-Mar-94): (or (eobp)
21261.90 (kwzh 17-Mar-94): (and (looking-at "BABYL OPTIONS:")
21271.90 (kwzh 17-Mar-94): (search-forward "\n\^_" nil t))
21281.90 (kwzh 17-Mar-94): (and (looking-at "\^L")
21291.90 (kwzh 17-Mar-94): (search-forward "\n\^_" nil t))
21301.90 (kwzh 17-Mar-94): (let ((case-fold-search t))
21311.226 (rms 01-Jun-97): (looking-at rmail-mmdf-delim1))
21321.90 (kwzh 17-Mar-94): (looking-at "From "))))
21331.90 (kwzh 17-Mar-94): (goto-char (+ header-end size))
21341.90 (kwzh 17-Mar-94): (message "Ignoring invalid Content-Length field")
21351.239 (kwzh 18-Nov-97): (sit-for 1 0 t)))
21361.365 (rms 29-Nov-02): (if (let ((case-fold-search nil))
21371.365 (rms 29-Nov-02): (re-search-forward
21381.365 (rms 29-Nov-02): (concat "^[\^_]?\\("
21391.365 (rms 29-Nov-02): rmail-unix-mail-delimiter
21401.365 (rms 29-Nov-02): "\\|"
21411.365 (rms 29-Nov-02): rmail-mmdf-delim1 "\\|"
21421.365 (rms 29-Nov-02): "^BABYL OPTIONS:\\|"
21431.365 (rms 29-Nov-02): "\^L\n[01],\\)") nil t))
21441.239 (kwzh 18-Nov-97): (goto-char (match-beginning 1))
21451.239 (kwzh 18-Nov-97): (goto-char (point-max)))
21461.239 (kwzh 18-Nov-97): (setq count (1+ count))
21471.239 (kwzh 18-Nov-97): (if quoted-printable-header-field-end
21481.239 (kwzh 18-Nov-97): (save-excursion
21491.379 (uid65566 12-Jan-04): (unless
21501.386 (rms 04-Mar-04): (mail-unquote-printable-region header-end (point) nil t t)
21511.379 (uid65566 12-Jan-04): (message "Malformed MIME quoted-printable message"))
21521.239 (kwzh 18-Nov-97): ;; Change "quoted-printable" to "8bit",
21531.239 (kwzh 18-Nov-97): ;; to reflect the decoding we just did.
21541.239 (kwzh 18-Nov-97): (goto-char quoted-printable-header-field-end)
21551.372 (eliz 28-Aug-03): (delete-region (point) (search-backward ":"))
21561.372 (eliz 28-Aug-03): (insert ": 8bit")))
21571.372 (eliz 28-Aug-03): (if base64-header-field-end
21581.377 (uid65627 30-Dec-03): (save-excursion
21591.377 (uid65627 30-Dec-03): (when
21601.377 (uid65627 30-Dec-03): (condition-case nil
21611.377 (uid65627 30-Dec-03): (progn
21621.381 (uid66361 21-Jan-04): (base64-decode-region
21631.381 (uid66361 21-Jan-04): (1+ header-end)
21641.381 (uid66361 21-Jan-04): (save-excursion
21651.381 (uid66361 21-Jan-04): ;; Prevent base64-decode-region
21661.381 (uid66361 21-Jan-04): ;; from removing newline characters.
21671.381 (uid66361 21-Jan-04): (skip-chars-backward "\n\t ")
21681.381 (uid66361 21-Jan-04): (point)))
21691.377 (uid65627 30-Dec-03): t)
21701.377 (uid65627 30-Dec-03): (error nil))
21711.377 (uid65627 30-Dec-03): ;; Change "base64" to "8bit", to reflect the
21721.377 (uid65627 30-Dec-03): ;; decoding we just did.
21731.377 (uid65627 30-Dec-03): (goto-char base64-header-field-end)
21741.377 (uid65627 30-Dec-03): (delete-region (point) (search-backward ":"))
21751.377 (uid65627 30-Dec-03): (insert ": 8bit")))))
21761.39 (rms 09-Mar-93):
21771.1 (roland 13-May-91): (save-excursion
21781.1 (roland 13-May-91): (save-restriction
21791.1 (roland 13-May-91): (narrow-to-region start (point))
21801.1 (roland 13-May-91): (goto-char (point-min))
21811.445 (m061211 13-Jan-08): (while (search-forward "\n\^_" nil t) ; single char
21821.445 (m061211 13-Jan-08): (replace-match "\n^_")))) ; 2 chars: "^" and "_"
21831.386 (rms 04-Mar-04): ;; This is for malformed messages that don't end in newline.
21841.386 (rms 04-Mar-04): ;; There shouldn't be any, but some users say occasionally
21851.386 (rms 04-Mar-04): ;; there are some.
21861.386 (rms 04-Mar-04): (or (bolp) (newline))
21871.1 (roland 13-May-91): (insert ?\^_)
21881.265 (rms 12-May-98): (setq last-coding-system-used nil)
21891.212 (handa 26-Feb-97): (or rmail-enable-mime
21901.247 (handa 20-Feb-98): (not rmail-enable-multibyte)
21911.295 (rms 28-Jan-99): (let ((mime-charset
21921.295 (rms 28-Jan-99): (if (and rmail-decode-mime-charset
21931.295 (rms 28-Jan-99): (save-excursion
21941.295 (rms 28-Jan-99): (goto-char start)
21951.295 (rms 28-Jan-99): (search-forward "\n\n" nil t)
21961.295 (rms 28-Jan-99): (let ((case-fold-search t))
21971.295 (rms 28-Jan-99): (re-search-backward
21981.295 (rms 28-Jan-99): rmail-mime-charset-pattern
21991.295 (rms 28-Jan-99): start t))))
22001.426 (eliz 20-May-06): (intern (downcase (match-string 1))))))
22011.295 (rms 28-Jan-99): (rmail-decode-region start (point) mime-charset)))
22021.265 (rms 12-May-98): (save-excursion
22031.265 (rms 12-May-98): (goto-char start)
22041.265 (rms 12-May-98): (forward-line 3)
22051.265 (rms 12-May-98): (insert "X-Coding-System: "
22061.265 (rms 12-May-98): (symbol-name last-coding-system-used)
22071.265 (rms 12-May-98): "\n"))
22081.374 (eliz 16-Oct-03): (narrow-to-region (point) (point-max))
22091.374 (eliz 16-Oct-03): (and (= 0 (% count 10))
22101.375 (eliz 16-Oct-03): (message "Converting to Babyl format...%d" count)))
22111.1 (roland 13-May-91): ;;
22121.43 (rms 09-May-93): ;; This kludge is because some versions of sendmail.el
22131.43 (rms 09-May-93): ;; insert an extra newline at the beginning that shouldn't
22141.43 (rms 09-May-93): ;; be there. sendmail.el has been fixed, but old versions
22151.43 (rms 09-May-93): ;; may still be in use. -- rms, 7 May 1993.
22161.43 (rms 09-May-93): ((eolp) (delete-char 1))
22171.7 (mib 20-Aug-91): (t (error "Cannot convert to babyl format")))))
22181.427 (rms 08-Sep-06): (setq buffer-undo-list nil)
22191.1 (roland 13-May-91): count))
22201.1 (roland 13-May-91):
22211.1 (roland 13-May-91): ;; Delete the "From ..." line, creating various other headers with
22221.1 (roland 13-May-91): ;; information from it if they don't already exist. Now puts the
22231.68 (rms 09-Oct-93): ;; original line into a mail-from: header line for debugging and for
22241.68 (rms 09-Oct-93): ;; use by the rmail-output function.
22251.1 (roland 13-May-91): (defun rmail-nuke-pinhead-header ()
22261.1 (roland 13-May-91): (save-excursion
22271.1 (roland 13-May-91): (save-restriction
22281.1 (roland 13-May-91): (let ((start (point))
22291.1 (roland 13-May-91): (end (progn
22301.1 (roland 13-May-91): (condition-case ()
22311.1 (roland 13-May-91): (search-forward "\n\n")
22321.1 (roland 13-May-91): (error
22331.1 (roland 13-May-91): (goto-char (point-max))
22341.1 (roland 13-May-91): (insert "\n\n")))
22351.1 (roland 13-May-91): (point)))
22361.1 (roland 13-May-91): has-from has-date)
22371.1 (roland 13-May-91): (narrow-to-region start end)
22381.1 (roland 13-May-91): (let ((case-fold-search t))
22391.1 (roland 13-May-91): (goto-char start)
22401.1 (roland 13-May-91): (setq has-from (search-forward "\nFrom:" nil t))
22411.1 (roland 13-May-91): (goto-char start)
22421.1 (roland 13-May-91): (setq has-date (and (search-forward "\nDate:" nil t) (point)))
22431.1 (roland 13-May-91): (goto-char start))
22441.1 (roland 13-May-91): (let ((case-fold-search nil))
22451.10 (jimb 19-Apr-92): (if (re-search-forward (concat "^" rmail-unix-mail-delimiter) nil t)
22461.1 (roland 13-May-91): (replace-match
22471.1 (roland 13-May-91): (concat
22481.1 (roland 13-May-91): "Mail-from: \\&"
22491.1 (roland 13-May-91): ;; Keep and reformat the date if we don't
22501.1 (roland 13-May-91): ;; have a Date: field.
22511.1 (roland 13-May-91): (if has-date
22521.1 (roland 13-May-91): ""
22531.24 (jimb 13-Sep-92): (concat
22541.188 (rms 28-Jun-96): "Date: \\2, \\4 \\3 \\9 \\5 "
22551.358 (pot 06-May-02):
22561.24 (jimb 13-Sep-92): ;; The timezone could be matched by group 7 or group 10.
22571.24 (jimb 13-Sep-92): ;; If neither of them matched, assume EST, since only
22581.24 (jimb 13-Sep-92): ;; Easterners would be so sloppy.
22591.24 (jimb 13-Sep-92): ;; It's a shame the substitution can't use "\\10".
22601.24 (jimb 13-Sep-92): (cond
22611.24 (jimb 13-Sep-92): ((/= (match-beginning 7) (match-end 7)) "\\7")
22621.24 (jimb 13-Sep-92): ((/= (match-beginning 10) (match-end 10))
22631.24 (jimb 13-Sep-92): (buffer-substring (match-beginning 10)
22641.24 (jimb 13-Sep-92): (match-end 10)))
22651.24 (jimb 13-Sep-92): (t "EST"))
22661.24 (jimb 13-Sep-92): "\n"))
22671.1 (roland 13-May-91): ;; Keep and reformat the sender if we don't
22681.1 (roland 13-May-91): ;; have a From: field.
22691.1 (roland 13-May-91): (if has-from
22701.1 (roland 13-May-91): ""
22711.60 (rms 29-Jul-93): "From: \\1\n"))
22721.60 (rms 29-Jul-93): t)))))))
22731.1 (roland 13-May-91):
22741.1 (roland 13-May-91): ;;;; *** Rmail Message Formatting and Header Manipulation ***
22751.1 (roland 13-May-91):
22761.1 (roland 13-May-91): (defun rmail-reformat-message (beg end)
22771.1 (roland 13-May-91): (goto-char beg)
22781.1 (roland 13-May-91): (forward-line 1)
22791.1 (roland 13-May-91): (if (/= (following-char) ?0)
22801.348 (pj 15-Jul-01): (error "Bad format in RMAIL file"))
22811.344 (rms 29-Jun-01): (let ((inhibit-read-only t)
22821.1 (roland 13-May-91): (delta (- (buffer-size) end)))
22831.1 (roland 13-May-91): (delete-char 1)
22841.1 (roland 13-May-91): (insert ?1)
22851.1 (roland 13-May-91): (forward-line 1)
22861.60 (rms 29-Jul-93): (let ((case-fold-search t))
22871.68 (rms 09-Oct-93): (while (looking-at "Summary-line:\\|Mail-From:")
22881.68 (rms 09-Oct-93): (forward-line 1)))
22891.1 (roland 13-May-91): (if (looking-at "\\*\\*\\* EOOH \\*\\*\\*\n")
22901.1 (roland 13-May-91): (delete-region (point)
22911.1 (roland 13-May-91): (progn (forward-line 1) (point))))
22921.1 (roland 13-May-91): (let ((str (buffer-substring (point)
22931.1 (roland 13-May-91): (save-excursion (search-forward "\n\n" end 'move)
22941.1 (roland 13-May-91): (point)))))
22951.1 (roland 13-May-91): (insert str "*** EOOH ***\n")
22961.1 (roland 13-May-91): (narrow-to-region (point) (- (buffer-size) delta)))
22971.1 (roland 13-May-91): (goto-char (point-min))
22981.129 (rms 24-Sep-94): (if rmail-message-filter (funcall rmail-message-filter))
22991.150 (rms 14-Apr-95): (if (or rmail-displayed-headers rmail-ignored-headers)
23001.150 (rms 14-Apr-95): (rmail-clear-headers))))
23011.1 (roland 13-May-91):
23021.128 (rms 23-Sep-94): (defun rmail-clear-headers (&optional ignored-headers)
23031.150 (rms 14-Apr-95): "Delete all header fields that Rmail should not show.
23041.150 (rms 14-Apr-95): If the optional argument IGNORED-HEADERS is non-nil,
23051.150 (rms 14-Apr-95): delete all header fields whose names match that regexp.
23061.150 (rms 14-Apr-95): Otherwise, if `rmail-displayed-headers' is non-nil,
23071.150 (rms 14-Apr-95): delete all header fields *except* those whose names match that regexp.
23081.413 (rms 15-Aug-05): Otherwise, delete all header fields whose names match `rmail-ignored-headers'
23091.413 (rms 15-Aug-05): unless they also match `rmail-nonignored-headers'."
23101.253 (rms 16-Mar-98): (when (search-forward "\n\n" nil t)
23111.253 (rms 16-Mar-98): (forward-char -1)
23121.253 (rms 16-Mar-98): (let ((case-fold-search t)
23131.253 (rms 16-Mar-98): (buffer-read-only nil))
23141.253 (rms 16-Mar-98): (if (and rmail-displayed-headers (null ignored-headers))
23151.254 (rms 26-Mar-98): (save-restriction
23161.254 (rms 26-Mar-98): (narrow-to-region (point-min) (point))
23171.254 (rms 26-Mar-98): (let (lim next)
23181.254 (rms 26-Mar-98): (goto-char (point-min))
23191.254 (rms 26-Mar-98): (while (and (not (eobp))
23201.254 (rms 26-Mar-98): (save-excursion
23211.254 (rms 26-Mar-98): (if (re-search-forward "\n[^ \t]" nil t)
23221.254 (rms 26-Mar-98): (setq lim (match-beginning 0)
23231.254 (rms 26-Mar-98): next (1+ lim))
23241.254 (rms 26-Mar-98): (setq lim nil next (point-max)))))
23251.254 (rms 26-Mar-98): (if (save-excursion
23261.254 (rms 26-Mar-98): (re-search-forward rmail-displayed-headers lim t))
23271.254 (rms 26-Mar-98): (goto-char next)
23281.254 (rms 26-Mar-98): (delete-region (point) next))))
23291.254 (rms 26-Mar-98): (goto-char (point-min)))
23301.253 (rms 16-Mar-98): (or ignored-headers (setq ignored-headers rmail-ignored-headers))
23311.253 (rms 16-Mar-98): (save-restriction
23321.253 (rms 16-Mar-98): (narrow-to-region (point-min) (point))
23331.413 (rms 15-Aug-05): (goto-char (point-min))
23341.320 (gerd 07-Jul-00): (while (and ignored-headers
23351.413 (rms 15-Aug-05): (re-search-forward ignored-headers nil t))
23361.253 (rms 16-Mar-98): (beginning-of-line)
23371.448 (bastien1 10-Feb-08): (if (and rmail-nonignored-headers
23381.448 (bastien1 10-Feb-08): (looking-at rmail-nonignored-headers))
23391.413 (rms 15-Aug-05): (forward-line 1)
23401.413 (rms 15-Aug-05): (delete-region (point)
23411.413 (rms 15-Aug-05): (save-excursion
23421.413 (rms 15-Aug-05): (if (re-search-forward "\n[^ \t]" nil t)
23431.413 (rms 15-Aug-05): (1- (point))
23441.413 (rms 15-Aug-05): (point-max)))))))))))
23451.1 (roland 13-May-91):
23461.204 (rms 28-Dec-96): (defun rmail-msg-is-pruned ()
23471.1 (roland 13-May-91): (rmail-maybe-set-message-counters)
23481.204 (rms 28-Dec-96): (save-restriction
23491.271 (rms 27-May-98): (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max))
23501.204 (rms 28-Dec-96): (save-excursion
23511.271 (rms 27-May-98): (goto-char (point-min))
23521.271 (rms 27-May-98): (forward-line 1)
23531.204 (rms 28-Dec-96): (= (following-char) ?1))))
23541.204 (rms 28-Dec-96):
23551.343 (gerd 26-Jun-01): (defun rmail-msg-restore-non-pruned-header ()
23561.344 (rms 29-Jun-01): (let ((old-point (point))
23571.344 (rms 29-Jun-01): new-point
23581.344 (rms 29-Jun-01): new-start
23591.344 (rms 29-Jun-01): (inhibit-read-only t))
23601.344 (rms 29-Jun-01): (save-excursion
23611.344 (rms 29-Jun-01): (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max))
23621.343 (gerd 26-Jun-01): (goto-char (point-min))
23631.343 (gerd 26-Jun-01): (forward-line 1)
23641.343 (gerd 26-Jun-01): ;; Change 1 to 0.
23651.343 (gerd 26-Jun-01): (delete-char 1)
23661.343 (gerd 26-Jun-01): (insert ?0)
23671.343 (gerd 26-Jun-01): ;; Insert new EOOH line at the proper place.
23681.343 (gerd 26-Jun-01): (forward-line 1)
23691.343 (gerd 26-Jun-01): (let ((case-fold-search t))
23701.343 (gerd 26-Jun-01): (while (looking-at "Summary-Line:\\|Mail-From:")
23711.343 (gerd 26-Jun-01): (forward-line 1)))
23721.343 (gerd 26-Jun-01): (insert "*** EOOH ***\n")
23731.343 (gerd 26-Jun-01): (setq new-start (point))
23741.343 (gerd 26-Jun-01): ;; Delete the old reformatted header.
23751.343 (gerd 26-Jun-01): (forward-char -1)
23761.343 (gerd 26-Jun-01): (search-forward "\n*** EOOH ***\n")
23771.343 (gerd 26-Jun-01): (forward-line -1)
23781.343 (gerd 26-Jun-01): (let ((start (point)))
23791.343 (gerd 26-Jun-01): (search-forward "\n\n")
23801.344 (rms 29-Jun-01): (if (and (<= start old-point)
23811.344 (rms 29-Jun-01): (<= old-point (point)))
23821.344 (rms 29-Jun-01): (setq new-point new-start))
23831.343 (gerd 26-Jun-01): (delete-region start (point)))
23841.343 (gerd 26-Jun-01): ;; Narrow to after the new EOOH line.
23851.344 (rms 29-Jun-01): (narrow-to-region new-start (point-max)))
23861.344 (rms 29-Jun-01): (if new-point
23871.344 (rms 29-Jun-01): (goto-char new-point))))
23881.343 (gerd 26-Jun-01):
23891.343 (gerd 26-Jun-01): (defun rmail-msg-prune-header ()
23901.344 (rms 29-Jun-01): (let ((new-point
23911.344 (rms 29-Jun-01): (= (point) (point-min))))
23921.344 (rms 29-Jun-01): (save-excursion
23931.344 (rms 29-Jun-01): (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max))
23941.344 (rms 29-Jun-01): (rmail-reformat-message (point-min) (point-max)))
23951.344 (rms 29-Jun-01): (if new-point
23961.344 (rms 29-Jun-01): (goto-char (point-min)))))
23971.343 (gerd 26-Jun-01):
23981.204 (rms 28-Dec-96): (defun rmail-toggle-header (&optional arg)
23991.204 (rms 28-Dec-96): "Show original message header if pruned header currently shown, or vice versa.
24001.204 (rms 28-Dec-96): With argument ARG, show the message header pruned if ARG is greater than zero;
24011.204 (rms 28-Dec-96): otherwise, show it in full."
24021.204 (rms 28-Dec-96): (interactive "P")
24031.343 (gerd 26-Jun-01): (let* ((pruned (with-current-buffer rmail-buffer
24041.343 (gerd 26-Jun-01): (rmail-msg-is-pruned)))
24051.273 (kwzh 04-Jun-98): (prune (if arg
24061.273 (kwzh 04-Jun-98): (> (prefix-numeric-value arg) 0)
24071.273 (kwzh 04-Jun-98): (not pruned))))
24081.273 (kwzh 04-Jun-98): (if (eq pruned prune)
24091.273 (kwzh 04-Jun-98): t
24101.343 (gerd 26-Jun-01): (set-buffer rmail-buffer)
24111.273 (kwzh 04-Jun-98): (rmail-maybe-set-message-counters)
24121.343 (gerd 26-Jun-01): (if rmail-enable-mime
24131.343 (gerd 26-Jun-01): (let ((buffer-read-only nil))
24141.343 (gerd 26-Jun-01): (if pruned
24151.343 (gerd 26-Jun-01): (rmail-msg-restore-non-pruned-header)
24161.343 (gerd 26-Jun-01): (rmail-msg-prune-header))
24171.343 (gerd 26-Jun-01): (funcall rmail-show-mime-function))
24181.343 (gerd 26-Jun-01): (let* ((buffer-read-only nil)
24191.343 (gerd 26-Jun-01): (window (get-buffer-window (current-buffer)))
24201.343 (gerd 26-Jun-01): (at-point-min (= (point) (point-min)))
24211.343 (gerd 26-Jun-01): (all-headers-visible (= (window-start window) (point-min)))
24221.343 (gerd 26-Jun-01): (on-header
24231.343 (gerd 26-Jun-01): (save-excursion
24241.343 (gerd 26-Jun-01): (and (not (search-backward "\n\n" nil t))
24251.343 (gerd 26-Jun-01): (progn
24261.343 (gerd 26-Jun-01): (end-of-line)
24271.343 (gerd 26-Jun-01): (re-search-backward "^[-A-Za-z0-9]+:" nil t))
24281.343 (gerd 26-Jun-01): (match-string 0))))
24291.343 (gerd 26-Jun-01): (old-screen-line
24301.343 (gerd 26-Jun-01): (rmail-count-screen-lines (window-start window) (point))))
24311.275 (rms 11-Jun-98): (if pruned
24321.343 (gerd 26-Jun-01): (rmail-msg-restore-non-pruned-header)
24331.343 (gerd 26-Jun-01): (rmail-msg-prune-header))
24341.343 (gerd 26-Jun-01): (cond (at-point-min
24351.343 (gerd 26-Jun-01): (goto-char (point-min)))
24361.343 (gerd 26-Jun-01): (on-header
24371.343 (gerd 26-Jun-01): (goto-char (point-min))
24381.343 (gerd 26-Jun-01): (search-forward "\n\n")
24391.343 (gerd 26-Jun-01): (or (re-search-backward
24401.343 (gerd 26-Jun-01): (concat "^" (regexp-quote on-header)) nil t)
24411.343 (gerd 26-Jun-01): (goto-char (point-min))))
24421.343 (gerd 26-Jun-01): (t
24431.343 (gerd 26-Jun-01): (save-selected-window
24441.343 (gerd 26-Jun-01): (select-window window)
24451.343 (gerd 26-Jun-01): (recenter old-screen-line)
24461.343 (gerd 26-Jun-01): (if (and all-headers-visible
24471.343 (gerd 26-Jun-01): (not (= (window-start) (point-min))))
24481.355 (rms 06-Feb-02): (recenter (- (window-height) 2))))))))
24491.273 (kwzh 04-Jun-98): (rmail-highlight-headers))))
24501.273 (kwzh 04-Jun-98):
24511.344 (rms 29-Jun-01): (defun rmail-narrow-to-non-pruned-header ()
24521.344 (rms 29-Jun-01): "Narrow to the whole (original) header of the current message."
24531.344 (rms 29-Jun-01): (let (start end)
24541.344 (rms 29-Jun-01): (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max))
24551.344 (rms 29-Jun-01): (goto-char (point-min))
24561.344 (rms 29-Jun-01): (forward-line 1)
24571.344 (rms 29-Jun-01): (if (= (following-char) ?1)
24581.344 (rms 29-Jun-01): (progn
24591.344 (rms 29-Jun-01): (forward-line 1)
24601.344 (rms 29-Jun-01): (setq start (point))
24611.344 (rms 29-Jun-01): (search-forward "*** EOOH ***\n")
24621.344 (rms 29-Jun-01): (setq end (match-beginning 0)))
24631.344 (rms 29-Jun-01): (forward-line 2)
24641.344 (rms 29-Jun-01): (setq start (point))
24651.344 (rms 29-Jun-01): (search-forward "\n\n")
24661.344 (rms 29-Jun-01): (setq end (1- (point))))
24671.344 (rms 29-Jun-01): (narrow-to-region start end)
24681.344 (rms 29-Jun-01): (goto-char start)))
24691.344 (rms 29-Jun-01):
24701.273 (kwzh 04-Jun-98): ;; Lifted from repos-count-screen-lines.
24711.273 (kwzh 04-Jun-98): ;; Return number of screen lines between START and END.
24721.273 (kwzh 04-Jun-98): (defun rmail-count-screen-lines (start end)
24731.272 (kwzh 02-Jun-98): (save-excursion
24741.273 (kwzh 04-Jun-98): (save-restriction
24751.273 (kwzh 04-Jun-98): (narrow-to-region start end)
24761.273 (kwzh 04-Jun-98): (goto-char (point-min))
24771.273 (kwzh 04-Jun-98): (vertical-motion (- (point-max) (point-min))))))
24781.1 (roland 13-May-91):
24791.1 (roland 13-May-91): ;;;; *** Rmail Attributes and Keywords ***
24801.1 (roland 13-May-91):
24811.1 (roland 13-May-91): ;; Make a string describing current message's attributes and keywords
24821.1 (roland 13-May-91): ;; and set it up as the name of a minor mode
24831.1 (roland 13-May-91): ;; so it will appear in the mode line.
24841.1 (roland 13-May-91): (defun rmail-display-labels ()
24851.1 (roland 13-May-91): (let ((blurb "") (beg (point-min-marker)) (end (point-max-marker)))
24861.1 (roland 13-May-91): (save-excursion
24871.1 (roland 13-May-91): (unwind-protect
24881.1 (roland 13-May-91): (progn
24891.1 (roland 13-May-91): (widen)
24901.1 (roland 13-May-91): (goto-char (rmail-msgbeg rmail-current-message))
24911.1 (roland 13-May-91): (forward-line 1)
24921.1 (roland 13-May-91): (if (looking-at "[01],")
24931.1 (roland 13-May-91): (progn
24941.1 (roland 13-May-91): (narrow-to-region (point) (progn (end-of-line) (point)))
24951.1 (roland 13-May-91): ;; Truly valid BABYL format requires a space before each
24961.1 (roland 13-May-91): ;; attribute or keyword name. Put them in if missing.
24971.1 (roland 13-May-91): (let (buffer-read-only)
24981.1 (roland 13-May-91): (goto-char (point-min))
24991.1 (roland 13-May-91): (while (search-forward "," nil t)
25001.1 (roland 13-May-91): (or (looking-at "[ ,]") (eobp)
25011.1 (roland 13-May-91): (insert " "))))
25021.1 (roland 13-May-91): (goto-char (point-max))
25031.1 (roland 13-May-91): (if (search-backward ",," nil 'move)
25041.1 (roland 13-May-91): (progn
25051.1 (roland 13-May-91): (if (> (point) (1+ (point-min)))
25061.1 (roland 13-May-91): (setq blurb (buffer-substring (+ 1 (point-min)) (point))))
25071.1 (roland 13-May-91): (if (> (- (point-max) (point)) 2)
25081.1 (roland 13-May-91): (setq blurb
25091.1 (roland 13-May-91): (concat blurb
25101.1 (roland 13-May-91): ";"
25111.1 (roland 13-May-91): (buffer-substring (+ (point) 3)
25121.1 (roland 13-May-91): (1- (point-max)))))))))))
25131.1 (roland 13-May-91): ;; Note: we don't use save-restriction because that does not work right
25141.1 (roland 13-May-91): ;; if changes are made outside the saved restriction
25151.1 (roland 13-May-91): ;; before that restriction is restored.
25161.1 (roland 13-May-91): (narrow-to-region beg end)
25171.1 (roland 13-May-91): (set-marker beg nil)
25181.1 (roland 13-May-91): (set-marker end nil)))
25191.1 (roland 13-May-91): (while (string-match " +," blurb)
25201.1 (roland 13-May-91): (setq blurb (concat (substring blurb 0 (match-beginning 0)) ","
25211.1 (roland 13-May-91): (substring blurb (match-end 0)))))
25221.1 (roland 13-May-91): (while (string-match ", +" blurb)
25231.1 (roland 13-May-91): (setq blurb (concat (substring blurb 0 (match-beginning 0)) ","
25241.1 (roland 13-May-91): (substring blurb (match-end 0)))))
25251.1 (roland 13-May-91): (setq mode-line-process
25261.150 (rms 14-Apr-95): (format " %d/%d%s"
25271.339 (gerd 08-May-01): rmail-current-message rmail-total-messages blurb))
25281.339 (gerd 08-May-01): ;; If rmail-enable-mime is non-nil, we may have to update
25291.339 (gerd 08-May-01): ;; `mode-line-process' of rmail-view-buffer too.
25301.339 (gerd 08-May-01): (if (and rmail-enable-mime
25311.339 (gerd 08-May-01): (not (eq (current-buffer) rmail-view-buffer))
25321.339 (gerd 08-May-01): (buffer-live-p rmail-view-buffer))
25331.339 (gerd 08-May-01): (let ((mlp mode-line-process))
25341.339 (gerd 08-May-01): (with-current-buffer rmail-view-buffer
25351.339 (gerd 08-May-01): (setq mode-line-process mlp))))))
25361.1 (roland 13-May-91):
25371.1 (roland 13-May-91): ;; Turn an attribute of a message on or off according to STATE.
25381.1 (roland 13-May-91): ;; ATTR is the name of the attribute, as a string.
25391.1 (roland 13-May-91): ;; MSGNUM is message number to change; nil means current message.
25401.1 (roland 13-May-91): (defun rmail-set-attribute (attr state &optional msgnum)
25411.339 (gerd 08-May-01): (set-buffer rmail-buffer)
25421.1 (roland 13-May-91): (let ((omax (point-max-marker))
25431.1 (roland 13-May-91): (omin (point-min-marker))
25441.1 (roland 13-May-91): (buffer-read-only nil))
25451.1 (roland 13-May-91): (or msgnum (setq msgnum rmail-current-message))
25461.71 (rms 16-Nov-93): (if (> msgnum 0)
25471.71 (rms 16-Nov-93): (unwind-protect
25481.71 (rms 16-Nov-93): (save-excursion
25491.71 (rms 16-Nov-93): (widen)
25501.71 (rms 16-Nov-93): (goto-char (+ 3 (rmail-msgbeg msgnum)))
25511.71 (rms 16-Nov-93): (let ((curstate
25521.71 (rms 16-Nov-93): (not
25531.71 (rms 16-Nov-93): (null (search-backward (concat ", " attr ",")
25541.71 (rms 16-Nov-93): (prog1 (point) (end-of-line)) t)))))
25551.71 (rms 16-Nov-93): (or (eq curstate (not (not state)))
25561.71 (rms 16-Nov-93): (if curstate
25571.71 (rms 16-Nov-93): (delete-region (point) (1- (match-end 0)))
25581.71 (rms 16-Nov-93): (beginning-of-line)
25591.71 (rms 16-Nov-93): (forward-char 2)
25601.71 (rms 16-Nov-93): (insert " " attr ","))))
25611.71 (rms 16-Nov-93): (if (string= attr "deleted")
25621.71 (rms 16-Nov-93): (rmail-set-message-deleted-p msgnum state)))
25631.71 (rms 16-Nov-93): ;; Note: we don't use save-restriction because that does not work right
25641.71 (rms 16-Nov-93): ;; if changes are made outside the saved restriction
25651.71 (rms 16-Nov-93): ;; before that restriction is restored.
25661.71 (rms 16-Nov-93): (narrow-to-region omin omax)
25671.71 (rms 16-Nov-93): (set-marker omin nil)
25681.71 (rms 16-Nov-93): (set-marker omax nil)
25691.71 (rms 16-Nov-93): (if (= msgnum rmail-current-message)
25701.71 (rms 16-Nov-93): (rmail-display-labels))))))
25711.1 (roland 13-May-91):
25721.1 (roland 13-May-91): ;; Return t if the attributes/keywords line of msg number MSG
25731.1 (roland 13-May-91): ;; contains a match for the regexp LABELS.
25741.1 (roland 13-May-91): (defun rmail-message-labels-p (msg labels)
25751.1 (roland 13-May-91): (save-excursion
25761.1 (roland 13-May-91): (save-restriction
25771.1 (roland 13-May-91): (widen)
25781.1 (roland 13-May-91): (goto-char (rmail-msgbeg msg))
25791.1 (roland 13-May-91): (forward-char 3)
25801.1 (roland 13-May-91): (re-search-backward labels (prog1 (point) (end-of-line)) t))))
25811.1 (roland 13-May-91):
25821.1 (roland 13-May-91): ;;;; *** Rmail Message Selection And Support ***
25831.1 (roland 13-May-91):
25841.1 (roland 13-May-91): (defun rmail-msgend (n)
25851.1 (roland 13-May-91): (marker-position (aref rmail-message-vector (1+ n))))
25861.1 (roland 13-May-91):
25871.1 (roland 13-May-91): (defun rmail-msgbeg (n)
25881.1 (roland 13-May-91): (marker-position (aref rmail-message-vector n)))
25891.1 (roland 13-May-91):
25901.1 (roland 13-May-91): (defun rmail-widen-to-current-msgbeg (function)
25911.1 (roland 13-May-91): "Call FUNCTION with point at start of internal data of current message.
25921.1 (roland 13-May-91): Assumes that bounds were previously narrowed to display the message in Rmail.
25931.1 (roland 13-May-91): The bounds are widened enough to move point where desired, then narrowed
25941.1 (roland 13-May-91): again afterward.
25951.1 (roland 13-May-91):
25961.1 (roland 13-May-91): FUNCTION may not change the visible text of the message, but it may
25971.1 (roland 13-May-91): change the invisible header text."
25981.1 (roland 13-May-91): (save-excursion
25991.318 (gerd 30-May-00): (unwind-protect
26001.318 (gerd 30-May-00): (progn
26011.318 (gerd 30-May-00): (narrow-to-region (rmail-msgbeg rmail-current-message)
26021.318 (gerd 30-May-00): (point-max))
26031.318 (gerd 30-May-00): (goto-char (point-min))
26041.318 (gerd 30-May-00): (funcall function))
26051.1 (roland 13-May-91): ;; Note: we don't use save-restriction because that does not work right
26061.1 (roland 13-May-91): ;; if changes are made outside the saved restriction
26071.1 (roland 13-May-91): ;; before that restriction is restored.
26081.318 (gerd 30-May-00): (narrow-to-region (rmail-msgbeg rmail-current-message)
26091.318 (gerd 30-May-00): (rmail-msgend rmail-current-message)))))
26101.1 (roland 13-May-91):
26111.1 (roland 13-May-91): (defun rmail-forget-messages ()
26121.1 (roland 13-May-91): (unwind-protect
26131.1 (roland 13-May-91): (if (vectorp rmail-message-vector)
26141.1 (roland 13-May-91): (let* ((i 0)
26151.1 (roland 13-May-91): (v rmail-message-vector)
26161.1 (roland 13-May-91): (n (length v)))
26171.1 (roland 13-May-91): (while (< i n)
26181.1 (roland 13-May-91): (move-marker (aref v i) nil)
26191.1 (roland 13-May-91): (setq i (1+ i)))))
26201.1 (roland 13-May-91): (setq rmail-message-vector nil)
26211.218 (rms 02-May-97): (setq rmail-msgref-vector nil)
26221.1 (roland 13-May-91): (setq rmail-deleted-vector nil)))
26231.1 (roland 13-May-91):
26241.1 (roland 13-May-91): (defun rmail-maybe-set-message-counters ()
26251.1 (roland 13-May-91): (if (not (and rmail-deleted-vector
26261.1 (roland 13-May-91): rmail-message-vector
26271.1 (roland 13-May-91): rmail-current-message
26281.1 (roland 13-May-91): rmail-total-messages))
26291.1 (roland 13-May-91): (rmail-set-message-counters)))
26301.1 (roland 13-May-91):
26311.1 (roland 13-May-91): (defun rmail-count-new-messages (&optional nomsg)
26321.1 (roland 13-May-91): (let* ((case-fold-search nil)
26331.1 (roland 13-May-91): (total-messages 0)
26341.1 (roland 13-May-91): (messages-head nil)
26351.1 (roland 13-May-91): (deleted-head nil))
26361.1 (roland 13-May-91): (or nomsg (message "Counting new messages..."))
26371.1 (roland 13-May-91): (goto-char (point-max))
26381.1 (roland 13-May-91): ;; Put at the end of messages-head
26391.1 (roland 13-May-91): ;; the entry for message N+1, which marks
26401.1 (roland 13-May-91): ;; the end of message N. (N = number of messages).
26411.1 (roland 13-May-91): (search-backward "\n\^_")
26421.1 (roland 13-May-91): (forward-char 1)
26431.1 (roland 13-May-91): (setq messages-head (list (point-marker)))
26441.1 (roland 13-May-91): (rmail-set-message-counters-counter (point-min))
26451.1 (roland 13-May-91): (setq rmail-current-message (1+ rmail-total-messages))
26461.1 (roland 13-May-91): (setq rmail-total-messages
26471.1 (roland 13-May-91): (+ rmail-total-messages total-messages))
26481.1 (roland 13-May-91): (setq rmail-message-vector
26491.1 (roland 13-May-91): (vconcat rmail-message-vector (cdr messages-head)))
26501.1 (roland 13-May-91): (aset rmail-message-vector
26511.1 (roland 13-May-91): rmail-current-message (car messages-head))
26521.1 (roland 13-May-91): (setq rmail-deleted-vector
26531.1 (roland 13-May-91): (concat rmail-deleted-vector deleted-head))
26541.1 (roland 13-May-91): (setq rmail-summary-vector
26551.1 (roland 13-May-91): (vconcat rmail-summary-vector (make-vector total-messages nil)))
26561.218 (rms 02-May-97): (setq rmail-msgref-vector
26571.218 (rms 02-May-97): (vconcat rmail-msgref-vector (make-vector total-messages nil)))
26581.218 (rms 02-May-97): ;; Fill in the new elements of rmail-msgref-vector.
26591.220 (rms 04-May-97): (let ((i (1+ (- rmail-total-messages total-messages))))
26601.218 (rms 02-May-97): (while (<= i rmail-total-messages)
26611.218 (rms 02-May-97): (aset rmail-msgref-vector i (list i))
26621.218 (rms 02-May-97): (setq i (1+ i))))
26631.1 (roland 13-May-91): (goto-char (point-min))
26641.1 (roland 13-May-91): (or nomsg (message "Counting new messages...done (%d)" total-messages))))
26651.1 (roland 13-May-91):
26661.1 (roland 13-May-91): (defun rmail-set-message-counters ()
26671.1 (roland 13-May-91): (rmail-forget-messages)
26681.1 (roland 13-May-91): (save-excursion
26691.1 (roland 13-May-91): (save-restriction
26701.1 (roland 13-May-91): (widen)
26711.1 (roland 13-May-91): (let* ((point-save (point))
26721.1 (roland 13-May-91): (total-messages 0)
26731.1 (roland 13-May-91): (messages-after-point)
26741.1 (roland 13-May-91): (case-fold-search nil)
26751.1 (roland 13-May-91): (messages-head nil)
26761.1 (roland 13-May-91): (deleted-head nil))
26771.1 (roland 13-May-91): (message "Counting messages...")
26781.1 (roland 13-May-91): (goto-char (point-max))
26791.1 (roland 13-May-91): ;; Put at the end of messages-head
26801.1 (roland 13-May-91): ;; the entry for message N+1, which marks
26811.1 (roland 13-May-91): ;; the end of message N. (N = number of messages).
26821.79 (rms 14-Jan-94): (search-backward "\n\^_" nil t)
26831.79 (rms 14-Jan-94): (if (/= (point) (point-max)) (forward-char 1))
26841.1 (roland 13-May-91): (setq messages-head (list (point-marker)))
26851.1 (roland 13-May-91): (rmail-set-message-counters-counter (min (point) point-save))
26861.1 (roland 13-May-91): (setq messages-after-point total-messages)
26871.1 (roland 13-May-91): (rmail-set-message-counters-counter)
26881.1 (roland 13-May-91): (setq rmail-total-messages total-messages)
26891.1 (roland 13-May-91): (setq rmail-current-message
26901.1 (roland 13-May-91): (min total-messages
26911.1 (roland 13-May-91): (max 1 (- total-messages messages-after-point))))
26921.1 (roland 13-May-91): (setq rmail-message-vector
26931.1 (roland 13-May-91): (apply 'vector (cons (point-min-marker) messages-head))
26941.324 (gerd 30-Nov-00): rmail-deleted-vector (concat "0" deleted-head)
26951.218 (rms 02-May-97): rmail-summary-vector (make-vector rmail-total-messages nil)
26961.218 (rms 02-May-97): rmail-msgref-vector (make-vector (1+ rmail-total-messages) nil))
26971.218 (rms 02-May-97): (let ((i 0))
26981.218 (rms 02-May-97): (while (<= i rmail-total-messages)
26991.218 (rms 02-May-97): (aset rmail-msgref-vector i (list i))
27001.218 (rms 02-May-97): (setq i (1+ i))))
27011.1 (roland 13-May-91): (message "Counting messages...done")))))
27021.358 (pot 06-May-02):
27031.1 (roland 13-May-91): (defun rmail-set-message-counters-counter (&optional stop)
27041.292 (andrewi 22-Nov-98): (let ((start (point))
27051.292 (andrewi 22-Nov-98): next)
27061.292 (andrewi 22-Nov-98): (while (search-backward "\n\^_\^L" stop t)
27071.292 (andrewi 22-Nov-98): ;; Detect messages that have been added with DOS line endings and
27081.292 (andrewi 22-Nov-98): ;; convert the line endings for such messages.
27091.292 (andrewi 22-Nov-98): (setq next (point))
27101.292 (andrewi 22-Nov-98): (if (looking-at "\n\^_\^L\r\n")
27111.292 (andrewi 22-Nov-98): (let ((buffer-read-only nil)
27121.292 (andrewi 22-Nov-98): (buffer-undo t))
27131.292 (andrewi 22-Nov-98): (message "Counting messages...(converting line endings)")
27141.292 (andrewi 22-Nov-98): (save-excursion
27151.292 (andrewi 22-Nov-98): (goto-char start)
27161.292 (andrewi 22-Nov-98): (while (search-backward "\r\n" next t)
27171.292 (andrewi 22-Nov-98): (delete-char 1)))))
27181.292 (andrewi 22-Nov-98): (setq start next)
27191.292 (andrewi 22-Nov-98): (forward-char 1)
27201.292 (andrewi 22-Nov-98): (setq messages-head (cons (point-marker) messages-head))
27211.292 (andrewi 22-Nov-98): (save-excursion
27221.292 (andrewi 22-Nov-98): (setq deleted-head
27231.292 (andrewi 22-Nov-98): (cons (if (search-backward ", deleted,"
27241.292 (andrewi 22-Nov-98): (prog1 (point)
27251.292 (andrewi 22-Nov-98): (forward-line 2))
27261.292 (andrewi 22-Nov-98): t)
27271.292 (andrewi 22-Nov-98): ?D ?\ )
27281.292 (andrewi 22-Nov-98): deleted-head)))
27291.292 (andrewi 22-Nov-98): (if (zerop (% (setq total-messages (1+ total-messages)) 20))
27301.292 (andrewi 22-Nov-98): (message "Counting messages...%d" total-messages)))))
27311.1 (roland 13-May-91):
27321.1 (roland 13-May-91): (defun rmail-beginning-of-message ()
27331.1 (roland 13-May-91): "Show current message starting from the beginning."
27341.1 (roland 13-May-91): (interactive)
27351.410 (eliz 12-Aug-05): (let ((rmail-show-message-hook
27361.410 (eliz 12-Aug-05): (list (function (lambda ()
27371.410 (eliz 12-Aug-05): (goto-char (point-min)))))))
27381.410 (eliz 12-Aug-05): (rmail-show-message rmail-current-message)))
27391.410 (eliz 12-Aug-05):
27401.410 (eliz 12-Aug-05): (defun rmail-end-of-message ()
27411.410 (eliz 12-Aug-05): "Show bottom of current message."
27421.410 (eliz 12-Aug-05): (interactive)
27431.410 (eliz 12-Aug-05): (let ((rmail-show-message-hook
27441.410 (eliz 12-Aug-05): (list (function (lambda ()
27451.410 (eliz 12-Aug-05): (goto-char (point-max))
27461.410 (eliz 12-Aug-05): (recenter (1- (window-height))))))))
27471.410 (eliz 12-Aug-05): (rmail-show-message rmail-current-message)))
27481.1 (roland 13-May-91):
27491.397 (rms 18-Mar-05): (defun rmail-unknown-mail-followup-to ()
27501.397 (rms 18-Mar-05): "Handle a \"Mail-Followup-To\" header field with an unknown mailing list.
27511.397 (rms 18-Mar-05): Ask the user whether to add that list name to `mail-mailing-lists'."
27521.397 (rms 18-Mar-05): (save-restriction
27531.397 (rms 18-Mar-05): (rmail-narrow-to-non-pruned-header)
27541.397 (rms 18-Mar-05): (let ((mail-followup-to (mail-fetch-field "mail-followup-to" nil t)))
27551.397 (rms 18-Mar-05): (when mail-followup-to
27561.397 (rms 18-Mar-05): (let ((addresses
27571.407 (ttn 06-Aug-05): (split-string
27581.397 (rms 18-Mar-05): (mail-strip-quoted-names mail-followup-to)
27591.397 (rms 18-Mar-05): ",[[:space:]]+" t)))
27601.397 (rms 18-Mar-05): (dolist (addr addresses)
27611.397 (rms 18-Mar-05): (when (and (not (member addr mail-mailing-lists))
27621.397 (rms 18-Mar-05): (not
27631.397 (rms 18-Mar-05): ;; taken from rmailsum.el
27641.397 (rms 18-Mar-05): (string-match
27651.397 (rms 18-Mar-05): (or rmail-user-mail-address-regexp
27661.397 (rms 18-Mar-05): (concat "^\\("
27671.397 (rms 18-Mar-05): (regexp-quote (user-login-name))
27681.397 (rms 18-Mar-05): "\\($\\|@\\)\\|"
27691.397 (rms 18-Mar-05): (regexp-quote
27701.397 (rms 18-Mar-05): (or user-mail-address
27711.397 (rms 18-Mar-05): (concat (user-login-name) "@"
27721.397 (rms 18-Mar-05): (or mail-host-address
27731.397 (rms 18-Mar-05): (system-name)))))
27741.397 (rms 18-Mar-05): "\\>\\)"))
27751.397 (rms 18-Mar-05): addr))
27761.397 (rms 18-Mar-05): (y-or-n-p
27771.397 (rms 18-Mar-05): (format "Add `%s' to `mail-mailing-lists'? "
27781.397 (rms 18-Mar-05): addr)))
27791.397 (rms 18-Mar-05): (customize-save-variable 'mail-mailing-lists
27801.397 (rms 18-Mar-05): (cons addr mail-mailing-lists)))))))))
27811.397 (rms 18-Mar-05):
27821.134 (rms 11-Oct-94): (defun rmail-show-message (&optional n no-summary)
27831.39 (rms 09-Mar-93): "Show message number N (prefix argument), counting from start of file.
27841.39 (rms 09-Mar-93): If summary buffer is currently displayed, update current message there also."
27851.1 (roland 13-May-91): (interactive "p")
27861.212 (handa 26-Feb-97): (or (eq major-mode 'rmail-mode)
27871.212 (handa 26-Feb-97): (switch-to-buffer rmail-buffer))
27881.1 (roland 13-May-91): (rmail-maybe-set-message-counters)
27891.1 (roland 13-May-91): (widen)
27901.1 (roland 13-May-91): (if (zerop rmail-total-messages)
27911.1 (roland 13-May-91): (progn (narrow-to-region (point-min) (1- (point-max)))
27921.1 (roland 13-May-91): (goto-char (point-min))
27931.1 (roland 13-May-91): (setq mode-line-process nil))
27941.265 (rms 12-May-98): (let (blurb coding-system)
27951.1 (roland 13-May-91): (if (not n)
27961.1 (roland 13-May-91): (setq n rmail-current-message)
27971.1 (roland 13-May-91): (cond ((<= n 0)
27981.1 (roland 13-May-91): (setq n 1
27991.1 (roland 13-May-91): rmail-current-message 1
28001.1 (roland 13-May-91): blurb "No previous message"))
28011.1 (roland 13-May-91): ((> n rmail-total-messages)
28021.1 (roland 13-May-91): (setq n rmail-total-messages
28031.1 (roland 13-May-91): rmail-current-message rmail-total-messages
28041.1 (roland 13-May-91): blurb "No following message"))
28051.1 (roland 13-May-91): (t
28061.1 (roland 13-May-91): (setq rmail-current-message n))))
28071.198 (rms 19-Sep-96): (let ((beg (rmail-msgbeg n)))
28081.1 (roland 13-May-91): (goto-char beg)
28091.1 (roland 13-May-91): (forward-line 1)
28101.265 (rms 12-May-98): (save-excursion
28111.265 (rms 12-May-98): (let ((end (rmail-msgend n)))
28121.265 (rms 12-May-98): (save-restriction
28131.265 (rms 12-May-98): (if (prog1 (= (following-char) ?0)
28141.265 (rms 12-May-98): (forward-line 2)
28151.300 (rms 16-Feb-99): ;; If there's a Summary-line in the (otherwise empty)
28161.300 (rms 16-Feb-99): ;; header, we didn't yet get past the EOOH line.
28171.300 (rms 16-Feb-99): (if (looking-at "^\\*\\*\\* EOOH \\*\\*\\*\n")
28181.300 (rms 16-Feb-99): (forward-line 1))
28191.265 (rms 12-May-98): (narrow-to-region (point) end))
28201.265 (rms 12-May-98): (rfc822-goto-eoh)
28211.265 (rms 12-May-98): (search-forward "\n*** EOOH ***\n" end t))
28221.265 (rms 12-May-98): (narrow-to-region beg (point))
28231.265 (rms 12-May-98): (goto-char (point-min))
28241.265 (rms 12-May-98): (if (re-search-forward "^X-Coding-System: *\\(.*\\)$" nil t)
28251.265 (rms 12-May-98): (let ((coding-system (intern (match-string 1))))
28261.359 (rms 10-May-02): (condition-case nil
28271.359 (rms 10-May-02): (progn
28281.359 (rms 10-May-02): (check-coding-system coding-system)
28291.359 (rms 10-May-02): (setq buffer-file-coding-system coding-system))
28301.368 (jpw 06-Jan-03): (error
28311.359 (rms 10-May-02): (setq buffer-file-coding-system nil))))
28321.265 (rms 12-May-98): (setq buffer-file-coding-system nil)))))
28331.198 (rms 19-Sep-96): ;; Clear the "unseen" attribute when we show a message.
28341.198 (rms 19-Sep-96): (rmail-set-attribute "unseen" nil)
28351.198 (rms 19-Sep-96): (let ((end (rmail-msgend n)))
28361.265 (rms 12-May-98): ;; Reformat the header, or else find the reformatted header.
28371.198 (rms 19-Sep-96): (if (= (following-char) ?0)
28381.1 (roland 13-May-91): (rmail-reformat-message beg end)
28391.198 (rms 19-Sep-96): (search-forward "\n*** EOOH ***\n" end t)
28401.198 (rms 19-Sep-96): (narrow-to-region (point) end)))
28411.1 (roland 13-May-91): (goto-char (point-min))
28421.347 (gerd 10-Jul-01): (walk-windows
28431.347 (gerd 10-Jul-01): (function (lambda (window)
28441.347 (gerd 10-Jul-01): (if (eq (window-buffer window) (current-buffer))
28451.347 (gerd 10-Jul-01): (set-window-point window (point)))))
28461.347 (gerd 10-Jul-01): nil t)
28471.1 (roland 13-May-91): (rmail-display-labels)
28481.212 (handa 26-Feb-97): (if (eq rmail-enable-mime t)
28491.212 (handa 26-Feb-97): (funcall rmail-show-mime-function)
28501.397 (rms 18-Mar-05): (setq rmail-view-buffer rmail-buffer))
28511.397 (rms 18-Mar-05): (when mail-mailing-lists
28521.397 (rms 18-Mar-05): (rmail-unknown-mail-followup-to))
28531.100 (kwzh 24-Apr-94): (rmail-highlight-headers)
28541.105 (rms 26-May-94): (if transient-mark-mode (deactivate-mark))
28551.1 (roland 13-May-91): (run-hooks 'rmail-show-message-hook)
28561.39 (rms 09-Mar-93): ;; If there is a summary buffer, try to move to this message
28571.39 (rms 09-Mar-93): ;; in that buffer. But don't complain if this message
28581.39 (rms 09-Mar-93): ;; is not mentioned in the summary.
28591.134 (rms 11-Oct-94): ;; Don't do this at all if we were called on behalf
28601.134 (rms 11-Oct-94): ;; of cursor motion in the summary buffer.
28611.134 (rms 11-Oct-94): (and (rmail-summary-exists) (not no-summary)
28621.134 (rms 11-Oct-94): (let ((curr-msg rmail-current-message))
28631.134 (rms 11-Oct-94): (rmail-select-summary
28641.134 (rms 11-Oct-94): (rmail-summary-goto-msg curr-msg t t))))
28651.339 (gerd 08-May-01): (with-current-buffer rmail-buffer
28661.339 (gerd 08-May-01): (rmail-auto-file))
28671.1 (roland 13-May-91): (if blurb
28681.1 (roland 13-May-91): (message blurb))))))
28691.1 (roland 13-May-91):
28701.430 (eliz 04-Nov-06): (defun rmail-redecode-body (coding &optional raw)
28711.326 (eliz 22-Jan-01): "Decode the body of the current message using coding system CODING.
28721.326 (eliz 22-Jan-01): This is useful with mail messages that have malformed or missing
28731.326 (eliz 22-Jan-01): charset= headers.
28741.326 (eliz 22-Jan-01):
28751.326 (eliz 22-Jan-01): This function assumes that the current message is already decoded
28761.326 (eliz 22-Jan-01): and displayed in the RMAIL buffer, but the coding system used to
28771.326 (eliz 22-Jan-01): decode it was incorrect. It then encodes the message back to its
28781.327 (eliz 25-Jan-01): original form, and decodes it again, using the coding system CODING.
28791.326 (eliz 22-Jan-01):
28801.430 (eliz 04-Nov-06): Optional argument RAW, if non-nil, means don't encode the message
28811.430 (eliz 04-Nov-06): before decoding it with the new CODING. This is useful if the current
28821.430 (eliz 04-Nov-06): message text was produced by some function which invokes `insert',
28831.430 (eliz 04-Nov-06): since `insert' leaves unibyte character codes 128 through 255 unconverted
28841.430 (eliz 04-Nov-06): to multibyte. One example of such a situation is when the text was
28851.430 (eliz 04-Nov-06): produced by `base64-decode-region'.
28861.430 (eliz 04-Nov-06):
28871.430 (eliz 04-Nov-06): Interactively, invoke the function with a prefix argument to set RAW
28881.430 (eliz 04-Nov-06): non-nil.
28891.430 (eliz 04-Nov-06):
28901.326 (eliz 22-Jan-01): Note that if Emacs erroneously auto-detected one of the iso-2022
28911.326 (eliz 22-Jan-01): encodings in the message, this function might fail because the escape
28921.326 (eliz 22-Jan-01): sequences that switch between character sets and also single-shift and
28931.326 (eliz 22-Jan-01): locking-shift codes are impossible to recover. This function is meant
28941.326 (eliz 22-Jan-01): to be used to fix messages encoded with 8-bit encodings, such as
28951.326 (eliz 22-Jan-01): iso-8859, koi8-r, etc."
28961.326 (eliz 22-Jan-01): (interactive "zCoding system for re-decoding this message: ")
28971.326 (eliz 22-Jan-01): (when (not rmail-enable-mime)
28981.326 (eliz 22-Jan-01): (or (eq major-mode 'rmail-mode)
28991.326 (eliz 22-Jan-01): (switch-to-buffer rmail-buffer))
29001.326 (eliz 22-Jan-01): (save-excursion
29011.430 (eliz 04-Nov-06): (let ((pruned (rmail-msg-is-pruned))
29021.430 (eliz 04-Nov-06): (raw (or raw current-prefix-arg)))
29031.353 (eliz 02-Feb-02): (unwind-protect
29041.353 (eliz 02-Feb-02): (let ((msgbeg (rmail-msgbeg rmail-current-message))
29051.353 (eliz 02-Feb-02): (msgend (rmail-msgend rmail-current-message))
29061.353 (eliz 02-Feb-02): x-coding-header)
29071.353 (eliz 02-Feb-02): ;; We need the message headers pruned (we later restore
29081.353 (eliz 02-Feb-02): ;; the pruned stat to what it was, see the end of
29091.353 (eliz 02-Feb-02): ;; unwind-protect form).
29101.353 (eliz 02-Feb-02): (or pruned
29111.353 (eliz 02-Feb-02): (rmail-toggle-header 1))
29121.353 (eliz 02-Feb-02): (narrow-to-region msgbeg msgend)
29131.353 (eliz 02-Feb-02): (goto-char (point-min))
29141.353 (eliz 02-Feb-02): (when (search-forward "\n*** EOOH ***\n" (point-max) t)
29151.353 (eliz 02-Feb-02): (narrow-to-region msgbeg (point)))
29161.353 (eliz 02-Feb-02): (goto-char (point-min))
29171.353 (eliz 02-Feb-02): (if (re-search-forward "^X-Coding-System: *\\(.*\\)$" nil t)
29181.353 (eliz 02-Feb-02): (let ((old-coding (intern (match-string 1)))
29191.353 (eliz 02-Feb-02): (buffer-read-only nil))
29201.353 (eliz 02-Feb-02): (check-coding-system old-coding)
29211.353 (eliz 02-Feb-02): ;; Make sure the new coding system uses the same EOL
29221.353 (eliz 02-Feb-02): ;; conversion, to prevent ^M characters from popping
29231.353 (eliz 02-Feb-02): ;; up all over the place.
29241.353 (eliz 02-Feb-02): (setq coding
29251.353 (eliz 02-Feb-02): (coding-system-change-eol-conversion
29261.353 (eliz 02-Feb-02): coding
29271.353 (eliz 02-Feb-02): (coding-system-eol-type old-coding)))
29281.428 (eliz 07-Oct-06): ;; If old-coding is `undecided', encode-coding-region
29291.428 (eliz 07-Oct-06): ;; will not encode the text at all. Find a proper
29301.428 (eliz 07-Oct-06): ;; non-trivial encoding to use.
29311.428 (eliz 07-Oct-06): (if (memq (coding-system-base old-coding) '(nil undecided))
29321.428 (eliz 07-Oct-06): (setq old-coding
29331.428 (eliz 07-Oct-06): (car (find-coding-systems-region msgbeg msgend))))
29341.353 (eliz 02-Feb-02): (setq x-coding-header (point-marker))
29351.353 (eliz 02-Feb-02): (narrow-to-region msgbeg msgend)
29361.430 (eliz 04-Nov-06): (and (null raw)
29371.430 (eliz 04-Nov-06): ;; If old and new encoding are the same, it
29381.430 (eliz 04-Nov-06): ;; clearly doesn't make sense to encode.
29391.430 (eliz 04-Nov-06): (not (coding-system-equal
29401.430 (eliz 04-Nov-06): (coding-system-base old-coding)
29411.430 (eliz 04-Nov-06): (coding-system-base coding)))
29421.430 (eliz 04-Nov-06): ;; If the body includes only eight-bit-*
29431.430 (eliz 04-Nov-06): ;; characters, encoding might fail, e.g. with
29441.430 (eliz 04-Nov-06): ;; UTF-8, and isn't needed anyway.
29451.430 (eliz 04-Nov-06): (> (length (delq 'ascii
29461.430 (eliz 04-Nov-06): (delq 'eight-bit-graphic
29471.430 (eliz 04-Nov-06): (delq 'eight-bit-control
29481.430 (eliz 04-Nov-06): (find-charset-region
29491.430 (eliz 04-Nov-06): msgbeg msgend)))))
29501.430 (eliz 04-Nov-06): 0)
29511.430 (eliz 04-Nov-06): (encode-coding-region (point) msgend old-coding))
29521.353 (eliz 02-Feb-02): (decode-coding-region (point) msgend coding)
29531.353 (eliz 02-Feb-02): (setq last-coding-system-used coding)
29541.353 (eliz 02-Feb-02): ;; Rewrite the coding-system header according
29551.353 (eliz 02-Feb-02): ;; to what we did.
29561.353 (eliz 02-Feb-02): (goto-char x-coding-header)
29571.353 (eliz 02-Feb-02): (delete-region (point)
29581.353 (eliz 02-Feb-02): (save-excursion
29591.353 (eliz 02-Feb-02): (beginning-of-line)
29601.353 (eliz 02-Feb-02): (point)))
29611.353 (eliz 02-Feb-02): (insert "X-Coding-System: "
29621.353 (eliz 02-Feb-02): (symbol-name last-coding-system-used))
29631.353 (eliz 02-Feb-02): (set-marker x-coding-header nil)
29641.353 (eliz 02-Feb-02): (rmail-show-message))
29651.353 (eliz 02-Feb-02): (error "No X-Coding-System header found")))
29661.353 (eliz 02-Feb-02): (or pruned
29671.353 (eliz 02-Feb-02): (rmail-toggle-header 0)))))))
29681.326 (eliz 22-Jan-01):
29691.100 (kwzh 24-Apr-94): ;; Find all occurrences of certain fields, and highlight them.
29701.100 (kwzh 24-Apr-94): (defun rmail-highlight-headers ()
29711.100 (kwzh 24-Apr-94): ;; Do this only if the system supports faces.
29721.107 (rms 30-Jun-94): (if (and (fboundp 'internal-find-face)
29731.107 (rms 30-Jun-94): rmail-highlighted-headers)
29741.100 (kwzh 24-Apr-94): (save-excursion
29751.100 (kwzh 24-Apr-94): (search-forward "\n\n" nil 'move)
29761.100 (kwzh 24-Apr-94): (save-restriction
29771.100 (kwzh 24-Apr-94): (narrow-to-region (point-min) (point))
29781.100 (kwzh 24-Apr-94): (let ((case-fold-search t)
29791.100 (kwzh 24-Apr-94): (inhibit-read-only t)
29801.100 (kwzh 24-Apr-94): ;; Highlight with boldface if that is available.
29811.100 (kwzh 24-Apr-94): ;; Otherwise use the `highlight' face.
29821.451 (bastien1 13-Feb-08): (face (or 'rmail-highlight
29831.112 (rms 30-Jul-94): (if (face-differs-from-default-p 'bold)
29841.112 (rms 30-Jul-94): 'bold 'highlight)))
29851.100 (kwzh 24-Apr-94): ;; List of overlays to reuse.
29861.100 (kwzh 24-Apr-94): (overlays rmail-overlay-list))
29871.100 (kwzh 24-Apr-94): (goto-char (point-min))
29881.100 (kwzh 24-Apr-94): (while (re-search-forward rmail-highlighted-headers nil t)
29891.106 (rms 18-Jun-94): (skip-chars-forward " \t")
29901.100 (kwzh 24-Apr-94): (let ((beg (point))
29911.100 (kwzh 24-Apr-94): overlay)
29921.100 (kwzh 24-Apr-94): (while (progn (forward-line 1)
29931.100 (kwzh 24-Apr-94): (looking-at "[ \t]")))
29941.100 (kwzh 24-Apr-94): ;; Back up over newline, then trailing spaces or tabs
29951.100 (kwzh 24-Apr-94): (forward-char -1)
29961.100 (kwzh 24-Apr-94): (while (member (preceding-char) '(? ?\t))
29971.100 (kwzh 24-Apr-94): (forward-char -1))
29981.100 (kwzh 24-Apr-94): (if overlays
29991.100 (kwzh 24-Apr-94): ;; Reuse an overlay we already have.
30001.100 (kwzh 24-Apr-94): (progn
30011.100 (kwzh 24-Apr-94): (setq overlay (car overlays)
30021.100 (kwzh 24-Apr-94): overlays (cdr overlays))
30031.100 (kwzh 24-Apr-94): (overlay-put overlay 'face face)
30041.100 (kwzh 24-Apr-94): (move-overlay overlay beg (point)))
30051.100 (kwzh 24-Apr-94): ;; Make a new overlay and add it to
30061.100 (kwzh 24-Apr-94): ;; rmail-overlay-list.
30071.100 (kwzh 24-Apr-94): (setq overlay (make-overlay beg (point)))
30081.100 (kwzh 24-Apr-94): (overlay-put overlay 'face face)
30091.100 (kwzh 24-Apr-94): (setq rmail-overlay-list
30101.100 (kwzh 24-Apr-94): (cons overlay rmail-overlay-list))))))))))
30111.317 (fx 24-May-00):
30121.317 (fx 24-May-00): (defun rmail-auto-file ()
30131.317 (fx 24-May-00): "Automatically move a message into a sub-folder based on criteria.
30141.317 (fx 24-May-00): Called when a new message is displayed."
30151.317 (fx 24-May-00): (if (or (rmail-message-labels-p rmail-current-message "filed")
30161.317 (fx 24-May-00): (not (string= (buffer-file-name)
30171.317 (fx 24-May-00): (expand-file-name rmail-file-name))))
30181.317 (fx 24-May-00): ;; Do nothing if it's already been filed.
30191.317 (fx 24-May-00): nil
30201.317 (fx 24-May-00): ;; Find out some basics (common fields)
30211.317 (fx 24-May-00): (let ((from (mail-fetch-field "from"))
30221.317 (fx 24-May-00): (subj (mail-fetch-field "subject"))
30231.317 (fx 24-May-00): (to (concat (mail-fetch-field "to") "," (mail-fetch-field "cc")))
30241.317 (fx 24-May-00): (d rmail-automatic-folder-directives)
30251.317 (fx 24-May-00): (directive-loop nil)
30261.317 (fx 24-May-00): (folder nil))
30271.317 (fx 24-May-00): (while d
30281.317 (fx 24-May-00): (setq folder (car (car d))
30291.317 (fx 24-May-00): directive-loop (cdr (car d)))
30301.317 (fx 24-May-00): (while (and (car directive-loop)
30311.317 (fx 24-May-00): (let ((f (cond
30321.317 (fx 24-May-00): ((string= (car directive-loop) "from") from)
30331.317 (fx 24-May-00): ((string= (car directive-loop) "to") to)
30341.317 (fx 24-May-00): ((string= (car directive-loop) "subject") subj)
30351.317 (fx 24-May-00): (t (mail-fetch-field (car directive-loop))))))
30361.317 (fx 24-May-00): (and f (string-match (car (cdr directive-loop)) f))))
30371.317 (fx 24-May-00): (setq directive-loop (cdr (cdr directive-loop))))
30381.317 (fx 24-May-00): ;; If there are no directives left, then it was a complete match.
30391.317 (fx 24-May-00): (if (null directive-loop)
30401.317 (fx 24-May-00): (if (null folder)
30411.317 (fx 24-May-00): (rmail-delete-forward)
30421.317 (fx 24-May-00): (if (string= "/dev/null" folder)
30431.317 (fx 24-May-00): (rmail-delete-message)
30441.317 (fx 24-May-00): (rmail-output-to-rmail-file folder 1 t)
30451.317 (fx 24-May-00): (setq d nil))))
30461.317 (fx 24-May-00): (setq d (cdr d))))))
30471.100 (kwzh 24-Apr-94):
30481.1 (roland 13-May-91): (defun rmail-next-message (n)
30491.1 (roland 13-May-91): "Show following message whether deleted or not.
30501.1 (roland 13-May-91): With prefix arg N, moves forward N messages, or backward if N is negative."
30511.1 (roland 13-May-91): (interactive "p")
30521.339 (gerd 08-May-01): (set-buffer rmail-buffer)
30531.1 (roland 13-May-91): (rmail-maybe-set-message-counters)
30541.1 (roland 13-May-91): (rmail-show-message (+ rmail-current-message n)))
30551.1 (roland 13-May-91):
30561.1 (roland 13-May-91): (defun rmail-previous-message (n)
30571.1 (roland 13-May-91): "Show previous message whether deleted or not.
30581.1 (roland 13-May-91): With prefix arg N, moves backward N messages, or forward if N is negative."
30591.1 (roland 13-May-91): (interactive "p")
30601.358 (pot 06-May-02): (rmail-next-message (- n)))
30611.1 (roland 13-May-91):
30621.1 (roland 13-May-91): (defun rmail-next-undeleted-message (n)
30631.1 (roland 13-May-91): "Show following non-deleted message.
30641.1 (roland 13-May-91): With prefix arg N, moves forward N non-deleted messages,
30651.68 (rms 09-Oct-93): or backward if N is negative.
30661.68 (rms 09-Oct-93):
30671.68 (rms 09-Oct-93): Returns t if a new message is being shown, nil otherwise."
30681.1 (roland 13-May-91): (interactive "p")
30691.339 (gerd 08-May-01): (set-buffer rmail-buffer)
30701.1 (roland 13-May-91): (rmail-maybe-set-message-counters)
30711.1 (roland 13-May-91): (let ((lastwin rmail-current-message)
30721.1 (roland 13-May-91): (current rmail-current-message))
30731.1 (roland 13-May-91): (while (and (> n 0) (< current rmail-total-messages))
30741.1 (roland 13-May-91): (setq current (1+ current))
30751.1 (roland 13-May-91): (if (not (rmail-message-deleted-p current))
30761.1 (roland 13-May-91): (setq lastwin current n (1- n))))
30771.1 (roland 13-May-91): (while (and (< n 0) (> current 1))
30781.1 (roland 13-May-91): (setq current (1- current))
30791.1 (roland 13-May-91): (if (not (rmail-message-deleted-p current))
30801.1 (roland 13-May-91): (setq lastwin current n (1+ n))))
30811.1 (roland 13-May-91): (if (/= lastwin rmail-current-message)
30821.68 (rms 09-Oct-93): (progn (rmail-show-message lastwin)
30831.68 (rms 09-Oct-93): t)
30841.68 (rms 09-Oct-93): (if (< n 0)
30851.68 (rms 09-Oct-93): (message "No previous nondeleted message"))
30861.68 (rms 09-Oct-93): (if (> n 0)
30871.68 (rms 09-Oct-93): (message "No following nondeleted message"))
30881.68 (rms 09-Oct-93): nil)))
30891.1 (roland 13-May-91):
30901.1 (roland 13-May-91): (defun rmail-previous-undeleted-message (n)
30911.1 (roland 13-May-91): "Show previous non-deleted message.
30921.1 (roland 13-May-91): With prefix argument N, moves backward N non-deleted messages,
30931.1 (roland 13-May-91): or forward if N is negative."
30941.1 (roland 13-May-91): (interactive "p")
30951.1 (roland 13-May-91): (rmail-next-undeleted-message (- n)))
30961.1 (roland 13-May-91):
30971.1 (roland 13-May-91): (defun rmail-first-message ()
30981.1 (roland 13-May-91): "Show first message in file."
30991.1 (roland 13-May-91): (interactive)
31001.1 (roland 13-May-91): (rmail-maybe-set-message-counters)
31011.1 (roland 13-May-91): (rmail-show-message 1))
31021.1 (roland 13-May-91):
31031.1 (roland 13-May-91): (defun rmail-last-message ()
31041.1 (roland 13-May-91): "Show last message in file."
31051.1 (roland 13-May-91): (interactive)
31061.1 (roland 13-May-91): (rmail-maybe-set-message-counters)
31071.1 (roland 13-May-91): (rmail-show-message rmail-total-messages))
31081.1 (roland 13-May-91):
31091.1 (roland 13-May-91): (defun rmail-what-message ()
31101.1 (roland 13-May-91): (let ((where (point))
31111.1 (roland 13-May-91): (low 1)
31121.1 (roland 13-May-91): (high rmail-total-messages)
31131.1 (roland 13-May-91): (mid (/ rmail-total-messages 2)))
31141.1 (roland 13-May-91): (while (> (- high low) 1)
31151.1 (roland 13-May-91): (if (>= where (rmail-msgbeg mid))
31161.1 (roland 13-May-91): (setq low mid)
31171.1 (roland 13-May-91): (setq high mid))
31181.1 (roland 13-May-91): (setq mid (+ low (/ (- high low) 2))))
31191.1 (roland 13-May-91): (if (>= where (rmail-msgbeg high)) high low)))
31201.1 (roland 13-May-91):
31211.39 (rms 09-Mar-93): (defun rmail-message-recipients-p (msg recipients &optional primary-only)
31221.39 (rms 09-Mar-93): (save-restriction
31231.39 (rms 09-Mar-93): (goto-char (rmail-msgbeg msg))
31241.261 (rms 18-Apr-98): (search-forward "\n*** EOOH ***\n")
31251.39 (rms 09-Mar-93): (narrow-to-region (point) (progn (search-forward "\n\n") (point)))
31261.39 (rms 09-Mar-93): (or (string-match recipients (or (mail-fetch-field "To") ""))
31271.39 (rms 09-Mar-93): (string-match recipients (or (mail-fetch-field "From") ""))
31281.39 (rms 09-Mar-93): (if (not primary-only)
31291.39 (rms 09-Mar-93): (string-match recipients (or (mail-fetch-field "Cc") ""))))))
31301.39 (rms 09-Mar-93):
31311.334 (gerd 26-Apr-01): (defun rmail-message-regexp-p (n regexp)
31321.334 (gerd 26-Apr-01): "Return t, if for message number N, regexp REGEXP matches in the header."
31331.334 (gerd 26-Apr-01): (let ((beg (rmail-msgbeg n))
31341.334 (gerd 26-Apr-01): (end (rmail-msgend n)))
31351.334 (gerd 26-Apr-01): (goto-char beg)
31361.334 (gerd 26-Apr-01): (forward-line 1)
31371.334 (gerd 26-Apr-01): (save-excursion
31381.334 (gerd 26-Apr-01): (save-restriction
31391.334 (gerd 26-Apr-01): (if (prog1 (= (following-char) ?0)
31401.334 (gerd 26-Apr-01): (forward-line 2)
31411.334 (gerd 26-Apr-01): ;; If there's a Summary-line in the (otherwise empty)
31421.334 (gerd 26-Apr-01): ;; header, we didn't yet get past the EOOH line.
31431.336 (gerd 30-Apr-01): (when (looking-at "^\\*\\*\\* EOOH \\*\\*\\*\n")
31441.336 (gerd 30-Apr-01): (forward-line 1))
31451.335 (gerd 27-Apr-01): (setq beg (point))
31461.334 (gerd 26-Apr-01): (narrow-to-region (point) end))
31471.358 (pot 06-May-02): (progn
31481.336 (gerd 30-Apr-01): (rfc822-goto-eoh)
31491.336 (gerd 30-Apr-01): (setq end (point)))
31501.335 (gerd 27-Apr-01): (setq beg (point))
31511.336 (gerd 30-Apr-01): (search-forward "\n*** EOOH ***\n" end t)
31521.336 (gerd 30-Apr-01): (setq end (1+ (match-beginning 0)))))
31531.335 (gerd 27-Apr-01): (goto-char beg)
31541.339 (gerd 08-May-01): (if rmail-enable-mime
31551.339 (gerd 08-May-01): (funcall rmail-search-mime-header-function n regexp end)
31561.339 (gerd 08-May-01): (re-search-forward regexp end t)))))
31571.339 (gerd 08-May-01):
31581.339 (gerd 08-May-01): (defun rmail-search-message (msg regexp)
31591.339 (gerd 08-May-01): "Return non-nil, if for message number MSG, regexp REGEXP matches."
31601.339 (gerd 08-May-01): (goto-char (rmail-msgbeg msg))
31611.339 (gerd 08-May-01): (if rmail-enable-mime
31621.339 (gerd 08-May-01): (funcall rmail-search-mime-message-function msg regexp)
31631.339 (gerd 08-May-01): (re-search-forward regexp (rmail-msgend msg) t)))
31641.39 (rms 09-Mar-93):
31651.1 (roland 13-May-91): (defvar rmail-search-last-regexp nil)
31661.19 (rms 26-Jul-92): (defun rmail-search (regexp &optional n)
31671.164 (kwzh 21-Dec-95): "Show message containing next match for REGEXP (but not the current msg).
31681.19 (rms 26-Jul-92): Prefix argument gives repeat count; negative argument means search
31691.19 (rms 26-Jul-92): backwards (through earlier messages).
31701.19 (rms 26-Jul-92): Interactively, empty argument means use same regexp used last time."
31711.1 (roland 13-May-91): (interactive
31721.1 (roland 13-May-91): (let* ((reversep (< (prefix-numeric-value current-prefix-arg) 0))
31731.1 (roland 13-May-91): (prompt
31741.415 (rfrancoi 24-Sep-05): (concat (if reversep "Reverse " "") "Rmail search (regexp"))
31751.1 (roland 13-May-91): regexp)
31761.415 (rfrancoi 24-Sep-05): (setq prompt
31771.415 (rfrancoi 24-Sep-05): (concat prompt
31781.415 (rfrancoi 24-Sep-05): (if rmail-search-last-regexp
31791.415 (rfrancoi 24-Sep-05): (concat ", default "
31801.415 (rfrancoi 24-Sep-05): rmail-search-last-regexp "): ")
31811.415 (rfrancoi 24-Sep-05): "): ")))
31821.1 (roland 13-May-91): (setq regexp (read-string prompt))
31831.1 (roland 13-May-91): (cond ((not (equal regexp ""))
31841.1 (roland 13-May-91): (setq rmail-search-last-regexp regexp))
31851.1 (roland 13-May-91): ((not rmail-search-last-regexp)
31861.1 (roland 13-May-91): (error "No previous Rmail search string")))
31871.19 (rms 26-Jul-92): (list rmail-search-last-regexp
31881.19 (rms 26-Jul-92): (prefix-numeric-value current-prefix-arg))))
31891.19 (rms 26-Jul-92): (or n (setq n 1))
31901.1 (roland 13-May-91): (message "%sRmail search for %s..."
31911.20 (rms 05-Aug-92): (if (< n 0) "Reverse " "")
31921.1 (roland 13-May-91): regexp)
31931.339 (gerd 08-May-01): (set-buffer rmail-buffer)
31941.1 (roland 13-May-91): (rmail-maybe-set-message-counters)
31951.1 (roland 13-May-91): (let ((omin (point-min))
31961.1 (roland 13-May-91): (omax (point-max))
31971.1 (roland 13-May-91): (opoint (point))
31981.1 (roland 13-May-91): win
31991.19 (rms 26-Jul-92): (reversep (< n 0))
32001.1 (roland 13-May-91): (msg rmail-current-message))
32011.1 (roland 13-May-91): (unwind-protect
32021.1 (roland 13-May-91): (progn
32031.1 (roland 13-May-91): (widen)
32041.19 (rms 26-Jul-92): (while (/= n 0)
32051.19 (rms 26-Jul-92): ;; Check messages one by one, advancing message number up or down
32061.19 (rms 26-Jul-92): ;; but searching forward through each message.
32071.19 (rms 26-Jul-92): (if reversep
32081.19 (rms 26-Jul-92): (while (and (null win) (> msg 1))
32091.339 (gerd 08-May-01): (setq msg (1- msg)
32101.339 (gerd 08-May-01): win (rmail-search-message msg regexp)))
32111.19 (rms 26-Jul-92): (while (and (null win) (< msg rmail-total-messages))
32121.339 (gerd 08-May-01): (setq msg (1+ msg)
32131.339 (gerd 08-May-01): win (rmail-search-message msg regexp))))
32141.20 (rms 05-Aug-92): (setq n (+ n (if reversep 1 -1)))))
32151.1 (roland 13-May-91): (if win
32161.1 (roland 13-May-91): (progn
32171.339 (gerd 08-May-01): (rmail-show-message msg)
32181.339 (gerd 08-May-01): ;; Search forward (if this is a normal search) or backward
32191.339 (gerd 08-May-01): ;; (if this is a reverse search) through this message to
32201.339 (gerd 08-May-01): ;; position point. This search may fail because REGEXP
32211.339 (gerd 08-May-01): ;; was found in the hidden portion of this message. In
32221.339 (gerd 08-May-01): ;; that case, move point to the beginning of visible
32231.339 (gerd 08-May-01): ;; portion.
32241.1 (roland 13-May-91): (if reversep
32251.1 (roland 13-May-91): (progn
32261.339 (gerd 08-May-01): (goto-char (point-max))
32271.339 (gerd 08-May-01): (re-search-backward regexp nil 'move))
32281.339 (gerd 08-May-01): (goto-char (point-min))
32291.339 (gerd 08-May-01): (re-search-forward regexp nil t))
32301.1 (roland 13-May-91): (message "%sRmail search for %s...done"
32311.1 (roland 13-May-91): (if reversep "Reverse " "")
32321.339 (gerd 08-May-01): regexp))
32331.1 (roland 13-May-91): (goto-char opoint)
32341.1 (roland 13-May-91): (narrow-to-region omin omax)
32351.1 (roland 13-May-91): (ding)
32361.1 (roland 13-May-91): (message "Search failed: %s" regexp)))))
32371.19 (rms 26-Jul-92):
32381.19 (rms 26-Jul-92): (defun rmail-search-backwards (regexp &optional n)
32391.19 (rms 26-Jul-92): "Show message containing previous match for REGEXP.
32401.19 (rms 26-Jul-92): Prefix argument gives repeat count; negative argument means search
32411.19 (rms 26-Jul-92): forward (through later messages).
32421.19 (rms 26-Jul-92): Interactively, empty argument means use same regexp used last time."
32431.19 (rms 26-Jul-92): (interactive
32441.20 (rms 05-Aug-92): (let* ((reversep (>= (prefix-numeric-value current-prefix-arg) 0))
32451.19 (rms 26-Jul-92): (prompt
32461.415 (rfrancoi 24-Sep-05): (concat (if reversep "Reverse " "") "Rmail search (regexp"))
32471.19 (rms 26-Jul-92): regexp)
32481.415 (rfrancoi 24-Sep-05): (setq prompt
32491.415 (rfrancoi 24-Sep-05): (concat prompt
32501.415 (rfrancoi 24-Sep-05): (if rmail-search-last-regexp
32511.415 (rfrancoi 24-Sep-05): (concat ", default "
32521.415 (rfrancoi 24-Sep-05): rmail-search-last-regexp "): ")
32531.415 (rfrancoi 24-Sep-05): "): ")))
32541.19 (rms 26-Jul-92): (setq regexp (read-string prompt))
32551.19 (rms 26-Jul-92): (cond ((not (equal regexp ""))
32561.19 (rms 26-Jul-92): (setq rmail-search-last-regexp regexp))
32571.19 (rms 26-Jul-92): ((not rmail-search-last-regexp)
32581.19 (rms 26-Jul-92): (error "No previous Rmail search string")))
32591.19 (rms 26-Jul-92): (list rmail-search-last-regexp
32601.19 (rms 26-Jul-92): (prefix-numeric-value current-prefix-arg))))
32611.154 (kwzh 13-Jun-95): (rmail-search regexp (- (or n 1))))
32621.1 (roland 13-May-91):
32631.1 (roland 13-May-91): ;; Show the first message which has the `unseen' attribute.
32641.1 (roland 13-May-91): (defun rmail-first-unseen-message ()
32651.31 (jla 07-Oct-92): (rmail-maybe-set-message-counters)
32661.1 (roland 13-May-91): (let ((current 1)
32671.1 (roland 13-May-91): found)
32681.1 (roland 13-May-91): (save-restriction
32691.1 (roland 13-May-91): (widen)
32701.141 (rms 20-Dec-94): (while (and (not found) (<= current rmail-total-messages))
32711.1 (roland 13-May-91): (if (rmail-message-labels-p current ", ?\\(unseen\\),")
32721.4 (roland 23-Jul-91): (setq found current))
32731.4 (roland 23-Jul-91): (setq current (1+ current))))
32741.30 (jla 05-Oct-92): ;; Let the caller show the message.
32751.30 (jla 05-Oct-92): ;; (if found
32761.30 (jla 05-Oct-92): ;; (rmail-show-message found))
32771.30 (jla 05-Oct-92): found))
32781.144 (rms 05-Feb-95):
32791.417 (as 08-Jan-06): (defun rmail-current-subject ()
32801.417 (as 08-Jan-06): "Return the current subject.
32811.417 (as 08-Jan-06): The subject is stripped of leading and trailing whitespace, and
32821.417 (as 08-Jan-06): of typical reply prefixes such as Re:."
32831.417 (as 08-Jan-06): (let ((subject (or (mail-fetch-field "Subject") "")))
32841.251 (rms 08-Mar-98): (if (string-match "\\`[ \t]+" subject)
32851.251 (rms 08-Mar-98): (setq subject (substring subject (match-end 0))))
32861.417 (as 08-Jan-06): (if (string-match rmail-reply-regexp subject)
32871.191 (kwzh 21-Jul-96): (setq subject (substring subject (match-end 0))))
32881.251 (rms 08-Mar-98): (if (string-match "[ \t]+\\'" subject)
32891.251 (rms 08-Mar-98): (setq subject (substring subject 0 (match-beginning 0))))
32901.417 (as 08-Jan-06): subject))
32911.417 (as 08-Jan-06):
32921.417 (as 08-Jan-06): (defun rmail-current-subject-regexp ()
32931.417 (as 08-Jan-06): "Return a regular expression matching the current subject.
32941.417 (as 08-Jan-06): The regular expression matches the subject header line of
32951.417 (as 08-Jan-06): messages about the same subject. The subject itself is stripped
32961.417 (as 08-Jan-06): of leading and trailing whitespace, of typical reply prefixes
32971.417 (as 08-Jan-06): such as Re: and whitespace within the subject is replaced by a
32981.417 (as 08-Jan-06): regular expression matching whitespace in general in order to
32991.417 (as 08-Jan-06): take into account that subject header lines may include newlines
33001.417 (as 08-Jan-06): and more whitespace. The returned regular expressions contains
33011.417 (as 08-Jan-06): `rmail-reply-regexp' and ends with a newline."
33021.417 (as 08-Jan-06): (let ((subject (rmail-current-subject)))
33031.416 (eliz 10-Dec-05): ;; If Subject is long, mailers will break it into several lines at
33041.416 (eliz 10-Dec-05): ;; arbitrary places, so replace whitespace with a regexp that will
33051.416 (eliz 10-Dec-05): ;; match any sequence of spaces, TABs, and newlines.
33061.416 (eliz 10-Dec-05): (setq subject (regexp-quote subject))
33071.416 (eliz 10-Dec-05): (setq subject
33081.416 (eliz 10-Dec-05): (replace-regexp-in-string "[ \t\n]+" "[ \t\n]+" subject t t))
33091.441 (miles 21-Nov-07): ;; Some mailers insert extra spaces after "Subject:", so allow any
33101.441 (miles 21-Nov-07): ;; amount of them.
33111.441 (miles 21-Nov-07): (concat "^Subject:[ \t]+"
33121.417 (as 08-Jan-06): (if (string= "\\`" (substring rmail-reply-regexp 0 2))
33131.417 (as 08-Jan-06): (substring rmail-reply-regexp 2)
33141.417 (as 08-Jan-06): rmail-reply-regexp)
33151.417 (as 08-Jan-06): subject "[ \t]*\n")))
33161.417 (as 08-Jan-06):
33171.417 (as 08-Jan-06): (defun rmail-next-same-subject (n)
33181.417 (as 08-Jan-06): "Go to the next mail message having the same subject header.
33191.417 (as 08-Jan-06): With prefix argument N, do this N times.
33201.417 (as 08-Jan-06): If N is negative, go backwards instead."
33211.417 (as 08-Jan-06): (interactive "p")
33221.417 (as 08-Jan-06): (let ((search-regexp (rmail-current-subject-regexp))
33231.417 (as 08-Jan-06): (forward (> n 0))
33241.417 (as 08-Jan-06): (i rmail-current-message)
33251.417 (as 08-Jan-06): (case-fold-search t)
33261.417 (as 08-Jan-06): found)
33271.144 (rms 05-Feb-95): (save-excursion
33281.144 (rms 05-Feb-95): (save-restriction
33291.144 (rms 05-Feb-95): (widen)
33301.144 (rms 05-Feb-95): (while (and (/= n 0)
33311.144 (rms 05-Feb-95): (if forward
33321.144 (rms 05-Feb-95): (< i rmail-total-messages)
33331.144 (rms 05-Feb-95): (> i 1)))
33341.144 (rms 05-Feb-95): (let (done)
33351.144 (rms 05-Feb-95): (while (and (not done)
33361.144 (rms 05-Feb-95): (if forward
33371.144 (rms 05-Feb-95): (< i rmail-total-messages)
33381.144 (rms 05-Feb-95): (> i 1)))
33391.144 (rms 05-Feb-95): (setq i (if forward (1+ i) (1- i)))
33401.144 (rms 05-Feb-95): (goto-char (rmail-msgbeg i))
33411.144 (rms 05-Feb-95): (search-forward "\n*** EOOH ***\n")
33421.144 (rms 05-Feb-95): (let ((beg (point)) end)
33431.144 (rms 05-Feb-95): (search-forward "\n\n")
33441.144 (rms 05-Feb-95): (setq end (point))
33451.144 (rms 05-Feb-95): (goto-char beg)
33461.144 (rms 05-Feb-95): (setq done (re-search-forward search-regexp end t))))
33471.144 (rms 05-Feb-95): (if done (setq found i)))
33481.144 (rms 05-Feb-95): (setq n (if forward (1- n) (1+ n))))))
33491.144 (rms 05-Feb-95): (if found
33501.144 (rms 05-Feb-95): (rmail-show-message found)
33511.144 (rms 05-Feb-95): (error "No %s message with same subject"
33521.144 (rms 05-Feb-95): (if forward "following" "previous")))))
33531.144 (rms 05-Feb-95):
33541.144 (rms 05-Feb-95): (defun rmail-previous-same-subject (n)
33551.144 (rms 05-Feb-95): "Go to the previous mail message having the same subject header.
33561.144 (rms 05-Feb-95): With prefix argument N, do this N times.
33571.144 (rms 05-Feb-95): If N is negative, go forwards instead."
33581.144 (rms 05-Feb-95): (interactive "p")
33591.144 (rms 05-Feb-95): (rmail-next-same-subject (- n)))
33601.1 (roland 13-May-91):
33611.1 (roland 13-May-91): ;;;; *** Rmail Message Deletion Commands ***
33621.1 (roland 13-May-91):
33631.1 (roland 13-May-91): (defun rmail-message-deleted-p (n)
33641.1 (roland 13-May-91): (= (aref rmail-deleted-vector n) ?D))
33651.1 (roland 13-May-91):
33661.1 (roland 13-May-91): (defun rmail-set-message-deleted-p (n state)
33671.1 (roland 13-May-91): (aset rmail-deleted-vector n (if state ?D ?\ )))
33681.1 (roland 13-May-91):
33691.1 (roland 13-May-91): (defun rmail-delete-message ()
33701.1 (roland 13-May-91): "Delete this message and stay on it."
33711.1 (roland 13-May-91): (interactive)
33721.161 (rms 10-Nov-95): (rmail-set-attribute "deleted" t)
33731.161 (rms 10-Nov-95): (run-hooks 'rmail-delete-message-hook))
33741.1 (roland 13-May-91):
33751.1 (roland 13-May-91): (defun rmail-undelete-previous-message ()
33761.1 (roland 13-May-91): "Back up to deleted message, select it, and undelete it."
33771.1 (roland 13-May-91): (interactive)
33781.339 (gerd 08-May-01): (set-buffer rmail-buffer)
33791.1 (roland 13-May-91): (let ((msg rmail-current-message))
33801.1 (roland 13-May-91): (while (and (> msg 0)
33811.1 (roland 13-May-91): (not (rmail-message-deleted-p msg)))
33821.1 (roland 13-May-91): (setq msg (1- msg)))
33831.1 (roland 13-May-91): (if (= msg 0)
33841.1 (roland 13-May-91): (error "No previous deleted message")
33851.1 (roland 13-May-91): (if (/= msg rmail-current-message)
33861.1 (roland 13-May-91): (rmail-show-message msg))
33871.39 (rms 09-Mar-93): (rmail-set-attribute "deleted" nil)
33881.39 (rms 09-Mar-93): (if (rmail-summary-exists)
33891.39 (rms 09-Mar-93): (save-excursion
33901.39 (rms 09-Mar-93): (set-buffer rmail-summary-buffer)
33911.39 (rms 09-Mar-93): (rmail-summary-mark-undeleted msg)))
33921.39 (rms 09-Mar-93): (rmail-maybe-display-summary))))
33931.1 (roland 13-May-91):
33941.1 (roland 13-May-91): (defun rmail-delete-forward (&optional backward)
33951.1 (roland 13-May-91): "Delete this message and move to next nondeleted one.
33961.1 (roland 13-May-91): Deleted messages stay in the file until the \\[rmail-expunge] command is given.
33971.68 (rms 09-Oct-93): With prefix argument, delete and move backward.
33981.68 (rms 09-Oct-93):
33991.68 (rms 09-Oct-93): Returns t if a new message is displayed after the delete, or nil otherwise."
34001.1 (roland 13-May-91): (interactive "P")
34011.1 (roland 13-May-91): (rmail-set-attribute "deleted" t)
34021.161 (rms 10-Nov-95): (run-hooks 'rmail-delete-message-hook)
34031.39 (rms 09-Mar-93): (let ((del-msg rmail-current-message))
34041.39 (rms 09-Mar-93): (if (rmail-summary-exists)
34051.133 (rms 08-Oct-94): (rmail-select-summary
34061.133 (rms 08-Oct-94): (rmail-summary-mark-deleted del-msg)))
34071.68 (rms 09-Oct-93): (prog1 (rmail-next-undeleted-message (if backward -1 1))
34081.68 (rms 09-Oct-93): (rmail-maybe-display-summary))))
34091.1 (roland 13-May-91):
34101.1 (roland 13-May-91): (defun rmail-delete-backward ()
34111.1 (roland 13-May-91): "Delete this message and move to previous nondeleted one.
34121.1 (roland 13-May-91): Deleted messages stay in the file until the \\[rmail-expunge] command is given."
34131.1 (roland 13-May-91): (interactive)
34141.1 (roland 13-May-91): (rmail-delete-forward t))
34151.1 (roland 13-May-91):
34161.131 (rms 27-Sep-94): ;; Compute the message number a given message would have after expunging.
34171.131 (rms 27-Sep-94): ;; The present number of the message is OLDNUM.
34181.131 (rms 27-Sep-94): ;; DELETEDVEC should be rmail-deleted-vector.
34191.131 (rms 27-Sep-94): ;; The value is nil for a message that would be deleted.
34201.131 (rms 27-Sep-94): (defun rmail-msg-number-after-expunge (deletedvec oldnum)
34211.131 (rms 27-Sep-94): (if (or (null oldnum) (= (aref deletedvec oldnum) ?D))
34221.131 (rms 27-Sep-94): nil
34231.131 (rms 27-Sep-94): (let ((i 0)
34241.131 (rms 27-Sep-94): (newnum 0))
34251.131 (rms 27-Sep-94): (while (< i oldnum)
34261.131 (rms 27-Sep-94): (if (/= (aref deletedvec i) ?D)
34271.131 (rms 27-Sep-94): (setq newnum (1+ newnum)))
34281.131 (rms 27-Sep-94): (setq i (1+ i)))
34291.131 (rms 27-Sep-94): newnum)))
34301.131 (rms 27-Sep-94):
34311.325 (gerd 04-Dec-00): (defun rmail-expunge-confirmed ()
34321.325 (gerd 04-Dec-00): "Return t if deleted message should be expunged. If necessary, ask the user.
34331.325 (gerd 04-Dec-00): See also user-option `rmail-confirm-expunge'."
34341.339 (gerd 08-May-01): (set-buffer rmail-buffer)
34351.325 (gerd 04-Dec-00): (or (not (stringp rmail-deleted-vector))
34361.325 (gerd 04-Dec-00): (not (string-match "D" rmail-deleted-vector))
34371.325 (gerd 04-Dec-00): (null rmail-confirm-expunge)
34381.325 (gerd 04-Dec-00): (funcall rmail-confirm-expunge
34391.325 (gerd 04-Dec-00): "Erase deleted messages from Rmail file? ")))
34401.325 (gerd 04-Dec-00):
34411.380 (uid65566 16-Jan-04): (defun rmail-only-expunge (&optional dont-show)
34421.1 (roland 13-May-91): "Actually erase all deleted messages in the file."
34431.1 (roland 13-May-91): (interactive)
34441.339 (gerd 08-May-01): (set-buffer rmail-buffer)
34451.1 (roland 13-May-91): (message "Expunging deleted messages...")
34461.1 (roland 13-May-91): ;; Discard all undo records for this buffer.
34471.1 (roland 13-May-91): (or (eq buffer-undo-list t)
34481.1 (roland 13-May-91): (setq buffer-undo-list nil))
34491.1 (roland 13-May-91): (rmail-maybe-set-message-counters)
34501.1 (roland 13-May-91): (let* ((omax (- (buffer-size) (point-max)))
34511.1 (roland 13-May-91): (omin (- (buffer-size) (point-min)))
34521.1 (roland 13-May-91): (opoint (if (and (> rmail-current-message 0)
34531.96 (kwzh 23-Apr-94): (rmail-message-deleted-p rmail-current-message))
34541.96 (kwzh 23-Apr-94): 0
34551.339 (gerd 08-May-01): (if rmail-enable-mime
34561.339 (gerd 08-May-01): (with-current-buffer rmail-view-buffer
34571.339 (gerd 08-May-01): (- (point)(point-min)))
34581.339 (gerd 08-May-01): (- (point) (point-min)))))
34591.1 (roland 13-May-91): (messages-head (cons (aref rmail-message-vector 0) nil))
34601.1 (roland 13-May-91): (messages-tail messages-head)
34611.1 (roland 13-May-91): ;; Don't make any undo records for the expunging.
34621.1 (roland 13-May-91): (buffer-undo-list t)
34631.1 (roland 13-May-91): (win))
34641.1 (roland 13-May-91): (unwind-protect
34651.1 (roland 13-May-91): (save-excursion
34661.1 (roland 13-May-91): (widen)
34671.1 (roland 13-May-91): (goto-char (point-min))
34681.1 (roland 13-May-91): (let ((counter 0)
34691.1 (roland 13-May-91): (number 1)
34701.1 (roland 13-May-91): (total rmail-total-messages)
34711.1 (roland 13-May-91): (new-message-number rmail-current-message)
34721.1 (roland 13-May-91): (new-summary nil)
34731.218 (rms 02-May-97): (new-msgref (list (list 0)))
34741.131 (rms 27-Sep-94): (rmailbuf (current-buffer))
34751.1 (roland 13-May-91): (buffer-read-only nil)
34761.1 (roland 13-May-91): (messages rmail-message-vector)
34771.1 (roland 13-May-91): (deleted rmail-deleted-vector)
34781.1 (roland 13-May-91): (summary rmail-summary-vector))
34791.1 (roland 13-May-91): (setq rmail-total-messages nil
34801.1 (roland 13-May-91): rmail-current-message nil
34811.1 (roland 13-May-91): rmail-message-vector nil
34821.1 (roland 13-May-91): rmail-deleted-vector nil
34831.1 (roland 13-May-91): rmail-summary-vector nil)
34841.131 (rms 27-Sep-94):
34851.1 (roland 13-May-91): (while (<= number total)
34861.1 (roland 13-May-91): (if (= (aref deleted number) ?D)
34871.1 (roland 13-May-91): (progn
34881.1 (roland 13-May-91): (delete-region
34891.1 (roland 13-May-91): (marker-position (aref messages number))
34901.1 (roland 13-May-91): (marker-position (aref messages (1+ number))))
34911.1 (roland 13-May-91): (move-marker (aref messages number) nil)
34921.1 (roland 13-May-91): (if (> new-message-number counter)
34931.1 (roland 13-May-91): (setq new-message-number (1- new-message-number))))
34941.1 (roland 13-May-91): (setq counter (1+ counter))
34951.1 (roland 13-May-91): (setq messages-tail
34961.1 (roland 13-May-91): (setcdr messages-tail
34971.1 (roland 13-May-91): (cons (aref messages number) nil)))
34981.1 (roland 13-May-91): (setq new-summary
34991.1 (roland 13-May-91): (cons (if (= counter number) (aref summary (1- number)))
35001.218 (rms 02-May-97): new-summary))
35011.218 (rms 02-May-97): (setq new-msgref
35021.218 (rms 02-May-97): (cons (aref rmail-msgref-vector number)
35031.218 (rms 02-May-97): new-msgref))
35041.218 (rms 02-May-97): (setcar (car new-msgref) counter))
35051.1 (roland 13-May-91): (if (zerop (% (setq number (1+ number)) 20))
35061.1 (roland 13-May-91): (message "Expunging deleted messages...%d" number)))
35071.1 (roland 13-May-91): (setq messages-tail
35081.1 (roland 13-May-91): (setcdr messages-tail
35091.1 (roland 13-May-91): (cons (aref messages number) nil)))
35101.1 (roland 13-May-91): (setq rmail-current-message new-message-number
35111.1 (roland 13-May-91): rmail-total-messages counter
35121.1 (roland 13-May-91): rmail-message-vector (apply 'vector messages-head)
35131.1 (roland 13-May-91): rmail-deleted-vector (make-string (1+ counter) ?\ )
35141.1 (roland 13-May-91): rmail-summary-vector (vconcat (nreverse new-summary))
35151.218 (rms 02-May-97): rmail-msgref-vector (apply 'vector (nreverse new-msgref))
35161.1 (roland 13-May-91): win t)))
35171.1 (roland 13-May-91): (message "Expunging deleted messages...done")
35181.1 (roland 13-May-91): (if (not win)
35191.1 (roland 13-May-91): (narrow-to-region (- (buffer-size) omin) (- (buffer-size) omax)))
35201.380 (uid65566 16-Jan-04): (if (not dont-show)
35211.380 (uid65566 16-Jan-04): (rmail-show-message
35221.406 (rms 08-Jul-05): (if (zerop rmail-current-message) 1 nil)))
35231.406 (rms 08-Jul-05): (if rmail-enable-mime
35241.406 (rms 08-Jul-05): (goto-char (+ (point-min) opoint))
35251.406 (rms 08-Jul-05): (goto-char (+ (point) opoint))))))
35261.39 (rms 09-Mar-93):
35271.39 (rms 09-Mar-93): (defun rmail-expunge ()
35281.39 (rms 09-Mar-93): "Erase deleted messages from Rmail file and summary buffer."
35291.39 (rms 09-Mar-93): (interactive)
35301.325 (gerd 04-Dec-00): (when (rmail-expunge-confirmed)
35311.313 (gerd 24-Mar-00): (rmail-only-expunge)
35321.313 (gerd 24-Mar-00): (if (rmail-summary-exists)
35331.325 (gerd 04-Dec-00): (rmail-select-summary (rmail-update-summary)))))
35341.1 (roland 13-May-91):
35351.1 (roland 13-May-91): ;;;; *** Rmail Mailing Commands ***
35361.1 (roland 13-May-91):
35371.203 (rms 07-Dec-96): (defun rmail-start-mail (&optional noerase to subject in-reply-to cc
35381.203 (rms 07-Dec-96): replybuffer sendactions same-window others)
35391.203 (rms 07-Dec-96): (let (yank-action)
35401.203 (rms 07-Dec-96): (if replybuffer
35411.203 (rms 07-Dec-96): (setq yank-action (list 'insert-buffer replybuffer)))
35421.203 (rms 07-Dec-96): (setq others (cons (cons "cc" cc) others))
35431.203 (rms 07-Dec-96): (setq others (cons (cons "in-reply-to" in-reply-to) others))
35441.203 (rms 07-Dec-96): (if same-window
35451.203 (rms 07-Dec-96): (compose-mail to subject others
35461.203 (rms 07-Dec-96): noerase nil
35471.203 (rms 07-Dec-96): yank-action sendactions)
35481.390 (eliz 24-Apr-04): (if rmail-mail-new-frame
35491.203 (rms 07-Dec-96): (prog1
35501.203 (rms 07-Dec-96): (compose-mail to subject others
35511.203 (rms 07-Dec-96): noerase 'switch-to-buffer-other-frame
35521.203 (rms 07-Dec-96): yank-action sendactions)
35531.203 (rms 07-Dec-96): ;; This is not a standard frame parameter;
35541.203 (rms 07-Dec-96): ;; nothing except sendmail.el looks at it.
35551.203 (rms 07-Dec-96): (modify-frame-parameters (selected-frame)
35561.203 (rms 07-Dec-96): '((mail-dedicated-frame . t))))
35571.203 (rms 07-Dec-96): (compose-mail to subject others
35581.203 (rms 07-Dec-96): noerase 'switch-to-buffer-other-window
35591.203 (rms 07-Dec-96): yank-action sendactions)))))
35601.57 (rms 16-Jul-93):
35611.1 (roland 13-May-91): (defun rmail-mail ()
35621.39 (rms 09-Mar-93): "Send mail in another window.
35631.39 (rms 09-Mar-93): While composing the message, use \\[mail-yank-original] to yank the
35641.39 (rms 09-Mar-93): original message into it."
35651.1 (roland 13-May-91): (interactive)
35661.212 (handa 26-Feb-97): (rmail-start-mail nil nil nil nil nil rmail-view-buffer))
35671.1 (roland 13-May-91):
35681.1 (roland 13-May-91): (defun rmail-continue ()
35691.1 (roland 13-May-91): "Continue composing outgoing message previously being composed."
35701.1 (roland 13-May-91): (interactive)
35711.57 (rms 16-Jul-93): (rmail-start-mail t))
35721.1 (roland 13-May-91):
35731.1 (roland 13-May-91): (defun rmail-reply (just-sender)
35741.1 (roland 13-May-91): "Reply to the current message.
35751.1 (roland 13-May-91): Normally include CC: to all other recipients of original message;
35761.1 (roland 13-May-91): prefix argument means ignore them. While composing the reply,
35771.1 (roland 13-May-91): use \\[mail-yank-original] to yank the original message into it."
35781.1 (roland 13-May-91): (interactive "P")
35791.207 (rms 31-Jan-97): (let (from reply-to cc subject date to message-id references
35801.202 (rms 26-Oct-96): resent-to resent-cc resent-reply-to
35811.212 (handa 26-Feb-97): (msgnum rmail-current-message))
35821.1 (roland 13-May-91): (save-excursion
35831.1 (roland 13-May-91): (save-restriction
35841.345 (gerd 06-Jul-01): (if rmail-enable-mime
35851.345 (gerd 06-Jul-01): (narrow-to-region
35861.345 (gerd 06-Jul-01): (goto-char (point-min))
35871.345 (gerd 06-Jul-01): (if (search-forward "\n\n" nil 'move)
35881.345 (gerd 06-Jul-01): (1+ (match-beginning 0))
35891.345 (gerd 06-Jul-01): (point)))
35901.339 (gerd 08-May-01): (widen)
35911.339 (gerd 08-May-01): (goto-char (rmail-msgbeg rmail-current-message))
35921.339 (gerd 08-May-01): (forward-line 1)
35931.339 (gerd 08-May-01): (if (= (following-char) ?0)
35941.339 (gerd 08-May-01): (narrow-to-region
35951.339 (gerd 08-May-01): (progn (forward-line 2)
35961.339 (gerd 08-May-01): (point))
35971.339 (gerd 08-May-01): (progn (search-forward "\n\n" (rmail-msgend rmail-current-message)
35981.339 (gerd 08-May-01): 'move)
35991.339 (gerd 08-May-01): (point)))
36001.339 (gerd 08-May-01): (narrow-to-region (point)
36011.339 (gerd 08-May-01): (progn (search-forward "\n*** EOOH ***\n")
36021.339 (gerd 08-May-01): (beginning-of-line) (point)))))
36031.202 (rms 26-Oct-96): (setq from (mail-fetch-field "from")
36041.413 (rms 15-Aug-05): reply-to (or (mail-fetch-field "mail-reply-to" nil t)
36051.397 (rms 18-Mar-05): (mail-fetch-field "reply-to" nil t)
36061.1 (roland 13-May-91): from)
36071.202 (rms 26-Oct-96): subject (mail-fetch-field "subject")
36081.202 (rms 26-Oct-96): date (mail-fetch-field "date")
36091.202 (rms 26-Oct-96): message-id (mail-fetch-field "message-id")
36101.207 (rms 31-Jan-97): references (mail-fetch-field "references" nil nil t)
36111.207 (rms 31-Jan-97): resent-reply-to (mail-fetch-field "resent-reply-to" nil t)
36121.202 (rms 26-Oct-96): resent-cc (and (not just-sender)
36131.202 (rms 26-Oct-96): (mail-fetch-field "resent-cc" nil t))
36141.202 (rms 26-Oct-96): resent-to (or (mail-fetch-field "resent-to" nil t) "")
36151.202 (rms 26-Oct-96): ;;; resent-subject (mail-fetch-field "resent-subject")
36161.202 (rms 26-Oct-96): ;;; resent-date (mail-fetch-field "resent-date")
36171.202 (rms 26-Oct-96): ;;; resent-message-id (mail-fetch-field "resent-message-id")
36181.413 (rms 15-Aug-05): )
36191.413 (rms 15-Aug-05): (unless just-sender
36201.413 (rms 15-Aug-05): (if (mail-fetch-field "mail-followup-to" nil t)
36211.413 (rms 15-Aug-05): ;; If this header field is present, use it instead of the To and CC fields.
36221.413 (rms 15-Aug-05): (setq to (mail-fetch-field "mail-followup-to" nil t))
36231.413 (rms 15-Aug-05): (setq cc (or (mail-fetch-field "cc" nil t) "")
36241.413 (rms 15-Aug-05): to (or (mail-fetch-field "to" nil t) ""))))
36251.413 (rms 15-Aug-05):
36261.413 (rms 15-Aug-05): ))
36271.413 (rms 15-Aug-05):
36281.202 (rms 26-Oct-96): ;; Merge the resent-to and resent-cc into the to and cc.
36291.202 (rms 26-Oct-96): (if (and resent-to (not (equal resent-to "")))
36301.202 (rms 26-Oct-96): (if (not (equal to ""))
36311.202 (rms 26-Oct-96): (setq to (concat to ", " resent-to))
36321.202 (rms 26-Oct-96): (setq to resent-to)))
36331.202 (rms 26-Oct-96): (if (and resent-cc (not (equal resent-cc "")))
36341.202 (rms 26-Oct-96): (if (not (equal cc ""))
36351.202 (rms 26-Oct-96): (setq cc (concat cc ", " resent-cc))
36361.202 (rms 26-Oct-96): (setq cc resent-cc)))
36371.202 (rms 26-Oct-96): ;; Add `Re: ' to subject if not there already.
36381.39 (rms 09-Mar-93): (and (stringp subject)
36391.143 (kwzh 03-Feb-95): (setq subject
36401.143 (kwzh 03-Feb-95): (concat rmail-reply-prefix
36411.211 (kwzh 23-Feb-97): (if (let ((case-fold-search t))
36421.211 (kwzh 23-Feb-97): (string-match rmail-reply-regexp subject))
36431.143 (kwzh 03-Feb-95): (substring subject (match-end 0))
36441.143 (kwzh 03-Feb-95): subject))))
36451.226 (rms 01-Jun-97): (rmail-start-mail
36461.226 (rms 01-Jun-97): nil
36471.226 (rms 01-Jun-97): ;; Using mail-strip-quoted-names is undesirable with newer mailers
36481.226 (rms 01-Jun-97): ;; since they can handle the names unstripped.
36491.226 (rms 01-Jun-97): ;; I don't know whether there are other mailers that still
36501.226 (rms 01-Jun-97): ;; need the names to be stripped.
36511.366 (rms 01-Jan-03): ;;; (mail-strip-quoted-names reply-to)
36521.403 (eliz 21-May-05): ;; Remove unwanted names from reply-to, since Mail-Followup-To
36531.403 (eliz 21-May-05): ;; header causes all the names in it to wind up in reply-to, not
36541.403 (eliz 21-May-05): ;; in cc. But if what's left is an empty list, use the original.
36551.403 (eliz 21-May-05): (let* ((reply-to-list (rmail-dont-reply-to reply-to)))
36561.403 (eliz 21-May-05): (if (string= reply-to-list "") reply-to reply-to-list))
36571.226 (rms 01-Jun-97): subject
36581.226 (rms 01-Jun-97): (rmail-make-in-reply-to-field from date message-id)
36591.226 (rms 01-Jun-97): (if just-sender
36601.226 (rms 01-Jun-97): nil
36611.226 (rms 01-Jun-97): ;; mail-strip-quoted-names is NOT necessary for rmail-dont-reply-to
36621.226 (rms 01-Jun-97): ;; to do its job.
36631.226 (rms 01-Jun-97): (let* ((cc-list (rmail-dont-reply-to
36641.226 (rms 01-Jun-97): (mail-strip-quoted-names
36651.226 (rms 01-Jun-97): (if (null cc) to (concat to ", " cc))))))
36661.226 (rms 01-Jun-97): (if (string= cc-list "") nil cc-list)))
36671.226 (rms 01-Jun-97): rmail-view-buffer
36681.226 (rms 01-Jun-97): (list (list 'rmail-mark-message
36691.339 (gerd 08-May-01): rmail-buffer
36701.339 (gerd 08-May-01): (with-current-buffer rmail-buffer
36711.339 (gerd 08-May-01): (aref rmail-msgref-vector msgnum))
36721.226 (rms 01-Jun-97): "answered"))
36731.226 (rms 01-Jun-97): nil
36741.226 (rms 01-Jun-97): (list (cons "References" (concat (mapconcat 'identity references " ")
36751.226 (rms 01-Jun-97): " " message-id))))))
36761.217 (rms 26-Apr-97):
36771.218 (rms 02-May-97): (defun rmail-mark-message (buffer msgnum-list attribute)
36781.218 (rms 02-May-97): "Give BUFFER's message number in MSGNUM-LIST the attribute ATTRIBUTE.
36791.218 (rms 02-May-97): This is use in the send-actions for message buffers.
36801.218 (rms 02-May-97): MSGNUM-LIST is a list of the form (MSGNUM)
36811.218 (rms 02-May-97): which is an element of rmail-msgref-vector."
36821.217 (rms 26-Apr-97): (save-excursion
36831.217 (rms 26-Apr-97): (set-buffer buffer)
36841.218 (rms 02-May-97): (if (car msgnum-list)
36851.218 (rms 02-May-97): (rmail-set-attribute attribute t (car msgnum-list)))))
36861.1 (roland 13-May-91):
36871.1 (roland 13-May-91): (defun rmail-make-in-reply-to-field (from date message-id)
36881.1 (roland 13-May-91): (cond ((not from)
36891.1 (roland 13-May-91): (if message-id
36901.1 (roland 13-May-91): message-id
36911.1 (roland 13-May-91): nil))
36921.1 (roland 13-May-91): (mail-use-rfc822
36931.1 (roland 13-May-91): (require 'rfc822)
36941.1 (roland 13-May-91): (let ((tem (car (rfc822-addresses from))))
36951.1 (roland 13-May-91): (if message-id
36961.233 (rms 12-Aug-97): (if (or (not tem)
36971.233 (rms 12-Aug-97): (string-match
36981.233 (rms 12-Aug-97): (regexp-quote (if (string-match "@[^@]*\\'" tem)
36991.233 (rms 12-Aug-97): (substring tem 0
37001.233 (rms 12-Aug-97): (match-beginning 0))
37011.233 (rms 12-Aug-97): tem))
37021.233 (rms 12-Aug-97): message-id))
37031.233 (rms 12-Aug-97): ;; missing From, or Message-ID is sufficiently informative
37041.1 (roland 13-May-91): message-id
37051.1 (roland 13-May-91): (concat message-id " (" tem ")"))
37061.82 (rms 29-Jan-94): ;; Copy TEM, discarding text properties.
37071.82 (rms 29-Jan-94): (setq tem (copy-sequence tem))
37081.82 (rms 29-Jan-94): (set-text-properties 0 (length tem) nil tem)
37091.82 (rms 29-Jan-94): (setq tem (copy-sequence tem))
37101.82 (rms 29-Jan-94): ;; Use prin1 to fake RFC822 quoting
37111.82 (rms 29-Jan-94): (let ((field (prin1-to-string tem)))
37121.82 (rms 29-Jan-94): (if date
37131.82 (rms 29-Jan-94): (concat field "'s message of " date)
37141.82 (rms 29-Jan-94): field)))))
37151.243 (rms 19-Jan-98): ((let* ((foo "[^][\000-\037()<>@,;:\\\" ]+")
37161.243 (rms 19-Jan-98): (bar "[^][\000-\037()<>@,;:\\\"]+"))
37171.243 (rms 19-Jan-98): ;; These strings both match all non-ASCII characters.
37181.1 (roland 13-May-91): (or (string-match (concat "\\`[ \t]*\\(" bar
37191.1 (roland 13-May-91): "\\)\\(<" foo "@" foo ">\\)?[ \t]*\\'")
37201.1 (roland 13-May-91): ;; "Unix Loser <Foo@bar.edu>" => "Unix Loser"
37211.1 (roland 13-May-91): from)
37221.1 (roland 13-May-91): (string-match (concat "\\`[ \t]*<" foo "@" foo ">[ \t]*(\\("
37231.1 (roland 13-May-91): bar "\\))[ \t]*\\'")
37241.1 (roland 13-May-91): ;; "<Bugs@bar.edu>" (Losing Unix) => "Losing Unix"
37251.1 (roland 13-May-91): from)))
37261.1 (roland 13-May-91): (let ((start (match-beginning 1))
37271.1 (roland 13-May-91): (end (match-end 1)))
37281.1 (roland 13-May-91): ;; Trim whitespace which above regexp match allows
37291.1 (roland 13-May-91): (while (and (< start end)
37301.1 (roland 13-May-91): (memq (aref from start) '(?\t ?\ )))
37311.1 (roland 13-May-91): (setq start (1+ start)))
37321.1 (roland 13-May-91): (while (and (< start end)
37331.1 (roland 13-May-91): (memq (aref from (1- end)) '(?\t ?\ )))
37341.1 (roland 13-May-91): (setq end (1- end)))
37351.1 (roland 13-May-91): (let ((field (substring from start end)))
37361.1 (roland 13-May-91): (if date (setq field (concat "message from " field " on " date)))
37371.1 (roland 13-May-91): (if message-id
37381.1 (roland 13-May-91): ;; "<AA259@bar.edu> (message from Unix Loser on 1-Apr-89)"
37391.1 (roland 13-May-91): (concat message-id " (" field ")")
37401.1 (roland 13-May-91): field))))
37411.1 (roland 13-May-91): (t
37421.1 (roland 13-May-91): ;; If we can't kludge it simply, do it correctly
37431.1 (roland 13-May-91): (let ((mail-use-rfc822 t))
37441.1 (roland 13-May-91): (rmail-make-in-reply-to-field from date message-id)))))
37451.147 (rms 12-Mar-95):
37461.42 (rms 07-May-93): (defun rmail-forward (resend)
37471.42 (rms 07-May-93): "Forward the current message to another user.
37481.42 (rms 07-May-93): With prefix argument, \"resend\" the message instead of forwarding it;
37491.42 (rms 07-May-93): see the documentation of `rmail-resend'."
37501.42 (rms 07-May-93): (interactive "P")
37511.42 (rms 07-May-93): (if resend
37521.42 (rms 07-May-93): (call-interactively 'rmail-resend)
37531.339 (gerd 08-May-01): (let ((forward-buffer rmail-buffer)
37541.131 (rms 27-Sep-94): (msgnum rmail-current-message)
37551.42 (rms 07-May-93): (subject (concat "["
37561.42 (rms 07-May-93): (let ((from (or (mail-fetch-field "From")
37571.42 (rms 07-May-93): (mail-fetch-field ">From"))))
37581.42 (rms 07-May-93): (if from
37591.42 (rms 07-May-93): (concat (mail-strip-quoted-names from) ": ")
37601.42 (rms 07-May-93): ""))
37611.42 (rms 07-May-93): (or (mail-fetch-field "Subject") "")
37621.42 (rms 07-May-93): "]")))
37631.203 (rms 07-Dec-96): (if (rmail-start-mail
37641.203 (rms 07-Dec-96): nil nil subject nil nil nil
37651.217 (rms 26-Apr-97): (list (list 'rmail-mark-message
37661.218 (rms 02-May-97): forward-buffer
37671.339 (gerd 08-May-01): (with-current-buffer rmail-buffer
37681.339 (gerd 08-May-01): (aref rmail-msgref-vector msgnum))
37691.217 (rms 26-Apr-97): "forwarded"))
37701.203 (rms 07-Dec-96): ;; If only one window, use it for the mail buffer.
37711.203 (rms 07-Dec-96): ;; Otherwise, use another window for the mail buffer
37721.203 (rms 07-Dec-96): ;; so that the Rmail buffer remains visible
37731.203 (rms 07-Dec-96): ;; and sending the mail will get back to it.
37741.203 (rms 07-Dec-96): (and (not rmail-mail-new-frame) (one-window-p t)))
37751.131 (rms 27-Sep-94): ;; The mail buffer is now current.
37761.58 (rms 24-Jul-93): (save-excursion
37771.65 (rms 15-Sep-93): ;; Insert after header separator--before signature if any.
37781.264 (rms 30-Apr-98): (goto-char (mail-text-start))
37791.350 (zsh 25-Nov-01): (if (or rmail-enable-mime rmail-enable-mime-composing)
37801.339 (gerd 08-May-01): (funcall rmail-insert-mime-forwarded-message-function
37811.339 (gerd 08-May-01): forward-buffer)
37821.339 (gerd 08-May-01): (insert "------- Start of forwarded message -------\n")
37831.339 (gerd 08-May-01): ;; Quote lines with `- ' if they start with `-'.
37841.339 (gerd 08-May-01): (let ((beg (point)) end)
37851.339 (gerd 08-May-01): (setq end (point-marker))
37861.339 (gerd 08-May-01): (set-marker-insertion-type end t)
37871.339 (gerd 08-May-01): (insert-buffer-substring forward-buffer)
37881.339 (gerd 08-May-01): (goto-char beg)
37891.339 (gerd 08-May-01): (while (re-search-forward "^-" end t)
37901.339 (gerd 08-May-01): (beginning-of-line)
37911.339 (gerd 08-May-01): (insert "- ")
37921.339 (gerd 08-May-01): (forward-line 1))
37931.339 (gerd 08-May-01): (goto-char end)
37941.339 (gerd 08-May-01): (skip-chars-backward "\n")
37951.339 (gerd 08-May-01): (if (< (point) end)
37961.339 (gerd 08-May-01): (forward-char 1))
37971.339 (gerd 08-May-01): (delete-region (point) end)
37981.339 (gerd 08-May-01): (set-marker end nil))
37991.339 (gerd 08-May-01): (insert "------- End of forwarded message -------\n"))
38001.131 (rms 27-Sep-94): (push-mark))))))
38011.147 (rms 12-Mar-95):
38021.1 (roland 13-May-91): (defun rmail-resend (address &optional from comment mail-alias-file)
38031.1 (roland 13-May-91): "Resend current message to ADDRESSES.
38041.73 (rms 23-Dec-93): ADDRESSES should be a single address, a string consisting of several
38051.1 (roland 13-May-91): addresses separated by commas, or a list of addresses.
38061.1 (roland 13-May-91):
38071.1 (roland 13-May-91): Optional FROM is the address to resend the message from, and
38081.232 (rms 29-Jul-97): defaults from the value of `user-mail-address'.
38091.232 (rms 29-Jul-97): Optional COMMENT is a string to insert as a comment in the resent message.
38101.1 (roland 13-May-91): Optional ALIAS-FILE is alternate aliases file to be used by sendmail,
38111.1 (roland 13-May-91): typically for purposes of moderating a list."
38121.1 (roland 13-May-91): (interactive "sResend to: ")
38131.46 (rms 04-Jun-93): (require 'sendmail)
38141.46 (rms 04-Jun-93): (require 'mailalias)
38151.342 (gerd 31-May-01): (unless (or (eq rmail-view-buffer (current-buffer))
38161.342 (gerd 31-May-01): (eq rmail-buffer (current-buffer)))
38171.311 (gerd 25-Feb-00): (error "Not an Rmail buffer"))
38181.232 (rms 29-Jul-97): (if (not from) (setq from user-mail-address))
38191.1 (roland 13-May-91): (let ((tembuf (generate-new-buffer " sendmail temp"))
38201.1 (roland 13-May-91): (case-fold-search nil)
38211.394 (rms 27-Dec-04): (mail-personal-alias-file
38221.394 (rms 27-Dec-04): (or mail-alias-file mail-personal-alias-file))
38231.288 (kwzh 21-Sep-98): (mailbuf rmail-buffer))
38241.1 (roland 13-May-91): (unwind-protect
38251.288 (kwzh 21-Sep-98): (with-current-buffer tembuf
38261.1 (roland 13-May-91): ;;>> Copy message into temp buffer
38271.342 (gerd 31-May-01): (if rmail-enable-mime
38281.342 (gerd 31-May-01): (funcall rmail-insert-mime-resent-message-function mailbuf)
38291.342 (gerd 31-May-01): (insert-buffer-substring mailbuf))
38301.1 (roland 13-May-91): (goto-char (point-min))
38311.167 (rms 05-Jan-96): ;; Delete any Sender field, since that's not specifiable.
38321.73 (rms 23-Dec-93): ; Only delete Sender fields in the actual header.
38331.73 (rms 23-Dec-93): (re-search-forward "^$" nil 'move)
38341.73 (rms 23-Dec-93): ; Using "while" here rather than "if" because some buggy mail
38351.73 (rms 23-Dec-93): ; software may have inserted multiple Sender fields.
38361.73 (rms 23-Dec-93): (while (re-search-backward "^Sender:" nil t)
38371.73 (rms 23-Dec-93): (let (beg)
38381.73 (rms 23-Dec-93): (setq beg (point))
38391.73 (rms 23-Dec-93): (forward-line 1)
38401.73 (rms 23-Dec-93): (while (looking-at "[ \t]")
38411.73 (rms 23-Dec-93): (forward-line 1))
38421.73 (rms 23-Dec-93): (delete-region beg (point))))
38431.73 (rms 23-Dec-93): ; Go back to the beginning of the buffer so the Resent- fields
38441.73 (rms 23-Dec-93): ; are inserted there.
38451.73 (rms 23-Dec-93): (goto-char (point-min))
38461.1 (roland 13-May-91): ;;>> Insert resent-from:
38471.1 (roland 13-May-91): (insert "Resent-From: " from "\n")
38481.55 (rms 07-Jul-93): (insert "Resent-Date: " (mail-rfc822-date) "\n")
38491.1 (roland 13-May-91): ;;>> Insert resent-to: and bcc if need be.
38501.1 (roland 13-May-91): (let ((before (point)))
38511.68 (rms 09-Oct-93): (if mail-self-blind
38521.68 (rms 09-Oct-93): (insert "Resent-Bcc: " (user-login-name) "\n"))
38531.1 (roland 13-May-91): (insert "Resent-To: " (if (stringp address)
38541.1 (roland 13-May-91): address
38551.1 (roland 13-May-91): (mapconcat 'identity address ",\n\t"))
38561.1 (roland 13-May-91): "\n")
38571.150 (rms 14-Apr-95): ;; Expand abbrevs in the recipients.
38581.121 (rms 14-Aug-94): (save-excursion
38591.150 (rms 14-Apr-95): (if (featurep 'mailabbrev)
38601.152 (rms 24-Apr-95): (let ((end (point-marker))
38611.152 (rms 24-Apr-95): (local-abbrev-table mail-abbrevs)
38621.152 (rms 24-Apr-95): (old-syntax-table (syntax-table)))
38631.152 (rms 24-Apr-95): (if (and (not (vectorp mail-abbrevs))
38641.152 (rms 24-Apr-95): (file-exists-p mail-personal-alias-file))
38651.152 (rms 24-Apr-95): (build-mail-abbrevs))
38661.357 (rms 25-Mar-02): (unless mail-abbrev-syntax-table
38671.357 (rms 25-Mar-02): (mail-abbrev-make-syntax-table))
38681.152 (rms 24-Apr-95): (set-syntax-table mail-abbrev-syntax-table)
38691.152 (rms 24-Apr-95): (goto-char before)
38701.152 (rms 24-Apr-95): (while (and (< (point) end)
38711.152 (rms 24-Apr-95): (progn (forward-word 1)
38721.152 (rms 24-Apr-95): (<= (point) end)))
38731.152 (rms 24-Apr-95): (expand-abbrev))
38741.152 (rms 24-Apr-95): (set-syntax-table old-syntax-table))
38751.150 (rms 14-Apr-95): (expand-mail-aliases before (point)))))
38761.1 (roland 13-May-91): ;;>> Set up comment, if any.
38771.1 (roland 13-May-91): (if (and (sequencep comment) (not (zerop (length comment))))
38781.1 (roland 13-May-91): (let ((before (point))
38791.1 (roland 13-May-91): after)
38801.1 (roland 13-May-91): (insert comment)
38811.1 (roland 13-May-91): (or (eolp) (insert "\n"))
38821.1 (roland 13-May-91): (setq after (point))
38831.1 (roland 13-May-91): (goto-char before)
38841.1 (roland 13-May-91): (while (< (point) after)
38851.1 (roland 13-May-91): (insert "Resent-Comment: ")
38861.1 (roland 13-May-91): (forward-line 1))))
38871.1 (roland 13-May-91): ;; Don't expand aliases in the destination fields
38881.1 (roland 13-May-91): ;; of the original message.
38891.1 (roland 13-May-91): (let (mail-aliases)
38901.78 (rms 06-Jan-94): (funcall send-mail-function)))
38911.42 (rms 07-May-93): (kill-buffer tembuf))
38921.288 (kwzh 21-Sep-98): (with-current-buffer rmail-buffer
38931.288 (kwzh 21-Sep-98): (rmail-set-attribute "resent" t rmail-current-message))))
38941.147 (rms 12-Mar-95):
38951.29 (rms 29-Sep-92): (defvar mail-unsent-separator
38961.32 (rms 09-Oct-92): (concat "^ *---+ +Unsent message follows +---+ *$\\|"
38971.32 (rms 09-Oct-92): "^ *---+ +Returned message +---+ *$\\|"
38981.269 (rms 20-May-98): "^ *---+ *Returned mail follows *---+ *$\\|"
38991.146 (rms 24-Feb-95): "^Start of returned message$\\|"
39001.279 (rms 25-Jun-98): "^---+ Below this line is a copy of the message.$\\|"
39011.33 (rms 09-Oct-92): "^ *---+ +Original message +---+ *$\\|"
39021.37 (rms 09-Jan-93): "^ *--+ +begin message +--+ *$\\|"
39031.68 (rms 09-Oct-93): "^ *---+ +Original message follows +---+ *$\\|"
39041.250 (kwzh 25-Feb-98): "^ *---+ +Your message follows +---+ *$\\|"
39051.305 (rms 07-Jul-99): "^|? *---+ +Message text follows: +---+ *|?$\\|"
39061.319 (gerd 06-Jul-00): "^ *---+ +This is a copy of \\w+ message, including all the headers.*---+ *$")
39071.122 (rms 19-Aug-94): "A regexp that matches the separator before the text of a failed message.")
39081.1 (roland 13-May-91):
39091.214 (rms 20-Mar-97): (defvar mail-mime-unsent-header "^Content-Type: message/rfc822 *$"
39101.214 (rms 20-Mar-97): "A regexp that matches the header of a MIME body part with a failed message.")
39111.214 (rms 20-Mar-97):
39121.1 (roland 13-May-91): (defun rmail-retry-failure ()
39131.1 (roland 13-May-91): "Edit a mail message which is based on the contents of the current message.
39141.1 (roland 13-May-91): For a message rejected by the mail system, extract the interesting headers and
39151.122 (rms 19-Aug-94): the body of the original message.
39161.214 (rms 20-Mar-97): If the failed message is a MIME multipart message, it is searched for a
39171.214 (rms 20-Mar-97): body part with a header which matches the variable `mail-mime-unsent-header'.
39181.214 (rms 20-Mar-97): Otherwise, the variable `mail-unsent-separator' should match the string that
39191.128 (rms 23-Sep-94): delimits the returned original message.
39201.128 (rms 23-Sep-94): The variable `rmail-retry-ignored-headers' is a regular expression
39211.128 (rms 23-Sep-94): specifying headers which should not be copied into the new message."
39221.1 (roland 13-May-91): (interactive)
39231.1 (roland 13-May-91): (require 'mail-utils)
39241.223 (rms 15-May-97): (let ((rmail-this-buffer (current-buffer))
39251.164 (kwzh 21-Dec-95): (msgnum rmail-current-message)
39261.344 (rms 29-Jun-01): bounce-start bounce-end bounce-indent resending
39271.344 (rms 29-Jun-01): ;; Fetch any content-type header in current message
39281.344 (rms 29-Jun-01): ;; Must search thru the whole unpruned header.
39291.344 (rms 29-Jun-01): (content-type
39301.344 (rms 29-Jun-01): (save-excursion
39311.344 (rms 29-Jun-01): (save-restriction
39321.344 (rms 29-Jun-01): (rmail-narrow-to-non-pruned-header)
39331.344 (rms 29-Jun-01): (mail-fetch-field "Content-Type") ))))
39341.344 (rms 29-Jun-01): (save-excursion
39351.344 (rms 29-Jun-01): (goto-char (point-min))
39361.344 (rms 29-Jun-01): (let ((case-fold-search t))
39371.358 (pot 06-May-02): (if (and content-type
39381.358 (pot 06-May-02): (string-match
39391.358 (pot 06-May-02): ";[\n\t ]*boundary=\"?\\([-0-9a-z'()+_,./:=? ]+\\)\"?"
39401.344 (rms 29-Jun-01): content-type))
39411.344 (rms 29-Jun-01): ;; Handle a MIME multipart bounce message.
39421.344 (rms 29-Jun-01): (let ((codestring
39431.344 (rms 29-Jun-01): (concat "\n--"
39441.358 (pot 06-May-02): (substring content-type (match-beginning 1)
39451.344 (rms 29-Jun-01): (match-end 1)))))
39461.344 (rms 29-Jun-01): (unless (re-search-forward mail-mime-unsent-header nil t)
39471.344 (rms 29-Jun-01): (error "Cannot find beginning of header in failed message"))
39481.344 (rms 29-Jun-01): (unless (search-forward "\n\n" nil t)
39491.344 (rms 29-Jun-01): (error "Cannot find start of Mime data in failed message"))
39501.344 (rms 29-Jun-01): (setq bounce-start (point))
39511.344 (rms 29-Jun-01): (if (search-forward codestring nil t)
39521.344 (rms 29-Jun-01): (setq bounce-end (match-beginning 0))
39531.344 (rms 29-Jun-01): (setq bounce-end (point-max))))
39541.344 (rms 29-Jun-01): ;; Non-MIME bounce.
39551.344 (rms 29-Jun-01): (or (re-search-forward mail-unsent-separator nil t)
39561.344 (rms 29-Jun-01): (error "Cannot parse this as a failure message"))
39571.344 (rms 29-Jun-01): (skip-chars-forward "\n")
39581.344 (rms 29-Jun-01): ;; Support a style of failure message in which the original
39591.344 (rms 29-Jun-01): ;; message is indented, and included within lines saying
39601.344 (rms 29-Jun-01): ;; `Start of returned message' and `End of returned message'.
39611.344 (rms 29-Jun-01): (if (looking-at " +Received:")
39621.344 (rms 29-Jun-01): (progn
39631.344 (rms 29-Jun-01): (setq bounce-start (point))
39641.344 (rms 29-Jun-01): (skip-chars-forward " ")
39651.344 (rms 29-Jun-01): (setq bounce-indent (- (current-column)))
39661.344 (rms 29-Jun-01): (goto-char (point-max))
39671.344 (rms 29-Jun-01): (re-search-backward "^End of returned message$" nil t)
39681.344 (rms 29-Jun-01): (setq bounce-end (point)))
39691.344 (rms 29-Jun-01): ;; One message contained a few random lines before
39701.344 (rms 29-Jun-01): ;; the old message header. The first line of the
39711.344 (rms 29-Jun-01): ;; message started with two hyphens. A blank line
39721.344 (rms 29-Jun-01): ;; followed these random lines. The same line
39731.344 (rms 29-Jun-01): ;; beginning with two hyphens was possibly marking
39741.344 (rms 29-Jun-01): ;; the end of the message.
39751.344 (rms 29-Jun-01): (if (looking-at "^--")
39761.344 (rms 29-Jun-01): (let ((boundary (buffer-substring-no-properties
39771.344 (rms 29-Jun-01): (point)
39781.344 (rms 29-Jun-01): (progn (end-of-line) (point)))))
39791.344 (rms 29-Jun-01): (search-forward "\n\n")
39801.344 (rms 29-Jun-01): (skip-chars-forward "\n")
39811.344 (rms 29-Jun-01): (setq bounce-start (point))
39821.344 (rms 29-Jun-01): (goto-char (point-max))
39831.344 (rms 29-Jun-01): (search-backward (concat "\n\n" boundary) bounce-start t)
39841.344 (rms 29-Jun-01): (setq bounce-end (point)))
39851.344 (rms 29-Jun-01): (setq bounce-start (point)
39861.344 (rms 29-Jun-01): bounce-end (point-max)))
39871.344 (rms 29-Jun-01): (unless (search-forward "\n\n" nil t)
39881.344 (rms 29-Jun-01): (error "Cannot find end of header in failed message"))))))
39891.344 (rms 29-Jun-01): ;; We have found the message that bounced, within the current message.
39901.344 (rms 29-Jun-01): ;; Now start sending new message; default header fields from original.
39911.344 (rms 29-Jun-01): ;; Turn off the usual actions for initializing the message body
39921.344 (rms 29-Jun-01): ;; because we want to get only the text from the failure message.
39931.344 (rms 29-Jun-01): (let (mail-signature mail-setup-hook)
39941.344 (rms 29-Jun-01): (if (rmail-start-mail nil nil nil nil nil rmail-this-buffer
39951.344 (rms 29-Jun-01): (list (list 'rmail-mark-message
39961.344 (rms 29-Jun-01): rmail-this-buffer
39971.344 (rms 29-Jun-01): (aref rmail-msgref-vector msgnum)
39981.344 (rms 29-Jun-01): "retried")))
39991.344 (rms 29-Jun-01): ;; Insert original text as initial text of new draft message.
40001.344 (rms 29-Jun-01): ;; Bind inhibit-read-only since the header delimiter
40011.344 (rms 29-Jun-01): ;; of the previous message was probably read-only.
40021.344 (rms 29-Jun-01): (let ((inhibit-read-only t)
40031.344 (rms 29-Jun-01): rmail-displayed-headers
40041.344 (rms 29-Jun-01): rmail-ignored-headers)
40051.344 (rms 29-Jun-01): (erase-buffer)
40061.344 (rms 29-Jun-01): (insert-buffer-substring rmail-this-buffer
40071.344 (rms 29-Jun-01): bounce-start bounce-end)
40081.344 (rms 29-Jun-01): (goto-char (point-min))
40091.344 (rms 29-Jun-01): (if bounce-indent
40101.344 (rms 29-Jun-01): (indent-rigidly (point-min) (point-max) bounce-indent))
40111.344 (rms 29-Jun-01): (rmail-clear-headers rmail-retry-ignored-headers)
40121.344 (rms 29-Jun-01): (rmail-clear-headers "^sender:\\|^return-path:\\|^received:")
40131.344 (rms 29-Jun-01): (mail-sendmail-delimit-header)
40141.344 (rms 29-Jun-01): (save-restriction
40151.344 (rms 29-Jun-01): (narrow-to-region (point-min) (mail-header-end))
40161.344 (rms 29-Jun-01): (setq resending (mail-fetch-field "resent-to"))
40171.344 (rms 29-Jun-01): (if mail-self-blind
40181.344 (rms 29-Jun-01): (if resending
40191.344 (rms 29-Jun-01): (insert "Resent-Bcc: " (user-login-name) "\n")
40201.344 (rms 29-Jun-01): (insert "BCC: " (user-login-name) "\n"))))
40211.344 (rms 29-Jun-01): (goto-char (point-min))
40221.344 (rms 29-Jun-01): (mail-position-on-field (if resending "Resent-To" "To") t))))))
40231.147 (rms 12-Mar-95):
40241.39 (rms 09-Mar-93): (defun rmail-summary-exists ()
40251.437 (miles 13-Aug-07): "Non-nil if in an RMAIL buffer and an associated summary buffer exists.
40261.91 (rms 18-Mar-94): In fact, the non-nil value returned is the summary buffer itself."
40271.39 (rms 09-Mar-93): (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
40281.39 (rms 09-Mar-93): rmail-summary-buffer))
40291.39 (rms 09-Mar-93):
40301.39 (rms 09-Mar-93): (defun rmail-summary-displayed ()
40311.437 (miles 13-Aug-07): "t if in RMAIL buffer and an associated summary buffer is displayed."
40321.39 (rms 09-Mar-93): (and rmail-summary-buffer (get-buffer-window rmail-summary-buffer)))
40331.39 (rms 09-Mar-93):
40341.219 (rms 03-May-97): (defcustom rmail-redisplay-summary nil
40351.39 (rms 09-Mar-93): "*Non-nil means Rmail should show the summary when it changes.
40361.219 (rms 03-May-97): This has an effect only if a summary buffer exists."
40371.219 (rms 03-May-97): :type 'boolean
40381.219 (rms 03-May-97): :group 'rmail-summary)
40391.219 (rms 03-May-97):
40401.219 (rms 03-May-97): (defcustom rmail-summary-window-size nil
40411.219 (rms 03-May-97): "*Non-nil means specify the height for an Rmail summary window."
40421.238 (kwzh 15-Nov-97): :type '(choice (const :tag "Disabled" nil) integer)
40431.219 (rms 03-May-97): :group 'rmail-summary)
40441.91 (rms 18-Mar-94):
40451.39 (rms 09-Mar-93): ;; Put the summary buffer back on the screen, if user wants that.
40461.39 (rms 09-Mar-93): (defun rmail-maybe-display-summary ()
40471.91 (rms 18-Mar-94): (let ((selected (selected-window))
40481.91 (rms 18-Mar-94): window)
40491.91 (rms 18-Mar-94): ;; If requested, make sure the summary is displayed.
40501.91 (rms 18-Mar-94): (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
40511.91 (rms 18-Mar-94): rmail-redisplay-summary
40521.120 (rms 13-Aug-94): (if (get-buffer-window rmail-summary-buffer 0)
40531.120 (rms 13-Aug-94): ;; It's already in some frame; show that one.
40541.120 (rms 13-Aug-94): (let ((frame (window-frame
40551.120 (rms 13-Aug-94): (get-buffer-window rmail-summary-buffer 0))))
40561.120 (rms 13-Aug-94): (make-frame-visible frame)
40571.120 (rms 13-Aug-94): (raise-frame frame))
40581.120 (rms 13-Aug-94): (display-buffer rmail-summary-buffer)))
40591.91 (rms 18-Mar-94): ;; If requested, set the height of the summary window.
40601.91 (rms 18-Mar-94): (and rmail-summary-buffer (buffer-name rmail-summary-buffer)
40611.91 (rms 18-Mar-94): rmail-summary-window-size
40621.91 (rms 18-Mar-94): (setq window (get-buffer-window rmail-summary-buffer))
40631.120 (rms 13-Aug-94): ;; Don't try to change the size if just one window in frame.
40641.120 (rms 13-Aug-94): (not (eq window (frame-root-window (window-frame window))))
40651.358 (pot 06-May-02): (unwind-protect
40661.91 (rms 18-Mar-94): (progn
40671.91 (rms 18-Mar-94): (select-window window)
40681.180 (simon 07-Mar-96): (enlarge-window (- rmail-summary-window-size (window-height))))
40691.91 (rms 18-Mar-94): (select-window selected)))))
40701.171 (simon 26-Jan-96):
40711.171 (simon 26-Jan-96): ;;;; *** Rmail Local Fontification ***
40721.171 (simon 26-Jan-96):
40731.171 (simon 26-Jan-96): (defun rmail-fontify-buffer-function ()
40741.171 (simon 26-Jan-96): ;; This function's symbol is bound to font-lock-fontify-buffer-function.
40751.172 (simon 02-Feb-96): (add-hook 'rmail-show-message-hook 'rmail-fontify-message nil t)
40761.180 (simon 07-Mar-96): ;; If we're already showing a message, fontify it now.
40771.180 (simon 07-Mar-96): (if rmail-current-message (rmail-fontify-message))
40781.180 (simon 07-Mar-96): ;; Prevent Font Lock mode from kicking in.
40791.172 (simon 02-Feb-96): (setq font-lock-fontified t))
40801.171 (simon 26-Jan-96):
40811.171 (simon 26-Jan-96): (defun rmail-unfontify-buffer-function ()
40821.171 (simon 26-Jan-96): ;; This function's symbol is bound to font-lock-fontify-unbuffer-function.
40831.172 (simon 02-Feb-96): (let ((modified (buffer-modified-p))
40841.172 (simon 02-Feb-96): (buffer-undo-list t) (inhibit-read-only t)
40851.172 (simon 02-Feb-96): before-change-functions after-change-functions
40861.172 (simon 02-Feb-96): buffer-file-name buffer-file-truename)
40871.172 (simon 02-Feb-96): (save-restriction
40881.172 (simon 02-Feb-96): (widen)
40891.172 (simon 02-Feb-96): (remove-hook 'rmail-show-message-hook 'rmail-fontify-message t)
40901.172 (simon 02-Feb-96): (remove-text-properties (point-min) (point-max) '(rmail-fontified nil))
40911.181 (rms 27-Mar-96): (font-lock-default-unfontify-buffer)
40921.181 (rms 27-Mar-96): (and (not modified) (buffer-modified-p) (set-buffer-modified-p nil)))))
40931.171 (simon 26-Jan-96):
40941.171 (simon 26-Jan-96): (defun rmail-fontify-message ()
40951.171 (simon 26-Jan-96): ;; Fontify the current message if it is not already fontified.
40961.171 (simon 26-Jan-96): (if (text-property-any (point-min) (point-max) 'rmail-fontified nil)
40971.171 (simon 26-Jan-96): (let ((modified (buffer-modified-p))
40981.171 (simon 26-Jan-96): (buffer-undo-list t) (inhibit-read-only t)
40991.171 (simon 26-Jan-96): before-change-functions after-change-functions
41001.171 (simon 26-Jan-96): buffer-file-name buffer-file-truename)
41011.171 (simon 26-Jan-96): (save-excursion
41021.171 (simon 26-Jan-96): (save-match-data
41031.171 (simon 26-Jan-96): (add-text-properties (point-min) (point-max) '(rmail-fontified t))
41041.181 (rms 27-Mar-96): (font-lock-fontify-region (point-min) (point-max))
41051.181 (rms 27-Mar-96): (and (not modified) (buffer-modified-p) (set-buffer-modified-p nil)))))))
41061.281 (kwzh 10-Jul-98):
41071.281 (kwzh 10-Jul-98): ;;; Speedbar support for RMAIL files.
41081.281 (kwzh 10-Jul-98): (eval-when-compile (require 'speedbar))
41091.179 (rms 04-Mar-96):
41101.281 (kwzh 10-Jul-98): (defvar rmail-speedbar-match-folder-regexp "^[A-Z0-9]+\\(\\.[A-Z0-9]+\\)?$"
41111.363 (jpw 24-Aug-02): "*This regex is used to match folder names to be displayed in speedbar.
41121.281 (kwzh 10-Jul-98): Enabling this will permit speedbar to display your folders for easy
41131.281 (kwzh 10-Jul-98): browsing, and moving of messages.")
41141.244 (zappo 23-Jan-98):
41151.244 (zappo 23-Jan-98): (defvar rmail-speedbar-last-user nil
41161.244 (zappo 23-Jan-98): "The last user to be displayed in the speedbar.")
41171.244 (zappo 23-Jan-98):
41181.281 (kwzh 10-Jul-98): (defvar rmail-speedbar-key-map nil
41191.281 (kwzh 10-Jul-98): "Keymap used when in rmail display mode.")
41201.281 (kwzh 10-Jul-98):
41211.281 (kwzh 10-Jul-98): (defun rmail-install-speedbar-variables ()
41221.281 (kwzh 10-Jul-98): "Install those variables used by speedbar to enhance rmail."
41231.281 (kwzh 10-Jul-98): (if rmail-speedbar-key-map
41241.281 (kwzh 10-Jul-98): nil
41251.281 (kwzh 10-Jul-98): (setq rmail-speedbar-key-map (speedbar-make-specialized-keymap))
41261.281 (kwzh 10-Jul-98):
41271.281 (kwzh 10-Jul-98): (define-key rmail-speedbar-key-map "e" 'speedbar-edit-line)
41281.281 (kwzh 10-Jul-98): (define-key rmail-speedbar-key-map "r" 'speedbar-edit-line)
41291.281 (kwzh 10-Jul-98): (define-key rmail-speedbar-key-map "\C-m" 'speedbar-edit-line)
41301.281 (kwzh 10-Jul-98): (define-key rmail-speedbar-key-map "M"
41311.281 (kwzh 10-Jul-98): 'rmail-speedbar-move-message-to-folder-on-line)))
41321.281 (kwzh 10-Jul-98):
41331.244 (zappo 23-Jan-98): (defvar rmail-speedbar-menu-items
41341.281 (kwzh 10-Jul-98): '(["Read Folder" speedbar-edit-line t]
41351.281 (kwzh 10-Jul-98): ["Move message to folder" rmail-speedbar-move-message-to-folder-on-line
41361.244 (zappo 23-Jan-98): (save-excursion (beginning-of-line)
41371.244 (zappo 23-Jan-98): (looking-at "<M> "))])
41381.244 (zappo 23-Jan-98): "Additional menu-items to add to speedbar frame.")
41391.244 (zappo 23-Jan-98):
41401.281 (kwzh 10-Jul-98): ;; Make sure our special speedbar major mode is loaded
41411.281 (kwzh 10-Jul-98): (if (featurep 'speedbar)
41421.281 (kwzh 10-Jul-98): (rmail-install-speedbar-variables)
41431.281 (kwzh 10-Jul-98): (add-hook 'speedbar-load-hook 'rmail-install-speedbar-variables))
41441.281 (kwzh 10-Jul-98):
41451.244 (zappo 23-Jan-98): (defun rmail-speedbar-buttons (buffer)
41461.244 (zappo 23-Jan-98): "Create buttons for BUFFER containing rmail messages.
41471.244 (zappo 23-Jan-98): Click on the address under Reply to: to reply to this person.
41481.244 (zappo 23-Jan-98): Under Folders: Click a name to read it, or on the <M> to move the
41491.244 (zappo 23-Jan-98): current message into that RMAIL folder."
41501.244 (zappo 23-Jan-98): (let ((from nil))
41511.244 (zappo 23-Jan-98): (save-excursion
41521.244 (zappo 23-Jan-98): (set-buffer buffer)
41531.244 (zappo 23-Jan-98): (goto-char (point-min))
41541.244 (zappo 23-Jan-98): (if (not (re-search-forward "^Reply-To: " nil t))
41551.244 (zappo 23-Jan-98): (if (not (re-search-forward "^From:? " nil t))
41561.244 (zappo 23-Jan-98): (setq from t)))
41571.244 (zappo 23-Jan-98): (if from
41581.244 (zappo 23-Jan-98): nil
41591.244 (zappo 23-Jan-98): (setq from (buffer-substring (point) (save-excursion
41601.244 (zappo 23-Jan-98): (end-of-line)
41611.244 (zappo 23-Jan-98): (point))))))
41621.244 (zappo 23-Jan-98): (goto-char (point-min))
41631.244 (zappo 23-Jan-98): (if (and (looking-at "Reply to:")
41641.244 (zappo 23-Jan-98): (equal from rmail-speedbar-last-user))
41651.244 (zappo 23-Jan-98): nil
41661.244 (zappo 23-Jan-98): (setq rmail-speedbar-last-user from)
41671.244 (zappo 23-Jan-98): (erase-buffer)
41681.244 (zappo 23-Jan-98): (insert "Reply To:\n")
41691.244 (zappo 23-Jan-98): (if (stringp from)
41701.244 (zappo 23-Jan-98): (speedbar-insert-button from 'speedbar-directory-face 'highlight
41711.244 (zappo 23-Jan-98): 'rmail-speedbar-button 'rmail-reply))
41721.244 (zappo 23-Jan-98): (insert "Folders:\n")
41731.244 (zappo 23-Jan-98): (let* ((case-fold-search nil)
41741.244 (zappo 23-Jan-98): (df (directory-files (save-excursion (set-buffer buffer)
41751.244 (zappo 23-Jan-98): default-directory)
41761.281 (kwzh 10-Jul-98): nil rmail-speedbar-match-folder-regexp)))
41771.244 (zappo 23-Jan-98): (while df
41781.244 (zappo 23-Jan-98): (speedbar-insert-button "<M>" 'speedbar-button-face 'highlight
41791.244 (zappo 23-Jan-98): 'rmail-speedbar-move-message (car df))
41801.244 (zappo 23-Jan-98): (speedbar-insert-button (car df) 'speedbar-file-face 'highlight
41811.244 (zappo 23-Jan-98): 'rmail-speedbar-find-file nil t)
41821.244 (zappo 23-Jan-98): (setq df (cdr df)))))))
41831.244 (zappo 23-Jan-98):
41841.244 (zappo 23-Jan-98): (defun rmail-speedbar-button (text token indent)
41851.244 (zappo 23-Jan-98): "Execute an rmail command specified by TEXT.
41861.244 (zappo 23-Jan-98): The command used is TOKEN. INDENT is not used."
41871.244 (zappo 23-Jan-98): (speedbar-with-attached-buffer
41881.244 (zappo 23-Jan-98): (funcall token t)))
41891.244 (zappo 23-Jan-98):
41901.244 (zappo 23-Jan-98): (defun rmail-speedbar-find-file (text token indent)
41911.244 (zappo 23-Jan-98): "Load in the rmail file TEXT.
41921.244 (zappo 23-Jan-98): TOKEN and INDENT are not used."
41931.244 (zappo 23-Jan-98): (speedbar-with-attached-buffer
41941.244 (zappo 23-Jan-98): (message "Loading in RMAIL file %s..." text)
41951.244 (zappo 23-Jan-98): (find-file text)))
41961.244 (zappo 23-Jan-98):
41971.281 (kwzh 10-Jul-98): (defun rmail-speedbar-move-message-to-folder-on-line ()
41981.244 (zappo 23-Jan-98): "If the current line is a folder, move current message to it."
41991.244 (zappo 23-Jan-98): (interactive)
42001.244 (zappo 23-Jan-98): (save-excursion
42011.244 (zappo 23-Jan-98): (beginning-of-line)
42021.244 (zappo 23-Jan-98): (if (re-search-forward "<M> " (save-excursion (end-of-line) (point)) t)
42031.244 (zappo 23-Jan-98): (progn
42041.244 (zappo 23-Jan-98): (forward-char -2)
42051.244 (zappo 23-Jan-98): (speedbar-do-function-pointer)))))
42061.244 (zappo 23-Jan-98):
42071.244 (zappo 23-Jan-98): (defun rmail-speedbar-move-message (text token indent)
42081.244 (zappo 23-Jan-98): "From button TEXT, copy current message to the rmail file specified by TOKEN.
42091.244 (zappo 23-Jan-98): TEXT and INDENT are not used."
42101.244 (zappo 23-Jan-98): (speedbar-with-attached-buffer
42111.244 (zappo 23-Jan-98): (message "Moving message to %s" token)
42121.244 (zappo 23-Jan-98): (rmail-output-to-rmail-file token)))
42131.244 (zappo 23-Jan-98):
42141.282 (rms 27-Jul-98): ; Functions for setting, getting and encoding the POP password.
42151.282 (rms 27-Jul-98): ; The password is encoded to prevent it from being easily accessible
42161.282 (rms 27-Jul-98): ; to "prying eyes." Obviously, this encoding isn't "real security,"
42171.282 (rms 27-Jul-98): ; nor is it meant to be.
42181.282 (rms 27-Jul-98):
42191.282 (rms 27-Jul-98): ;;;###autoload
42201.395 (eliz 15-Jan-05): (defun rmail-set-remote-password (password)
42211.395 (eliz 15-Jan-05): "Set PASSWORD to be used for retrieving mail from a POP or IMAP server."
42221.282 (rms 27-Jul-98): (interactive "sPassword: ")
42231.282 (rms 27-Jul-98): (if password
42241.395 (eliz 15-Jan-05): (setq rmail-encoded-remote-password
42251.282 (rms 27-Jul-98): (rmail-encode-string password (emacs-pid)))
42261.395 (eliz 15-Jan-05): (setq rmail-remote-password nil)
42271.395 (eliz 15-Jan-05): (setq rmail-encoded-remote-password nil)))
42281.282 (rms 27-Jul-98):
42291.395 (eliz 15-Jan-05): (defun rmail-get-remote-password (imap)
42301.395 (eliz 15-Jan-05): "Get the password for retrieving mail from a POP or IMAP server. If none
42311.282 (rms 27-Jul-98): has been set, then prompt the user for one."
42321.395 (eliz 15-Jan-05): (when (not rmail-encoded-remote-password)
42331.395 (eliz 15-Jan-05): (if (not rmail-remote-password)
42341.395 (eliz 15-Jan-05): (setq rmail-remote-password
42351.395 (eliz 15-Jan-05): (read-passwd (if imap
42361.395 (eliz 15-Jan-05): "IMAP password: "
42371.395 (eliz 15-Jan-05): "POP password: "))))
42381.395 (eliz 15-Jan-05): (rmail-set-remote-password rmail-remote-password)
42391.395 (eliz 15-Jan-05): (setq rmail-remote-password nil))
42401.395 (eliz 15-Jan-05): (rmail-encode-string rmail-encoded-remote-password (emacs-pid)))
42411.282 (rms 27-Jul-98):
42421.282 (rms 27-Jul-98): (defun rmail-have-password ()
42431.395 (eliz 15-Jan-05): (or rmail-remote-password rmail-encoded-remote-password))
42441.282 (rms 27-Jul-98):
42451.282 (rms 27-Jul-98): (defun rmail-encode-string (string mask)
42461.282 (rms 27-Jul-98): "Encode STRING with integer MASK, by taking the exclusive OR of the
42471.282 (rms 27-Jul-98): lowest byte in the mask with the first character of string, the
42481.282 (rms 27-Jul-98): second-lowest-byte with the second character of the string, etc.,
42491.282 (rms 27-Jul-98): restarting at the lowest byte of the mask whenever it runs out.
42501.282 (rms 27-Jul-98): Returns the encoded string. Calling the function again with an
42511.282 (rms 27-Jul-98): encoded string (and the same mask) will decode the string."
42521.293 (rms 31-Dec-98): (setq mask (abs mask)) ; doesn't work if negative
42531.358 (pot 06-May-02): (let* ((string-vector (string-to-vector string)) (i 0)
42541.282 (rms 27-Jul-98): (len (length string-vector)) (curmask mask) charmask)
42551.282 (rms 27-Jul-98): (while (< i len)
42561.282 (rms 27-Jul-98): (if (= curmask 0)
42571.282 (rms 27-Jul-98): (setq curmask mask))
42581.282 (rms 27-Jul-98): (setq charmask (% curmask 256))
42591.282 (rms 27-Jul-98): (setq curmask (lsh curmask -8))
42601.282 (rms 27-Jul-98): (aset string-vector i (logxor charmask (aref string-vector i)))
42611.282 (rms 27-Jul-98): (setq i (1+ i)))
42621.282 (rms 27-Jul-98): (concat string-vector)))
42631.389 (lh 21-Apr-04):
42641.389 (lh 21-Apr-04): ;;;; Desktop support
42651.389 (lh 21-Apr-04):
42661.389 (lh 21-Apr-04): (defun rmail-restore-desktop-buffer (desktop-buffer-file-name
42671.389 (lh 21-Apr-04): desktop-buffer-name
42681.389 (lh 21-Apr-04): desktop-buffer-misc)
42691.389 (lh 21-Apr-04): "Restore an rmail buffer specified in a desktop file."
42701.389 (lh 21-Apr-04): (condition-case error
42711.389 (lh 21-Apr-04): (progn
42721.389 (lh 21-Apr-04): (rmail-input desktop-buffer-file-name)
42731.389 (lh 21-Apr-04): (if (eq major-mode 'rmail-mode)
42741.389 (lh 21-Apr-04): (current-buffer)
42751.389 (lh 21-Apr-04): rmail-buffer))
42761.389 (lh 21-Apr-04): (file-locked
42771.389 (lh 21-Apr-04): (kill-buffer (current-buffer))
42781.389 (lh 21-Apr-04): nil)))
42791.409 (lh 10-Aug-05):
42801.412 (schwab 14-Aug-05): (add-to-list 'desktop-buffer-mode-handlers
42811.412 (schwab 14-Aug-05): '(rmail-mode . rmail-restore-desktop-buffer))
42821.244 (zappo 23-Jan-98):
42831.9 (jimb 16-Mar-92): (provide 'rmail)
42841.9 (jimb 16-Mar-92):
42851.453 (monnier 10-Apr-08): ;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c
42861.12 (eric 30-May-92): ;;; rmail.el ends here
diff --git a/lisp/mail/mbox-trunk-annotations/rmailedit.el.annotation b/lisp/mail/mbox-trunk-annotations/rmailedit.el.annotation
deleted file mode 100644
index 6a6867e89a1..00000000000
--- a/lisp/mail/mbox-trunk-annotations/rmailedit.el.annotation
+++ /dev/null
@@ -1,164 +0,0 @@
11.25 (pj 15-Jul-01): ;;; rmailedit.el --- "RMAIL edit mode" Edit the current message
21.3 (eric 30-May-92):
31.40 (gm 12-Jun-08): ;; Copyright (C) 1985, 1994, 2001, 2002, 2003, 2004, 2005, 2006,
41.40 (gm 12-Jun-08): ;; 2007, 2008 Free Software Foundation, Inc.
51.6 (eric 22-Jul-92):
61.4 (eric 16-Jul-92): ;; Maintainer: FSF
71.5 (eric 17-Jul-92): ;; Keywords: mail
81.1 (jla 31-Oct-89):
91.1 (jla 31-Oct-89): ;; This file is part of GNU Emacs.
101.1 (jla 31-Oct-89):
111.39 (gm 06-May-08): ;; GNU Emacs is free software: you can redistribute it and/or modify
121.1 (jla 31-Oct-89): ;; it under the terms of the GNU General Public License as published by
131.39 (gm 06-May-08): ;; the Free Software Foundation, either version 3 of the License, or
141.39 (gm 06-May-08): ;; (at your option) any later version.
151.1 (jla 31-Oct-89):
161.1 (jla 31-Oct-89): ;; GNU Emacs is distributed in the hope that it will be useful,
171.1 (jla 31-Oct-89): ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
181.1 (jla 31-Oct-89): ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
191.1 (jla 31-Oct-89): ;; GNU General Public License for more details.
201.1 (jla 31-Oct-89):
211.1 (jla 31-Oct-89): ;; You should have received a copy of the GNU General Public License
221.39 (gm 06-May-08): ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
231.25 (pj 15-Jul-01):
241.25 (pj 15-Jul-01): ;;; Commentary:
251.1 (jla 31-Oct-89):
261.4 (eric 16-Jul-92): ;;; Code:
271.1 (jla 31-Oct-89):
281.1 (jla 31-Oct-89): (require 'rmail)
291.1 (jla 31-Oct-89):
301.23 (gerd 07-May-01): (defcustom rmail-edit-mode-hook nil
311.23 (gerd 07-May-01): "List of functions to call when editing an RMAIL message."
321.23 (gerd 07-May-01): :type 'hook
331.24 (gerd 07-May-01): :version "21.1"
341.23 (gerd 07-May-01): :group 'rmail-edit)
351.23 (gerd 07-May-01):
361.18 (kwzh 08-Apr-98): (defvar rmail-old-text)
371.18 (kwzh 08-Apr-98):
381.1 (jla 31-Oct-89): (defvar rmail-edit-map nil)
391.1 (jla 31-Oct-89): (if rmail-edit-map
401.1 (jla 31-Oct-89): nil
411.7 (rms 20-Jul-93): ;; Make a keymap that inherits text-mode-map.
421.18 (kwzh 08-Apr-98): (setq rmail-edit-map (make-sparse-keymap))
431.18 (kwzh 08-Apr-98): (set-keymap-parent rmail-edit-map text-mode-map)
441.1 (jla 31-Oct-89): (define-key rmail-edit-map "\C-c\C-c" 'rmail-cease-edit)
451.1 (jla 31-Oct-89): (define-key rmail-edit-map "\C-c\C-]" 'rmail-abort-edit))
461.1 (jla 31-Oct-89):
471.1 (jla 31-Oct-89): ;; Rmail Edit mode is suitable only for specially formatted data.
481.1 (jla 31-Oct-89): (put 'rmail-edit-mode 'mode-class 'special)
491.1 (jla 31-Oct-89):
501.36 (dann 25-Nov-07): (declare-function rmail-summary-disable "" ())
511.36 (dann 25-Nov-07): (declare-function rmail-summary-enable "rmailsum" ())
521.36 (dann 25-Nov-07):
531.1 (jla 31-Oct-89): (defun rmail-edit-mode ()
541.1 (jla 31-Oct-89): "Major mode for editing the contents of an RMAIL message.
551.1 (jla 31-Oct-89): The editing commands are the same as in Text mode, together with two commands
561.1 (jla 31-Oct-89): to return to regular RMAIL:
571.23 (gerd 07-May-01): * \\[rmail-abort-edit] cancels the changes
581.1 (jla 31-Oct-89): you have made and returns to RMAIL
591.23 (gerd 07-May-01): * \\[rmail-cease-edit] makes them permanent.
601.23 (gerd 07-May-01): This functions runs the normal hook `rmail-edit-mode-hook'.
611.1 (jla 31-Oct-89): \\{rmail-edit-map}"
621.29 (lute 14-Jun-05): (delay-mode-hooks (text-mode))
631.1 (jla 31-Oct-89): (use-local-map rmail-edit-map)
641.1 (jla 31-Oct-89): (setq major-mode 'rmail-edit-mode)
651.1 (jla 31-Oct-89): (setq mode-name "RMAIL Edit")
661.1 (jla 31-Oct-89): (if (boundp 'mode-line-modified)
671.1 (jla 31-Oct-89): (setq mode-line-modified (default-value 'mode-line-modified))
681.1 (jla 31-Oct-89): (setq mode-line-format (default-value 'mode-line-format)))
691.9 (kwzh 07-Apr-94): (if (rmail-summary-exists)
701.10 (kwzh 07-Apr-94): (save-excursion
711.10 (kwzh 07-Apr-94): (set-buffer rmail-summary-buffer)
721.10 (kwzh 07-Apr-94): (rmail-summary-disable)))
731.28 (lute 26-May-05): (run-mode-hooks 'rmail-edit-mode-hook))
741.1 (jla 31-Oct-89):
751.20 (rms 27-May-98): (defvar rmail-old-pruned nil)
761.20 (rms 27-May-98): (put 'rmail-old-pruned 'permanent-local t)
771.20 (rms 27-May-98):
781.21 (rms 13-Jul-98): (defvar rmail-edit-saved-coding-system nil)
791.21 (rms 13-Jul-98): (put 'rmail-edit-saved-coding-system 'permanent-local t)
801.21 (rms 13-Jul-98):
811.17 (rms 27-Sep-96): ;;;###autoload
821.1 (jla 31-Oct-89): (defun rmail-edit-current-message ()
831.1 (jla 31-Oct-89): "Edit the contents of this message."
841.1 (jla 31-Oct-89): (interactive)
851.20 (rms 27-May-98): (make-local-variable 'rmail-old-pruned)
861.20 (rms 27-May-98): (setq rmail-old-pruned (rmail-msg-is-pruned))
871.21 (rms 13-Jul-98): (make-local-variable 'rmail-edit-saved-coding-system)
881.21 (rms 13-Jul-98): (setq rmail-edit-saved-coding-system save-buffer-coding-system)
891.20 (rms 27-May-98): (rmail-toggle-header 0)
901.1 (jla 31-Oct-89): (rmail-edit-mode)
911.21 (rms 13-Jul-98): ;; As the local value of save-buffer-coding-system is deleted by
921.21 (rms 13-Jul-98): ;; rmail-edit-mode, we restore the original value.
931.21 (rms 13-Jul-98): (make-local-variable 'save-buffer-coding-system)
941.21 (rms 13-Jul-98): (setq save-buffer-coding-system rmail-edit-saved-coding-system)
951.1 (jla 31-Oct-89): (make-local-variable 'rmail-old-text)
961.1 (jla 31-Oct-89): (setq rmail-old-text (buffer-substring (point-min) (point-max)))
971.1 (jla 31-Oct-89): (setq buffer-read-only nil)
981.14 (kwzh 25-Apr-95): (force-mode-line-update)
991.1 (jla 31-Oct-89): (if (and (eq (key-binding "\C-c\C-c") 'rmail-cease-edit)
1001.1 (jla 31-Oct-89): (eq (key-binding "\C-c\C-]") 'rmail-abort-edit))
1011.1 (jla 31-Oct-89): (message "Editing: Type C-c C-c to return to Rmail, C-c C-] to abort")
1021.16 (kwzh 25-Jan-96): (message "%s" (substitute-command-keys
1031.20 (rms 27-May-98): "Editing: Type \\[rmail-cease-edit] to return to Rmail, \\[rmail-abort-edit] to abort"))))
1041.1 (jla 31-Oct-89):
1051.1 (jla 31-Oct-89): (defun rmail-cease-edit ()
1061.1 (jla 31-Oct-89): "Finish editing message; switch back to Rmail proper."
1071.1 (jla 31-Oct-89): (interactive)
1081.9 (kwzh 07-Apr-94): (if (rmail-summary-exists)
1091.10 (kwzh 07-Apr-94): (save-excursion
1101.10 (kwzh 07-Apr-94): (set-buffer rmail-summary-buffer)
1111.10 (kwzh 07-Apr-94): (rmail-summary-enable)))
1121.1 (jla 31-Oct-89): ;; Make sure buffer ends with a newline.
1131.1 (jla 31-Oct-89): (save-excursion
1141.1 (jla 31-Oct-89): (goto-char (point-max))
1151.1 (jla 31-Oct-89): (if (/= (preceding-char) ?\n)
1161.1 (jla 31-Oct-89): (insert "\n"))
1171.1 (jla 31-Oct-89): ;; Adjust the marker that points to the end of this message.
1181.1 (jla 31-Oct-89): (set-marker (aref rmail-message-vector (1+ rmail-current-message))
1191.1 (jla 31-Oct-89): (point)))
1201.1 (jla 31-Oct-89): (let ((old rmail-old-text))
1211.14 (kwzh 25-Apr-95): (force-mode-line-update)
1221.18 (kwzh 08-Apr-98): (kill-all-local-variables)
1231.1 (jla 31-Oct-89): (rmail-mode-1)
1241.40 (gm 12-Jun-08): (if (boundp 'tool-bar-map)
1251.40 (gm 12-Jun-08): (set (make-local-variable 'tool-bar-map) rmail-tool-bar-map))
1261.18 (kwzh 08-Apr-98): (rmail-variables)
1271.21 (rms 13-Jul-98): ;; As the local value of save-buffer-coding-system is changed by
1281.21 (rms 13-Jul-98): ;; rmail-variables, we restore the original value.
1291.21 (rms 13-Jul-98): (setq save-buffer-coding-system rmail-edit-saved-coding-system)
1301.1 (jla 31-Oct-89): (if (and (= (length old) (- (point-max) (point-min)))
1311.1 (jla 31-Oct-89): (string= old (buffer-substring (point-min) (point-max))))
1321.1 (jla 31-Oct-89): ()
1331.1 (jla 31-Oct-89): (setq old nil)
1341.1 (jla 31-Oct-89): (rmail-set-attribute "edited" t)
1351.1 (jla 31-Oct-89): (if (boundp 'rmail-summary-vector)
1361.1 (jla 31-Oct-89): (progn
1371.1 (jla 31-Oct-89): (aset rmail-summary-vector (1- rmail-current-message) nil)
1381.1 (jla 31-Oct-89): (save-excursion
1391.1 (jla 31-Oct-89): (rmail-widen-to-current-msgbeg
1401.19 (rms 01-May-98): (function (lambda ()
1411.1 (jla 31-Oct-89): (forward-line 2)
1421.1 (jla 31-Oct-89): (if (looking-at "Summary-line: ")
1431.1 (jla 31-Oct-89): (let ((buffer-read-only nil))
1441.1 (jla 31-Oct-89): (delete-region (point)
1451.1 (jla 31-Oct-89): (progn (forward-line 1)
1461.19 (rms 01-May-98): (point))))))))))))
1471.19 (rms 01-May-98): (save-excursion
1481.20 (rms 27-May-98): (rmail-show-message)
1491.20 (rms 27-May-98): (rmail-toggle-header (if rmail-old-pruned 1 0))))
1501.22 (gerd 18-Nov-99): (run-hooks 'rmail-mode-hook)
1511.1 (jla 31-Oct-89): (setq buffer-read-only t))
1521.1 (jla 31-Oct-89):
1531.1 (jla 31-Oct-89): (defun rmail-abort-edit ()
1541.1 (jla 31-Oct-89): "Abort edit of current message; restore original contents."
1551.1 (jla 31-Oct-89): (interactive)
1561.1 (jla 31-Oct-89): (delete-region (point-min) (point-max))
1571.1 (jla 31-Oct-89): (insert rmail-old-text)
1581.13 (rms 09-Aug-94): (rmail-cease-edit)
1591.13 (rms 09-Aug-94): (rmail-highlight-headers))
1601.1 (jla 31-Oct-89):
1611.26 (rost 15-Nov-02): (provide 'rmailedit)
1621.26 (rost 15-Nov-02):
1631.38 (monnier 10-Apr-08): ;; arch-tag: 93c22709-a14a-46c1-ab91-52c3f5a0ec12
1641.3 (eric 30-May-92): ;;; rmailedit.el ends here
diff --git a/lisp/mail/mbox-trunk-annotations/rmailkwd.el.annotation b/lisp/mail/mbox-trunk-annotations/rmailkwd.el.annotation
deleted file mode 100644
index 387fe97a1ad..00000000000
--- a/lisp/mail/mbox-trunk-annotations/rmailkwd.el.annotation
+++ /dev/null
@@ -1,290 +0,0 @@
11.14 (pj 15-Jul-01): ;;; rmailkwd.el --- part of the "RMAIL" mail reader for Emacs
21.3 (eric 30-May-92):
31.17 (ttn 06-Aug-05): ;; Copyright (C) 1985, 1988, 1994, 2001, 2002, 2003, 2004,
41.23 (miles 08-Jan-08): ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
51.6 (eric 22-Jul-92):
61.4 (eric 16-Jul-92): ;; Maintainer: FSF
71.5 (eric 17-Jul-92): ;; Keywords: mail
81.1 (jla 31-Oct-89):
91.1 (jla 31-Oct-89): ;; This file is part of GNU Emacs.
101.1 (jla 31-Oct-89):
111.25 (gm 06-May-08): ;; GNU Emacs is free software: you can redistribute it and/or modify
121.1 (jla 31-Oct-89): ;; it under the terms of the GNU General Public License as published by
131.25 (gm 06-May-08): ;; the Free Software Foundation, either version 3 of the License, or
141.25 (gm 06-May-08): ;; (at your option) any later version.
151.1 (jla 31-Oct-89):
161.1 (jla 31-Oct-89): ;; GNU Emacs is distributed in the hope that it will be useful,
171.1 (jla 31-Oct-89): ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
181.1 (jla 31-Oct-89): ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
191.1 (jla 31-Oct-89): ;; GNU General Public License for more details.
201.1 (jla 31-Oct-89):
211.1 (jla 31-Oct-89): ;; You should have received a copy of the GNU General Public License
221.25 (gm 06-May-08): ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
231.14 (pj 15-Jul-01):
241.14 (pj 15-Jul-01): ;;; Commentary:
251.1 (jla 31-Oct-89):
261.4 (eric 16-Jul-92): ;;; Code:
271.1 (jla 31-Oct-89):
281.18 (lektu 29-Aug-05): (defvar rmail-buffer)
291.18 (lektu 29-Aug-05): (defvar rmail-current-message)
301.18 (lektu 29-Aug-05): (defvar rmail-last-label)
311.18 (lektu 29-Aug-05): (defvar rmail-last-multi-labels)
321.18 (lektu 29-Aug-05): (defvar rmail-summary-vector)
331.18 (lektu 29-Aug-05): (defvar rmail-total-messages)
341.18 (lektu 29-Aug-05):
351.1 (jla 31-Oct-89): ;; Global to all RMAIL buffers. It exists primarily for the sake of
361.1 (jla 31-Oct-89): ;; completion. It is better to use strings with the label functions
371.1 (jla 31-Oct-89): ;; and let them worry about making the label.
381.1 (jla 31-Oct-89):
391.1 (jla 31-Oct-89): (defvar rmail-label-obarray (make-vector 47 0))
401.1 (jla 31-Oct-89):
411.1 (jla 31-Oct-89): ;; Named list of symbols representing valid message attributes in RMAIL.
421.1 (jla 31-Oct-89):
431.1 (jla 31-Oct-89): (defconst rmail-attributes
441.1 (jla 31-Oct-89): (cons 'rmail-keywords
451.9 (kwzh 21-Apr-95): (mapcar (function (lambda (s) (intern s rmail-label-obarray)))
461.9 (kwzh 21-Apr-95): '("deleted" "answered" "filed" "forwarded" "unseen" "edited"
471.9 (kwzh 21-Apr-95): "resent"))))
481.1 (jla 31-Oct-89):
491.1 (jla 31-Oct-89): (defconst rmail-deleted-label (intern "deleted" rmail-label-obarray))
501.1 (jla 31-Oct-89):
511.1 (jla 31-Oct-89): ;; Named list of symbols representing valid message keywords in RMAIL.
521.1 (jla 31-Oct-89):
531.11 (rms 22-Sep-96): (defvar rmail-keywords)
541.1 (jla 31-Oct-89):
551.12 (rms 27-Sep-96): ;;;###autoload
561.1 (jla 31-Oct-89): (defun rmail-add-label (string)
571.1 (jla 31-Oct-89): "Add LABEL to labels associated with current RMAIL message.
581.1 (jla 31-Oct-89): Completion is performed over known labels when reading."
591.1 (jla 31-Oct-89): (interactive (list (rmail-read-label "Add label")))
601.1 (jla 31-Oct-89): (rmail-set-label string t))
611.1 (jla 31-Oct-89):
621.12 (rms 27-Sep-96): ;;;###autoload
631.1 (jla 31-Oct-89): (defun rmail-kill-label (string)
641.1 (jla 31-Oct-89): "Remove LABEL from labels associated with current RMAIL message.
651.1 (jla 31-Oct-89): Completion is performed over known labels when reading."
661.1 (jla 31-Oct-89): (interactive (list (rmail-read-label "Remove label")))
671.1 (jla 31-Oct-89): (rmail-set-label string nil))
681.1 (jla 31-Oct-89):
691.12 (rms 27-Sep-96): ;;;###autoload
701.1 (jla 31-Oct-89): (defun rmail-read-label (prompt)
711.13 (gerd 08-May-01): (with-current-buffer rmail-buffer
721.13 (gerd 08-May-01): (if (not rmail-keywords) (rmail-parse-file-keywords))
731.13 (gerd 08-May-01): (let ((result
741.13 (gerd 08-May-01): (completing-read (concat prompt
751.13 (gerd 08-May-01): (if rmail-last-label
761.13 (gerd 08-May-01): (concat " (default "
771.13 (gerd 08-May-01): (symbol-name rmail-last-label)
781.13 (gerd 08-May-01): "): ")
791.13 (gerd 08-May-01): ": "))
801.13 (gerd 08-May-01): rmail-label-obarray
811.13 (gerd 08-May-01): nil
821.13 (gerd 08-May-01): nil)))
831.13 (gerd 08-May-01): (if (string= result "")
841.13 (gerd 08-May-01): rmail-last-label
851.13 (gerd 08-May-01): (setq rmail-last-label (rmail-make-label result t))))))
861.1 (jla 31-Oct-89):
871.22 (dann 27-Nov-07): (declare-function rmail-maybe-set-message-counters "rmail" ())
881.22 (dann 27-Nov-07): (declare-function rmail-display-labels "rmail" ())
891.22 (dann 27-Nov-07): (declare-function rmail-msgbeg "rmail" (n))
901.22 (dann 27-Nov-07): (declare-function rmail-set-message-deleted-p "rmail" (n state))
911.22 (dann 27-Nov-07): (declare-function rmail-message-labels-p "rmail" (msg labels))
921.22 (dann 27-Nov-07): (declare-function rmail-show-message "rmail" (&optional n no-summary))
931.22 (dann 27-Nov-07): (declare-function mail-comma-list-regexp "mail-utils" (labels))
941.22 (dann 27-Nov-07): (declare-function mail-parse-comma-list "mail-utils.el" ())
951.22 (dann 27-Nov-07):
961.1 (jla 31-Oct-89): (defun rmail-set-label (l state &optional n)
971.13 (gerd 08-May-01): (with-current-buffer rmail-buffer
981.13 (gerd 08-May-01): (rmail-maybe-set-message-counters)
991.13 (gerd 08-May-01): (if (not n) (setq n rmail-current-message))
1001.13 (gerd 08-May-01): (aset rmail-summary-vector (1- n) nil)
1011.13 (gerd 08-May-01): (let* ((attribute (rmail-attribute-p l))
1021.13 (gerd 08-May-01): (keyword (and (not attribute)
1031.13 (gerd 08-May-01): (or (rmail-keyword-p l)
1041.13 (gerd 08-May-01): (rmail-install-keyword l))))
1051.13 (gerd 08-May-01): (label (or attribute keyword)))
1061.13 (gerd 08-May-01): (if label
1071.13 (gerd 08-May-01): (let ((omax (- (buffer-size) (point-max)))
1081.13 (gerd 08-May-01): (omin (- (buffer-size) (point-min)))
1091.13 (gerd 08-May-01): (buffer-read-only nil)
1101.13 (gerd 08-May-01): (case-fold-search t))
1111.13 (gerd 08-May-01): (unwind-protect
1121.13 (gerd 08-May-01): (save-excursion
1131.13 (gerd 08-May-01): (widen)
1141.13 (gerd 08-May-01): (goto-char (rmail-msgbeg n))
1151.13 (gerd 08-May-01): (forward-line 1)
1161.13 (gerd 08-May-01): (if (not (looking-at "[01],"))
1171.13 (gerd 08-May-01): nil
1181.13 (gerd 08-May-01): (let ((start (1+ (point)))
1191.13 (gerd 08-May-01): (bound))
1201.13 (gerd 08-May-01): (narrow-to-region (point) (progn (end-of-line) (point)))
1211.13 (gerd 08-May-01): (setq bound (point-max))
1221.13 (gerd 08-May-01): (search-backward ",," nil t)
1231.13 (gerd 08-May-01): (if attribute
1241.13 (gerd 08-May-01): (setq bound (1+ (point)))
1251.13 (gerd 08-May-01): (setq start (1+ (point))))
1261.13 (gerd 08-May-01): (goto-char start)
1271.13 (gerd 08-May-01): ; (while (re-search-forward "[ \t]*,[ \t]*" nil t)
1281.13 (gerd 08-May-01): ; (replace-match ","))
1291.13 (gerd 08-May-01): ; (goto-char start)
1301.13 (gerd 08-May-01): (if (re-search-forward
1311.1 (jla 31-Oct-89): (concat ", " (rmail-quote-label-name label) ",")
1321.1 (jla 31-Oct-89): bound
1331.1 (jla 31-Oct-89): 'move)
1341.13 (gerd 08-May-01): (if (not state) (replace-match ","))
1351.13 (gerd 08-May-01): (if state (insert " " (symbol-name label) ",")))
1361.13 (gerd 08-May-01): (if (eq label rmail-deleted-label)
1371.13 (gerd 08-May-01): (rmail-set-message-deleted-p n state)))))
1381.13 (gerd 08-May-01): (narrow-to-region (- (buffer-size) omin) (- (buffer-size) omax))
1391.13 (gerd 08-May-01): (if (= n rmail-current-message) (rmail-display-labels))))))))
1401.1 (jla 31-Oct-89):
1411.1 (jla 31-Oct-89): ;; Commented functions aren't used by RMAIL but might be nice for user
1421.1 (jla 31-Oct-89): ;; packages that do stuff with RMAIL. Note that rmail-message-labels-p
1431.2 (jimb 23-Feb-91): ;; is in rmail.el now.
1441.1 (jla 31-Oct-89):
1451.1 (jla 31-Oct-89): ;(defun rmail-message-label-p (label &optional n)
1461.1 (jla 31-Oct-89): ; "Returns symbol if LABEL (attribute or keyword) on NTH or current message."
1471.7 (kwzh 01-Apr-94): ; (rmail-message-labels-p (or n rmail-current-message) (regexp-quote label)))
1481.1 (jla 31-Oct-89):
1491.1 (jla 31-Oct-89): ;(defun rmail-parse-message-labels (&optional n)
1501.1 (jla 31-Oct-89): ; "Returns labels associated with NTH or current RMAIL message.
1511.7 (kwzh 01-Apr-94): ;The result is a list of two lists of strings. The first is the
1521.7 (kwzh 01-Apr-94): ;message attributes and the second is the message keywords."
1531.7 (kwzh 01-Apr-94): ; (let (atts keys)
1541.7 (kwzh 01-Apr-94): ; (save-restriction
1551.7 (kwzh 01-Apr-94): ; (widen)
1561.7 (kwzh 01-Apr-94): ; (goto-char (rmail-msgbeg (or n rmail-current-message)))
1571.7 (kwzh 01-Apr-94): ; (forward-line 1)
1581.7 (kwzh 01-Apr-94): ; (or (looking-at "[01],") (error "Malformed label line"))
1591.7 (kwzh 01-Apr-94): ; (forward-char 2)
1601.7 (kwzh 01-Apr-94): ; (while (looking-at "[ \t]*\\([^ \t\n,]+\\),")
1611.7 (kwzh 01-Apr-94): ; (setq atts (cons (buffer-substring (match-beginning 1) (match-end 1))
1621.7 (kwzh 01-Apr-94): ; atts))
1631.7 (kwzh 01-Apr-94): ; (goto-char (match-end 0)))
1641.7 (kwzh 01-Apr-94): ; (or (looking-at ",") (error "Malformed label line"))
1651.7 (kwzh 01-Apr-94): ; (forward-char 1)
1661.7 (kwzh 01-Apr-94): ; (while (looking-at "[ \t]*\\([^ \t\n,]+\\),")
1671.7 (kwzh 01-Apr-94): ; (setq keys (cons (buffer-substring (match-beginning 1) (match-end 1))
1681.7 (kwzh 01-Apr-94): ; keys))
1691.7 (kwzh 01-Apr-94): ; (goto-char (match-end 0)))
1701.7 (kwzh 01-Apr-94): ; (or (looking-at "[ \t]*$") (error "Malformed label line"))
1711.7 (kwzh 01-Apr-94): ; (list (nreverse atts) (nreverse keys)))))
1721.1 (jla 31-Oct-89):
1731.1 (jla 31-Oct-89): (defun rmail-attribute-p (s)
1741.1 (jla 31-Oct-89): (let ((symbol (rmail-make-label s)))
1751.1 (jla 31-Oct-89): (if (memq symbol (cdr rmail-attributes)) symbol)))
1761.1 (jla 31-Oct-89):
1771.1 (jla 31-Oct-89): (defun rmail-keyword-p (s)
1781.1 (jla 31-Oct-89): (let ((symbol (rmail-make-label s)))
1791.1 (jla 31-Oct-89): (if (memq symbol (cdr (rmail-keywords))) symbol)))
1801.1 (jla 31-Oct-89):
1811.1 (jla 31-Oct-89): (defun rmail-make-label (s &optional forcep)
1821.1 (jla 31-Oct-89): (cond ((symbolp s) s)
1831.1 (jla 31-Oct-89): (forcep (intern (downcase s) rmail-label-obarray))
1841.1 (jla 31-Oct-89): (t (intern-soft (downcase s) rmail-label-obarray))))
1851.1 (jla 31-Oct-89):
1861.1 (jla 31-Oct-89): (defun rmail-force-make-label (s)
1871.1 (jla 31-Oct-89): (intern (downcase s) rmail-label-obarray))
1881.1 (jla 31-Oct-89):
1891.1 (jla 31-Oct-89): (defun rmail-quote-label-name (label)
1901.1 (jla 31-Oct-89): (regexp-quote (symbol-name (rmail-make-label label t))))
1911.1 (jla 31-Oct-89):
1921.1 (jla 31-Oct-89): ;; Motion on messages with keywords.
1931.1 (jla 31-Oct-89):
1941.12 (rms 27-Sep-96): ;;;###autoload
1951.2 (jimb 23-Feb-91): (defun rmail-previous-labeled-message (n labels)
1961.2 (jimb 23-Feb-91): "Show previous message with one of the labels LABELS.
1971.2 (jimb 23-Feb-91): LABELS should be a comma-separated list of label names.
1981.2 (jimb 23-Feb-91): If LABELS is empty, the last set of labels specified is used.
1991.1 (jla 31-Oct-89): With prefix argument N moves backward N messages with these labels."
2001.1 (jla 31-Oct-89): (interactive "p\nsMove to previous msg with labels: ")
2011.2 (jimb 23-Feb-91): (rmail-next-labeled-message (- n) labels))
2021.1 (jla 31-Oct-89):
2031.12 (rms 27-Sep-96): ;;;###autoload
2041.1 (jla 31-Oct-89): (defun rmail-next-labeled-message (n labels)
2051.2 (jimb 23-Feb-91): "Show next message with one of the labels LABELS.
2061.2 (jimb 23-Feb-91): LABELS should be a comma-separated list of label names.
2071.2 (jimb 23-Feb-91): If LABELS is empty, the last set of labels specified is used.
2081.1 (jla 31-Oct-89): With prefix argument N moves forward N messages with these labels."
2091.1 (jla 31-Oct-89): (interactive "p\nsMove to next msg with labels: ")
2101.1 (jla 31-Oct-89): (if (string= labels "")
2111.1 (jla 31-Oct-89): (setq labels rmail-last-multi-labels))
2121.1 (jla 31-Oct-89): (or labels
2131.1 (jla 31-Oct-89): (error "No labels to find have been specified previously"))
2141.13 (gerd 08-May-01): (set-buffer rmail-buffer)
2151.1 (jla 31-Oct-89): (setq rmail-last-multi-labels labels)
2161.1 (jla 31-Oct-89): (rmail-maybe-set-message-counters)
2171.1 (jla 31-Oct-89): (let ((lastwin rmail-current-message)
2181.1 (jla 31-Oct-89): (current rmail-current-message)
2191.1 (jla 31-Oct-89): (regexp (concat ", ?\\("
2201.1 (jla 31-Oct-89): (mail-comma-list-regexp labels)
2211.1 (jla 31-Oct-89): "\\),")))
2221.1 (jla 31-Oct-89): (save-restriction
2231.1 (jla 31-Oct-89): (widen)
2241.1 (jla 31-Oct-89): (while (and (> n 0) (< current rmail-total-messages))
2251.1 (jla 31-Oct-89): (setq current (1+ current))
2261.1 (jla 31-Oct-89): (if (rmail-message-labels-p current regexp)
2271.1 (jla 31-Oct-89): (setq lastwin current n (1- n))))
2281.1 (jla 31-Oct-89): (while (and (< n 0) (> current 1))
2291.1 (jla 31-Oct-89): (setq current (1- current))
2301.1 (jla 31-Oct-89): (if (rmail-message-labels-p current regexp)
2311.1 (jla 31-Oct-89): (setq lastwin current n (1+ n)))))
2321.1 (jla 31-Oct-89): (rmail-show-message lastwin)
2331.1 (jla 31-Oct-89): (if (< n 0)
2341.1 (jla 31-Oct-89): (message "No previous message with labels %s" labels))
2351.1 (jla 31-Oct-89): (if (> n 0)
2361.1 (jla 31-Oct-89): (message "No following message with labels %s" labels))))
2371.1 (jla 31-Oct-89):
2381.1 (jla 31-Oct-89): ;;; Manipulate the file's Labels option.
2391.1 (jla 31-Oct-89):
2401.1 (jla 31-Oct-89): ;; Return a list of symbols for all
2411.1 (jla 31-Oct-89): ;; the keywords (labels) recorded in this file's Labels option.
2421.1 (jla 31-Oct-89): (defun rmail-keywords ()
2431.1 (jla 31-Oct-89): (or rmail-keywords (rmail-parse-file-keywords)))
2441.1 (jla 31-Oct-89):
2451.1 (jla 31-Oct-89): ;; Set rmail-keywords to a list of symbols for all
2461.1 (jla 31-Oct-89): ;; the keywords (labels) recorded in this file's Labels option.
2471.1 (jla 31-Oct-89): (defun rmail-parse-file-keywords ()
2481.1 (jla 31-Oct-89): (save-restriction
2491.1 (jla 31-Oct-89): (save-excursion
2501.1 (jla 31-Oct-89): (widen)
2511.1 (jla 31-Oct-89): (goto-char 1)
2521.1 (jla 31-Oct-89): (setq rmail-keywords
2531.1 (jla 31-Oct-89): (if (search-forward "\nLabels:" (rmail-msgbeg 1) t)
2541.1 (jla 31-Oct-89): (progn
2551.1 (jla 31-Oct-89): (narrow-to-region (point) (progn (end-of-line) (point)))
2561.1 (jla 31-Oct-89): (goto-char (point-min))
2571.1 (jla 31-Oct-89): (cons 'rmail-keywords
2581.1 (jla 31-Oct-89): (mapcar 'rmail-force-make-label
2591.1 (jla 31-Oct-89): (mail-parse-comma-list)))))))))
2601.1 (jla 31-Oct-89):
2611.1 (jla 31-Oct-89): ;; Add WORD to the list in the file's Labels option.
2621.1 (jla 31-Oct-89): ;; Any keyword used for the first time needs this done.
2631.1 (jla 31-Oct-89): (defun rmail-install-keyword (word)
2641.1 (jla 31-Oct-89): (let ((keyword (rmail-make-label word t))
2651.1 (jla 31-Oct-89): (keywords (rmail-keywords)))
2661.1 (jla 31-Oct-89): (if (not (or (rmail-attribute-p keyword)
2671.1 (jla 31-Oct-89): (rmail-keyword-p keyword)))
2681.1 (jla 31-Oct-89): (let ((omin (- (buffer-size) (point-min)))
2691.1 (jla 31-Oct-89): (omax (- (buffer-size) (point-max))))
2701.1 (jla 31-Oct-89): (unwind-protect
2711.1 (jla 31-Oct-89): (save-excursion
2721.1 (jla 31-Oct-89): (widen)
2731.1 (jla 31-Oct-89): (goto-char 1)
2741.1 (jla 31-Oct-89): (let ((case-fold-search t)
2751.1 (jla 31-Oct-89): (buffer-read-only nil))
2761.1 (jla 31-Oct-89): (or (search-forward "\nLabels:" nil t)
2771.1 (jla 31-Oct-89): (progn
2781.1 (jla 31-Oct-89): (end-of-line)
2791.1 (jla 31-Oct-89): (insert "\nLabels:")))
2801.1 (jla 31-Oct-89): (delete-region (point) (progn (end-of-line) (point)))
2811.1 (jla 31-Oct-89): (setcdr keywords (cons keyword (cdr keywords)))
2821.1 (jla 31-Oct-89): (while (setq keywords (cdr keywords))
2831.1 (jla 31-Oct-89): (insert (symbol-name (car keywords)) ","))
2841.1 (jla 31-Oct-89): (delete-char -1)))
2851.1 (jla 31-Oct-89): (narrow-to-region (- (buffer-size) omin)
2861.1 (jla 31-Oct-89): (- (buffer-size) omax)))))
2871.1 (jla 31-Oct-89): keyword))
2881.3 (eric 30-May-92):
2891.24 (monnier 10-Apr-08): ;; arch-tag: b26b3392-99ca-4e1d-933a-dab59b04e9a8
2901.3 (eric 30-May-92): ;;; rmailkwd.el ends here
diff --git a/lisp/mail/mbox-trunk-annotations/rmailmsc.el.annotation b/lisp/mail/mbox-trunk-annotations/rmailmsc.el.annotation
deleted file mode 100644
index 93bcb129e10..00000000000
--- a/lisp/mail/mbox-trunk-annotations/rmailmsc.el.annotation
+++ /dev/null
@@ -1,67 +0,0 @@
11.2 (eric 30-May-92): ;;; rmailmsc.el --- miscellaneous support functions for the RMAIL mail reader
21.2 (eric 30-May-92):
31.18 (gm 09-Dec-06): ;; Copyright (C) 1985, 2001, 2002, 2003, 2004, 2005,
41.22 (miles 08-Jan-08): ;; 2006, 2007, 2008 Free Software Foundation, Inc.
51.5 (eric 22-Jul-92):
61.3 (eric 16-Jul-92): ;; Maintainer: FSF
71.4 (eric 17-Jul-92): ;; Keywords: mail
81.1 (jimb 31-Oct-89):
91.1 (jimb 31-Oct-89): ;; This file is part of GNU Emacs.
101.1 (jimb 31-Oct-89):
111.24 (gm 06-May-08): ;; GNU Emacs is free software: you can redistribute it and/or modify
121.1 (jimb 31-Oct-89): ;; it under the terms of the GNU General Public License as published by
131.24 (gm 06-May-08): ;; the Free Software Foundation, either version 3 of the License, or
141.24 (gm 06-May-08): ;; (at your option) any later version.
151.1 (jimb 31-Oct-89):
161.1 (jimb 31-Oct-89): ;; GNU Emacs is distributed in the hope that it will be useful,
171.1 (jimb 31-Oct-89): ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
181.1 (jimb 31-Oct-89): ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
191.1 (jimb 31-Oct-89): ;; GNU General Public License for more details.
201.1 (jimb 31-Oct-89):
211.1 (jimb 31-Oct-89): ;; You should have received a copy of the GNU General Public License
221.24 (gm 06-May-08): ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
231.1 (jimb 31-Oct-89):
241.12 (pj 15-Jul-01): ;;; Commentary:
251.12 (pj 15-Jul-01):
261.6 (eric 17-Mar-93): ;;; Code:
271.1 (jimb 31-Oct-89):
281.16 (lektu 29-Aug-05): (defvar rmail-current-message)
291.16 (lektu 29-Aug-05): (defvar rmail-inbox-list)
301.16 (lektu 29-Aug-05):
311.21 (dann 25-Nov-07): (declare-function rmail-parse-file-inboxes "rmail" ())
321.21 (dann 25-Nov-07): (declare-function rmail-show-message "rmail" (&optional n no-summary))
331.21 (dann 25-Nov-07):
341.10 (rms 27-Sep-96): ;;;###autoload
351.1 (jimb 31-Oct-89): (defun set-rmail-inbox-list (file-name)
361.1 (jimb 31-Oct-89): "Set the inbox list of the current RMAIL file to FILE-NAME.
371.8 (rms 06-Sep-94): You can specify one file name, or several names separated by commas.
381.8 (rms 06-Sep-94): If FILE-NAME is empty, remove any existing inbox list."
391.1 (jimb 31-Oct-89): (interactive "sSet mailbox list to (comma-separated list of filenames): ")
401.11 (rms 08-Aug-98):
411.11 (rms 08-Aug-98): (unless (eq major-mode 'rmail-mode)
421.11 (rms 08-Aug-98): (error "set-rmail-inbox-list works only for an Rmail file"))
431.11 (rms 08-Aug-98):
441.1 (jimb 31-Oct-89): (save-excursion
451.1 (jimb 31-Oct-89): (let ((names (rmail-parse-file-inboxes))
461.1 (jimb 31-Oct-89): (standard-output nil))
471.1 (jimb 31-Oct-89): (if (or (not names)
481.1 (jimb 31-Oct-89): (y-or-n-p (concat "Replace "
491.1 (jimb 31-Oct-89): (mapconcat 'identity names ", ")
501.1 (jimb 31-Oct-89): "? ")))
511.1 (jimb 31-Oct-89): (let ((buffer-read-only nil))
521.1 (jimb 31-Oct-89): (widen)
531.1 (jimb 31-Oct-89): (goto-char (point-min))
541.1 (jimb 31-Oct-89): (search-forward "\n\^_")
551.1 (jimb 31-Oct-89): (re-search-backward "^Mail" nil t)
561.1 (jimb 31-Oct-89): (forward-line 0)
571.1 (jimb 31-Oct-89): (if (looking-at "Mail:")
581.1 (jimb 31-Oct-89): (delete-region (point)
591.1 (jimb 31-Oct-89): (progn (forward-line 1)
601.1 (jimb 31-Oct-89): (point))))
611.1 (jimb 31-Oct-89): (if (not (string= file-name ""))
621.7 (rms 18-Jun-94): (insert-before-markers "Mail: " file-name "\n"))))))
631.1 (jimb 31-Oct-89): (setq rmail-inbox-list (rmail-parse-file-inboxes))
641.1 (jimb 31-Oct-89): (rmail-show-message rmail-current-message))
651.2 (eric 30-May-92):
661.23 (monnier 10-Apr-08): ;; arch-tag: 74ed1d50-2c25-4cbd-b5ae-d29ed8aba6e4
671.2 (eric 30-May-92): ;;; rmailmsc.el ends here
diff --git a/lisp/mail/mbox-trunk-annotations/rmailout.el.annotation b/lisp/mail/mbox-trunk-annotations/rmailout.el.annotation
deleted file mode 100644
index a7900d4c4f4..00000000000
--- a/lisp/mail/mbox-trunk-annotations/rmailout.el.annotation
+++ /dev/null
@@ -1,420 +0,0 @@
11.65 (pj 15-Jul-01): ;;; rmailout.el --- "RMAIL" mail reader for Emacs: output message to a file
21.4 (eric 30-May-92):
31.69 (ttn 06-Aug-05): ;; Copyright (C) 1985, 1987, 1993, 1994, 2001, 2002, 2003, 2004,
41.79 (miles 08-Jan-08): ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
51.9 (eric 22-Jul-92):
61.6 (eric 15-Jul-92): ;; Maintainer: FSF
71.8 (eric 17-Jul-92): ;; Keywords: mail
81.1 (root 22-May-90):
91.1 (root 22-May-90): ;; This file is part of GNU Emacs.
101.1 (root 22-May-90):
111.81 (gm 06-May-08): ;; GNU Emacs is free software: you can redistribute it and/or modify
121.1 (root 22-May-90): ;; it under the terms of the GNU General Public License as published by
131.81 (gm 06-May-08): ;; the Free Software Foundation, either version 3 of the License, or
141.81 (gm 06-May-08): ;; (at your option) any later version.
151.1 (root 22-May-90):
161.1 (root 22-May-90): ;; GNU Emacs is distributed in the hope that it will be useful,
171.1 (root 22-May-90): ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
181.1 (root 22-May-90): ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
191.1 (root 22-May-90): ;; GNU General Public License for more details.
201.1 (root 22-May-90):
211.1 (root 22-May-90): ;; You should have received a copy of the GNU General Public License
221.81 (gm 06-May-08): ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
231.65 (pj 15-Jul-01):
241.65 (pj 15-Jul-01): ;;; Commentary:
251.1 (root 22-May-90):
261.6 (eric 15-Jul-92): ;;; Code:
271.1 (root 22-May-90):
281.30 (kwzh 09-Feb-94): (require 'rmail)
291.59 (rms 04-Jan-99): (provide 'rmailout)
301.30 (kwzh 09-Feb-94):
311.44 (rms 14-Sep-96): ;;;###autoload
321.49 (rms 03-May-97): (defcustom rmail-output-file-alist nil
331.2 (rms 24-Dec-90): "*Alist matching regexps to suggested output Rmail files.
341.16 (rms 09-Jul-93): This is a list of elements of the form (REGEXP . NAME-EXP).
351.21 (roland 14-Oct-93): The suggestion is taken if REGEXP matches anywhere in the message buffer.
361.16 (rms 09-Jul-93): NAME-EXP may be a string constant giving the file name to use,
371.16 (rms 09-Jul-93): or more generally it may be any kind of expression that returns
381.49 (rms 03-May-97): a file name as a string."
391.49 (rms 03-May-97): :type '(repeat (cons regexp
401.49 (rms 03-May-97): (choice :value ""
411.49 (rms 03-May-97): (string :tag "File Name")
421.49 (rms 03-May-97): sexp)))
431.49 (rms 03-May-97): :group 'rmail-output)
441.2 (rms 24-Dec-90):
451.59 (rms 04-Jan-99): (defun rmail-output-read-rmail-file-name ()
461.59 (rms 04-Jan-99): "Read the file name to use for `rmail-output-to-rmail-file'.
471.59 (rms 04-Jan-99): Set `rmail-default-rmail-file' to this name as well as returning it."
481.59 (rms 04-Jan-99): (let ((default-file
491.59 (rms 04-Jan-99): (let (answer tail)
501.59 (rms 04-Jan-99): (setq tail rmail-output-file-alist)
511.59 (rms 04-Jan-99): ;; Suggest a file based on a pattern match.
521.59 (rms 04-Jan-99): (while (and tail (not answer))
531.59 (rms 04-Jan-99): (save-excursion
541.63 (gerd 08-May-01): (set-buffer rmail-buffer)
551.59 (rms 04-Jan-99): (goto-char (point-min))
561.59 (rms 04-Jan-99): (if (re-search-forward (car (car tail)) nil t)
571.59 (rms 04-Jan-99): (setq answer (eval (cdr (car tail)))))
581.59 (rms 04-Jan-99): (setq tail (cdr tail))))
591.59 (rms 04-Jan-99): ;; If no suggestions, use same file as last time.
601.59 (rms 04-Jan-99): (expand-file-name (or answer rmail-default-rmail-file)))))
611.59 (rms 04-Jan-99): (let ((read-file
621.59 (rms 04-Jan-99): (expand-file-name
631.59 (rms 04-Jan-99): (read-file-name
641.70 (rfrancoi 24-Sep-05): (concat "Output message to Rmail file (default "
651.59 (rms 04-Jan-99): (file-name-nondirectory default-file)
661.70 (rfrancoi 24-Sep-05): "): ")
671.59 (rms 04-Jan-99): (file-name-directory default-file)
681.59 (rms 04-Jan-99): (abbreviate-file-name default-file))
691.59 (rms 04-Jan-99): (file-name-directory default-file))))
701.59 (rms 04-Jan-99): ;; If the user enters just a directory,
711.59 (rms 04-Jan-99): ;; use the name within that directory chosen by the default.
721.59 (rms 04-Jan-99): (setq rmail-default-rmail-file
731.59 (rms 04-Jan-99): (if (file-directory-p read-file)
741.59 (rms 04-Jan-99): (expand-file-name (file-name-nondirectory default-file)
751.59 (rms 04-Jan-99): read-file)
761.59 (rms 04-Jan-99): read-file)))))
771.59 (rms 04-Jan-99):
781.59 (rms 04-Jan-99): (defun rmail-output-read-file-name ()
791.59 (rms 04-Jan-99): "Read the file name to use for `rmail-output'.
801.59 (rms 04-Jan-99): Set `rmail-default-file' to this name as well as returning it."
811.59 (rms 04-Jan-99): (let ((default-file
821.59 (rms 04-Jan-99): (let (answer tail)
831.59 (rms 04-Jan-99): (setq tail rmail-output-file-alist)
841.59 (rms 04-Jan-99): ;; Suggest a file based on a pattern match.
851.59 (rms 04-Jan-99): (while (and tail (not answer))
861.59 (rms 04-Jan-99): (save-excursion
871.59 (rms 04-Jan-99): (goto-char (point-min))
881.59 (rms 04-Jan-99): (if (re-search-forward (car (car tail)) nil t)
891.59 (rms 04-Jan-99): (setq answer (eval (cdr (car tail)))))
901.59 (rms 04-Jan-99): (setq tail (cdr tail))))
911.59 (rms 04-Jan-99): ;; If no suggestion, use same file as last time.
921.59 (rms 04-Jan-99): (or answer rmail-default-file))))
931.59 (rms 04-Jan-99): (let ((read-file
941.59 (rms 04-Jan-99): (expand-file-name
951.59 (rms 04-Jan-99): (read-file-name
961.70 (rfrancoi 24-Sep-05): (concat "Output message to Unix mail file (default "
971.59 (rms 04-Jan-99): (file-name-nondirectory default-file)
981.70 (rfrancoi 24-Sep-05): "): ")
991.59 (rms 04-Jan-99): (file-name-directory default-file)
1001.59 (rms 04-Jan-99): (abbreviate-file-name default-file))
1011.59 (rms 04-Jan-99): (file-name-directory default-file))))
1021.59 (rms 04-Jan-99): (setq rmail-default-file
1031.59 (rms 04-Jan-99): (if (file-directory-p read-file)
1041.59 (rms 04-Jan-99): (expand-file-name (file-name-nondirectory default-file)
1051.59 (rms 04-Jan-99): read-file)
1061.59 (rms 04-Jan-99): (expand-file-name
1071.59 (rms 04-Jan-99): (or read-file (file-name-nondirectory default-file))
1081.59 (rms 04-Jan-99): (file-name-directory default-file)))))))
1091.59 (rms 04-Jan-99):
1101.77 (dann 25-Nov-07): (declare-function rmail-update-summary "rmailsum" (&rest ignore))
1111.77 (dann 25-Nov-07):
1121.55 (rms 16-Aug-98): ;;; There are functions elsewhere in Emacs that use this function;
1131.55 (rms 16-Aug-98): ;;; look at them before you change the calling method.
1141.45 (rms 27-Sep-96): ;;;###autoload
1151.61 (fx 24-May-00): (defun rmail-output-to-rmail-file (file-name &optional count stay)
1161.1 (root 22-May-90): "Append the current message to an Rmail file named FILE-NAME.
1171.1 (root 22-May-90): If the file does not exist, ask if it should be created.
1181.1 (root 22-May-90): If file is being visited, the message is appended to the Emacs
1191.1 (root 22-May-90): buffer visiting that file.
1201.50 (rms 20-Sep-97): If the file exists and is not an Rmail file, the message is
1211.50 (rms 20-Sep-97): appended in inbox format, the same way `rmail-output' does it.
1221.16 (rms 09-Jul-93):
1231.37 (rms 05-May-94): The default file name comes from `rmail-default-rmail-file',
1241.28 (rms 15-Jan-94): which is updated to the name you use in this command.
1251.28 (rms 15-Jan-94):
1261.71 (eliz 04-Nov-05): A prefix argument COUNT says to output that many consecutive messages,
1271.61 (fx 24-May-00): starting with the current one. Deleted messages are skipped and don't count.
1281.61 (fx 24-May-00):
1291.71 (eliz 04-Nov-05): If the optional argument STAY is non-nil, then leave the last filed
1301.71 (eliz 04-Nov-05): message up instead of moving forward to the next non-deleted message."
1311.13 (rms 11-Jun-93): (interactive
1321.59 (rms 04-Jan-99): (list (rmail-output-read-rmail-file-name)
1331.59 (rms 04-Jan-99): (prefix-numeric-value current-prefix-arg)))
1341.11 (jimb 14-Feb-93): (or count (setq count 1))
1351.3 (jimb 01-Mar-91): (setq file-name
1361.3 (jimb 01-Mar-91): (expand-file-name file-name
1371.27 (rms 15-Jan-94): (file-name-directory rmail-default-rmail-file)))
1381.42 (rms 21-Sep-95): (if (and (file-readable-p file-name) (not (mail-file-babyl-p file-name)))
1391.16 (rms 09-Jul-93): (rmail-output file-name count)
1401.16 (rms 09-Jul-93): (rmail-maybe-set-message-counters)
1411.16 (rms 09-Jul-93): (setq file-name (abbreviate-file-name file-name))
1421.47 (rms 30-Mar-97): (or (find-buffer-visiting file-name)
1431.16 (rms 09-Jul-93): (file-exists-p file-name)
1441.16 (rms 09-Jul-93): (if (yes-or-no-p
1451.16 (rms 09-Jul-93): (concat "\"" file-name "\" does not exist, create it? "))
1461.16 (rms 09-Jul-93): (let ((file-buffer (create-file-buffer file-name)))
1471.1 (root 22-May-90): (save-excursion
1481.16 (rms 09-Jul-93): (set-buffer file-buffer)
1491.16 (rms 09-Jul-93): (rmail-insert-rmail-file-header)
1501.62 (eliz 11-Mar-01): (let ((require-final-newline nil)
1511.62 (eliz 11-Mar-01): (coding-system-for-write
1521.62 (eliz 11-Mar-01): (or rmail-file-coding-system
1531.62 (eliz 11-Mar-01): 'emacs-mule-unix)))
1541.16 (rms 09-Jul-93): (write-region (point-min) (point-max) file-name t 1)))
1551.16 (rms 09-Jul-93): (kill-buffer file-buffer))
1561.16 (rms 09-Jul-93): (error "Output file does not exist")))
1571.16 (rms 09-Jul-93): (while (> count 0)
1581.16 (rms 09-Jul-93): (let (redelete)
1591.16 (rms 09-Jul-93): (unwind-protect
1601.16 (rms 09-Jul-93): (progn
1611.63 (gerd 08-May-01): (set-buffer rmail-buffer)
1621.24 (rms 23-Dec-93): ;; Temporarily turn off Deleted attribute.
1631.24 (rms 23-Dec-93): ;; Do this outside the save-restriction, since it would
1641.24 (rms 23-Dec-93): ;; shift the place in the buffer where the visible text starts.
1651.24 (rms 23-Dec-93): (if (rmail-message-deleted-p rmail-current-message)
1661.24 (rms 23-Dec-93): (progn (setq redelete t)
1671.24 (rms 23-Dec-93): (rmail-set-attribute "deleted" nil)))
1681.16 (rms 09-Jul-93): (save-restriction
1691.16 (rms 09-Jul-93): (widen)
1701.16 (rms 09-Jul-93): ;; Decide whether to append to a file or to an Emacs buffer.
1711.16 (rms 09-Jul-93): (save-excursion
1721.47 (rms 30-Mar-97): (let ((buf (find-buffer-visiting file-name))
1731.16 (rms 09-Jul-93): (cur (current-buffer))
1741.16 (rms 09-Jul-93): (beg (1+ (rmail-msgbeg rmail-current-message)))
1751.52 (rms 27-May-98): (end (1+ (rmail-msgend rmail-current-message)))
1761.52 (rms 27-May-98): (coding-system-for-write
1771.52 (rms 27-May-98): (or rmail-file-coding-system
1781.52 (rms 27-May-98): 'emacs-mule-unix)))
1791.16 (rms 09-Jul-93): (if (not buf)
1801.40 (rms 17-Nov-94): ;; Output to a file.
1811.40 (rms 17-Nov-94): (if rmail-fields-not-to-output
1821.40 (rms 17-Nov-94): ;; Delete some fields while we output.
1831.40 (rms 17-Nov-94): (let ((obuf (current-buffer)))
1841.40 (rms 17-Nov-94): (set-buffer (get-buffer-create " rmail-out-temp"))
1851.40 (rms 17-Nov-94): (insert-buffer-substring obuf beg end)
1861.40 (rms 17-Nov-94): (rmail-delete-unwanted-fields)
1871.40 (rms 17-Nov-94): (append-to-file (point-min) (point-max) file-name)
1881.40 (rms 17-Nov-94): (set-buffer obuf)
1891.40 (rms 17-Nov-94): (kill-buffer (get-buffer " rmail-out-temp")))
1901.40 (rms 17-Nov-94): (append-to-file beg end file-name))
1911.16 (rms 09-Jul-93): (if (eq buf (current-buffer))
1921.16 (rms 09-Jul-93): (error "Can't output message to same file it's already in"))
1931.16 (rms 09-Jul-93): ;; File has been visited, in buffer BUF.
1941.16 (rms 09-Jul-93): (set-buffer buf)
1951.16 (rms 09-Jul-93): (let ((buffer-read-only nil)
1961.16 (rms 09-Jul-93): (msg (and (boundp 'rmail-current-message)
1971.16 (rms 09-Jul-93): rmail-current-message)))
1981.16 (rms 09-Jul-93): ;; If MSG is non-nil, buffer is in RMAIL mode.
1991.16 (rms 09-Jul-93): (if msg
2001.16 (rms 09-Jul-93): (progn
2011.25 (rms 24-Dec-93): ;; Turn on auto save mode, if it's off in this
2021.25 (rms 24-Dec-93): ;; buffer but enabled by default.
2031.25 (rms 24-Dec-93): (and (not buffer-auto-save-file-name)
2041.25 (rms 24-Dec-93): auto-save-default
2051.25 (rms 24-Dec-93): (auto-save-mode t))
2061.16 (rms 09-Jul-93): (rmail-maybe-set-message-counters)
2071.16 (rms 09-Jul-93): (widen)
2081.16 (rms 09-Jul-93): (narrow-to-region (point-max) (point-max))
2091.16 (rms 09-Jul-93): (insert-buffer-substring cur beg end)
2101.16 (rms 09-Jul-93): (goto-char (point-min))
2111.16 (rms 09-Jul-93): (widen)
2121.16 (rms 09-Jul-93): (search-backward "\n\^_")
2131.16 (rms 09-Jul-93): (narrow-to-region (point) (point-max))
2141.40 (rms 17-Nov-94): (rmail-delete-unwanted-fields)
2151.16 (rms 09-Jul-93): (rmail-count-new-messages t)
2161.24 (rms 23-Dec-93): (if (rmail-summary-exists)
2171.24 (rms 23-Dec-93): (rmail-select-summary
2181.24 (rms 23-Dec-93): (rmail-update-summary)))
2191.16 (rms 09-Jul-93): (rmail-show-message msg))
2201.52 (rms 27-May-98): ;; Output file not in rmail mode => just insert at the end.
2211.52 (rms 27-May-98): (narrow-to-region (point-min) (1+ (buffer-size)))
2221.52 (rms 27-May-98): (goto-char (point-max))
2231.52 (rms 27-May-98): (insert-buffer-substring cur beg end)
2241.52 (rms 27-May-98): (rmail-delete-unwanted-fields)))))))
2251.16 (rms 09-Jul-93): (rmail-set-attribute "filed" t))
2261.16 (rms 09-Jul-93): (if redelete (rmail-set-attribute "deleted" t))))
2271.16 (rms 09-Jul-93): (setq count (1- count))
2281.16 (rms 09-Jul-93): (if rmail-delete-after-output
2291.66 (pot 04-Feb-03): (unless
2301.61 (fx 24-May-00): (if (and (= count 0) stay)
2311.61 (fx 24-May-00): (rmail-delete-message)
2321.61 (fx 24-May-00): (rmail-delete-forward))
2331.61 (fx 24-May-00): (setq count 0))
2341.16 (rms 09-Jul-93): (if (> count 0)
2351.66 (pot 04-Feb-03): (unless
2361.61 (fx 24-May-00): (if (not stay) (rmail-next-undeleted-message 1))
2371.61 (fx 24-May-00): (setq count 0)))))))
2381.16 (rms 09-Jul-93):
2391.45 (rms 27-Sep-96): ;;;###autoload
2401.49 (rms 03-May-97): (defcustom rmail-fields-not-to-output nil
2411.49 (rms 03-May-97): "*Regexp describing fields to exclude when outputting a message to a file."
2421.49 (rms 03-May-97): :type '(choice (const :tag "None" nil)
2431.49 (rms 03-May-97): regexp)
2441.49 (rms 03-May-97): :group 'rmail-output)
2451.40 (rms 17-Nov-94):
2461.40 (rms 17-Nov-94): ;; Delete from the buffer header fields we don't want output.
2471.40 (rms 17-Nov-94): ;; NOT-RMAIL if t means this buffer does not have the full header
2481.40 (rms 17-Nov-94): ;; and *** EOOH *** that a message in an Rmail file has.
2491.40 (rms 17-Nov-94): (defun rmail-delete-unwanted-fields (&optional not-rmail)
2501.66 (pot 04-Feb-03): (if rmail-fields-not-to-output
2511.40 (rms 17-Nov-94): (save-excursion
2521.40 (rms 17-Nov-94): (goto-char (point-min))
2531.40 (rms 17-Nov-94): ;; Find the end of the header.
2541.40 (rms 17-Nov-94): (if (and (or not-rmail (search-forward "\n*** EOOH ***\n" nil t))
2551.40 (rms 17-Nov-94): (search-forward "\n\n" nil t))
2561.40 (rms 17-Nov-94): (let ((end (point-marker)))
2571.40 (rms 17-Nov-94): (goto-char (point-min))
2581.40 (rms 17-Nov-94): (while (re-search-forward rmail-fields-not-to-output end t)
2591.40 (rms 17-Nov-94): (beginning-of-line)
2601.40 (rms 17-Nov-94): (delete-region (point)
2611.40 (rms 17-Nov-94): (progn (forward-line 1) (point)))))))))
2621.40 (rms 17-Nov-94):
2631.55 (rms 16-Aug-98): ;;; There are functions elsewhere in Emacs that use this function;
2641.55 (rms 16-Aug-98): ;;; look at them before you change the calling method.
2651.45 (rms 27-Sep-96): ;;;###autoload
2661.22 (rms 15-Nov-93): (defun rmail-output (file-name &optional count noattribute from-gnus)
2671.32 (rms 03-Apr-94): "Append this message to system-inbox-format mail file named FILE-NAME.
2681.71 (eliz 04-Nov-05): A prefix argument COUNT says to output that many consecutive messages,
2691.11 (jimb 14-Feb-93): starting with the current one. Deleted messages are skipped and don't count.
2701.71 (eliz 04-Nov-05): When called from lisp code, COUNT may be omitted and defaults to 1.
2711.19 (rms 25-Jul-93):
2721.20 (rms 09-Oct-93): If the pruned message header is shown on the current message, then
2731.20 (rms 09-Oct-93): messages will be appended with pruned headers; otherwise, messages
2741.20 (rms 09-Oct-93): will be appended with their original headers.
2751.28 (rms 15-Jan-94):
2761.38 (rms 19-May-94): The default file name comes from `rmail-default-file',
2771.28 (rms 15-Jan-94): which is updated to the name you use in this command.
2781.20 (rms 09-Oct-93):
2791.19 (rms 25-Jul-93): The optional third argument NOATTRIBUTE, if non-nil, says not
2801.22 (rms 15-Nov-93): to set the `filed' attribute, and not to display a message.
2811.22 (rms 15-Nov-93):
2821.22 (rms 15-Nov-93): The optional fourth argument FROM-GNUS is set when called from GNUS."
2831.1 (root 22-May-90): (interactive
2841.59 (rms 04-Jan-99): (list (rmail-output-read-file-name)
2851.59 (rms 04-Jan-99): (prefix-numeric-value current-prefix-arg)))
2861.11 (jimb 14-Feb-93): (or count (setq count 1))
2871.3 (jimb 01-Mar-91): (setq file-name
2881.3 (jimb 01-Mar-91): (expand-file-name file-name
2891.27 (rms 15-Jan-94): (and rmail-default-file
2901.27 (rms 15-Jan-94): (file-name-directory rmail-default-file))))
2911.42 (rms 21-Sep-95): (if (and (file-readable-p file-name) (mail-file-babyl-p file-name))
2921.16 (rms 09-Jul-93): (rmail-output-to-rmail-file file-name count)
2931.63 (gerd 08-May-01): (set-buffer rmail-buffer)
2941.20 (rms 09-Oct-93): (let ((orig-count count)
2951.20 (rms 09-Oct-93): (rmailbuf (current-buffer))
2961.20 (rms 09-Oct-93): (case-fold-search t)
2971.20 (rms 09-Oct-93): (tembuf (get-buffer-create " rmail-output"))
2981.20 (rms 09-Oct-93): (original-headers-p
2991.22 (rms 15-Nov-93): (and (not from-gnus)
3001.66 (pot 04-Feb-03): (save-excursion
3011.22 (rms 15-Nov-93): (save-restriction
3021.22 (rms 15-Nov-93): (narrow-to-region (rmail-msgbeg rmail-current-message) (point-max))
3031.22 (rms 15-Nov-93): (goto-char (point-min))
3041.22 (rms 15-Nov-93): (forward-line 1)
3051.22 (rms 15-Nov-93): (= (following-char) ?0)))))
3061.20 (rms 09-Oct-93): header-beginning
3071.66 (pot 04-Feb-03): mail-from mime-version content-type)
3081.20 (rms 09-Oct-93): (while (> count 0)
3091.55 (rms 16-Aug-98): ;; Preserve the Mail-From and MIME-Version fields
3101.55 (rms 16-Aug-98): ;; even if they have been pruned.
3111.22 (rms 15-Nov-93): (or from-gnus
3121.55 (rms 16-Aug-98): (save-excursion
3131.55 (rms 16-Aug-98): (save-restriction
3141.55 (rms 16-Aug-98): (widen)
3151.55 (rms 16-Aug-98): (goto-char (rmail-msgbeg rmail-current-message))
3161.55 (rms 16-Aug-98): (setq header-beginning (point))
3171.55 (rms 16-Aug-98): (search-forward "\n*** EOOH ***\n")
3181.55 (rms 16-Aug-98): (narrow-to-region header-beginning (point))
3191.66 (pot 04-Feb-03): (setq mail-from (mail-fetch-field "Mail-From"))
3201.66 (pot 04-Feb-03): (unless rmail-enable-mime
3211.66 (pot 04-Feb-03): (setq mime-version (mail-fetch-field "MIME-Version")
3221.66 (pot 04-Feb-03): content-type (mail-fetch-field "Content-type"))))))
3231.16 (rms 09-Jul-93): (save-excursion
3241.16 (rms 09-Jul-93): (set-buffer tembuf)
3251.16 (rms 09-Jul-93): (erase-buffer)
3261.16 (rms 09-Jul-93): (insert-buffer-substring rmailbuf)
3271.64 (gerd 06-Jul-01): (when rmail-enable-mime
3281.64 (gerd 06-Jul-01): (if original-headers-p
3291.64 (gerd 06-Jul-01): (delete-region (goto-char (point-min))
3301.64 (gerd 06-Jul-01): (if (search-forward "\n*** EOOH ***\n")
3311.64 (gerd 06-Jul-01): (match-end 0)))
3321.64 (gerd 06-Jul-01): (goto-char (point-min))
3331.64 (gerd 06-Jul-01): (forward-line 2)
3341.64 (gerd 06-Jul-01): (delete-region (point-min)(point))
3351.64 (gerd 06-Jul-01): (search-forward "\n*** EOOH ***\n")
3361.64 (gerd 06-Jul-01): (delete-region (match-beginning 0)
3371.64 (gerd 06-Jul-01): (if (search-forward "\n\n")
3381.64 (gerd 06-Jul-01): (1- (match-end 0)))))
3391.64 (gerd 06-Jul-01): (setq buffer-file-coding-system (or rmail-file-coding-system
3401.64 (gerd 06-Jul-01): 'raw-text)))
3411.40 (rms 17-Nov-94): (rmail-delete-unwanted-fields t)
3421.56 (rms 21-Oct-98): (or (bolp) (insert "\n"))
3431.16 (rms 09-Jul-93): (goto-char (point-min))
3441.20 (rms 09-Oct-93): (if mail-from
3451.20 (rms 09-Oct-93): (insert mail-from "\n")
3461.20 (rms 09-Oct-93): (insert "From "
3471.20 (rms 09-Oct-93): (mail-strip-quoted-names (or (mail-fetch-field "from")
3481.20 (rms 09-Oct-93): (mail-fetch-field "really-from")
3491.20 (rms 09-Oct-93): (mail-fetch-field "sender")
3501.20 (rms 09-Oct-93): "unknown"))
3511.20 (rms 09-Oct-93): " " (current-time-string) "\n"))
3521.72 (eliz 21-Jan-06): (when mime-version
3531.72 (eliz 21-Jan-06): (insert "MIME-Version: " mime-version)
3541.72 (eliz 21-Jan-06): ;; Some malformed MIME messages set content-type to nil.
3551.72 (eliz 21-Jan-06): (when content-type
3561.72 (eliz 21-Jan-06): (insert "\nContent-type: " content-type "\n")))
3571.16 (rms 09-Jul-93): ;; ``Quote'' "\nFrom " as "\n>From "
3581.16 (rms 09-Jul-93): ;; (note that this isn't really quoting, as there is no requirement
3591.16 (rms 09-Jul-93): ;; that "\n[>]+From " be quoted in the same transparent way.)
3601.41 (kwzh 02-Dec-94): (let ((case-fold-search nil))
3611.41 (kwzh 02-Dec-94): (while (search-forward "\nFrom " nil t)
3621.41 (kwzh 02-Dec-94): (forward-char -5)
3631.41 (kwzh 02-Dec-94): (insert ?>)))
3641.19 (rms 25-Jul-93): (write-region (point-min) (point-max) file-name t
3651.19 (rms 25-Jul-93): (if noattribute 'nomsg)))
3661.20 (rms 09-Oct-93): (or noattribute
3671.20 (rms 09-Oct-93): (if (equal major-mode 'rmail-mode)
3681.20 (rms 09-Oct-93): (rmail-set-attribute "filed" t)))
3691.20 (rms 09-Oct-93): (setq count (1- count))
3701.22 (rms 15-Nov-93): (or from-gnus
3711.22 (rms 15-Nov-93): (let ((next-message-p
3721.22 (rms 15-Nov-93): (if rmail-delete-after-output
3731.22 (rms 15-Nov-93): (rmail-delete-forward)
3741.22 (rms 15-Nov-93): (if (> count 0)
3751.22 (rms 15-Nov-93): (rmail-next-undeleted-message 1))))
3761.22 (rms 15-Nov-93): (num-appended (- orig-count count)))
3771.22 (rms 15-Nov-93): (if (and next-message-p original-headers-p)
3781.22 (rms 15-Nov-93): (rmail-toggle-header))
3791.22 (rms 15-Nov-93): (if (and (> count 0) (not next-message-p))
3801.66 (pot 04-Feb-03): (progn
3811.78 (deego 06-Dec-07): (error "%s"
3821.22 (rms 15-Nov-93): (save-excursion
3831.22 (rms 15-Nov-93): (set-buffer rmailbuf)
3841.22 (rms 15-Nov-93): (format "Only %d message%s appended" num-appended
3851.22 (rms 15-Nov-93): (if (= num-appended 1) "" "s"))))
3861.22 (rms 15-Nov-93): (setq count 0))))))
3871.20 (rms 09-Oct-93): (kill-buffer tembuf))))
3881.4 (eric 30-May-92):
3891.46 (rms 30-Mar-97): ;;;###autoload
3901.48 (rms 05-Apr-97): (defun rmail-output-body-to-file (file-name)
3911.46 (rms 30-Mar-97): "Write this message body to the file FILE-NAME.
3921.46 (rms 30-Mar-97): FILE-NAME defaults, interactively, from the Subject field of the message."
3931.46 (rms 30-Mar-97): (interactive
3941.46 (rms 30-Mar-97): (let ((default-file
3951.51 (rms 23-May-98): (or (mail-fetch-field "Subject")
3961.51 (rms 23-May-98): rmail-default-body-file)))
3971.51 (rms 23-May-98): (list (setq rmail-default-body-file
3981.51 (rms 23-May-98): (read-file-name
3991.51 (rms 23-May-98): "Output message body to file: "
4001.51 (rms 23-May-98): (and default-file (file-name-directory default-file))
4011.51 (rms 23-May-98): default-file
4021.51 (rms 23-May-98): nil default-file)))))
4031.51 (rms 23-May-98): (setq file-name
4041.51 (rms 23-May-98): (expand-file-name file-name
4051.51 (rms 23-May-98): (and rmail-default-body-file
4061.51 (rms 23-May-98): (file-name-directory rmail-default-body-file))))
4071.46 (rms 30-Mar-97): (save-excursion
4081.46 (rms 30-Mar-97): (goto-char (point-min))
4091.46 (rms 30-Mar-97): (search-forward "\n\n")
4101.48 (rms 05-Apr-97): (and (file-exists-p file-name)
4111.74 (lektu 13-Nov-06): (not (y-or-n-p (format "File %s exists; overwrite? " file-name)))
4121.48 (rms 05-Apr-97): (error "Operation aborted"))
4131.46 (rms 30-Mar-97): (write-region (point) (point-max) file-name)
4141.46 (rms 30-Mar-97): (if (equal major-mode 'rmail-mode)
4151.46 (rms 30-Mar-97): (rmail-set-attribute "stored" t)))
4161.46 (rms 30-Mar-97): (if rmail-delete-after-output
4171.46 (rms 30-Mar-97): (rmail-delete-forward)))
4181.46 (rms 30-Mar-97):
4191.80 (monnier 10-Apr-08): ;; arch-tag: 447117c6-1a9a-4b88-aa43-3101b043e3a4
4201.4 (eric 30-May-92): ;;; rmailout.el ends here
diff --git a/lisp/mail/mbox-trunk-annotations/rmailsort.el.annotation b/lisp/mail/mbox-trunk-annotations/rmailsort.el.annotation
deleted file mode 100644
index 96601607f03..00000000000
--- a/lisp/mail/mbox-trunk-annotations/rmailsort.el.annotation
+++ /dev/null
@@ -1,250 +0,0 @@
11.28 (pj 15-Jul-01): ;;; rmailsort.el --- Rmail: sort messages
21.7 (eric 30-May-92):
31.32 (ttn 06-Aug-05): ;; Copyright (C) 1990, 1993, 1994, 2001, 2002, 2003, 2004,
41.37 (miles 08-Jan-08): ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
51.11 (eric 22-Jul-92):
61.14 (rms 26-May-93): ;; Author: Masanobu UMEDA <umerin@mse.kyutech.ac.jp>
71.26 (rms 10-Feb-97): ;; Maintainer: FSF
81.10 (eric 17-Jul-92): ;; Keywords: mail
91.9 (eric 16-Jul-92):
101.8 (rms 14-Jul-92): ;; This file is part of GNU Emacs.
111.1 (rms 10-Sep-90):
121.39 (gm 06-May-08): ;; GNU Emacs is free software: you can redistribute it and/or modify
131.8 (rms 14-Jul-92): ;; it under the terms of the GNU General Public License as published by
141.39 (gm 06-May-08): ;; the Free Software Foundation, either version 3 of the License, or
151.39 (gm 06-May-08): ;; (at your option) any later version.
161.1 (rms 10-Sep-90):
171.1 (rms 10-Sep-90): ;; GNU Emacs is distributed in the hope that it will be useful,
181.8 (rms 14-Jul-92): ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
191.8 (rms 14-Jul-92): ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
201.8 (rms 14-Jul-92): ;; GNU General Public License for more details.
211.8 (rms 14-Jul-92):
221.8 (rms 14-Jul-92): ;; You should have received a copy of the GNU General Public License
231.39 (gm 06-May-08): ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
241.28 (pj 15-Jul-01):
251.28 (pj 15-Jul-01): ;;; Commentary:
261.1 (rms 10-Sep-90):
271.9 (eric 16-Jul-92): ;;; Code:
281.1 (rms 10-Sep-90):
291.1 (rms 10-Sep-90): (require 'sort)
301.24 (kwzh 20-Jan-96):
311.24 (kwzh 20-Jan-96): ;; For rmail-select-summary
321.24 (kwzh 20-Jan-96): (require 'rmail)
331.1 (rms 10-Sep-90):
341.14 (rms 26-May-93): (autoload 'timezone-make-date-sortable "timezone")
351.14 (rms 26-May-93):
361.14 (rms 26-May-93): ;; Sorting messages in Rmail buffer
371.14 (rms 26-May-93):
381.25 (rms 27-Sep-96): ;;;###autoload
391.1 (rms 10-Sep-90): (defun rmail-sort-by-date (reverse)
401.1 (rms 10-Sep-90): "Sort messages of current Rmail file by date.
411.1 (rms 10-Sep-90): If prefix argument REVERSE is non-nil, sort them in reverse order."
421.1 (rms 10-Sep-90): (interactive "P")
431.1 (rms 10-Sep-90): (rmail-sort-messages reverse
441.1 (rms 10-Sep-90): (function
451.1 (rms 10-Sep-90): (lambda (msg)
461.14 (rms 26-May-93): (rmail-make-date-sortable
471.1 (rms 10-Sep-90): (rmail-fetch-field msg "Date"))))))
481.1 (rms 10-Sep-90):
491.25 (rms 27-Sep-96): ;;;###autoload
501.1 (rms 10-Sep-90): (defun rmail-sort-by-subject (reverse)
511.1 (rms 10-Sep-90): "Sort messages of current Rmail file by subject.
521.1 (rms 10-Sep-90): If prefix argument REVERSE is non-nil, sort them in reverse order."
531.1 (rms 10-Sep-90): (interactive "P")
541.1 (rms 10-Sep-90): (rmail-sort-messages reverse
551.1 (rms 10-Sep-90): (function
561.1 (rms 10-Sep-90): (lambda (msg)
571.1 (rms 10-Sep-90): (let ((key (or (rmail-fetch-field msg "Subject") ""))
581.1 (rms 10-Sep-90): (case-fold-search t))
591.1 (rms 10-Sep-90): ;; Remove `Re:'
601.18 (kwzh 23-Mar-94): (if (string-match "^\\(re:[ \t]*\\)*" key)
611.18 (kwzh 23-Mar-94): (substring key (match-end 0))
621.18 (kwzh 23-Mar-94): key))))))
631.1 (rms 10-Sep-90):
641.25 (rms 27-Sep-96): ;;;###autoload
651.1 (rms 10-Sep-90): (defun rmail-sort-by-author (reverse)
661.1 (rms 10-Sep-90): "Sort messages of current Rmail file by author.
671.1 (rms 10-Sep-90): If prefix argument REVERSE is non-nil, sort them in reverse order."
681.1 (rms 10-Sep-90): (interactive "P")
691.1 (rms 10-Sep-90): (rmail-sort-messages reverse
701.1 (rms 10-Sep-90): (function
711.1 (rms 10-Sep-90): (lambda (msg)
721.14 (rms 26-May-93): (downcase ;Canonical name
731.14 (rms 26-May-93): (mail-strip-quoted-names
741.14 (rms 26-May-93): (or (rmail-fetch-field msg "From")
751.14 (rms 26-May-93): (rmail-fetch-field msg "Sender") "")))))))
761.1 (rms 10-Sep-90):
771.25 (rms 27-Sep-96): ;;;###autoload
781.1 (rms 10-Sep-90): (defun rmail-sort-by-recipient (reverse)
791.1 (rms 10-Sep-90): "Sort messages of current Rmail file by recipient.
801.1 (rms 10-Sep-90): If prefix argument REVERSE is non-nil, sort them in reverse order."
811.1 (rms 10-Sep-90): (interactive "P")
821.1 (rms 10-Sep-90): (rmail-sort-messages reverse
831.1 (rms 10-Sep-90): (function
841.1 (rms 10-Sep-90): (lambda (msg)
851.14 (rms 26-May-93): (downcase ;Canonical name
861.14 (rms 26-May-93): (mail-strip-quoted-names
871.14 (rms 26-May-93): (or (rmail-fetch-field msg "To")
881.14 (rms 26-May-93): (rmail-fetch-field msg "Apparently-To") "")
891.14 (rms 26-May-93): ))))))
901.1 (rms 10-Sep-90):
911.25 (rms 27-Sep-96): ;;;###autoload
921.3 (rms 03-Dec-90): (defun rmail-sort-by-correspondent (reverse)
931.3 (rms 03-Dec-90): "Sort messages of current Rmail file by other correspondent.
941.3 (rms 03-Dec-90): If prefix argument REVERSE is non-nil, sort them in reverse order."
951.3 (rms 03-Dec-90): (interactive "P")
961.3 (rms 03-Dec-90): (rmail-sort-messages reverse
971.3 (rms 03-Dec-90): (function
981.3 (rms 03-Dec-90): (lambda (msg)
991.3 (rms 03-Dec-90): (rmail-select-correspondent
1001.3 (rms 03-Dec-90): msg
1011.3 (rms 03-Dec-90): '("From" "Sender" "To" "Apparently-To"))))))
1021.3 (rms 03-Dec-90):
1031.3 (rms 03-Dec-90): (defun rmail-select-correspondent (msg fields)
1041.3 (rms 03-Dec-90): (let ((ans ""))
1051.14 (rms 26-May-93): (while (and fields (string= ans ""))
1061.14 (rms 26-May-93): (setq ans
1071.14 (rms 26-May-93): (rmail-dont-reply-to
1081.14 (rms 26-May-93): (mail-strip-quoted-names
1091.14 (rms 26-May-93): (or (rmail-fetch-field msg (car fields)) ""))))
1101.14 (rms 26-May-93): (setq fields (cdr fields)))
1111.14 (rms 26-May-93): ans))
1121.4 (rms 27-Dec-90):
1131.25 (rms 27-Sep-96): ;;;###autoload
1141.14 (rms 26-May-93): (defun rmail-sort-by-lines (reverse)
1151.15 (rms 22-Jun-93): "Sort messages of current Rmail file by number of lines.
1161.4 (rms 27-Dec-90): If prefix argument REVERSE is non-nil, sort them in reverse order."
1171.4 (rms 27-Dec-90): (interactive "P")
1181.4 (rms 27-Dec-90): (rmail-sort-messages reverse
1191.4 (rms 27-Dec-90): (function
1201.4 (rms 27-Dec-90): (lambda (msg)
1211.17 (kwzh 12-Mar-94): (count-lines (rmail-msgbeg msg)
1221.17 (kwzh 12-Mar-94): (rmail-msgend msg))))))
1231.21 (kwzh 07-Apr-94):
1241.25 (rms 27-Sep-96): ;;;###autoload
1251.27 (gerd 07-May-01): (defun rmail-sort-by-labels (reverse labels)
1261.21 (kwzh 07-Apr-94): "Sort messages of current Rmail file by labels.
1271.21 (kwzh 07-Apr-94): If prefix argument REVERSE is non-nil, sort them in reverse order.
1281.21 (kwzh 07-Apr-94): KEYWORDS is a comma-separated list of labels."
1291.21 (kwzh 07-Apr-94): (interactive "P\nsSort by labels: ")
1301.21 (kwzh 07-Apr-94): (or (string-match "[^ \t]" labels)
1311.21 (kwzh 07-Apr-94): (error "No labels specified"))
1321.21 (kwzh 07-Apr-94): (setq labels (concat (substring labels (match-beginning 0)) ","))
1331.21 (kwzh 07-Apr-94): (let (labelvec)
1341.21 (kwzh 07-Apr-94): (while (string-match "[ \t]*,[ \t]*" labels)
1351.29 (lektu 04-Feb-03): (setq labelvec (cons
1361.21 (kwzh 07-Apr-94): (concat ", ?\\("
1371.21 (kwzh 07-Apr-94): (substring labels 0 (match-beginning 0))
1381.21 (kwzh 07-Apr-94): "\\),")
1391.21 (kwzh 07-Apr-94): labelvec))
1401.21 (kwzh 07-Apr-94): (setq labels (substring labels (match-end 0))))
1411.21 (kwzh 07-Apr-94): (setq labelvec (apply 'vector (nreverse labelvec)))
1421.21 (kwzh 07-Apr-94): (rmail-sort-messages reverse
1431.21 (kwzh 07-Apr-94): (function
1441.21 (kwzh 07-Apr-94): (lambda (msg)
1451.21 (kwzh 07-Apr-94): (let ((n 0))
1461.21 (kwzh 07-Apr-94): (while (and (< n (length labelvec))
1471.21 (kwzh 07-Apr-94): (not (rmail-message-labels-p
1481.21 (kwzh 07-Apr-94): msg (aref labelvec n))))
1491.21 (kwzh 07-Apr-94): (setq n (1+ n)))
1501.21 (kwzh 07-Apr-94): n))))))
1511.14 (rms 26-May-93):
1521.14 (rms 26-May-93): ;; Basic functions
1531.36 (dann 25-Nov-07): (declare-function rmail-update-summary "rmailsum" (&rest ignore))
1541.1 (rms 10-Sep-90):
1551.14 (rms 26-May-93): (defun rmail-sort-messages (reverse keyfun)
1561.1 (rms 10-Sep-90): "Sort messages of current Rmail file.
1571.14 (rms 26-May-93): If 1st argument REVERSE is non-nil, sort them in reverse order.
1581.14 (rms 26-May-93): 2nd argument KEYFUN is called with a message number, and should return a key."
1591.26 (rms 10-Feb-97): (save-current-buffer
1601.16 (rms 24-Nov-93): ;; If we are in a summary buffer, operate on the Rmail buffer.
1611.16 (rms 24-Nov-93): (if (eq major-mode 'rmail-summary-mode)
1621.16 (rms 24-Nov-93): (set-buffer rmail-buffer))
1631.16 (rms 24-Nov-93): (let ((buffer-read-only nil)
1641.26 (rms 10-Feb-97): (point-offset (- (point) (point-min)))
1651.16 (rms 24-Nov-93): (predicate nil) ;< or string-lessp
1661.16 (rms 24-Nov-93): (sort-lists nil))
1671.16 (rms 24-Nov-93): (message "Finding sort keys...")
1681.16 (rms 24-Nov-93): (widen)
1691.16 (rms 24-Nov-93): (let ((msgnum 1))
1701.16 (rms 24-Nov-93): (while (>= rmail-total-messages msgnum)
1711.16 (rms 24-Nov-93): (setq sort-lists
1721.16 (rms 24-Nov-93): (cons (list (funcall keyfun msgnum) ;Make sorting key
1731.16 (rms 24-Nov-93): (eq rmail-current-message msgnum) ;True if current
1741.16 (rms 24-Nov-93): (aref rmail-message-vector msgnum)
1751.16 (rms 24-Nov-93): (aref rmail-message-vector (1+ msgnum)))
1761.16 (rms 24-Nov-93): sort-lists))
1771.16 (rms 24-Nov-93): (if (zerop (% msgnum 10))
1781.16 (rms 24-Nov-93): (message "Finding sort keys...%d" msgnum))
1791.16 (rms 24-Nov-93): (setq msgnum (1+ msgnum))))
1801.16 (rms 24-Nov-93): (or reverse (setq sort-lists (nreverse sort-lists)))
1811.16 (rms 24-Nov-93): ;; Decide predicate: < or string-lessp
1821.16 (rms 24-Nov-93): (if (numberp (car (car sort-lists))) ;Is a key numeric?
1831.16 (rms 24-Nov-93): (setq predicate (function <))
1841.16 (rms 24-Nov-93): (setq predicate (function string-lessp)))
1851.16 (rms 24-Nov-93): (setq sort-lists
1861.16 (rms 24-Nov-93): (sort sort-lists
1871.16 (rms 24-Nov-93): (function
1881.16 (rms 24-Nov-93): (lambda (a b)
1891.16 (rms 24-Nov-93): (funcall predicate (car a) (car b))))))
1901.16 (rms 24-Nov-93): (if reverse (setq sort-lists (nreverse sort-lists)))
1911.16 (rms 24-Nov-93): ;; Now we enter critical region. So, keyboard quit is disabled.
1921.16 (rms 24-Nov-93): (message "Reordering messages...")
1931.16 (rms 24-Nov-93): (let ((inhibit-quit t) ;Inhibit quit
1941.16 (rms 24-Nov-93): (current-message nil)
1951.16 (rms 24-Nov-93): (msgnum 1)
1961.16 (rms 24-Nov-93): (msginfo nil))
1971.16 (rms 24-Nov-93): ;; There's little hope that we can easily undo after that.
1981.20 (kwzh 30-Mar-94): (buffer-disable-undo (current-buffer))
1991.16 (rms 24-Nov-93): (goto-char (rmail-msgbeg 1))
2001.16 (rms 24-Nov-93): ;; To force update of all markers.
2011.16 (rms 24-Nov-93): (insert-before-markers ?Z)
2021.16 (rms 24-Nov-93): (backward-char 1)
2031.16 (rms 24-Nov-93): ;; Now reorder messages.
2041.16 (rms 24-Nov-93): (while sort-lists
2051.16 (rms 24-Nov-93): (setq msginfo (car sort-lists))
2061.16 (rms 24-Nov-93): ;; Swap two messages.
2071.16 (rms 24-Nov-93): (insert-buffer-substring
2081.16 (rms 24-Nov-93): (current-buffer) (nth 2 msginfo) (nth 3 msginfo))
2091.16 (rms 24-Nov-93): (delete-region (nth 2 msginfo) (nth 3 msginfo))
2101.16 (rms 24-Nov-93): ;; Is current message?
2111.16 (rms 24-Nov-93): (if (nth 1 msginfo)
2121.16 (rms 24-Nov-93): (setq current-message msgnum))
2131.16 (rms 24-Nov-93): (setq sort-lists (cdr sort-lists))
2141.16 (rms 24-Nov-93): (if (zerop (% msgnum 10))
2151.16 (rms 24-Nov-93): (message "Reordering messages...%d" msgnum))
2161.16 (rms 24-Nov-93): (setq msgnum (1+ msgnum)))
2171.16 (rms 24-Nov-93): ;; Delete the garbage inserted before.
2181.16 (rms 24-Nov-93): (delete-char 1)
2191.16 (rms 24-Nov-93): (setq quit-flag nil)
2201.16 (rms 24-Nov-93): (buffer-enable-undo)
2211.16 (rms 24-Nov-93): (rmail-set-message-counters)
2221.19 (kwzh 30-Mar-94): (rmail-show-message current-message)
2231.26 (rms 10-Feb-97): (goto-char (+ point-offset (point-min)))
2241.19 (kwzh 30-Mar-94): (if (rmail-summary-exists)
2251.19 (kwzh 30-Mar-94): (rmail-select-summary
2261.19 (kwzh 30-Mar-94): (rmail-update-summary)))))))
2271.14 (rms 26-May-93):
2281.1 (rms 10-Sep-90): (defun rmail-fetch-field (msg field)
2291.14 (rms 26-May-93): "Return the value of the header FIELD of MSG.
2301.1 (rms 10-Sep-90): Arguments are MSG and FIELD."
2311.14 (rms 26-May-93): (save-restriction
2321.14 (rms 26-May-93): (widen)
2331.14 (rms 26-May-93): (let ((next (rmail-msgend msg)))
2341.1 (rms 10-Sep-90): (goto-char (rmail-msgbeg msg))
2351.1 (rms 10-Sep-90): (narrow-to-region (if (search-forward "\n*** EOOH ***\n" next t)
2361.1 (rms 10-Sep-90): (point)
2371.1 (rms 10-Sep-90): (forward-line 1)
2381.1 (rms 10-Sep-90): (point))
2391.1 (rms 10-Sep-90): (progn (search-forward "\n\n" nil t) (point)))
2401.1 (rms 10-Sep-90): (mail-fetch-field field))))
2411.1 (rms 10-Sep-90):
2421.14 (rms 26-May-93): (defun rmail-make-date-sortable (date)
2431.14 (rms 26-May-93): "Make DATE sortable using the function string-lessp."
2441.14 (rms 26-May-93): ;; Assume the default time zone is GMT.
2451.14 (rms 26-May-93): (timezone-make-date-sortable date "GMT" "GMT"))
2461.6 (jimb 16-Mar-92):
2471.6 (jimb 16-Mar-92): (provide 'rmailsort)
2481.7 (eric 30-May-92):
2491.38 (monnier 10-Apr-08): ;; arch-tag: 0d90896b-0c35-46ac-b240-38be5ada2360
2501.7 (eric 30-May-92): ;;; rmailsort.el ends here