From d0a84773625bfb095dd2c60e5480983e68fbf371 Mon Sep 17 00:00:00 2001 From: morioka Date: Tue, 10 Mar 1998 04:45:06 +0000 Subject: [PATCH] tm 7.82. --- ChangeLog | 59 +++++++++++++++++++++++++++++++++++++++++++++ emu-e19.el | 57 ++++++++++++++++++++++++++++--------------- emu-mule.el | 9 ++++++- emu-nemacs.el | 75 ++++++++++++++++++++++++++++++++++++++++----------------- emu.el | 24 +++++++++++++++--- install.el | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 6 files changed, 248 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27afe3a..1060534 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,62 @@ +Thu Sep 5 13:28:51 1996 MORIOKA Tomohiko + + * tl: Version 7.61.2 was released. + + * emu-nemacs.el (encode-coding-region): New function. + + * emu-nemacs.el (decode-coding-region): New function. + + * emu-nemacs.el (encode-coding-string): New function. + +Thu Sep 5 12:29:01 1996 MORIOKA Tomohiko + + * emu-e19.el (decode-coding-region): New function. + (encode-coding-region): New function. + + * emu-e19.el (encode-coding-string): New function. + +Thu Sep 5 08:58:28 1996 MORIOKA Tomohiko + + * emu-mule.el (charsets-mime-charset-alist): add gb2312 + charset. (cf. [kanji:704]) + + * smiley-mule.el: Comment was fixed. (cf. [tm-ja:2074]) + +Wed Sep 4 21:20:32 1996 MORIOKA Tomohiko + + * emu-mule.el (encode-coding-region): New function. + + * tl-list.el (ASSOC): New function. + +Wed Sep 4 19:00:01 1996 MORIOKA Tomohiko + + * TL-ELS: add cless.el. + + * tl-list.el: Use cless.el if new cl is installed. + +Wed Sep 4 18:39:20 1996 MORIOKA Tomohiko + + * cless.el: New module. + +Wed Sep 4 15:49:30 1996 MORIOKA Tomohiko + + * install.el (install-detect-elisp-directory): New function. + +Wed Sep 4 13:24:03 1996 MORIOKA Tomohiko + + * install.el (install-prefix): New variable. + (install-elisp-prefix): New variable. + (install-default-elisp-directory): New variable. + +Wed Sep 4 11:00:37 1996 MORIOKA Tomohiko + + * emu.el (buffer-live-p): New function. (cf. [tm-ja:2072]) + +Wed Sep 4 01:25:35 1996 Katsumi Yamaoka + + * smiley-mule.el: add DOC-strings for smiley-bitmap-for-*. + + Tue Sep 3 15:02:47 1996 MORIOKA Tomohiko * tl: Version 7.61.1 was released. diff --git a/emu-e19.el b/emu-e19.el index 7811db9..817d63f 100644 --- a/emu-e19.el +++ b/emu-e19.el @@ -4,7 +4,7 @@ ;; Author: MORIOKA Tomohiko ;; Version: -;; $Id: emu-e19.el,v 7.32 1996/08/17 03:25:51 morioka Exp $ +;; $Id: emu-e19.el,v 7.35 1996/09/05 12:29:01 morioka Exp $ ;; Keywords: emulation, compatibility, mule, Latin-1 ;; This file is part of tl (Tiny Library). @@ -84,7 +84,7 @@ (list lc-ltn1) )) -;;; @@ for Mule emulation +;;; @@ for old MULE emulation ;;; (defconst lc-ascii 0) @@ -98,23 +98,26 @@ (defconst *ctext* nil) (defconst *noconv* nil) -(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. [emu-e19.el; Mule emulating function]" - str) - -(defun code-convert-region (beg end ic oc) - "Convert code of the text between BEGIN and END from SOURCE -to TARGET. On successful conversion returns t, -else returns nil. [emu-e19.el; Mule emulating function]" - t) - (defun decode-coding-string (string coding-system) "Decode the STRING which is encoded in CODING-SYSTEM. -\[emu-e19.el]" +\[emu-e19.el; EMACS 20 emulating function]" + string) + +(defun encode-coding-string (string coding-system) + "Encode the STRING as CODING-SYSTEM. +\[emu-e19.el; EMACS 20 emulating function]" string) +(defun decode-coding-region (start end coding-system) + "Decode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-e19.el; EMACS 20 emulating function]" + 0) + +(defun encode-coding-region (start end coding-system) + "Encode the text between START and END to CODING-SYSTEM. +\[emu-e19.el; EMACS 20 emulating function]" + 0) + (defun code-detect-region (beg end) "Detect coding-system of the text in the region between START and END. [emu-e19.el; Mule emulating function]" @@ -129,6 +132,22 @@ between START and END. [emu-e19.el; Mule emulating function]" ))) +;;; @@ for old MULE emulation +;;; + +(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. [emu-e19.el; old MULE emulating function]" + str) + +(defun code-convert-region (beg end ic oc) + "Convert code of the text between BEGIN and END from SOURCE +to TARGET. On successful conversion returns t, +else returns nil. [emu-e19.el; old MULE emulating function]" + t) + + ;;; @ MIME charset ;;; @@ -188,7 +207,7 @@ between START and END. [emu-e19.el; Mule emulating function]" (defun char-bytes (char) "Return number of bytes a character in CHAR occupies in a buffer. -\[emu-e19.el; Mule emulating function]" +\[emu-e19.el; MULE emulating function]" 1) (defalias 'char-length 'char-bytes) @@ -198,7 +217,7 @@ between START and END. [emu-e19.el; Mule emulating function]" \[emu-nemacs.el]" 1) -;;; @@ for Mule emulation +;;; @@ for old MULE emulation ;;; (defalias 'char-width 'char-columns) @@ -222,13 +241,13 @@ between START and END. [emu-e19.el; Mule emulating function]" (defun truncate-string (str width &optional start-column) "Truncate STR to fit in WIDTH columns. Optional non-nil arg START-COLUMN specifies the starting column. -\[emu-e19.el; Mule 2.3 emulating function]" +\[emu-e19.el; MULE 2.3 emulating function]" (or start-column (setq start-column 0)) (substring str start-column width) ) -;;; @@ for Mule emulation +;;; @@ for old MULE emulation ;;; (defalias 'string-width 'length) diff --git a/emu-mule.el b/emu-mule.el index 73e639e..9d63e5f 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -4,7 +4,7 @@ ;; Author: MORIOKA Tomohiko ;; Version: -;; $Id: emu-mule.el,v 7.48 1996/08/22 16:21:21 morioka Exp $ +;; $Id: emu-mule.el,v 7.50 1996/09/05 08:58:28 morioka Exp $ ;; Keywords: emulation, compatibility, Mule ;; This file is part of tl (Tiny Library). @@ -68,6 +68,12 @@ ;;; @ coding system ;;; +(defun encode-coding-region (start end coding-system) + "Encode the text between START and END to CODING-SYSTEM. +\[emu-mule.el; EMACS 20 emulating function]" + (code-convert-region start end *internal* coding-system) + ) + (defun decode-coding-string (str coding-system) "Decode the string STR which is encoded in CODING-SYSTEM. \[emu-mule.el]" @@ -115,6 +121,7 @@ (cons (list lc-ascii lc-ltn5) 'iso-8859-9) (cons (list lc-ascii lc-roman lc-jpold lc-jp) 'iso-2022-jp) (cons (list lc-ascii lc-kr) 'euc-kr) + (cons (list lc-ascii lc-cn) 'gb2312) (cons (list lc-ascii lc-big5-1 lc-big5-2) 'big5) (cons (list lc-ascii lc-roman lc-ltn1 lc-grk lc-jpold lc-cn lc-jp lc-kr lc-jp2) 'iso-2022-jp-2) diff --git a/emu-nemacs.el b/emu-nemacs.el index c485326..ebf12ae 100644 --- a/emu-nemacs.el +++ b/emu-nemacs.el @@ -4,7 +4,7 @@ ;; Author: MORIOKA Tomohiko ;; Version: -;; $Id: emu-nemacs.el,v 7.40 1996/08/18 06:39:40 morioka Exp $ +;; $Id: emu-nemacs.el,v 7.43 1996/09/05 13:28:51 morioka Exp $ ;; Keywords: emulation, compatibility, NEmacs, mule ;; This file is part of tl (Tiny Library). @@ -91,7 +91,7 @@ ) str))) -;;; @@ for Mule emulation +;;; @@ for old MULE emulation ;;; (defconst lc-ascii 0) @@ -108,33 +108,42 @@ (defconst *internal* 3) (defconst *euc-japan* 3) -(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. [emu-nemacs.el; Mule emulating function]" - (if (not (eq ic oc)) - (convert-string-kanji-code str ic oc) - str)) - -(defun code-convert-region (beg end ic oc) - "Convert code of the text between BEGIN and END from SOURCE -to TARGET. On successful conversion returns t, -else returns nil. [emu-nemacs.el; Mule emulating function]" - (if (/= ic oc) - (save-excursion - (save-restriction - (narrow-to-region beg end) - (convert-region-kanji-code beg end ic oc) - )))) - (defun decode-coding-string (string coding-system) "Decode the STRING which is encoded in CODING-SYSTEM. -\[emu-nemacs.el]" +\[emu-nemacs.el; EMACS 20 emulating function]" (if (eq coding-system 3) string (convert-string-kanji-code string coding-system 3) )) +(defun encode-coding-string (string coding-system) + "Encode the STRING to CODING-SYSTEM. +\[emu-nemacs.el; EMACS 20 emulating function]" + (if (eq coding-system 3) + string + (convert-string-kanji-code string 3 coding-system) + )) + +(defun decode-coding-region (start end coding-system) + "Decode the text between START and END which is encoded in CODING-SYSTEM. +\[emu-nemacs.el; EMACS 20 emulating function]" + (if (/= ic oc) + (save-excursion + (save-restriction + (narrow-to-region start end) + (convert-region-kanji-code start end coding-system 3) + )))) + +(defun encode-coding-region (start end coding-system) + "Encode the text between START and END to CODING-SYSTEM. +\[emu-nemacs.el; EMACS 20 emulating function]" + (if (/= ic oc) + (save-excursion + (save-restriction + (narrow-to-region start end) + (convert-region-kanji-code start end 3 coding-system) + )))) + (defun code-detect-region (start end) "Detect coding-system of the text in the region between START and END. \[emu-nemacs.el; Mule emulating function]" @@ -160,6 +169,28 @@ else returns nil. [emu-nemacs.el; Mule emulating function]" (,@ body) ))) +;;; @@ for old MULE emulation +;;; + +(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. [emu-nemacs.el; Mule emulating function]" + (if (not (eq ic oc)) + (convert-string-kanji-code str ic oc) + str)) + +(defun code-convert-region (beg end ic oc) + "Convert code of the text between BEGIN and END from SOURCE +to TARGET. On successful conversion returns t, +else returns nil. [emu-nemacs.el; Mule emulating function]" + (if (/= ic oc) + (save-excursion + (save-restriction + (narrow-to-region beg end) + (convert-region-kanji-code beg end ic oc) + )))) + ;;; @ MIME charset ;;; diff --git a/emu.el b/emu.el index 1d32f1e..c460ebc 100644 --- a/emu.el +++ b/emu.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1995,1996 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: $Id: emu.el,v 7.22 1996/08/18 07:30:38 morioka Exp $ +;; Version: $Id: emu.el,v 7.24 1996/09/04 15:49:30 morioka Exp $ ;; Keywords: emulation, compatibility, NEmacs, Mule, XEmacs ;; This file is part of tl (Tiny Library). @@ -97,12 +97,13 @@ and `default-mime-charset'. [emu.el]" default-mime-charset))) -;;; @ Emacs 19.29 emulation +;;; @ EMACS 19.29 emulation ;;; (or (fboundp 'buffer-substring-no-properties) (defun buffer-substring-no-properties (beg end) - "Return the text from BEG to END, without text properties, as a string." + "Return the text from BEG to END, without text properties, as a string. +\[emu.el; EMACS 19.29 emulating function]" (let ((string (buffer-substring beg end))) (tl:set-text-properties 0 (length string) nil string) string)) @@ -131,12 +132,27 @@ See `read-from-minibuffer' for details of HISTORY argument." If you want to use `add-to-list' on a variable that is not defined until a certain package is loaded, you should put the call to `add-to-list' into a hook function that will be run only after loading the package. -\[emu.el; Emacs 19.30 emulating function]" +\[emu.el; EMACS 19.30 emulating function]" (or (member element (symbol-value list-var)) (set list-var (cons element (symbol-value list-var))))) ) +;;; @ EMACS 19.32 emulation +;;; + +(or (fboundp 'buffer-live-p) + (defun buffer-live-p (object) + "Return non-nil if OBJECT is a buffer which has not been killed. +Value is nil if OBJECT is not a buffer or if it has been killed. +\[emu.el; EMACS 19.32 emulating function]" + (and object + (get-buffer object) + (buffer-name (get-buffer object)) + )) + ) + + ;;; @ XEmacs emulation ;;; diff --git a/install.el b/install.el index e557267..6397515 100644 --- a/install.el +++ b/install.el @@ -4,7 +4,7 @@ ;; Author: MORIOKA Tomohiko ;; Created: 1996/8/18 -;; Version: $Id: install.el,v 1.6 1996/08/30 15:12:25 morioka Exp $ +;; Version: $Id: install.el,v 2.1 1996/09/04 13:57:50 morioka Exp $ ;; Keywords: install ;; This file is part of tl (Tiny Library). @@ -26,6 +26,12 @@ ;;; Code: +(require 'emu) +(require 'file-detect) + +;;; @ compile Emacs Lisp files +;;; + (defun compile-elisp-module (module &optional path every-time) (setq module (expand-file-name (symbol-name module) path)) (let ((el-file (concat module ".el")) @@ -45,6 +51,9 @@ modules)) +;;; @ install files +;;; + (defvar install-overwritten-file-modes (+ (* 64 6)(* 8 4) 4)) (defun install-file (file src dest &optional move overwrite) @@ -79,6 +88,10 @@ )) files)) + +;;; @@ install Emacs Lisp files +;;; + (defun install-elisp-module (module src dest) (let (el-file elc-file) (let ((name (symbol-name module))) @@ -121,6 +134,62 @@ modules)) +;;; @ detect install path +;;; + +(defvar install-prefix + (if (or running-emacs-18 running-xemacs) + (expand-file-name "../../.." exec-directory) + (expand-file-name "../../../.." data-directory) + )) ; install to shared directory (maybe "/usr/local") + +(defvar install-elisp-prefix + (if (>= emacs-major-version 19) + "site-lisp" + "local.lisp")) + +(defun install-detect-elisp-directory (&optional prefix elisp-prefix) + (or prefix + (setq prefix install-prefix) + ) + (or elisp-prefix + (setq elisp-prefix install-elisp-prefix) + ) + (or + (catch 'tag + (let ((rest default-load-path) + dir) + (while (setq dir (car rest)) + (if (string-match + (concat "^" + (expand-file-name (concat ".*/" elisp-prefix) prefix) + "$") + dir) + (or (string-match (format "%d\\.%d" + emacs-major-version + emacs-minor-version) dir) + (throw 'tag dir) + )) + (setq rest (cdr rest)) + ))) + (expand-file-name (concat + (if running-emacs-19_29-or-later + "share/" + "lib/") + (cond ((boundp 'NEMACS) "nemacs/") + ((boundp 'MULE) "mule/") + (running-xemacs + (if (featurep 'mule) + "xmule/" + "xemacs/")) + (t "emacs/")) + elisp-prefix) prefix) + )) + +(defvar install-default-elisp-directory + (install-detect-elisp-directory)) + + ;;; @ end ;;; -- 1.7.10.4