From: morioka Date: Thu, 17 Sep 1998 14:07:02 +0000 (+0000) Subject: (make-obsolete): New function. X-Git-Tag: poe-199811302358~39 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=2a828bbe4e302faa0df3e1dca27ed00fe83fe2fd;p=elisp%2Fapel.git (make-obsolete): New function. --- diff --git a/poe-18.el b/poe-18.el index 45d6138..5704c40 100644 --- a/poe-18.el +++ b/poe-18.el @@ -164,6 +164,18 @@ Associates the function with the current load file, if any. (cons 'defun (cons name (cons arglist body))) ) +(defun-maybe make-obsolete (fn new) + "Make the byte-compiler warn that FUNCTION is obsolete. +The warning will say that NEW should be used instead. +If NEW is a string, that is the `use instead' message." + (interactive "aMake function obsolete: \nxObsoletion replacement: ") + (let ((handler (get fn 'byte-compile))) + (if (eq 'byte-compile-obsolete handler) + (setcar (get fn 'byte-obsolete-info) new) + (put fn 'byte-obsolete-info (cons new handler)) + (put fn 'byte-compile 'byte-compile-obsolete))) + fn) + ;;; @ file ;;;