annotate lisp/tl/cless.el @ 42:8b8b7f3559a2 r19-15b104

Import from CVS: tag r19-15b104
author cvs
date Mon, 13 Aug 2007 08:54:51 +0200
parents 49a24b4fd526
children 131b0175ea99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
1 ;;; cless.el --- Common lisp and Emacs Lisp source sharing
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
2
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
3 ;; Copyright (C) 1996 MORIOKA Tomohiko
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
5 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
6 ;; Version:
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 8
diff changeset
7 ;; $Id: cless.el,v 1.3 1996/12/29 00:15:08 steve Exp $
4
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
8 ;; Keywords: common lisp
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
9
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
10 ;; This file is not part of GNU Emacs.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
11
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
12 ;; This program is free software; you can redistribute it and/or
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
13 ;; modify it under the terms of the GNU General Public License as
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
14 ;; published by the Free Software Foundation; either version 2, or (at
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
15 ;; your option) any later version.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
16
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
17 ;; This program is distributed in the hope that it will be useful, but
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
20 ;; General Public License for more details.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
21
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
23 ;; along with This program; see the file COPYING. If not, write to
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
24 ;; the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
25 ;; Boston, MA 02111-1307, USA.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
26
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
27 ;;; Code:
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
28
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
29 (require 'cl)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
30
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
31 (defun call-after-loaded (module func &optional hook-name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
32 "If MODULE is provided, then FUNC is called.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
33 Otherwise func is set to MODULE-load-hook.
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
34 If optional argument HOOK-NAME is specified,
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
35 it is used as hook to set. [cless.el; imported from tl-misc.el]"
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
36 (if (featurep module)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
37 (funcall func)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
38 (progn
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
39 (if (null hook-name)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
40 (setq hook-name
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
41 (intern (concat (symbol-name module) "-load-hook")))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
42 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
43 (add-hook hook-name func)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
44 )))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
45
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
46 (defun define-cless-alias (alias func)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
47 (defalias alias func)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
48 (call-after-loaded
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
49 'cl-macs
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
50 (` (lambda ()
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
51 (define-compiler-macro (, alias) (&rest args)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
52 (cons (, (list 'quote func)) args)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
53 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
54 ))
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
55 )
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
56
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
57 (define-cless-alias 'FLOOR 'floor*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
58 (define-cless-alias 'CEILING 'ceiling*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
59 (define-cless-alias 'TRUNCATE 'truncate*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
60 (define-cless-alias 'ROUND 'round*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
61 (define-cless-alias 'MOD 'mod*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
62
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
63 (define-cless-alias 'DELETE 'delete*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
64 (define-cless-alias 'SORT 'sort*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
65 (define-cless-alias 'MEMBER 'member*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
66 (define-cless-alias 'ASSOC 'assoc*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
67 (define-cless-alias 'RASSOC 'rassoc*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
68
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
69 (define-cless-alias 'MAPCAR 'mapcar*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
70
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
71 (define-cless-alias 'DEFUN 'defun*)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
72
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
73
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
74
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
75 ;;; @ end
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
76 ;;;
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
77
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
78 (provide 'cless)
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
79
b82b59fe008d Import from CVS: tag r19-15b3
cvs
parents:
diff changeset
80 ;;; cless.el ends here