]> code.delx.au - gnu-emacs/blobdiff - lisp/mail/sendmail.el
(mail-recover-1): Decrease non-random-len by 1 for the newly-readded #.
[gnu-emacs] / lisp / mail / sendmail.el
index 8497af5f7efd950b101e9ccb08fc79a75687f876..6bcb89d733da4cf568c3f87f43db1a40a42460c9 100644 (file)
@@ -1,6 +1,6 @@
 ;;; sendmail.el --- mail sending commands for Emacs.  -*- byte-compile-dynamic: t -*-
 
-;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 98, 2000, 2001
+;; Copyright (C) 1985, 86, 92, 93, 94, 95, 96, 98, 2000, 2001, 2002
 ;;   Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
@@ -301,6 +301,16 @@ for the recipient, who may not know how to decode them properly."
   :type '(choice (const t) (const nil) (const query) (const mime))
   :group 'sendmail)
 
+(defcustom mail-use-dsn nil
+  "*Ask MTA for notification of failed, delayed or successful delivery.
+Note that only some MTAs (currently only recent versions of Sendmail)
+support Delivery Status Notification."
+  :group 'sendmail
+  :type '(repeat (radio (const :tag "Failure" failure)
+                       (const :tag "Delay" delay)
+                       (const :tag "Success" success)))
+  :version "21.3")
+
 ;; Note: could use /usr/ucb/mail instead of sendmail;
 ;; options -t, and -v if not interactive.
 (defvar mail-mailer-swallows-blank-line
@@ -471,6 +481,7 @@ Here are commands that move to a header field (and create it if there isn't):
 \\[mail-sent-via]  mail-sent-via (add a Sent-via field for each To or CC).
 Turning on Mail mode runs the normal hooks `text-mode-hook' and
 `mail-mode-hook' (in that order)."
+  (setq local-abbrev-table text-mode-abbrev-table)
   (make-local-variable 'mail-reply-action)
   (make-local-variable 'mail-send-actions)
   (setq buffer-offer-save t)
@@ -491,7 +502,7 @@ Turning on Mail mode runs the normal hooks `text-mode-hook' and
                adaptive-fill-regexp))
   (make-local-variable 'adaptive-fill-first-line-regexp)
   (setq adaptive-fill-first-line-regexp
-       (concat "[ \t]*[-[:alnum:]]+>+[ \t]*\\|"
+       (concat "[ \t]*[-[:alnum:]]*>+[ \t]*\\|"
                adaptive-fill-first-line-regexp))
   ;; `-- ' precedes the signature.  `-----' appears at the start of the
   ;; lines that delimit forwarded messages.
@@ -990,6 +1001,9 @@ external program defined by `sendmail-program'."
 ;;;                          (or resend-to-addresses
                                  '("-t")
 ;;;                              )
+                             (if mail-use-dsn
+                                 (list "-N" (mapconcat 'symbol-name
+                                                       mail-use-dsn ",")))
                              )
                      )
                     (exit-value (apply 'call-process-region args)))
@@ -1549,6 +1563,7 @@ The seventh argument ACTIONS is a list of actions to take
     (setq non-random-len
          (- (length file-name) (length (make-temp-name "")) 1))
     (setq wildcard (concat (substring file-name 0 non-random-len) "*"))
+    (debug)
     (if (null (file-expand-wildcards wildcard))
        (message "There are no auto-saved drafts to recover")
       ;; Bind dired-trivial-filenames to t because all auto-save file
@@ -1631,15 +1646,12 @@ you can move to one of them and type C-c C-c to recover that one."
                  ;; ls-lisp instead).
                  (dired-noselect file-name
                                  (concat dired-listing-switches "t"))))
-            (save-excursion
-              (set-buffer dispbuf)
-              (let ((buffer-read-only nil))
-                (goto-char (point-min))
-                (forward-line)
-                (kill-line 2)
-                (dired-move-to-filename)
-                (setq dispbuf (rename-buffer "*Directory*" t))))
-            (display-buffer dispbuf t)
+            (save-selected-window
+              (select-window (display-buffer dispbuf t))
+              (goto-char (point-min))
+              (forward-line 2)
+              (dired-move-to-filename)
+              (setq dispbuf (rename-buffer "*Directory*" t)))
             (if (not (yes-or-no-p
                       (format "Recover mail draft from auto save file %s? "
                               file-name)))