comparison lisp/mail/mh-comp.el @ 29420:25fb2df6c428

(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.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Mon, 05 Jun 2000 07:15:34 +0000
parents 192cbf5dbea2
children c4366892a814
comparison
equal deleted inserted replaced
29419:b82691dc560e 29420:25fb2df6c428
24 24
25 ;; Internal support for mh-e package. 25 ;; Internal support for mh-e package.
26 26
27 ;;; Change Log: 27 ;;; Change Log:
28 28
29 ;; $Id: mh-comp.el,v 1.16 1999/11/10 10:46:01 gerd Exp $ 29 ;; $Id: mh-comp.el,v 1.17 2000/04/27 18:56:42 gerd Exp $
30 30
31 ;;; Code: 31 ;;; Code:
32 32
33 (provide 'mh-comp) 33 (provide 'mh-comp)
34 (require 'mh-utils) 34 (require 'mh-utils)
515 (setq components 515 (setq components
516 (expand-file-name mh-comp-formfile mh-lib))) 516 (expand-file-name mh-comp-formfile mh-lib)))
517 components) 517 components)
518 ((file-exists-p 518 ((file-exists-p
519 (setq components 519 (setq components
520 (expand-file-name mh-comp-formfile mh-etc))) 520 (expand-file-name mh-comp-formfile
521 ;; What is this mh-etc ?? -sm
522 (and (boundp 'mh-etc) mh-etc))))
521 components) 523 components)
522 (t 524 (t
523 (error (format "Can't find components file \"%s\"" 525 (error (format "Can't find components file \"%s\""
524 components))))) 526 components)))))
525 nil))) 527 nil)))
689 (defvar mh-annotate-field nil) ;Field name for message annotation. 691 (defvar mh-annotate-field nil) ;Field name for message annotation.
690 692
691 (put 'mh-letter-mode 'mode-class 'special) 693 (put 'mh-letter-mode 'mode-class 'special)
692 694
693 ;;;###autoload 695 ;;;###autoload
694 (defun mh-letter-mode () 696 (define-derived-mode mh-letter-mode text-mode "MH-Letter"
695 "Mode for composing letters in mh-e.\\<mh-letter-mode-map> 697 "Mode for composing letters in mh-e.\\<mh-letter-mode-map>
696 When you have finished composing, type \\[mh-send-letter] to send the message 698 When you have finished composing, type \\[mh-send-letter] to send the message
697 using the MH mail handling system. 699 using the MH mail handling system.
698 See the documentation for \\[mh-edit-mhn] for information on composing MIME 700 See the documentation for \\[mh-edit-mhn] for information on composing MIME
699 messages. 701 messages.
718 720
719 mh-signature-file-name (\"~/.signature\") 721 mh-signature-file-name (\"~/.signature\")
720 File to be inserted into message by \\[mh-insert-signature]. 722 File to be inserted into message by \\[mh-insert-signature].
721 723
722 This command runs the normal hooks `text-mode-hook' and `mh-letter-mode-hook'." 724 This command runs the normal hooks `text-mode-hook' and `mh-letter-mode-hook'."
723
724 (interactive)
725 (or mh-user-path (mh-find-path)) 725 (or mh-user-path (mh-find-path))
726 (make-local-variable 'paragraph-start) 726 (make-local-variable 'paragraph-start)
727 (setq paragraph-start (concat "^[ \t]*[-_][-_][-_]+$\\|" paragraph-start)) 727 (setq paragraph-start (concat "^[ \t]*[-_][-_][-_]+$\\|" paragraph-start))
728 (make-local-variable 'paragraph-separate) 728 (make-local-variable 'paragraph-separate)
729 (setq paragraph-separate 729 (setq paragraph-separate
734 (make-local-variable 'mh-previous-window-config) 734 (make-local-variable 'mh-previous-window-config)
735 (make-local-variable 'mh-sent-from-folder) 735 (make-local-variable 'mh-sent-from-folder)
736 (make-local-variable 'mh-sent-from-msg) 736 (make-local-variable 'mh-sent-from-msg)
737 (make-local-variable 'mail-header-separator) 737 (make-local-variable 'mail-header-separator)
738 (setq mail-header-separator "--------") ;for Hyperbole 738 (setq mail-header-separator "--------") ;for Hyperbole
739 (use-local-map mh-letter-mode-map)
740 (setq major-mode 'mh-letter-mode)
741 (mh-set-mode-name "MH-Letter")
742 (set-syntax-table mh-letter-mode-syntax-table)
743 (run-hooks 'text-mode-hook)
744 ;; if text-mode-hook turned on auto-fill, tune it for messages 739 ;; if text-mode-hook turned on auto-fill, tune it for messages
745 (cond ((and (boundp 'auto-fill-hook) auto-fill-hook) ;emacs 18 740 (when auto-fill-function
746 (make-local-variable 'auto-fill-hook) 741 (make-local-variable 'auto-fill-function)
747 (setq auto-fill-hook 'mh-auto-fill-for-letter))) 742 (setq auto-fill-function 'mh-auto-fill-for-letter)))
748 (cond ((and (boundp 'auto-fill-function) auto-fill-function) ;emacs 19
749 (make-local-variable 'auto-fill-function)
750 (setq auto-fill-function 'mh-auto-fill-for-letter)))
751 (run-hooks 'mh-letter-mode-hook))
752 743
753 744
754 (defun mh-auto-fill-for-letter () 745 (defun mh-auto-fill-for-letter ()
755 ;; Auto-fill in letters treats the header specially by inserting a tab 746 ;; Auto-fill in letters treats the header specially by inserting a tab
756 ;; before continuation line. 747 ;; before continuation line.