X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=pcustom.el;h=242ede6de8b57d7d2834023fa58538906bc80e08;hb=33ef4ed54607c80928235f326a66728bf33cdf6b;hp=fd63bbeee575b2b30eb0e4f73509f1a7aba844a4;hpb=3b4f94331ac91f1faa37728ab2d32f7bdbad0195;p=elisp%2Fapel.git diff --git a/pcustom.el b/pcustom.el index fd63bbe..242ede6 100644 --- a/pcustom.el +++ b/pcustom.el @@ -1,11 +1,10 @@ ;;; pcustom.el -- a portable custom.el. +;; Copyright (C) 1999 Free Software Foundation, Inc. ;; Copyright (C) 1999 Mikio Nakajima -;; Copyright (C) 1999 Shuhei KOBAYASHI ;; Author: Mikio Nakajima ;; Shuhei KOBAYASHI -;; Maintainer: Mikio Nakajima ;; Keywords: emulating, custom ;; This file is part of APEL (A Portable Emacs Library). @@ -22,36 +21,45 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program; see the file COPYING. If not, write to the -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, -;; Boston, MA 02111-1307, USA. +;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, +;; Boston, MA 02110-1301, USA. + +;;; Commentary: ;;; Code: -;; If old compiler is used under v18, `eval-when-compile' and -;; `static-if' are expanded (and evaluated) at *load-time*. +(require 'poe) (eval-when-compile (require 'static)) -;; XXX: needs better abstraction. (static-if (condition-case nil ;; compile-time check. - ;; "new custom" requires widget library. - (and (require 'widget) - (require 'custom) - (fboundp 'custom-declare-variable)) + (if (and (require 'custom) + (fboundp 'custom-declare-variable)) + ;; you have "new custom". + t + ;; you have custom, but it is "old". + (message "\ + ** \"old custom\" is loaded. See README if you want to use \"new custom\".") + (sleep-for 1) + nil) + ;; you don't have custom. (error nil)) ;; you have "new custom". no load-time check. (require 'custom) - ;; your custom is "old custom", or you don't have custom library. + ;; your custom is "old custom", + ;; or you don't have custom library at compile-time. (or (condition-case nil ;; load-time check. - ;; "new custom" requires widget library. - (and (require 'widget) - (require 'custom) + ;; load "custom" if exists. + (and (require 'custom) (fboundp 'custom-declare-variable)) (error nil)) - ;; load emulation version. + ;; your custom is "old custom", + ;; or you don't have custom library. + ;; load emulation version of "new custom". (require 'tinycustom))) -(provide 'pcustom) +(require 'product) +(product-provide (provide 'pcustom) (require 'apel-ver)) -;; end of pcustom.el +;;; pcustom.el ends here