2 ;;; emu-mule.el --- Mule 2.* emulation module for Mule
4 ;;; Copyright (C) 1995 Free Software Foundation, Inc.
5 ;;; Copyright (C) 1994,1995 MORIOKA Tomohiko
7 ;;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
9 ;;; $Id: emu-mule.el,v 7.2 1996/04/17 15:17:24 morioka Exp $
10 ;;; Keywords: emulation, compatibility, Mule
12 ;;; This file is part of tl (Tiny Library).
14 ;;; This program is free software; you can redistribute it and/or
15 ;;; modify it under the terms of the GNU General Public License as
16 ;;; published by the Free Software Foundation; either version 2, or
17 ;;; (at your option) any later version.
19 ;;; This program 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 GNU
22 ;;; General Public License for more details.
24 ;;; You should have received a copy of the GNU General Public License
25 ;;; along with This program. If not, write to the Free Software
26 ;;; Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
30 (defun some-element (pred seq)
31 "Return the first element of sequence SEQ
32 whose return value applied function PRED is not nil.
33 [emu-mule; tl-list function]"
34 (let ((i 0)(len (length seq)) element)
37 (if (funcall pred (setq element (elt seq i)))
45 ;;; @ leading-character
49 "Return leading character of CHAR or LEADING-CHARACTER."
55 ;;; @ version specific features
58 (cond (running-emacs-19
60 (defun fontset-pixel-size (fontset)
68 (cdr (get-fontset-info fontset))
73 (defun tl:make-overlay (beg end &optional buffer type))
74 (defun tl:overlay-put (overlay prop value))
75 (defun tl:add-text-properties (start end properties &optional object))
79 ;;; @@ truncate-string
82 (or (fboundp 'truncate-string)
83 ;;; Imported from Mule-2.3
84 (defun truncate-string (str width &optional start-column)
85 "Truncate STR to fit in WIDTH columns.
86 Optional non-nil arg START-COLUMN specifies the starting column.
87 \[emu-mule.el; Mule 2.3 emulating function]"
89 (setq start-column 0))
90 (let ((max-width (string-width str))
95 (if (>= width max-width)
96 (setq width max-width))
97 (if (>= start-column width)
99 (while (< column start-column)
100 (setq ch (aref str from)
101 column (+ column (char-width ch))
102 from (+ from (char-bytes ch))))
103 (if (< width max-width)
106 (while (<= column width)
107 (setq ch (aref str to)
108 column (+ column (char-width ch))
110 to (+ to (char-bytes ch))))
112 (substring str from to))))
122 ;;; emu-mule.el ends here