2 ;;; emu-nemacs: Mule 2 emulation module for NEmacs
4 ;;; $Id: emu-nemacs.el,v 5.0 1995/08/26 17:56:33 morioka Exp $
13 (defconst emacs-major-version (string-to-int emacs-version))
16 (defconst *internal* 3)
17 (defconst *euc-japan* 3)
23 (defun string-width (str)
24 "Return number of columns STRING will occupy.
25 [Mule compatible function in tm-nemacs]"
28 (defun char-bytes (chr)
29 "Return number of bytes CHAR will occupy in a buffer.
30 [Mule compatible function in tm-nemacs]"
33 (defun char-width (chr)
34 "Return number of columns CHAR will occupy when displayed.
35 [Mule compatible function in tm-nemacs]"
38 (defun code-convert-string (str ic oc)
39 "Convert code in STRING from SOURCE code to TARGET code,
40 On successful converion, returns the result string,
41 else returns nil. [Mule compatible function in tm-nemacs]"
43 (convert-string-kanji-code str ic oc)
46 (defun check-ASCII-string (str)
49 (setq len (length str))
52 (if (>= (elt str i) 128)
59 "Return leading character of CHAR or LEADING-CHARACTER."
65 ;; by YAMATE Keiichirou 1994/10/28
66 (defun attribute-add-narrow-attribute (attr from to)
67 (or (consp (symbol-value attr))
69 (let* ((attr-value (symbol-value attr))
70 (len (car attr-value))
73 (while (and (< posfrom len)
74 (> from (nth posfrom attr-value)))
75 (setq posfrom (1+ posfrom)))
77 (while (and (< posto len)
78 (> to (nth posto attr-value)))
79 (setq posto (1+ posto)))
83 (= to (nth posto attr-value)))
84 (set-marker (nth posto attr-value) from)
85 (setcdr (nthcdr (1- posfrom) attr-value)
86 (cons (set-marker-type (set-marker (make-marker)
89 (cons (set-marker-type (set-marker (make-marker)
92 (nthcdr posto attr-value))))
93 (setcar attr-value (+ len 2))))
94 (if (= (% posfrom 2) 0)
95 (setq posfrom (1- posfrom))
96 (set-marker (nth posfrom attr-value) from))
99 (setq posto (1- posto))
100 (set-marker (nth posto attr-value) to))
101 (setcdr (nthcdr posfrom attr-value)
102 (nthcdr posto attr-value)))))
105 (provide 'emu-nemacs)