comparison lisp/bytecomp/bytecomp-runtime.el @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents ec9a17fef872
children 0d2f883870bc
comparison
equal deleted inserted replaced
69:804d1389bcd6 70:131b0175ea99
111 (intern str)) 111 (intern str))
112 (car (read-from-string (read-string "Obsoletion replacement: "))))) 112 (car (read-from-string (read-string "Obsoletion replacement: ")))))
113 (put var 'byte-obsolete-variable new) 113 (put var 'byte-obsolete-variable new)
114 var) 114 var)
115 115
116 ;; By overwhelming demand, we separate out truly obsolete symbols from
117 ;; those that are present for GNU Emacs compatibility.
118 (defun make-compatible (fn new)
119 "Make the byte-compiler know that FUNCTION is provided for compatibility.
120 The warning will say that NEW should be used instead.
121 If NEW is a string, that is the `use instead' message."
122 (interactive "aMake function compatible: \nxCompatible replacement: ")
123 (let ((handler (get fn 'byte-compile)))
124 (if (eq 'byte-compile-compatible handler)
125 (setcar (get fn 'byte-compatible-info) new)
126 (put fn 'byte-compatible-info (cons new handler))
127 (put fn 'byte-compile 'byte-compile-compatible)))
128 fn)
129
130 (defun make-compatible-variable (var new)
131 "Make the byte-compiler know that VARIABLE is provided for compatibility.
132 and NEW should be used instead. If NEW is a string, then that is the
133 `use instead' message."
134 (interactive
135 (list
136 (let ((str (completing-read "Make variable compatible: "
137 obarray 'boundp t)))
138 (if (equal str "") (error ""))
139 (intern str))
140 (car (read-from-string (read-string "Compatible replacement: ")))))
141 (put var 'byte-compatible-variable new)
142 var)
143
144 (put 'dont-compile 'lisp-indent-hook 0) 116 (put 'dont-compile 'lisp-indent-hook 0)
145 (defmacro dont-compile (&rest body) 117 (defmacro dont-compile (&rest body)
146 "Like `progn', but the body always runs interpreted (not compiled). 118 "Like `progn', but the body always runs interpreted (not compiled).
147 If you think you need this, you're probably making a mistake somewhere." 119 If you think you need this, you're probably making a mistake somewhere."
148 (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body))))) 120 (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))
193 Keys: Values: Corresponding variable: 165 Keys: Values: Corresponding variable:
194 166
195 verbose t, nil byte-compile-verbose 167 verbose t, nil byte-compile-verbose
196 optimize t, nil, source, byte byte-optimize 168 optimize t, nil, source, byte byte-optimize
197 warnings list of warnings byte-compile-warnings 169 warnings list of warnings byte-compile-warnings
198 file-format emacs18, emacs19 byte-compile-emacs18-compatibility 170 file-format emacs19, emacs20 byte-compile-emacs19-compatibility
199 171
200 The value specified with the `warnings' option must be a list, containing 172 The value specificed with the `warnings' option must be a list, containing
201 some subset of the following flags: 173 some subset of the following flags:
202 174
203 free-vars references to variables not in the current lexical scope. 175 free-vars references to variables not in the current lexical scope.
204 unused-vars references to non-global variables bound but not referenced. 176 unused-vars references to non-global variables bound but not referenced.
205 unresolved calls to unknown functions. 177 unresolved calls to unknown functions.