summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/bytecomp.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2012-09-20 09:46:36 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2012-09-20 09:46:36 -0400
commit95b9712e9e3e8df09ad07423012bfbd978239014 (patch)
tree04ffa4bc0b34d4ffd3a6ed916b8ec6001a26e119 /lisp/emacs-lisp/bytecomp.el
parentf490dab981c46011d22b19b697fc979aa736a221 (diff)
downloademacs-95b9712e9e3e8df09ad07423012bfbd978239014.tar.gz
* lisp/emacs-lisp/macroexp.el (macroexp--obsolete-warning): New function.
(macroexp--expand-all): Use it. (macroexp--funcall-and-return): Remove by folding it into its sole caller (macroexp--warn-and-return). * lisp/emacs-lisp/bytecomp.el (byte-compile-warn-obsolete): Use macroexp--obsolete-warning.
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r--lisp/emacs-lisp/bytecomp.el16
1 files changed, 5 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index c42ae21aae5..7a229750178 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -1115,18 +1115,12 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
"Warn that SYMBOL (a variable or function) is obsolete."
(when (byte-compile-warning-enabled-p 'obsolete)
(let* ((funcp (get symbol 'byte-obsolete-info))
- (obsolete (or funcp (get symbol 'byte-obsolete-variable)))
- (instead (car obsolete))
- (asof (nth 2 obsolete)))
+ (msg (macroexp--obsolete-warning
+ symbol
+ (or funcp (get symbol 'byte-obsolete-variable))
+ (if funcp "function" "variable"))))
(unless (and funcp (memq symbol byte-compile-not-obsolete-funcs))
- (byte-compile-warn "`%s' is an obsolete %s%s%s" symbol
- (if funcp "function" "variable")
- (if asof (concat " (as of " asof ")") "")
- (cond ((stringp instead)
- (concat "; " instead))
- (instead
- (format "; use `%s' instead." instead))
- (t ".")))))))
+ (byte-compile-warn "%s" msg)))))
(defun byte-compile-report-error (error-info)
"Report Lisp error in compilation. ERROR-INFO is the error data."