1 ;;; tl-misc.el --- miscellaneous utility of tl.
3 ;; Copyright (C) 1995,1996 Free Software Foundation, Inc.
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
7 ;; $Id: tl-misc.el,v 1.1.1.1 1998-01-14 06:27:57 steve Exp $
8 ;; Keywords: load-path, module, structure
10 ;; This file is part of tl (Tiny Library).
12 ;; This program is free software; you can redistribute it and/or
13 ;; modify it under the terms of the GNU General Public License as
14 ;; published by the Free Software Foundation; either version 2, or (at
15 ;; your option) any later version.
17 ;; This program is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with This program; see the file COPYING. If not, write to
24 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
25 ;; Boston, MA 02111-1307, USA.
32 (autoload 'add-path "file-detect")
33 (autoload 'get-latest-path "file-detect")
34 (autoload 'file-installed-p "file-detect")
40 (defun call-after-loaded (module func &optional hook-name)
41 "If MODULE is provided, then FUNC is called.
42 Otherwise func is set to MODULE-load-hook.
43 If optional argument HOOK-NAME is specified,
44 it is used as hook to set. [tl-misc.el]"
49 (setq hook-name (symbol-concat module "-load-hook"))
51 (add-hook hook-name func)
58 (defmacro define-structure (name &rest slots)
59 (let ((pred (symbol-concat name '-p)))
63 (` (defun (, pred) (obj)
65 (eq (elt obj 0) '(, name))
68 (` (defun (, (symbol-concat name '/create)) (, slots)
69 (, (cons 'vector (cons (list 'quote name) slots)))
76 (` (defun (, (symbol-concat name '/ slot)) (obj)
85 (list (list 'quote name))
94 ;;; tl-misc.el ends here