X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fsemi.git;a=blobdiff_plain;f=signature.el;h=3a21aeb973425b73d87e89ffae64a72771e4a09c;hp=a3850a7ef02cf209b320e0360c08d661c832c0d0;hb=HEAD;hpb=158af224de699c0a561aa13b3d7563a1a109b69d diff --git a/signature.el b/signature.el index a3850a7..3a21aeb 100644 --- a/signature.el +++ b/signature.el @@ -1,41 +1,35 @@ -;;; ;;; signature.el --- a signature utility for GNU Emacs -;;; -;;; Copyright (C) 1995 Free Software Foundation, Inc. -;;; Copyright (C) 1994 .. 1996 MORIOKA Tomohiko -;;; Copyright (C) 1994 OKABE Yasuo -;;; Copyright (C) 1996 Artur Pioro -;;; Copyright (C) 1996 KOBAYASHI Shuhei -;;; -;;; Author: MORIOKA Tomohiko -;;; OKABE Yasuo -;;; Artur Pioro -;;; KOBAYASHI Shuhei -;;; Maintainer: KOBAYASHI Shuhei -;;; Created: 1994/7/11 -;;; Version: -;;; $Id: signature.el,v 7.11 1996/07/10 13:45:06 shuhei-k Exp $ -;;; Keywords: mail, news, signature -;;; -;;; This file is part of tm (Tools for MIME). -;;; -;;; This program is free software; you can redistribute it and/or -;;; modify it under the terms of the GNU General Public License as -;;; published by the Free Software Foundation; either version 2, or -;;; (at your option) any later version. -;;; -;;; This program is distributed in the hope that it will be useful, -;;; but WITHOUT ANY WARRANTY; without even the implied warranty of -;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -;;; General Public License for more details. -;;; -;;; You should have received a copy of the GNU General Public License -;;; along with This program. If not, write to the Free Software -;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. -;;; + +;; Copyright (C) 1994,1995,1996,1997,2000 Free Software Foundation, Inc. + +;; Author: MORIOKA Tomohiko +;; OKABE Yasuo +;; Shuhei KOBAYASHI +;; Maintainer: Shuhei KOBAYASHI +;; Created: 1994/7/11 +;; Keywords: mail, news, signature + +;; 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 +;; published by the Free Software Foundation; either version 2, or (at +;; your option) any later version. + +;; This program is distributed in the hope that it will be useful, but +;; WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +;; General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with this program; see the file COPYING. If not, write to +;; the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + ;;; Code: -(require 'tl-822) +(require 'std11) + ;;; @ valiables ;;; @@ -50,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") @@ -64,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: " @@ -98,7 +90,7 @@ of file.") (let ((alist signature-file-alist) cell field value) (while alist (setq cell (car alist) - field (rfc822/get-field-body (car (car cell))) + field (std11-field-body (car (car cell))) value (cdr (car cell))) (cond ((functionp value) (let ((name (apply value field (cdr cell)))) @@ -148,6 +140,9 @@ specify a file named -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))