comparison lisp/bytecomp/bytecomp-runtime.el @ 22:8fc7fe29b841 r19-15b94

Import from CVS: tag r19-15b94
author cvs
date Mon, 13 Aug 2007 08:50:29 +0200
parents 0293115a14e9
children ec9a17fef872
comparison
equal deleted inserted replaced
21:b88636d63495 22:8fc7fe29b841
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
116 (put 'dont-compile 'lisp-indent-hook 0) 144 (put 'dont-compile 'lisp-indent-hook 0)
117 (defmacro dont-compile (&rest body) 145 (defmacro dont-compile (&rest body)
118 "Like `progn', but the body always runs interpreted (not compiled). 146 "Like `progn', but the body always runs interpreted (not compiled).
119 If you think you need this, you're probably making a mistake somewhere." 147 If you think you need this, you're probably making a mistake somewhere."
120 (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body))))) 148 (list 'eval (list 'quote (if (cdr body) (cons 'progn body) (car body)))))