Commit d87e5a25 authored by Juanma Barranquero's avatar Juanma Barranquero
Browse files

(byte-compile-obsolete): If no replacement is provided,

don't print "use nil instead".
parent 31d24a4b
......@@ -1119,15 +1119,17 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
;;; Used by make-obsolete.
(defun byte-compile-obsolete (form)
(let* ((new (get (car form) 'byte-obsolete-info))
(use (car new))
(handler (nth 1 new))
(when (nth 2 new)))
(byte-compile-set-symbol-position (car form))
(if (byte-compile-warning-enabled-p 'obsolete)
(byte-compile-warn "`%s' is an obsolete function%s; %s" (car form)
(byte-compile-warn "`%s' is an obsolete function%s%s" (car form)
(if when (concat " (as of Emacs " when ")") "")
(if (stringp (car new))
(car new)
(format "use `%s' instead." (car new)))))
(cond ((stringp use)
(concat "; " use))
(use (format "; use `%s' instead." use))
(t "."))))
(funcall (or handler 'byte-compile-normal-call) form)))
;; Compiler options
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment