From: hayashi Date: Mon, 9 Jul 2001 06:27:40 +0000 (+0000) Subject: * egg-edep.el: Define compatibility functions. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=a97740746fe0daf6d9958480ab645810eeebb49e;p=elisp%2Ftamago.git * egg-edep.el: Define compatibility functions. (egg-characterp): New function. --- diff --git a/ChangeLog b/ChangeLog index b2413f2..1ab6fbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2001-07-09 Yoshiki Hayashi + * egg-edep.el: Define compatibility functions. + (egg-characterp): New function. + +2001-07-09 Yoshiki Hayashi + * its.el (its-mode-map): Use XEmacs compatible form to define keymap. diff --git a/egg-edep.el b/egg-edep.el index 8a93a96..47a16c9 100644 --- a/egg-edep.el +++ b/egg-edep.el @@ -31,40 +31,57 @@ ;;; Code: -(if (and (fboundp 'set-buffer-multibyte) - (subrp (symbol-function 'set-buffer-multibyte))) - ;; Emacs 20.3 +(if (featurep 'xemacs) (progn + (defun egg-characterp (char) + (characterp char)) (defun egg-char-bytes (x) 1) (defun egg-charset-bytes (x) 1) (defun egg-char-bytes-at (str pos) 1) (defun egg-chars-in-period (str pos len) len) (defalias 'egg-string-to-vector 'identity) (defalias 'egg-string-to-char-at 'aref) - ) - ;; Emacs 20.2 - (defun set-buffer-multibyte (flag) - (setq enable-multibyte-characters flag)) - (defalias 'string-as-unibyte 'identity) - (defalias 'string-as-multibyte 'identity) - (defalias 'coding-system-put 'put) - - (defalias 'egg-char-bytes 'char-bytes) - (defalias 'egg-charset-bytes 'charset-bytes) - (defun egg-char-bytes-at (str pos) - (char-bytes (egg-string-to-char-at str pos))) - (defun egg-chars-in-period (str pos len) - (chars-in-string (substring str pos (+ pos len)))) - (defalias 'egg-string-to-vector 'string-to-vector) - (defalias 'egg-string-to-char-at 'sref) - ) + (unless (fboundp 'set-buffer-multibyte) + (defun set-buffer-multibyte (ignored) + nil))) + (if (and (fboundp 'set-buffer-multibyte) + (subrp (symbol-function 'set-buffer-multibyte))) + ;; Emacs 20.3 + (progn + (defun egg-char-bytes (x) 1) + (defun egg-charset-bytes (x) 1) + (defun egg-char-bytes-at (str pos) 1) + (defun egg-chars-in-period (str pos len) len) + (defalias 'egg-string-to-vector 'identity) + (defalias 'egg-string-to-char-at 'aref) + ) + ;; Emacs 20.2 + (defun set-buffer-multibyte (flag) + (setq enable-multibyte-characters flag)) + (defalias 'string-as-unibyte 'identity) + (defalias 'string-as-multibyte 'identity) + (defalias 'coding-system-put 'put) + + (defalias 'egg-char-bytes 'char-bytes) + (defalias 'egg-charset-bytes 'charset-bytes) + (defun egg-char-bytes-at (str pos) + (char-bytes (egg-string-to-char-at str pos))) + (defun egg-chars-in-period (str pos len) + (chars-in-string (substring str pos (+ pos len)))) + (defalias 'egg-string-to-vector 'string-to-vector) + (defalias 'egg-string-to-char-at 'sref) + ) + (defun egg-characterp (char) + (numberp char))) ;; Elisp bug fix (defun egg-next-single-property-change (pos prop &optional object limit) - (if limit - (min limit (next-single-property-change pos prop object (1+ limit))) - (next-single-property-change pos prop object))) + (if (featurep 'xemacs) + (next-single-property-change pos prop object limit) + (if limit + (min limit (next-single-property-change pos prop object (1+ limit))) + (next-single-property-change pos prop object)))) (defun egg-string-match-charset (charset string &optional start) (let ((cur-ct (category-table))