--- cvs-compat.el.orig Mon Mar 6 06:32:21 2000 +++ cvs-compat.el Wed Nov 1 17:30:04 2000 @@ -30,6 +30,19 @@ (require 'cl) ;;;; +;;;; :-Keywords +;;;; + +(eval-and-compile + (funcall (lambda (keys) + (let ((keywords keys)) + (while keywords + (or (boundp (car keywords)) + (set (car keywords) (car keywords))) + (setq keywords (cdr keywords))))) + '(:dense :inherit :postproc :show))) + +;;;; ;;;; String Processing ;;;; @@ -66,6 +79,18 @@ (defmacro with-current-buffer (buf &rest body) `(save-current-buffer (set-buffer ,buf) ,@body))) +;; doesn't exist in Emacs < 20.1 +(unless (fboundp 'with-temp-buffer) + (defmacro with-temp-buffer (&rest body) + (let ((temp-buffer (make-symbol "temp-buffer"))) + `(let ((,temp-buffer + (get-buffer-create (generate-new-buffer-name " *temp*")))) + (unwind-protect + (with-current-buffer ,temp-buffer + ,@body) + (and (buffer-name ,temp-buffer) + (kill-buffer ,temp-buffer))))))) + ;;;; ;;;; Keymaps ;;;; @@ -113,6 +138,19 @@ (defmacro defface (sym val str &rest rest) `(defvar ,sym (make-face ',sym) ,str))) +(load "bytecomp" nil t) +(unless (fboundp 'byte-compile-file-form-custom-declare-variable) + ;; Bind defcustom'ed variables. + (put 'custom-declare-variable 'byte-hunk-handler + 'byte-compile-file-form-custom-declare-variable) + (defun byte-compile-file-form-custom-declare-variable (form) + (if (memq 'free-vars byte-compile-warnings) + (setq byte-compile-bound-variables + (cons (nth 1 (nth 1 form)) byte-compile-bound-variables))) + form)) + +;;(setq byte-compile-warnings '(free-vars unresolved callargs redefine)) + ;;;; ;;;; missing functions in XEmacs ;;;; @@ -134,6 +172,12 @@ (unless (fboundp 'read-directory-name) (defalias 'read-directory-name 'read-file-name)) +;; doesn't exist in Emacs < 20.1 nor XEmacs < 20.3 +(unless (fboundp 'functionp) + (defun functionp (object) + (or (subrp object) (byte-code-function-p object) + (eq (car-safe object) 'lambda) + (and (symbolp object) (fboundp object))))) (provide 'cvs-compat) ;;; cvs-compat.el ends here