1 ;; egg-edep.el --- This file serves Emacs version dependent definitions
3 ;; Copyright (C) 1999,2000 PFU LIMITED
5 ;; Author: NIIBE Yutaka <gniibe@chroot.org>
6 ;; KATAYAMA Yoshio <kate@pfu.co.jp>
8 ;; Maintainer: TOMURA Satoru <tomura@etl.go.jp>
10 ;; Keywords: mule, multilingual, input method
12 ;; This file is part of EGG.
14 ;; EGG is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by
16 ;; the Free Software Foundation; either version 2, or (at your option)
19 ;; EGG is distributed in the hope that it will be useful,
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 ;; GNU General Public License for more details.
24 ;; You should have received a copy of the GNU General Public License
25 ;; along with GNU Emacs; see the file COPYING. If not, write to the
26 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27 ;; Boston, MA 02111-1307, USA.
34 (if (and (fboundp 'set-buffer-multibyte)
35 (subrp (symbol-function 'set-buffer-multibyte)))
38 (defun egg-char-bytes (x) 1)
39 (defun egg-charset-bytes (x) 1)
40 (defun egg-char-bytes-at (str pos) 1)
41 (defun egg-chars-in-period (str pos len) len)
42 (defalias 'egg-string-to-vector 'identity)
43 (defalias 'egg-string-to-char-at 'aref)
46 (defun set-buffer-multibyte (flag)
47 (setq enable-multibyte-characters flag))
48 (defalias 'string-as-unibyte 'identity)
49 (defalias 'string-as-multibyte 'identity)
50 (defalias 'coding-system-put 'put)
52 (defalias 'egg-char-bytes 'char-bytes)
53 (defalias 'egg-charset-bytes 'charset-bytes)
54 (defun egg-char-bytes-at (str pos)
55 (char-bytes (egg-string-to-char-at str pos)))
56 (defun egg-chars-in-period (str pos len)
57 (chars-in-string (substring str pos (+ pos len))))
58 (defalias 'egg-string-to-vector 'string-to-vector)
59 (defalias 'egg-string-to-char-at 'sref)
64 (defun egg-next-single-property-change (pos prop &optional object limit)
66 (min limit (next-single-property-change pos prop object (1+ limit)))
67 (next-single-property-change pos prop object)))
69 (defun egg-string-match-charset (charset string &optional start)
70 (let ((cur-ct (category-table))
74 (set-category-table (copy-category-table))
75 (setq category (get-unused-category))
76 (define-category category "")
77 (modify-category-entry (make-char charset) category)
78 (string-match (concat "\\c" (list category) "+") string start))
79 (set-category-table cur-ct))))
81 (unless (egg-string-match-charset 'japanese-jisx0208 "
\e$B!#
\e(B")
82 (defun egg-string-match-charset (charset string &optional start)
84 (if (= (charset-chars charset) 94)
86 (setq min 32 max 127))
87 (string-match (if (= (charset-dimension charset) 1)
88 (concat "[" (list (make-char charset min))
89 "-" (list (make-char charset max))
91 (concat "[" (list (make-char charset min min))
92 "-" (list (make-char charset max max))