;;; 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))