Merge remi-1_14_2-1.
[elisp/semi.git] / signature.el
index b111892..6bd81c3 100644 (file)
@@ -1,18 +1,15 @@
 ;;; signature.el --- a signature utility for GNU Emacs
 
-;; Copyright (C) 1994,1995,1996 Free Software Foundation, Inc.
+;; Copyright (C) 1994,1995,1996,1997,2000 Free Software Foundation, Inc.
 
-;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
+;; Author: MORIOKA Tomohiko <tomo@m17n.org>
 ;;         OKABE Yasuo <okabe@kudpc.kyoto-u.ac.jp>
-;;         Artur Pioro <artur@flugor.if.uj.edu.pl>
-;;         KOBAYASHI Shuhei <shuhei-k@jaist.ac.jp>
-;; Maintainer: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
+;;         Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
+;; Maintainer: Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
 ;; Created: 1994/7/11
-;; Version:
-;;     $Id: signature.el,v 7.13 1996/08/30 04:34:56 morioka Exp $
 ;; Keywords: mail, news, signature
 
-;; This file is part of tm (Tools for MIME).
+;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
 
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License as
@@ -47,10 +44,19 @@ of file.")
 (defvar signature-load-hook nil
   "*List of functions called after signature.el is loaded.")
 
+(defvar signature-separator "-- \n"
+  "*String to separate contents and signature.
+It is inserted when signature is inserted at end of file.")
+
 (defvar signature-file-name "~/.signature"
   "*Name of file containing the user's signature.")
 
-(defvar signature-file-alist nil)
+(defvar signature-file-alist nil
+  "*Alist of the form:
+    (((FIELD . PATTERN) . FILENAME)
+     ...)
+PATTERN is a string or list of string. If PATTERN matches the contents of
+FIELD, the contents of FILENAME is inserted.")
 
 (defvar signature-file-prefix nil
   "*String containing optional prefix for the signature file names")
@@ -61,18 +67,7 @@ of file.")
 (defvar signature-use-bbdb nil
   "*If non-nil, Register sigtype to BBDB.")
 
-;;;
-;;; Example:
-;;;
-;;; (setq signature-file-alist
-;;;       '((("Newsgroups" . "zxr")   . "~/.signature-sun")
-;;;         (("To" . "uramimi")       . "~/.signature-sun")
-;;;         (("Newsgroups" . "jokes") . "~/.signature-jokes")
-;;;         (("To" . "tea")           . "~/.signature-jokes")
-;;;         (("To" . ("sim" "oku"))   . "~/.signature-formal")
-;;;         ))
-
-(autoload 'signature/get-sigtype-from-bbdb "tm-bbdb")
+(autoload 'signature/get-sigtype-from-bbdb "mime-bbdb")
 
 (defun signature/get-sigtype-interactively (&optional default)
   (read-file-name "Insert your signature: "
@@ -145,6 +140,9 @@ specify a file named <signature-file-name>-DISTRIBUTION interactively."
           (if signature-delete-blank-lines-at-eof (delete-blank-lines))
           ))
     (run-hooks 'signature-insert-hook)
+    (if (= (point)(point-max))
+       (insert signature-separator)
+      )
     (insert-file-contents signature-file-name)
     (force-mode-line-update)
     signature-file-name))