From: morioka Date: Mon, 9 Mar 1998 07:04:30 +0000 (+0000) Subject: tm 6.73. X-Git-Tag: tm6_73~1 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=10a05263929f746884d85cc228ac03487449a06e;p=elisp%2Fapel.git tm 6.73. --- diff --git a/Makefile b/Makefile index 96bc1f1..d32f067 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 4.0 1995/05/22 13:10:38 morioka Exp morioka $ +# $Id: Makefile,v 6.0 1995/08/26 20:17:00 morioka Exp morioka $ # # Please specify emacs executables: @@ -27,30 +27,30 @@ TLDIR19 = $(HOME)/lib/emacs19/lisp FILES = tl/README.eng tl/Makefile tl/Makefile.bc tl/loadpath \ tl/*.el tl/doc/*.texi -TARFILE = tl6.0.tar +TARFILE = tl-6.5.tar nemacs: make -f Makefile.bc all \ EMACS=$(NEMACS) EMACS_TYPE=nemacs \ - TL18=tl-18.el OPT='-l tl-18.el' + EMU18=emu-18.el OPT='-l emu-18.el' install-nemacs: nemacs make -f Makefile.bc install \ EMACS=$(NEMACS) EMACS_TYPE=nemacs \ - TL18=tl-18.el OPT='-l tl-18.el' \ + EMU18=emu-18.el OPT='-l emu-18.el' \ TLDIR=$(TLDIR18) mule1: make -f Makefile.bc all \ EMACS=$(MULE1) EMACS_TYPE=mule \ - TL18=tl-18.el OPT='-l tl-18.el' + EMU18=emu-18.el OPT='-l emu-18.el' install-mule1: mule1 make -f Makefile.bc install \ EMACS=$(MULE1) EMACS_TYPE=mule \ - TL18=tl-18.el OPT='-l tl-18.el' \ + EMU18=emu-18.el OPT='-l emu-18.el' \ TLDIR=$(TLDIR18) diff --git a/emu-18.el b/emu-18.el new file mode 100644 index 0000000..9d20e8d --- /dev/null +++ b/emu-18.el @@ -0,0 +1,58 @@ +;;; +;;; emu-18: Emacs 19.* emulation module for Emacs 18.* +;;; +;;; $Id: emu-18.el,v 3.0 1995/08/26 18:07:06 morioka Exp $ +;;; + +;; This function is imported from AUC TeX. +(defun add-hook (hook function &optional append) + "Add to the value of HOOK the function FUNCTION. +FUNCTION is not added if already present. +FUNCTION is added (if necessary) at the beginning of the hook list +unless the optional argument APPEND is non-nil, in which case +FUNCTION is added at the end. + +HOOK should be a symbol, and FUNCTION may be any valid function. If +HOOK is void, it is first set to nil. If HOOK's value is a single +function, it is changed to a list of functions. +\[emu-18 Emacs 19 emulating function]" + (or (boundp hook) + (set hook nil) + ) + ;; If the hook value is a single function, turn it into a list. + (let ((old (symbol-value hook))) + (if (or (not (listp old)) + (eq (car old) 'lambda)) + (set hook (list old)) + )) + (or (if (consp function) + ;; Clever way to tell whether a given lambda-expression + ;; is equal to anything in the hook. + (let ((tail (assoc (cdr function) (symbol-value hook)))) + (equal function tail) + ) + (memq function (symbol-value hook)) + ) + (set hook + (if append + (nconc (symbol-value hook) (list function)) + (cons function (symbol-value hook)) + )) + )) + +(defun member (elt list) + "Return non-nil if ELT is an element of LIST. Comparison done with EQUAL. +The value is actually the tail of LIST whose car is ELT. +\[emu-18 Emacs 19 emulating function]" + (while (and list (not (equal elt (car list)))) + (setq list (cdr list))) + list) + +(defun defalias (SYM NEWDEF) + "Set SYMBOL's function definition to NEWVAL, and return NEWVAL. +Associates the function with the current load file, if any. +\[emu-18 Emacs 19 emulating function]" + (fset SYM (symbol-function NEWDEF)) + NEWDEF) + +(provide 'emu-18) diff --git a/emu-mule.el b/emu-mule.el new file mode 100644 index 0000000..2fd7140 --- /dev/null +++ b/emu-mule.el @@ -0,0 +1,46 @@ +;;; +;;; emu-mule: Mule 2.* emulation module for Mule +;;; +;;; $Id: emu-mule.el,v 6.1 1995/08/26 18:07:55 morioka Exp $ +;;; + +(defun some-element (pred seq) + "Return the first element of sequence SEQ +whose return value applied function PRED is not nil. +[emu-mule; tl-list function]" + (let ((i 0)(len (length seq)) element) + (catch 'tag + (while (< i len) + (if (funcall pred (setq element (elt seq i))) + (throw 'tag element) + ) + (setq i (+ i 1)) + )) + )) + +(defun get-lc (chr) + "Return leading character of CHAR or LEADING-CHARACTER." + (if (< chr 128) + lc-ascii + chr)) + + +(if (not (boundp 'emacs-major-version)) + (defconst emacs-major-version (string-to-int emacs-version)) + ) + +(cond ((>= emacs-major-version 19) + (defun fontset-pixel-size (fontset) + (elt + (get-font-info + (some-element + (function + (lambda (n) + (not (= n -1)) + )) + (cdr (get-fontset-info fontset)) + )) 5)) + ) + (t (require 'emu-18))) + +(provide 'emu-mule) diff --git a/emu-nemacs.el b/emu-nemacs.el new file mode 100644 index 0000000..709ed48 --- /dev/null +++ b/emu-nemacs.el @@ -0,0 +1,105 @@ +;;; +;;; emu-nemacs: Mule 2 emulation module for NEmacs +;;; +;;; $Id: emu-nemacs.el,v 5.0 1995/08/26 17:56:33 morioka Exp $ +;;; + +(require 'emu-18) + + +;;; @ constants +;;; + +(defconst emacs-major-version (string-to-int emacs-version)) + +(defconst *junet* 2) +(defconst *internal* 3) +(defconst *euc-japan* 3) + +(defconst lc-ascii 0) +(defconst lc-jp 146) + +;; by mol. 1993/9/26 +(defun string-width (str) + "Return number of columns STRING will occupy. + [Mule compatible function in tm-nemacs]" + (length str)) + +(defun char-bytes (chr) + "Return number of bytes CHAR will occupy in a buffer. + [Mule compatible function in tm-nemacs]" + (if (< chr 128) 1 2)) + +(defun char-width (chr) + "Return number of columns CHAR will occupy when displayed. + [Mule compatible function in tm-nemacs]" + (if (< chr 128) 1 2)) + +(defun code-convert-string (str ic oc) + "Convert code in STRING from SOURCE code to TARGET code, +On successful converion, returns the result string, +else returns nil. [Mule compatible function in tm-nemacs]" + (if (not (eq ic oc)) + (convert-string-kanji-code str ic oc) + str)) + +(defun check-ASCII-string (str) + (let ((i 0) + len) + (setq len (length str)) + (catch 'label + (while (< i len) + (if (>= (elt str i) 128) + (throw 'label nil)) + (setq i (+ i 1)) + ) + str))) + +(defun get-lc (chr) + "Return leading character of CHAR or LEADING-CHARACTER." + (if (< chr 128) + lc-ascii + lc-jp)) + + +;; by YAMATE Keiichirou 1994/10/28 +(defun attribute-add-narrow-attribute (attr from to) + (or (consp (symbol-value attr)) + (set attr (list 1))) + (let* ((attr-value (symbol-value attr)) + (len (car attr-value)) + (posfrom 1) + posto) + (while (and (< posfrom len) + (> from (nth posfrom attr-value))) + (setq posfrom (1+ posfrom))) + (setq posto posfrom) + (while (and (< posto len) + (> to (nth posto attr-value))) + (setq posto (1+ posto))) + (if (= posto posfrom) + (if (= (% posto 2) 1) + (if (and (< to len) + (= to (nth posto attr-value))) + (set-marker (nth posto attr-value) from) + (setcdr (nthcdr (1- posfrom) attr-value) + (cons (set-marker-type (set-marker (make-marker) + from) + 'point-type) + (cons (set-marker-type (set-marker (make-marker) + to) + nil) + (nthcdr posto attr-value)))) + (setcar attr-value (+ len 2)))) + (if (= (% posfrom 2) 0) + (setq posfrom (1- posfrom)) + (set-marker (nth posfrom attr-value) from)) + (if (= (% posto 2) 0) + nil + (setq posto (1- posto)) + (set-marker (nth posto attr-value) to)) + (setcdr (nthcdr posfrom attr-value) + (nthcdr posto attr-value))))) + + +(provide 'emu-nemacs) diff --git a/emu.el b/emu.el new file mode 100644 index 0000000..e0c1c11 --- /dev/null +++ b/emu.el @@ -0,0 +1,24 @@ +;;; +;;; emu: Emulation module for each Emacs variants +;;; +;;; $Id: emu.el,v 1.1 1995/08/26 18:22:56 morioka Exp $ +;;; + +(cond ((boundp 'MULE) (require 'emu-mule)) + ((boundp 'NEMACS)(require 'emu-nemacs)) + (t (require 'emu-orig)) + ) + + +;;; @ Emacs 19.29 emulation +;;; + +(if (not (fboundp 'buffer-substring-no-properties)) + (defalias 'buffer-substring-no-properties 'buffer-substring) + ) + + +;;; @ end +;;; + +(provide 'emu)