Mercurial > emacs
comparison lisp/emacs-lisp/eieio-comp.el @ 111427:28be5d9560c5
Minor eieio-comp changes.
* lisp/emacs-lisp/eieio-comp.el (byte-compile-file-form-defmethod):
Use boundp tests to silence compiler. Update for changed name of
bytecomp-filename variable.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 06 Nov 2010 12:47:42 -0700 |
parents | 280c8ae2476d |
children | 417b1e4d63cd |
comparison
equal
deleted
inserted
replaced
111426:5dbc2ccef17c | 111427:28be5d9560c5 |
---|---|
45 ) | 45 ) |
46 | 46 |
47 ;; This teaches the byte compiler how to do this sort of thing. | 47 ;; This teaches the byte compiler how to do this sort of thing. |
48 (put 'defmethod 'byte-hunk-handler 'byte-compile-file-form-defmethod) | 48 (put 'defmethod 'byte-hunk-handler 'byte-compile-file-form-defmethod) |
49 | 49 |
50 ;; Variables used free: | |
51 (defvar outbuffer) | |
52 (defvar filename) | |
53 | |
54 (defun byte-compile-file-form-defmethod (form) | 50 (defun byte-compile-file-form-defmethod (form) |
55 "Mumble about the method we are compiling. | 51 "Mumble about the method we are compiling. |
56 This function is mostly ripped from `byte-compile-file-form-defun', | 52 This function is mostly ripped from `byte-compile-file-form-defun', |
57 but it's been modified to handle the special syntax of the `defmethod' | 53 but it's been modified to handle the special syntax of the `defmethod' |
58 command. There should probably be one for `defgeneric' as well, but | 54 command. There should probably be one for `defgeneric' as well, but |
81 (lamparams (byte-compile-defmethod-param-convert params)) | 77 (lamparams (byte-compile-defmethod-param-convert params)) |
82 (arg1 (car params)) | 78 (arg1 (car params)) |
83 (class (if (listp arg1) (nth 1 arg1) nil)) | 79 (class (if (listp arg1) (nth 1 arg1) nil)) |
84 (my-outbuffer (if (eval-when-compile (featurep 'xemacs)) | 80 (my-outbuffer (if (eval-when-compile (featurep 'xemacs)) |
85 byte-compile-outbuffer | 81 byte-compile-outbuffer |
86 (condition-case nil | 82 (cond ((boundp 'bytecomp-outbuffer) |
87 bytecomp-outbuffer | 83 bytecomp-outbuffer) ; Emacs >= 23.2 |
88 (error outbuffer)))) | 84 ((boundp 'outbuffer) outbuffer) |
89 ) | 85 (t (error "Unable to set outbuffer")))))) |
90 (let ((name (format "%s::%s" (or class "#<generic>") meth))) | 86 (let ((name (format "%s::%s" (or class "#<generic>") meth))) |
91 (if byte-compile-verbose | 87 (if byte-compile-verbose |
92 ;; #### filename used free | 88 ;; #### filename used free |
93 (message "Compiling %s... (%s)" (or filename "") name)) | 89 (message "Compiling %s... (%s)" |
90 (cond ((boundp 'bytecomp-filename) bytecomp-filename) | |
91 ((boundp 'filename) filename) | |
92 (t "")) | |
93 name)) | |
94 (setq byte-compile-current-form name) ; for warnings | 94 (setq byte-compile-current-form name) ; for warnings |
95 ) | 95 ) |
96 ;; Flush any pending output | 96 ;; Flush any pending output |
97 (byte-compile-flush-pending) | 97 (byte-compile-flush-pending) |
98 ;; Byte compile the body. For the byte compiled forms, add the | 98 ;; Byte compile the body. For the byte compiled forms, add the |
137 (setq paramlist (cdr paramlist))) | 137 (setq paramlist (cdr paramlist))) |
138 (nreverse argfix))) | 138 (nreverse argfix))) |
139 | 139 |
140 (provide 'eieio-comp) | 140 (provide 'eieio-comp) |
141 | 141 |
142 ;; arch-tag: f2aacdd3-1da2-4ee9-b3e5-e8eac0832ee3 | |
143 ;;; eieio-comp.el ends here | 142 ;;; eieio-comp.el ends here |