Mercurial > emacs
annotate lisp/emacs-lisp/eieio-comp.el @ 104489:25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
* cedet/semantic/wisent/java-tags.el:
* cedet/semantic/wisent/javat-wy.el: New files.
* cedet/semantic/wisent/java.el:
* cedet/semantic/wisent/java-wy.el: Files removed.
* cedet/semantic/java.el (semantic-java-prototype-function)
(semantic-java-prototype-variable, semantic-java-prototype-type):
Doc fix
(java-mode::semantic-format-tag-prototype): Renamed from
semantic-format-prototype-tag, which didn't match the overloadable
function.
* cedet/semantic/bovine/c.el (semantic-c-dereference-namespace-alias):
Deal correctly with nested namespaces. Make sure type actually
exists in original namespace.
* cedet/semantic/lex-spp.el (semantic-lex-spp-hack-depth): New.
(semantic-lex-spp-lex-text-string): Use above to enable recursion.
* cedet/semantic/format.el: Whitespace cleanup.
(semantic-test-all-format-tag-functions): Move to end.
(semantic-format-tag-prototype, semantic-format-tag-name)
(semantic-format-tag-name-default): Revert to original upstream
positions.
* cedet/semantic/elp.el: File removed.
* cedet/semantic/analyze.el (semantic-adebug-analyze): New
function, moved here from semantic/adebug.
* cedet/semantic/adebug.el: Declare external semanticdb functions.
(semantic-adebug-analyze, semantic-adebug-edebug-expr): Deleted.
* emacs-lisp/eieio.el (eieio-unbound): Default value is now robust
to recompile.
* emacs-lisp/eieio-datadebug.el: Add eieio objects to the list of
data debug things to recognize.
* emacs-lisp/eieio-comp.el: Synch to upstream.
* cedet/data-debug.el: Don't require eieio and semantic/tag.
If eieio is loaded, require eieio-datadebug.
(data-debug-insert-ring-button): Do not be specific about the ring
contents.
(data-debug-thing-alist): Remove eieio and semantic specific
entries.
(data-debug-add-specialized-thing): New function.
* cedet/cedet.el: Update commentary.
* cedet/cedet-edebug.el: Require edebug and debug.
author | Chong Yidong <cyd@stupidchicken.com> |
---|---|
date | Sun, 13 Sep 2009 15:58:30 +0000 |
parents | a64f3429f0ac |
children |
rev | line source |
---|---|
104431
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; eieio-comp.el -- eieio routines to help with byte compilation |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
3 ;;; Copyright (C) 1995,1996, 1998, 1999, 2000, 2001, 2002, 2005, 2008, |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
4 ;;; 2009 Free Software Foundation, Inc. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 ;; Author: Eric M. Ludlam <zappo@gnu.org> |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 ;; Version: 0.2 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 ;; Keywords: oop, lisp, tools |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 ;; This file is part of GNU Emacs. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
11 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; GNU Emacs is free software: you can redistribute it and/or modify |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
13 ;; it under the terms of the GNU General Public License as published by |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
14 ;; the Free Software Foundation, either version 3 of the License, or |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 ;; (at your option) any later version. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; GNU Emacs is distributed in the hope that it will be useful, |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 ;; GNU General Public License for more details. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
22 ;; You should have received a copy of the GNU General Public License |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;;; Commentary: |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 ;; Byte compiler functions for defmethod. This will affect the new GNU |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
28 ;; byte compiler for Emacs 19 and better. This function will be called by |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 ;; the byte compiler whenever a `defmethod' is encountered in a file. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 ;; It will output a function call to `eieio-defmethod' with the byte |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 ;; compiled function as a parameter. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 ;;; Code: |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 (declare-function eieio-defgeneric-form "eieio" (method doc-string)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 |
104489
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
37 ;; Some compatibility stuff |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
38 (eval-and-compile |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
39 (if (not (fboundp 'byte-compile-compiled-obj-to-list)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
40 (defun byte-compile-compiled-obj-to-list (moose) nil)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
41 |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
42 (if (not (boundp 'byte-compile-outbuffer)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
43 (defvar byte-compile-outbuffer nil)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
44 ) |
104431
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 ;; This teaches the byte compiler how to do this sort of thing. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 (put 'defmethod 'byte-hunk-handler 'byte-compile-file-form-defmethod) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 |
104489
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
49 ;; Variables used free: |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
50 (defvar outbuffer) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
51 (defvar filename) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
52 |
104431
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 (defun byte-compile-file-form-defmethod (form) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 "Mumble about the method we are compiling. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 This function is mostly ripped from `byte-compile-file-form-defun', but |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 it's been modified to handle the special syntax of the defmethod |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 command. There should probably be one for defgeneric as well, but |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 that is called but rarely. Argument FORM is the body of the method." |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 (setq form (cdr form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 (let* ((meth (car form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (key (progn (setq form (cdr form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 (cond ((or (eq ':BEFORE (car form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 (eq ':before (car form))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 (setq form (cdr form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 ":before ") |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 ((or (eq ':AFTER (car form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 (eq ':after (car form))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 (setq form (cdr form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 ":after ") |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 ((or (eq ':PRIMARY (car form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 (eq ':primary (car form))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
72 (setq form (cdr form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 ":primary ") |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 ((or (eq ':STATIC (car form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 (eq ':static (car form))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 (setq form (cdr form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 ":static ") |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 (t "")))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
79 (params (car form)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 (lamparams (byte-compile-defmethod-param-convert params)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 (arg1 (car params)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 (class (if (listp arg1) (nth 1 arg1) nil)) |
104489
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
83 (my-outbuffer (if (eval-when-compile (featurep 'xemacs)) |
104431
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 byte-compile-outbuffer |
104489
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
85 (condition-case nil |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
86 bytecomp-outbuffer |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
87 (error outbuffer)))) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
88 ) |
104431
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 (let ((name (format "%s::%s" (or class "#<generic>") meth))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 (if byte-compile-verbose |
104489
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
91 ;; #### filename used free |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
92 (message "Compiling %s... (%s)" (or filename "") name)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
93 (setq byte-compile-current-form name) ; for warnings |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
94 ) |
104431
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 ;; Flush any pending output |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
96 (byte-compile-flush-pending) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 ;; Byte compile the body. For the byte compiled forms, add the |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 ;; rest arguments, which will get ignored by the engine which will |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 ;; add them later (I hope) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 (let* ((new-one (byte-compile-lambda |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 (append (list 'lambda lamparams) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 (cdr form)))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 (code (byte-compile-byte-code-maker new-one))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 (princ "\n(eieio-defmethod '" my-outbuffer) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 (princ meth my-outbuffer) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 (princ " '(" my-outbuffer) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 (princ key my-outbuffer) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 (prin1 params my-outbuffer) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 (princ " " my-outbuffer) |
104489
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
110 (prin1 code my-outbuffer) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
111 (princ "))" my-outbuffer) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
112 ) |
104431
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
113 ;; Now add this function to the list of known functions. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
114 ;; Don't bother with a doc string. Not relevant here. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 (add-to-list 'byte-compile-function-environment |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 (cons meth |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 (eieio-defgeneric-form meth ""))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 ;; Remove it from the undefined list if it is there. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 (let ((elt (assq meth byte-compile-unresolved-functions))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 (if elt (setq byte-compile-unresolved-functions |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 (delq elt byte-compile-unresolved-functions)))) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
124 ;; nil prevents cruft from appearing in the output buffer. |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
125 nil)) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 |
104489
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
127 (defun byte-compile-defmethod-param-convert (paramlist) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
128 "Convert method params into the params used by the defmethod thingy. |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
129 Argument PARAMLIST is the paramter list to convert." |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
130 (let ((argfix nil)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
131 (while paramlist |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
132 (setq argfix (cons (if (listp (car paramlist)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
133 (car (car paramlist)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
134 (car paramlist)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
135 argfix)) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
136 (setq paramlist (cdr paramlist))) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
137 (nreverse argfix))) |
25e047f7f6a2
Synch to Eric Ludlam's upstream CEDET repository.
Chong Yidong <cyd@stupidchicken.com>
parents:
104431
diff
changeset
|
138 |
104431
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 (provide 'eieio-comp) |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
140 |
a64f3429f0ac
emacs-lisp/eieio-base.el, emacs-lisp/eieio-comp.el,
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 ;;; eieio-comp.el ends here |