]> code.delx.au - gnu-emacs/blobdiff - lisp/emacs-lisp/eieio-comp.el
Merge from emacs-23
[gnu-emacs] / lisp / emacs-lisp / eieio-comp.el
index 70981a1b34738239214d4a4407a8eb2eac894544..34d0a89d3601cc5e7533c7034ebbc5a1e06d0299 100644 (file)
@@ -5,7 +5,8 @@
 
 ;; Author: Eric M. Ludlam <zappo@gnu.org>
 ;; Version: 0.2
-;; Keywords: oop, lisp, tools
+;; Keywords: lisp, tools
+;; Package: eieio
 
 ;; This file is part of GNU Emacs.
 
 ;; This teaches the byte compiler how to do this sort of thing.
 (put 'defmethod 'byte-hunk-handler 'byte-compile-file-form-defmethod)
 
-;; Variables used free:
-(defvar outbuffer)
-(defvar filename)
-
 (defun byte-compile-file-form-defmethod (form)
   "Mumble about the method we are compiling.
 This function is mostly ripped from `byte-compile-file-form-defun',
@@ -82,14 +79,18 @@ that is called but rarely.  Argument FORM is the body of the method."
         (class (if (listp arg1) (nth 1 arg1) nil))
         (my-outbuffer (if (eval-when-compile (featurep 'xemacs))
                           byte-compile-outbuffer
-                        (condition-case nil
-                            bytecomp-outbuffer
-                          (error outbuffer))))
-        )
+                        (cond ((boundp 'bytecomp-outbuffer)
+                               bytecomp-outbuffer) ; Emacs >= 23.2
+                              ((boundp 'outbuffer) outbuffer)
+                              (t (error "Unable to set outbuffer"))))))
     (let ((name (format "%s::%s" (or class "#<generic>") meth)))
       (if byte-compile-verbose
          ;; #### filename used free
-         (message "Compiling %s... (%s)" (or filename "") name))
+         (message "Compiling %s... (%s)"
+                  (cond ((boundp 'bytecomp-filename) bytecomp-filename)
+                        ((boundp 'filename) filename)
+                        (t ""))
+                  name))
       (setq byte-compile-current-form name) ; for warnings
       )
     ;; Flush any pending output
@@ -138,5 +139,4 @@ Argument PARAMLIST is the parameter list to convert."
 
 (provide 'eieio-comp)
 
-;; arch-tag: f2aacdd3-1da2-4ee9-b3e5-e8eac0832ee3
 ;;; eieio-comp.el ends here