;;; mu-bbdb.el --- `attribution' function for mu-cite with BBDB.
-;; Copyright (C) 1996 Shuhei KOBAYASHI
+;; Copyright (C) 1996,1997 Shuhei KOBAYASHI
;; Author: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
;; Version: $Id: mu-bbdb.el,v 3.3 1996/12/10 11:57:23 shuhei-k Exp $
-;; This file is part of tl (Tiny Library).
+;; This file is part of MU (Message Utilities).
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU General Public License as
;; - How to use
;; 1. bytecompile this file and copy it to the apropriate directory.
;; 2. put the following lines to your ~/.emacs:
-;; (require 'tl-misc)
-;; (call-after-loaded 'mu-cite
-;; (function
-;; (lambda ()
-;; (require 'mu-bbdb)
-;; )))
+;; (add-hook 'mu-cite-load-hook
+;; (function
+;; (lambda ()
+;; (require 'mu-bbdb)
+;; )))
\f
;;; Code:
;;; mu-cite.el --- yet another citation tool for GNU Emacs
-;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
+;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; MINOURA Makoto <minoura@netlaputa.or.jp>
;; Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
;; Maintainer: Shuhei KOBAYASHI <shuhei-k@jaist.ac.jp>
-;; Version: $Revision: 7.49 $
+;; Version: $Revision: 7.51 $
;; Keywords: mail, news, citation
;; This file is part of MU (Message Utilities).
;;; Code:
(require 'std11)
-(require 'tl-str)
-(require 'tl-list)
+;;(require 'tl-str)
+;;(require 'tl-list)
+(require 'alist)
;;; @ version
;;;
+(defsubst get-version-string (id)
+ "Return a version-string from RCS ID."
+ (and (string-match ",v \\([0-9][0-9.][0-9.]+\\)" id)
+ (substring id (match-beginning 1)(match-end 1))
+ ))
+
(defconst mu-cite/RCS-ID
- "$Id: mu-cite.el,v 7.49 1997/03/18 15:07:56 morioka Exp $")
+ "$Id: mu-cite.el,v 7.51 1998/02/13 10:11:54 morioka Exp $")
(defconst mu-cite/version (get-version-string mu-cite/RCS-ID))
;; get citation-name from the database
(defun mu-cite/get-citation-name (from)
- (assoc-value from mu-cite/citation-name-alist)
+ (cdr (assoc from mu-cite/citation-name-alist))
)
;; register citation-name to the database
)
(defun mu-cite/get-value (item)
- (let ((ret (assoc-value item mu-cite/methods-alist)))
+ (let ((ret (cdr (assoc item mu-cite/methods-alist))))
(if (functionp ret)
(prog1
(setq ret (funcall ret))
(replace-match new)
))
+(defun string-compare-from-top (str1 str2)
+ (let* ((len1 (length str1))
+ (len2 (length str2))
+ (len (min len1 len2))
+ (p 0)
+ c1 c2)
+ (while (and (< p len)
+ (progn
+ (setq c1 (sref str1 p)
+ c2 (sref str2 p))
+ (eq c1 c2)
+ ))
+ (setq p (+ p (char-length c1)))
+ )
+ (and (> p 0)
+ (let ((matched (substring str1 0 p))
+ (r1 (and (< p len1)(substring str1 p)))
+ (r2 (and (< p len2)(substring str2 p)))
+ )
+ (if (eq r1 r2)
+ matched
+ (list 'seq matched (list 'or r1 r2))
+ )))))
+
;;; @ end
;;;