1 ;; This file serves Emacs version dependent definitions
3 (if (and (fboundp 'set-buffer-multibyte)
4 (subrp (symbol-function 'set-buffer-multibyte)))
7 (defun egg-char-bytes (x) 1)
8 (defun egg-charset-bytes (x) 1)
9 (defun egg-char-bytes-at (str pos) 1)
10 (defun egg-chars-in-period (str pos len) len)
11 (defalias 'egg-string-to-vector 'identity)
12 (defalias 'egg-string-to-char-at 'aref)
15 (defun set-buffer-multibyte (flag)
16 (setq enable-multibyte-characters flag))
17 (defalias 'string-as-unibyte 'identity)
18 (defalias 'string-as-multibyte 'identity)
19 (defalias 'coding-system-put 'put)
21 (defalias 'egg-char-bytes 'char-bytes)
22 (defalias 'egg-charset-bytes 'charset-bytes)
23 (defun egg-char-bytes-at (str pos)
24 (char-bytes (egg-string-to-char-at str pos)))
25 (defun egg-chars-in-period (str pos len)
26 (chars-in-string (substring str pos (+ pos len))))
27 (defalias 'egg-string-to-vector 'string-to-vector)
28 (defun egg-string-to-char-at (str pos)
29 (let ((c (aref str pos)))
32 (>= (1+ pos) (length str))
33 (< (aref str (1+ pos)) ?\240))
35 (string-match "[\240-\377]+" str (1+ pos))
36 (string-to-char (substring str pos (match-end 0))))))
41 (defun egg-next-single-property-change (pos prop &optional object limit)
42 (min limit (next-single-property-change pos prop object (1+ limit))))