From 2a828bbe4e302faa0df3e1dca27ed00fe83fe2fd Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 17 Sep 1998 14:07:02 +0000 Subject: [PATCH] (make-obsolete): New function. --- poe-18.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 ;;; -- 1.7.10.4