Setup auto-fill-chars.
[bpt/emacs.git] / lisp / message.el
index 1986454..edfe6fb 100644 (file)
@@ -260,7 +260,10 @@ The function `message-setup' runs this hook.")
 It is run after the headers have been inserted and before 
 the signature is inserted.")
 
-(defvar message-mode-hook nil
+(defvar message-mode-hook
+  (if (fboundp 'mail-abbrevs-setup)
+      '(mail-abbrevs-setup)
+    (list (intern "mail-aliases-setup")))
   "Hook run in message mode buffers.")
 
 (defvar message-header-hook nil
@@ -679,6 +682,32 @@ Return the number of headers removed."
             (1+ max)))))
       (message-sort-headers-1))))
 
+(defmacro message-y-or-n-p (question show &rest text)
+  "Ask QUESTION, displaying the rest of the arguments in a temporary buffer."
+  `(message-talkative-question 'y-or-n-p ,question ,show ,@text))
+
+(defun message-talkative-question (ask question show &rest text)
+  "Call FUNCTION with argument QUESTION, displaying the rest of the arguments in a temporary buffer if SHOW.  
+The following arguments may contain lists of values."
+  (if (and show
+          (setq text (message-flatten-list text)))
+      (save-window-excursion
+       (save-excursion
+         (with-output-to-temp-buffer " *MESSAGE information message*"
+           (set-buffer " *MESSAGE information message*")
+           (mapcar 'princ text)
+           (goto-char (point-min))))
+       (funcall ask question))
+    (funcall ask question)))
+
+(defun message-flatten-list (&rest list)
+  (message-flatten-list-1 list))
+
+(defun message-flatten-list-1 (list)
+  (cond ((consp list) 
+        (apply 'nconc (mapcar 'message-flatten-list-1 list)))
+       (list
+        (list list))))
 \f
 
 ;;;
@@ -776,7 +805,7 @@ C-c C-i  message-goto-signature (move to the beginning of the signature).
 C-c C-w  message-insert-signature (insert `message-signature-file' file).
 C-c C-y  message-yank-original (insert current message, if any).
 C-c C-q  message-fill-yanked-message (fill what was yanked).
-C-c C-r  message-ceasar-buffer-body (rot13 the message body)."
+C-c C-r  message-caesar-buffer-body (rot13 the message body)."
   (interactive)
   (kill-all-local-variables)
   (make-local-variable 'message-reply-buffer)
@@ -827,10 +856,6 @@ C-c C-r  message-ceasar-buffer-body (rot13 the message body)."
   (when (string-match "XEmacs\\|Lucid" emacs-version)
     (message-setup-toolbar))
   (easy-menu-add message-mode-menu message-mode-map)
-  ;; Allow mail alias things.
-  (if (fboundp 'mail-abbrevs-setup)
-      (mail-abbrevs-setup)
-    (funcall (intern "mail-aliases-setup")))
   (run-hooks 'text-mode-hook 'message-mode-hook))
 
 \f
@@ -1765,7 +1790,7 @@ the user from the mailer."
                   (not (eq message-fcc-handler-function 'rmail-output)))
              (funcall message-fcc-handler-function file)
            (if (and (file-readable-p file) (mail-file-babyl-p file))
-               (rmail-output file 1)
+               (rmail-output file 1 nil t)
              (let ((mail-use-rfc822 t))
                (rmail-output file 1 t t))))))
       (kill-buffer (current-buffer)))))
@@ -2964,35 +2989,6 @@ Do a `tab-to-tab-stop' if not in those headers."
          (goto-char (point-min))
          (pop-to-buffer cur)))))))
 
-;;; Help stuff.
-
-(defmacro message-y-or-n-p (question show &rest text)
-  "Ask QUESTION, displaying the rest of the arguments in a temporary buffer."
-  `(message-talkative-question 'y-or-n-p ,question ,show ,@text))
-
-(defun message-talkative-question (ask question show &rest text)
-  "Call FUNCTION with argument QUESTION, displaying the rest of the arguments in a temporary buffer if SHOW.  
-The following arguments may contain lists of values."
-  (if (and show
-          (setq text (message-flatten-list text)))
-      (save-window-excursion
-       (save-excursion
-         (with-output-to-temp-buffer " *MESSAGE information message*"
-           (set-buffer " *MESSAGE information message*")
-           (mapcar 'princ text)
-           (goto-char (point-min))))
-       (funcall ask question))
-    (funcall ask question)))
-
-(defun message-flatten-list (&rest list)
-  (message-flatten-list-1 list))
-
-(defun message-flatten-list-1 (list)
-  (cond ((consp list) 
-        (apply 'append (mapcar 'message-flatten-list-1 list)))
-       (list
-        (list list))))
-
 (run-hooks 'message-load-hook)
 
 (provide 'message)