comparison lisp/progmodes/cc-bytecomp.el @ 48361:2ac046f0f384

(cc-bytecomp-defun): Fixed bug that caused existing function definitions to be overridden by phonies when the bytecomp environment is restored.
author Martin Stjernholm <mast@lysator.liu.se>
date Sat, 16 Nov 2002 01:35:54 +0000
parents 7a3ac6c387fe
children eafa82fa3d92
comparison
equal deleted inserted replaced
48360:033719ff91f1 48361:2ac046f0f384
223 223
224 (defmacro cc-bytecomp-defun (fun) 224 (defmacro cc-bytecomp-defun (fun)
225 "Bind the symbol as a function during compilation of the file, 225 "Bind the symbol as a function during compilation of the file,
226 to silence the byte compiler. Don't use within `eval-when-compile'." 226 to silence the byte compiler. Don't use within `eval-when-compile'."
227 `(eval-when-compile 227 `(eval-when-compile
228 (if (not (assq ',fun cc-bytecomp-original-functions)) 228 (if (fboundp ',fun)
229 (setq cc-bytecomp-original-functions 229 nil
230 (cons (list ',fun 230 (if (not (assq ',fun cc-bytecomp-original-functions))
231 nil 231 (setq cc-bytecomp-original-functions
232 (if (fboundp ',fun) 232 (cons (list ',fun nil 'unbound)
233 (symbol-function ',fun) 233 cc-bytecomp-original-functions)))
234 'unbound)) 234 (if (and (cc-bytecomp-is-compiling)
235 cc-bytecomp-original-functions))) 235 (= cc-bytecomp-load-depth 0))
236 (if (and (cc-bytecomp-is-compiling) 236 (fset ',fun 'cc-bytecomp-ignore)))))
237 (= cc-bytecomp-load-depth 0)
238 (not (fboundp ',fun)))
239 (fset ',fun 'cc-bytecomp-ignore))))
240 237
241 (put 'cc-bytecomp-defmacro 'lisp-indent-function 'defun) 238 (put 'cc-bytecomp-defmacro 'lisp-indent-function 'defun)
242 (defmacro cc-bytecomp-defmacro (fun &rest temp-macro) 239 (defmacro cc-bytecomp-defmacro (fun &rest temp-macro)
243 "Bind the symbol as a macro during compilation (and evaluation) of the 240 "Bind the symbol as a macro during compilation (and evaluation) of the
244 file. Don't use outside `eval-when-compile'." 241 file. Don't use outside `eval-when-compile'."