]> code.delx.au - gnu-emacs/blobdiff - lisp/mail/sendmail.el
(mail-mode): Don't set local-abbrev-table.
[gnu-emacs] / lisp / mail / sendmail.el
index 8497af5f7efd950b101e9ccb08fc79a75687f876..7be8c973762c3dcf40d8c2b8566385110a609b2b 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
@@ -257,7 +257,7 @@ If a string, that string is inserted.
   which is the standard way to delimit a signature in a message.)
 Otherwise, it should be an expression; it is evaluated
 and should insert whatever you want to insert."
-  :type '(choice (const "None" nil)
+  :type '(choice (const :tag "None" nil)
                 (const :tag "Use `.signature' file" t)
                 (string :tag "String to insert")
                 (sexp :tag "Expression to evaluate"))
@@ -269,6 +269,14 @@ and should insert whatever you want to insert."
   :type 'file
   :group 'sendmail)
 
+;;;###autoload
+(defcustom mail-default-directory "~/"
+  "*Directory for mail buffers.
+Value of `default-directory' for mail buffers.
+This directory is used for auto-save files of mail buffers."
+  :type '(directory :tag "Directory")
+  :group 'sendmail)
+
 (defvar mail-reply-action nil)
 (defvar mail-send-actions nil
   "A list of actions to be performed upon successful sending of a message.")
@@ -301,6 +309,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.4")
+
 ;; Note: could use /usr/ucb/mail instead of sendmail;
 ;; options -t, and -v if not interactive.
 (defvar mail-mailer-swallows-blank-line
@@ -455,6 +473,7 @@ actually occur.")
   :type 'hook
   :options '(footnote-mode))
 
+(defvar mail-mode-abbrev-table text-mode-abbrev-table)
 ;;;###autoload
 (define-derived-mode mail-mode text-mode "Mail"
   "Major mode for editing mail to be sent.
@@ -491,7 +510,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 +1009,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)))
@@ -1499,10 +1521,11 @@ The seventh argument ACTIONS is a list of actions to take
 ;;;          (message "Auto save file for draft message exists; consider M-x mail-recover"))
 ;;;          t))
   (pop-to-buffer "*mail*")
-  ;; Put the auto-save file in the home dir
-  ;; to avoid any danger that it can't be written.
-  (if (file-exists-p (expand-file-name "~/"))
-      (setq default-directory (expand-file-name "~/")))
+  ;; Avoid danger that the auto-save file can't be written.
+  (let ((dir (expand-file-name
+             (file-name-as-directory mail-default-directory))))
+    (if (file-exists-p dir)
+       (setq default-directory dir)))
   ;; Only call auto-save-mode if necessary, to avoid changing auto-save file.
   (if (or (and auto-save-default (not buffer-auto-save-file-name))
           (and (not auto-save-default) buffer-auto-save-file-name))
@@ -1618,8 +1641,10 @@ you can move to one of them and type C-c C-c to recover that one."
   (switch-to-buffer "*mail*")
   ;; If *mail* didn't exist, set its directory, so that auto-saved
   ;; drafts will be found.
-  (if (file-exists-p (expand-file-name "~/"))
-      (setq default-directory "~/"))
+  (let ((dir (expand-file-name
+             (file-name-as-directory mail-default-directory))))
+    (if (file-exists-p dir)
+       (setq default-directory dir)))
   (or (eq major-mode 'mail-mode)
       (mail-mode))
   (let ((file-name buffer-auto-save-file-name))
@@ -1631,15 +1656,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)))