Mercurial > emacs
comparison lisp/emacs-lisp/bytecomp.el @ 105364:338d102432df
* eval.c (Fcalled_interactively_p): Add `kind' argument.
* subr.el (interactive-p): Mark obsolete.
(called-interactively-p): Make the optional-ness of `kind' obsolete.
* emacs-lisp/bytecomp.el (byte-compile-fdefinition): Make it obey
advertised-signature-table for subroutines as well.
author | Stefan Monnier <monnier@iro.umontreal.ca> |
---|---|
date | Thu, 01 Oct 2009 17:47:38 +0000 |
parents | a3acd4b1e5cc |
children | 83e7d269fc49 |
comparison
equal
deleted
inserted
replaced
105363:a3acd4b1e5cc | 105364:338d102432df |
---|---|
1246 (or (symbolp (symbol-function fn)) | 1246 (or (symbolp (symbol-function fn)) |
1247 (consp (symbol-function fn)) | 1247 (consp (symbol-function fn)) |
1248 (and (not macro-p) | 1248 (and (not macro-p) |
1249 (byte-code-function-p (symbol-function fn))))) | 1249 (byte-code-function-p (symbol-function fn))))) |
1250 (setq fn (symbol-function fn))) | 1250 (setq fn (symbol-function fn))) |
1251 (let ((advertised (gethash fn advertised-signature-table t))) | 1251 (let ((advertised (gethash (if (and (symbolp fn) (fboundp fn)) |
1252 ;; Could be a subr. | |
1253 (symbol-function fn) | |
1254 fn) | |
1255 advertised-signature-table t))) | |
1252 (cond | 1256 (cond |
1253 ((listp advertised) | 1257 ((listp advertised) |
1254 (if macro-p | 1258 (if macro-p |
1255 `(macro lambda ,advertised) | 1259 `(macro lambda ,advertised) |
1256 `(lambda ,advertised))) | 1260 `(lambda ,advertised))) |
3102 | 3106 |
3103 ;; Compile those primitive ordinary functions | 3107 ;; Compile those primitive ordinary functions |
3104 ;; which have special byte codes just for speed. | 3108 ;; which have special byte codes just for speed. |
3105 | 3109 |
3106 (defmacro byte-defop-compiler (function &optional compile-handler) | 3110 (defmacro byte-defop-compiler (function &optional compile-handler) |
3107 ;; add a compiler-form for FUNCTION. | 3111 "Add a compiler-form for FUNCTION. |
3108 ;; If function is a symbol, then the variable "byte-SYMBOL" must name | 3112 If function is a symbol, then the variable \"byte-SYMBOL\" must name |
3109 ;; the opcode to be used. If function is a list, the first element | 3113 the opcode to be used. If function is a list, the first element |
3110 ;; is the function and the second element is the bytecode-symbol. | 3114 is the function and the second element is the bytecode-symbol. |
3111 ;; The second element may be nil, meaning there is no opcode. | 3115 The second element may be nil, meaning there is no opcode. |
3112 ;; COMPILE-HANDLER is the function to use to compile this byte-op, or | 3116 COMPILE-HANDLER is the function to use to compile this byte-op, or |
3113 ;; may be the abbreviations 0, 1, 2, 3, 0-1, or 1-2. | 3117 may be the abbreviations 0, 1, 2, 3, 0-1, or 1-2. |
3114 ;; If it is nil, then the handler is "byte-compile-SYMBOL." | 3118 If it is nil, then the handler is \"byte-compile-SYMBOL.\"" |
3115 (let (opcode) | 3119 (let (opcode) |
3116 (if (symbolp function) | 3120 (if (symbolp function) |
3117 (setq opcode (intern (concat "byte-" (symbol-name function)))) | 3121 (setq opcode (intern (concat "byte-" (symbol-name function)))) |
3118 (setq opcode (car (cdr function)) | 3122 (setq opcode (car (cdr function)) |
3119 function (car function))) | 3123 function (car function))) |