2000-06-05 Stefan Monnier <monnier@cs.yale.edu>
+ * mail/mh-comp.el (mh-send-sub): Check mh-etc is bound before using it.
+ (mh-letter-mode): Derive from text-mode.
+ This implicitly means that it now calls kill-all-local-variables.
+ Also remove the Emacs-18 compatibility code.
+
* emacs-lisp/autoload.el (make-autoload): Simplify docstring.
Make use of symbol-property doc-string-elt.
Use memq rather than a sequence of eq.
;;; Change Log:
-;; $Id: mh-comp.el,v 1.16 1999/11/10 10:46:01 gerd Exp $
+;; $Id: mh-comp.el,v 1.17 2000/04/27 18:56:42 gerd Exp $
;;; Code:
components)
((file-exists-p
(setq components
- (expand-file-name mh-comp-formfile mh-etc)))
+ (expand-file-name mh-comp-formfile
+ ;; What is this mh-etc ?? -sm
+ (and (boundp 'mh-etc) mh-etc))))
components)
(t
(error (format "Can't find components file \"%s\""
(put 'mh-letter-mode 'mode-class 'special)
;;;###autoload
-(defun mh-letter-mode ()
+(define-derived-mode mh-letter-mode text-mode "MH-Letter"
"Mode for composing letters in mh-e.\\<mh-letter-mode-map>
When you have finished composing, type \\[mh-send-letter] to send the message
using the MH mail handling system.
File to be inserted into message by \\[mh-insert-signature].
This command runs the normal hooks `text-mode-hook' and `mh-letter-mode-hook'."
-
- (interactive)
(or mh-user-path (mh-find-path))
(make-local-variable 'paragraph-start)
(setq paragraph-start (concat "^[ \t]*[-_][-_][-_]+$\\|" paragraph-start))
(make-local-variable 'mh-sent-from-msg)
(make-local-variable 'mail-header-separator)
(setq mail-header-separator "--------") ;for Hyperbole
- (use-local-map mh-letter-mode-map)
- (setq major-mode 'mh-letter-mode)
- (mh-set-mode-name "MH-Letter")
- (set-syntax-table mh-letter-mode-syntax-table)
- (run-hooks 'text-mode-hook)
;; if text-mode-hook turned on auto-fill, tune it for messages
- (cond ((and (boundp 'auto-fill-hook) auto-fill-hook) ;emacs 18
- (make-local-variable 'auto-fill-hook)
- (setq auto-fill-hook 'mh-auto-fill-for-letter)))
- (cond ((and (boundp 'auto-fill-function) auto-fill-function) ;emacs 19
- (make-local-variable 'auto-fill-function)
- (setq auto-fill-function 'mh-auto-fill-for-letter)))
- (run-hooks 'mh-letter-mode-hook))
+ (when auto-fill-function
+ (make-local-variable 'auto-fill-function)
+ (setq auto-fill-function 'mh-auto-fill-for-letter)))
(defun mh-auto-fill-for-letter ()