]> code.delx.au - gnu-emacs/blobdiff - lisp/mail/rmail.el
Comment (minor header format fix).
[gnu-emacs] / lisp / mail / rmail.el
index ed434ad75cb9cf4c452c2637f56468093b341ce5..e851b96fda496a7a6134e533bf4c8cf72b3302ca 100644 (file)
@@ -1,7 +1,7 @@
 ;;; rmail.el --- main code of "RMAIL" mail reader for Emacs
 
 ;; Copyright (C) 1985, 1986, 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1998,
-;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+;;   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -9,10 +9,10 @@
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -20,9 +20,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
@@ -219,7 +217,15 @@ Otherwise, look for `movemail' in the directories in
       (dolist (dir (append rmail-movemail-search-path exec-path
                           (list exec-directory)))
        (when (and dir (file-accessible-directory-p dir))
-         (let ((progname (expand-file-name "movemail" dir)))
+         ;; Previously, this didn't have to work on Windows, because
+         ;; rmail-insert-inbox-text before r1.439 fell back to using
+         ;; (expand-file-name "movemail" exec-directory) and just
+         ;; assuming it would work.
+         ;; http://lists.gnu.org/archive/html/bug-gnu-emacs/2008-02/msg00087.html
+         (let ((progname (expand-file-name
+                          (concat "movemail"
+                                  (if (memq system-type '(ms-dos windows-nt))
+                                      ".exe")) dir)))
            (when (and (not (file-directory-p progname))
                       (file-executable-p progname))
              (let ((x (rmail-probe progname)))
@@ -327,8 +333,7 @@ If nil, display all header fields except those matched by
 ;;;###autoload
 (defcustom rmail-highlighted-headers "^From:\\|^Subject:" "\
 *Regexp to match Header fields that Rmail should normally highlight.
-A value of nil means don't highlight.
-See also `rmail-highlight-face'."
+A value of nil means don't highlight."
   :type 'regexp
   :group 'rmail-headers)
 
@@ -338,12 +343,11 @@ See also `rmail-highlight-face'."
   :group 'rmail-headers
   :version "22.1")
 
-;;;###autoload
-(defcustom rmail-highlight-face 'rmail-highlight "\
-*Face used by Rmail for highlighting headers."
-  :type '(choice (const :tag "Default" nil)
-                face)
-  :group 'rmail-headers)
+(defface rmail-header-name
+  '((t (:inherit font-lock-function-name-face)))
+  "Face to use for highlighting the header names."
+  :group 'rmail-headers
+  :version "23.1")
 
 ;;;###autoload
 (defcustom rmail-delete-after-output nil "\
@@ -705,12 +709,12 @@ The first parenthesized expression should match the MIME-charset name.")
           (cite-prefix "a-z")
           (cite-suffix (concat cite-prefix "0-9_.@-`'\"")))
       (list '("^\\(From\\|Sender\\|Resent-From\\):"
-             . font-lock-function-name-face)
-           '("^Reply-To:.*$" . font-lock-function-name-face)
-           '("^Subject:" . font-lock-comment-face)
-           '("^X-Spam-Status:" . font-lock-keyword-face)
+             . 'rmail-header-name)
+           '("^Reply-To:.*$" . 'rmail-header-name)
+           '("^Subject:" . 'rmail-header-name)
+           '("^X-Spam-Status:" . 'rmail-header-name)
            '("^\\(To\\|Apparently-To\\|Cc\\|Newsgroups\\):"
-             . font-lock-keyword-face)
+             . 'rmail-header-name)
            ;; Use MATCH-ANCHORED to effectively anchor the regexp left side.
            `(,cite-chars
              (,(concat "\\=[ \t]*"
@@ -721,7 +725,7 @@ The first parenthesized expression should match the MIME-charset name.")
               (1 font-lock-comment-delimiter-face nil t)
               (5 font-lock-comment-face nil t)))
            '("^\\(X-[a-z0-9-]+\\|In-reply-to\\|Date\\):.*\\(\n[ \t]+.*\\)*$"
-             . font-lock-string-face))))
+             . 'rmail-header-name))))
   "Additional expressions to highlight in Rmail mode.")
 
 ;; Perform BODY in the summary buffer
@@ -764,13 +768,14 @@ isn't provided."
        (require rmail-mime-feature)
       (error
        (display-warning
-       :warning
+       'rmail
        (format "Although MIME support is requested
 by setting `rmail-enable-mime' to non-nil, the required feature
 `%s' (the value of `rmail-mime-feature')
 is not available in the current session.
-So, the MIME support is turned off for the moment." 
-               rmail-mime-feature))
+So, the MIME support is turned off for the moment."
+               rmail-mime-feature)
+       :warning)
        (setq rmail-enable-mime nil)))))
 
 
@@ -1799,9 +1804,9 @@ is non-nil if the user has supplied the password interactively.
                    ;; in case of multiple inboxes that need moving.
                    (concat ".newmail-"
                            (file-name-nondirectory
-                            (if (memq system-type '(windows-nt cygwin))
-                                ;; cannot have "po:" in file name
-                                (substring file 3)
+                            (if (memq system-type '(windows-nt cygwin ms-dos))
+                                ;; cannot have colons in file name
+                                (replace-regexp-in-string ":" "-" file)
                               file)))
                    ;; Use the directory of this rmail file
                    ;; because it's a nuisance to use the homedir
@@ -2975,7 +2980,7 @@ iso-8859, koi8-r, etc."
                (inhibit-read-only t)
                ;; Highlight with boldface if that is available.
                ;; Otherwise use the `highlight' face.
-               (face (or rmail-highlight-face
+               (face (or 'rmail-highlight
                          (if (face-differs-from-default-p 'bold)
                              'bold 'highlight)))
                ;; List of overlays to reuse.
@@ -4278,5 +4283,5 @@ encoded string (and the same mask) will decode the string."
 
 (provide 'rmail)
 
-;;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c
+;; arch-tag: cff0a950-57fe-4f73-a86e-91ff75afd06c
 ;;; rmail.el ends here