Merge from emacs--rel--22
[bpt/emacs.git] / lisp / mail / rmailsum.el
index 539a176..9c9ba7a 100644 (file)
@@ -1,17 +1,17 @@
 ;;; rmailsum.el --- make summary buffers for the mail reader
 
 ;; Copyright (C) 1985, 1993, 1994, 1995, 1996, 2000, 2001, 2002, 2003,
-;;   2004, 2005, 2006 Free Software Foundation, Inc.
+;;   2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: mail
 
 ;; 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 2, 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
@@ -19,9 +19,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:
 
@@ -288,12 +286,14 @@ nil for FUNCTION means all messages."
                    (if (zerop (% rmail-new-summary-line-count 10))
                        (message "Computing summary lines...%d"
                                 rmail-new-summary-line-count))
-                   (rmail-make-summary-line-1 msg)))))
+                   (rmail-make-summary-line-1 msg))))
+       delpos)
     ;; Fix up the part of the summary that says "deleted" or "unseen".
-    (aset line 5
-         (if (rmail-message-deleted-p msg) ?\D
+    (string-match "[0-9]+" line)
+    (aset line (match-end 0)
+         (if (rmail-message-deleted-p msg) ?D
            (if (= ?0 (char-after (+ 3 (rmail-msgbeg msg))))
-               ?\- ?\ )))
+               ?- ?\s)))
     line))
 
 ;;;###autoload
@@ -535,7 +535,7 @@ messages, or backward if NUMBER is negative."
        (search (if (> number 0) 're-search-forward 're-search-backward))
        (non-del-msg-found nil))
     (while (and (> count 0) (setq non-del-msg-found
-                                 (or (funcall search "^....[^D]" nil t)
+                                 (or (funcall search "^.....[^D]" nil t)
                                      non-del-msg-found)))
       (setq count (1- count))))
   (beginning-of-line)
@@ -854,6 +854,15 @@ Search, the `unseen' attribute is restored.")
                      (set-buffer rmail-buffer)
                      (rmail-show-message msg-num t))))))
        (rmail-summary-update-highlight nil)))))
+
+(defun rmail-summary-save-buffer ()
+  "Save the buffer associated with this RMAIL summary."
+  (interactive)
+  (save-window-excursion
+    (save-excursion
+      (switch-to-buffer rmail-buffer)
+      (save-buffer))))
+
 \f
 (if rmail-summary-mode-map
     nil
@@ -923,6 +932,7 @@ Search, the `unseen' attribute is restored.")
     'rmail-summary-sort-by-lines)
   (define-key rmail-summary-mode-map "\C-c\C-s\C-k"
     'rmail-summary-sort-by-labels)
+  (define-key rmail-summary-mode-map "\C-x\C-s" 'rmail-summary-save-buffer)
   )
 \f
 ;;; Menu bar bindings.
@@ -1311,6 +1321,13 @@ argument says to read a file name and use that file as the inbox."
     (end-of-buffer))
   (forward-line -1))
 
+(declare-function rmail-abort-edit "rmailedit" ())
+(declare-function rmail-cease-edit "rmailedit"())
+(declare-function rmail-set-label "rmailkwd" (l state &optional n))
+(declare-function rmail-output-read-file-name "rmailout" ())
+(declare-function rmail-output-read-rmail-file-name  "rmailout" ())
+(declare-function mail-send-and-exit "sendmail" (&optional arg))
+
 (defvar rmail-summary-edit-map nil)
 (if rmail-summary-edit-map
     nil
@@ -1685,5 +1702,5 @@ KEYWORDS is a comma-separated list of labels."
 
 (provide 'rmailsum)
 
-;;; arch-tag: 556079ee-75c1-47f5-9884-2e0a0bc6c5a1
+;; arch-tag: 556079ee-75c1-47f5-9884-2e0a0bc6c5a1
 ;;; rmailsum.el ends here