Only do the defcustom compilation thing on XEmacs, where it seems to be needed.
[gnus] / lisp / dgnushack.el
index 384db33..d758100 100644 (file)
@@ -1,7 +1,5 @@
 ;;; dgnushack.el --- a hack to set the load path for byte-compiling
-;; Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2003,
-;; 2004, 2005, 2006, 2007, 2008, 2009, 2010
-;;        Free Software Foundation, Inc.
+;; Copyright (C) 1994-2011 Free Software Foundation, Inc.
 
 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
 ;; Version: 4.19
 (require 'cl)
 (require 'iswitchb)
 
+(condition-case nil
+    (require 'org-entities)
+  (error nil))
+
 (defvar srcdir (or (getenv "srcdir") "."))
 (defvar loaddir (and load-file-name (file-name-directory load-file-name)))
 
   (when (featurep 'xemacs)
     (unless (fboundp 'defadvice)
       (autoload 'defadvice "advice" nil nil 'macro))
+    (unless (boundp 'help-echo-owns-message)
+      (defvar help-echo-owns-message))
+    (unless (fboundp 'url-retrieve-synchronously)
+      (defalias 'url-retrieve-synchronously 'url-retrieve))
     (autoload 'Info-directory "info" nil t)
     (autoload 'Info-index "info" nil t)
     (autoload 'Info-index-next "info" nil t)
     (autoload 'read-passwd "passwd")
     (autoload 'regexp-opt "regexp-opt")
     (autoload 'reporter-submit-bug-report "reporter")
+    (if (condition-case nil
+           (progn
+             (require 'rot13)
+             (not (fboundp 'rot13-string)))
+         (error nil))
+       (defmacro rot13-string (string)
+         "Return ROT13 encryption of STRING."
+         `(let ((string ,string))
+            (with-temp-buffer
+              (insert string)
+              (translate-region (point-min) (point-max) ,rot13-display-table)
+              (buffer-string)))))
     (if (and (emacs-version>= 21 5)
             (not (featurep 'sxemacs)))
        (autoload 'setenv "process" nil t)
@@ -232,7 +250,8 @@ in `defcustom' forms."
            (search-forward " 'foo '(byte-code " nil t))
        (kill-buffer outbuf)))))
 
-(when (dgnushack-emacs-compile-defcustom-p)
+(when (and (featurep 'xemacs)
+          (dgnushack-emacs-compile-defcustom-p))
   (maybe-fbind '(defined-colors face-attribute))
   (maybe-bind '(idna-program installation-directory)))
 
@@ -296,7 +315,8 @@ dgnushack-compile."
                 ;; lpath.el binds it.
                 (not (eq (symbol-function 'libxml-parse-html-region)
                          'ignore)))
-      (setq files (delete "shr.el" files)))
+      (dolist (file '("color.el" "shr-color.el" "shr.el"))
+       (setq files (delete file files))))
 
     (dolist (file files)
       (setq file (expand-file-name file srcdir))