checkdoc.
[elisp/apel.git] / pcustom.el
index f4adf8f..28a9321 100644 (file)
@@ -5,7 +5,6 @@
 
 ;; Author: Mikio Nakajima <minakaji@osaka.email.ne.jp>
 ;;     Shuhei KOBAYASHI <shuhei@aqua.ocn.ne.jp>
-;; Maintainer: Mikio Nakajima <minakaji@osaka.email.ne.jp>
 ;; Keywords: emulating, custom
 
 ;; This file is part of APEL (A Portable Emacs Library).
 ;; General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; 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.
 
-;;; Code:
+;;; Commentary:
 
-(require 'broken)
+;;; Code:
 
-(broken-facility new-custom
-  "New custom library not found; we use tinycustom for emulation."
-  (condition-case nil
-      (and (require 'custom)
-          (fboundp 'custom-declare-variable))
-    (error nil)))
+(require 'poe)
+(eval-when-compile (require 'static))
 
-(if-broken new-custom
-    (require 'tinycustom)
-  (require 'custom))
+(static-if (condition-case nil
+              ;; compile-time check.
+              ;; "new custom" requires widget library.
+              (and (require 'widget)
+                   (require 'custom)
+                   (fboundp 'custom-declare-variable))
+            (error
+             (if (null (featurep 'pcustom))
+                 (progn
+                   (message "
+  ** New CUSTOM library is not detected.  If you have that one, e.g. v1.9962,
+  ** please specify the installed path of the new CUSTOM library in the file
+  ** \"subdirs.el\" and rebuild this package.  For example, if you have
+  ** installed it in \"/usr/local/share/emacs/site-lisp/custom/\", put the
+  ** following line in the file \"/usr/local/share/emacs/site-lisp/subdirs.el\".
+  **
+  **   (normal-top-level-add-to-load-path '(\"custom\"))
+  **
+  ** Note that the argument can be a list of subdirectories.
+")
+                   (sleep-for 1)))
+             nil))
+    ;; you have "new custom". no load-time check.
+    (require 'custom)
+  ;; your custom is "old custom",
+  ;; or you don't have custom library at compile-time.
+  (or (condition-case nil
+         ;; load-time check.
+         ;; load "custom" if exists.
+         (and (require 'custom)
+              (fboundp 'custom-declare-variable))
+       (error nil))
+      ;; your custom is "old custom",
+      ;; or you don't have custom library.
+      ;; load emulation version of "new custom".
+      (require 'tinycustom)))
 
 (provide 'pcustom)
 
-;; end of pcustom.el
+;;; pcustom.el ends here