From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.devel Subject: Re: Recognizing obsolete external package versions Date: Fri, 10 Aug 2007 17:15:11 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1186780335 21975 80.91.229.12 (10 Aug 2007 21:12:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 10 Aug 2007 21:12:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: rms@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 10 23:12:12 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IJbmC-0002DG-W7 for ged-emacs-devel@m.gmane.org; Fri, 10 Aug 2007 23:12:09 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJbmC-0006k6-E4 for ged-emacs-devel@m.gmane.org; Fri, 10 Aug 2007 17:12:08 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IJbm9-0006jY-Kb for emacs-devel@gnu.org; Fri, 10 Aug 2007 17:12:05 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IJbm7-0006j8-90 for emacs-devel@gnu.org; Fri, 10 Aug 2007 17:12:04 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IJbm7-0006j5-4F for emacs-devel@gnu.org; Fri, 10 Aug 2007 17:12:03 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1IJbm6-0007aa-Rw for emacs-devel@gnu.org; Fri, 10 Aug 2007 17:12:02 -0400 Original-Received: from rgm by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1IJbp9-000416-GM; Fri, 10 Aug 2007 17:15:11 -0400 X-Spook: event security Mole SHA Cocaine terrorism ASPIC BLU-114/B X-Ran: Unt'f-=V7T/\i$uHAW:[?A{9jaMDCd_dD9z_]vxn|]mcIJV,LY:a:Riup3Vo?+IoZ=bkX/ X-Hue: red X-Attribution: GM In-Reply-To: (Richard Stallman's message of "Tue, 31 Jul 2007 16:22:30 -0400") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:76331 Archived-At: Richard Stallman wrote: > Would someone please implement that feature? Will this do? (defconst bad-packages-list '((semantic (string-equal semantic-version "2.0pre3") (format "Semantic 2.0pre3 won't run in Emacs %s. It causes excessive CPU load. Update to a newer version." emacs-major-version)) ;; Install run-time check for older versions of CUA-mode, which ;; does not work with GNU Emacs version 22.1 and newer. ;; ;; Except for version 1.2, all of the 1.x and 2.x version of cua-mode ;; provided the `CUA-mode' feature. Since this is no longer true, ;; we can warn the user if the `CUA-mode' feature is ever provided. (CUA-mode t (format "\n\nCUA-mode is now part of the standard \ GNU Emacs distribution, so you may now enable CUA via the Options menu or by customizing option `cua-mode'.\n You have loaded an older version of CUA-mode which does not work correctly with this version of GNU Emacs.\n\n%s" (if user-init-file (format "To correct this, remove the loading and \ customization of the old version from the %s file.\n\n" user-init-file) "")))) "List of packages known to cause problems in this version of Emacs. Each element has the form (PACKAGE TESTFUNC MSGFUNC). Upon loading PACKAGE, evaluate TESTFUNC, and if it returns non-nil signal an error with message given by evaluating MSGFUNC.") (defun bad-package-check (package) "Run a check using an element from `bad-packages-list'. Use the element matching the symbol PACKAGE. This function is added to `after-load-alist'." (let ((list (assoc package bad-packages-list))) (and list (condition-case nil (eval (nth 1 list)) (error nil)) (error (eval (nth 2 list)))))) (mapc (lambda (elem) (eval-after-load (car elem) `(bad-package-check ',(car elem)))) bad-packages-list)