# HG changeset patch # User Juanma Barranquero # Date 1206533897 0 # Node ID 790aba3b39c541a83b90328cc8ac44eac52c67f9 # Parent 9ecf89702ffc652ac0a761ba558c014bd835ae72 (byte-compile-obsolete): If no replacement is provided, don't print "use nil instead". diff -r 9ecf89702ffc -r 790aba3b39c5 lisp/emacs-lisp/bytecomp.el --- a/lisp/emacs-lisp/bytecomp.el Wed Mar 26 11:50:34 2008 +0000 +++ b/lisp/emacs-lisp/bytecomp.el Wed Mar 26 12:18:17 2008 +0000 @@ -1119,15 +1119,17 @@ ;;; 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