+(load (expand-file-name "lpath.el" srcdir) nil t t)
+
+(load (expand-file-name "gnus-clfns.el" srcdir) nil t t)
+
+(when (boundp 'MULE)
+ ;; Bind the function `base64-encode-string' before loading canlock.
+ ;; Since canlock will bind it as an autoloaded function, it causes
+ ;; damage to define the function by MEL.
+ (load (expand-file-name "base64.el" srcdir) nil t t)
+ ;; Load special macros for compiling canlock.el.
+ (load (expand-file-name "canlock-om.el" srcdir) nil t t))
+
+(require 'custom)
+
+;; Bind functions defined by `defun-maybe'.
+(put 'defun-maybe 'byte-hunk-handler 'byte-compile-file-form-defun-maybe)
+(defun byte-compile-file-form-defun-maybe (form)
+ (if (and (not (fboundp (nth 1 form)))
+ (memq 'unresolved byte-compile-warnings))
+ (setq byte-compile-function-environment
+ (cons (cons (nth 1 form)
+ (cons 'lambda (cdr (cdr form))))
+ byte-compile-function-environment)))
+ form)
+
+(condition-case nil
+ :symbol-for-testing-whether-colon-keyword-is-available-or-not
+ (void-variable
+ (defun dgnushack-bind-colon-keywords ()
+ "Bind all the colon keywords for old Emacsen."
+ (let ((cache (expand-file-name "dgnuskwds.el" srcdir))
+ (makefile (expand-file-name "Makefile" srcdir))
+ (buffer (get-buffer-create " *colon keywords*"))
+ keywords ignores files file dirs dir form elem make-backup-files)
+ (save-excursion
+ (set-buffer buffer)
+ (let (buffer-file-format
+ format-alist
+ insert-file-contents-post-hook
+ insert-file-contents-pre-hook
+ jam-zcat-filename-list
+ jka-compr-compression-info-list)
+ (if (and (file-exists-p cache)
+ (file-exists-p makefile)
+ (file-newer-than-file-p cache makefile))
+ (progn
+ (insert-file-contents cache nil nil nil t)
+ (setq keywords (read buffer)))
+ (setq
+ ignores
+ '(:symbol-for-testing-whether-colon-keyword-is-available-or-not
+ ;; The following keywords will be bound by CUSTOM.
+ :get :group :initialize :link :load :options :prefix
+ :require :set :tag :type)
+ files (list (locate-library "semi-def")
+ (locate-library "mailcap")
+ (locate-library "mime-def")
+ (locate-library "path-util")
+ (locate-library "poem"))
+ dirs (list (file-name-as-directory (expand-file-name srcdir))))
+ (while files
+ (when (setq file (pop files))
+ (setq dir (file-name-directory file))
+ (unless (member dir dirs)
+ (push dir dirs))))
+ (message "Searching for all the colon keywords in:")
+ (while dirs
+ (setq dir (pop dirs))
+ (message " %s..." dir)
+ (setq files (directory-files dir t
+ "\\.el\\(\\.gz\\|\\.bz2\\)?$"))
+ (while files
+ (setq file (pop files))
+ (if (string-match "\\(\\.gz$\\)\\|\\.bz2$" file)
+ (let ((temp (expand-file-name "dgnustemp.el" srcdir)))
+ (when
+ (let* ((binary (if (boundp 'MULE)
+ '*noconv*
+ 'binary))
+ (coding-system-for-read binary)
+ (coding-system-for-write binary)
+ (input-coding-system binary)
+ (output-coding-system binary)
+ (default-process-coding-system
+ (cons binary binary))
+ call-process-hook)
+ (insert-file-contents file nil nil nil t)
+ (when
+ (condition-case code
+ (progn
+ (if (match-beginning 1)
+ (call-process-region
+ (point-min) (point-max)
+ "gzip" t buffer nil "-cd")
+ (call-process-region
+ (point-min) (point-max)
+ "bzip2" t buffer nil "-d"))
+ t)
+ (error
+ (erase-buffer)
+ (message "In file %s: %s" file code)
+ nil))
+ (write-region (point-min) (point-max) temp
+ nil 'silent)
+ t))
+ (unwind-protect
+ (insert-file-contents temp nil nil nil t)
+ (delete-file temp))))
+ (insert-file-contents file nil nil nil t))
+ (while (setq form (condition-case nil
+ (read buffer)
+ (error nil)))
+ (when (listp form)
+ (while form
+ (setq elem (pop form))
+ (unless (memq (car-safe elem)
+ '(defcustom defface defgroup
+ define-widget quote))
+ (while (consp elem)
+ (push (car elem) form)
+ (setq elem (cdr elem)))
+ (when (and elem
+ (symbolp elem)
+ (not (eq ': elem))
+ (eq ?: (aref (symbol-name elem) 0))
+ (not (memq elem ignores))
+ (not (memq elem keywords)))
+ (push elem keywords))))))))
+ (setq keywords (sort keywords
+ (lambda (a b)
+ (string-lessp (symbol-name a)
+ (symbol-name b)))))
+ (erase-buffer)
+ (insert (format "%s" keywords))
+ (write-region (point-min) (point) cache nil 'silent)
+ (message
+ "The following colon keywords will be bound at run-time:\n %s"
+ keywords))))
+ (kill-buffer buffer)
+ (defconst dgnushack-colon-keywords keywords)
+ (while keywords
+ (set (car keywords) (car keywords))
+ (setq keywords (cdr keywords)))))
+ (byte-compile 'dgnushack-bind-colon-keywords)
+ (dgnushack-bind-colon-keywords)))
+
+(when (boundp 'MULE)
+ (setq :version ':version
+ :set-after ':set-after)
+ (require 'custom)
+ (defadvice custom-handle-keyword
+ (around dont-signal-an-error-even-if-unsupported-keyword-is-given
+ activate)
+ "Don't signal an error even if unsupported keyword is given."
+ (if (not (memq (ad-get-arg 1) '(:version :set-after)))
+ ad-do-it)))
+
+(when (boundp 'MULE)
+ (put 'custom-declare-face 'byte-optimizer
+ 'byte-optimize-ignore-unsupported-custom-keywords)
+ (put 'custom-declare-group 'byte-optimizer
+ 'byte-optimize-ignore-unsupported-custom-keywords)
+ (defun byte-optimize-ignore-unsupported-custom-keywords (form)
+ (if (or (memq ':version (nthcdr 4 form))
+ (memq ':set-after (nthcdr 4 form)))
+ (let ((newform (list (car form) (nth 1 form)
+ (nth 2 form) (nth 3 form)))
+ (args (nthcdr 4 form)))
+ (while args
+ (or (memq (car args) '(:version :set-after))
+ (setq newform (nconc newform (list (car args)
+ (car (cdr args))))))
+ (setq args (cdr (cdr args))))
+ newform)
+ form))
+
+ (put 'custom-declare-variable 'byte-hunk-handler
+ 'byte-compile-file-form-custom-declare-variable)
+ (defun byte-compile-file-form-custom-declare-variable (form)
+ ;; Bind defcustom'ed variables.
+ (if (memq 'free-vars byte-compile-warnings)
+ (setq byte-compile-bound-variables
+ (cons (nth 1 (nth 1 form)) byte-compile-bound-variables)))
+ (if (memq ':version (nthcdr 4 form))
+ ;; Make the variable uncustomizable.
+ `(defvar ,(nth 1 (nth 1 form)) ,(nth 1 (nth 2 form))
+ ,(substring (nth 3 form) (if (string-match "^[\t *]+" (nth 3 form))
+ (match-end 0)
+ 0)))
+ ;; Ignore unsupported keyword(s).
+ (if (memq ':set-after (nthcdr 4 form))
+ (let ((newform (list (car form) (nth 1 form)
+ (nth 2 form) (nth 3 form)))
+ (args (nthcdr 4 form)))
+ (while args
+ (or (eq (car args) ':set-after)
+ (setq newform (nconc newform (list (car args)
+ (car (cdr args))))))
+ (setq args (cdr (cdr args))))
+ newform)
+ form)))
+
+ (defadvice byte-compile-inline-expand (around ignore-built-in-functions
+ (form) activate)
+ "Ignore built-in functions."
+ (let* ((name (car form))
+ (fn (and (fboundp name)
+ (symbol-function name))))
+ (if (subrp fn)
+ ;; Give up on inlining.
+ (setq ad-return-value form)
+ ad-do-it))))
+
+;; Unknown variables and functions.
+(unless (boundp 'buffer-file-coding-system)
+ (defvar buffer-file-coding-system (symbol-value 'file-coding-system)))
+(unless (featurep 'xemacs)
+ (defalias 'Custom-make-dependencies 'ignore)
+ (defalias 'update-autoloads-from-directory 'ignore))