From: morioka Date: Wed, 11 Mar 1998 13:11:40 +0000 (+0000) Subject: APEL 4.1. X-Git-Tag: apel-4_1~1 X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fapel.git;a=commitdiff_plain;h=1a0eea626829d44fecd5169d25b27431b8a751ea APEL 4.1. --- diff --git a/ChangeLog b/ChangeLog index 330397e..a853462 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,45 @@ +1997-11-04 MORIOKA Tomohiko + + * APEL: Version 4.1 was released. + + * APEL-MK (compile-apel): Use `config-apel'; don't use + `add-to-list' for compatibility. + (install-apel): Don't call `config-apel' directly. + + * APEL-CFG: Add load-path setting. + +1997-11-04 MORIOKA Tomohiko + + * emu-20.el (mime-charset-list): New inline-function. + (widget-mime-charset-prompt-value-history): New variable. + (mime-charset): New widget. + (widget-mime-charset-prompt-value): New function. + (widget-mime-charset-action): New function. + (default-mime-charset): Use `defcustom'. + + * emu-20.el (default-mime-charset): Modify DOC-string. + + * emu-mule.el (charsets-mime-charset-alist): New implementation. + + * emu-e20.el (encode-mime-charset-region, + decode-mime-charset-region, encode-mime-charset-string, + decode-mime-charset-string): New function (copied from emu-20.el); + check `enable-multibyte-characters'. + + * emu-x20.el (encode-mime-charset-region, + decode-mime-charset-region, encode-mime-charset-string, + decode-mime-charset-string): New function (copied from emu-20.el). + + * emu-20.el: Move function `encode-mime-charset-region', + `decode-mime-charset-region', `encode-mime-charset-string' and + `decode-mime-charset-string' to emu-x20.el and emu-e20.el. + +1997-10-04 MORIOKA Tomohiko + + * emu-x20.el (charsets-mime-charset-alist): Use MIME charset + `iso-8859-5' for cyrillic. + + 1997-09-26 MORIOKA Tomohiko * APEL: Version 3.4.4 was released. diff --git a/Makefile b/Makefile index 6ef932d..dd5fabd 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ # -# $Id: Makefile,v 0.13 1997/09/25 16:24:38 morioka Exp $ +# $Id: Makefile,v 0.14 1997/11/04 09:06:02 morioka Exp $ # -VERSION = 3.4.4 +VERSION = 4.1 -TAR = gtar +TAR = tar RM = /bin/rm -f CP = /bin/cp -p diff --git a/emu-20.el b/emu-20.el index fdda4ee..7c09911 100644 --- a/emu-20.el +++ b/emu-20.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1997 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: $Id: emu-20.el,v 7.15 1997/09/07 02:57:51 morioka Exp $ +;; Version: $Id: emu-20.el,v 7.18 1997/11/04 08:36:40 morioka Exp $ ;; Keywords: emulation, compatibility, Mule ;; This file is part of emu. @@ -30,6 +30,9 @@ ;;; Code: +(require 'custom) + + ;;; @ binary access ;;; @@ -108,38 +111,51 @@ used as line break code type of coding-system." (if (find-coding-system charset) charset)) -(defsubst encode-mime-charset-region (start end charset) - "Encode the text between START and END as MIME CHARSET." - (let ((cs (mime-charset-to-coding-system charset))) - (if cs - (encode-coding-region start end cs) - ))) - -(defsubst decode-mime-charset-region (start end charset) - "Decode the text between START and END as MIME CHARSET." - (let ((cs (mime-charset-to-coding-system charset))) - (if cs - (decode-coding-region start end cs) - ))) - -(defsubst encode-mime-charset-string (string charset) - "Encode the STRING as MIME CHARSET." - (let ((cs (mime-charset-to-coding-system charset))) - (if cs - (encode-coding-string string cs) - string))) - -(defsubst decode-mime-charset-string (string charset) - "Decode the STRING as MIME CHARSET." - (let ((cs (mime-charset-to-coding-system charset))) - (if cs - (decode-coding-string string cs) - string))) - - -(defvar default-mime-charset 'x-ctext - "Default value of MIME charset used when MIME charset is not specified. -It must be symbol.") +(defsubst mime-charset-list () + "Return a list of all existing MIME-charset." + (nconc (mapcar (function car) mime-charset-coding-system-alist) + (coding-system-list))) + + +(defvar widget-mime-charset-prompt-value-history nil + "History of input to `widget-mime-charset-prompt-value'.") + +(define-widget 'mime-charset 'coding-system + "A mime-charset." + :format "%{%t%}: %v" + :tag "MIME-charset" + :prompt-history 'widget-mime-charset-prompt-value-history + :prompt-value 'widget-mime-charset-prompt-value + :action 'widget-mime-charset-action) + +(defun widget-mime-charset-prompt-value (widget prompt value unbound) + ;; Read mime-charset from minibuffer. + (intern + (completing-read (format "%s (default %s) " prompt value) + (mapcar (function + (lambda (sym) + (list (symbol-name sym)) + )) + (mime-charset-list))))) + +(defun widget-mime-charset-action (widget &optional event) + ;; Read a mime-charset from the minibuffer. + (let ((answer + (widget-mime-charset-prompt-value + widget + (widget-apply widget :menu-tag-get) + (widget-value widget) + t))) + (widget-value-set widget answer) + (widget-apply widget :notify widget event) + (widget-setup))) + +(defcustom default-mime-charset 'x-ctext + "Default value of MIME-charset. +It is used when MIME-charset is not specified. +It must be symbol." + :group 'i18n + :type 'mime-charset) (defsubst detect-mime-charset-region (start end) "Return MIME charset for region between START and END." diff --git a/emu-e20.el b/emu-e20.el index 6b97ee2..6858a6b 100644 --- a/emu-e20.el +++ b/emu-e20.el @@ -1,9 +1,9 @@ -;;; emu-e20.el --- emu API implementation for Emacs/mule (19.34.91-delta) +;;; emu-e20.el --- emu API implementation for Emacs 20 ;; Copyright (C) 1996,1997 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: $Id: emu-e20.el,v 7.24 1997/09/07 02:39:24 morioka Exp $ +;; Version: $Id: emu-e20.el,v 7.26 1997/11/04 09:10:31 morioka Exp $ ;; Keywords: emulation, compatibility, Mule ;; This file is part of emu. @@ -25,7 +25,7 @@ ;;; Commentary: -;; This module requires Emacs 20.0.90 or later. +;; This module requires Emacs 20.1 or later. ;;; Code: @@ -76,6 +76,39 @@ in the region between START and END." ;;; @ MIME charset ;;; +(defsubst encode-mime-charset-region (start end charset) + "Encode the text between START and END as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset))) + (encode-coding-region start end cs) + ))) + +(defsubst decode-mime-charset-region (start end charset) + "Decode the text between START and END as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset))) + (decode-coding-region start end cs) + ))) + +(defsubst encode-mime-charset-string (string charset) + "Encode the STRING as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset))) + (encode-coding-string string cs) + string))) + +(defsubst decode-mime-charset-string (string charset) + "Decode the STRING as MIME CHARSET." + (let (cs) + (if (and enable-multibyte-characters + (setq cs (mime-charset-to-coding-system charset))) + (decode-coding-string string cs) + string))) + + (defvar charsets-mime-charset-alist '(((ascii) . us-ascii) ((ascii latin-iso8859-1) . iso-8859-1) diff --git a/emu-mule.el b/emu-mule.el index 1ae0651..2e493df 100644 --- a/emu-mule.el +++ b/emu-mule.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1995,1996,1997 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko -;; Version: $Id: emu-mule.el,v 7.64 1997/08/30 09:42:40 morioka Exp $ +;; Version: $Id: emu-mule.el,v 7.65 1997/11/04 08:01:11 morioka Exp $ ;; Keywords: emulation, compatibility, Mule ;; This file is part of emu. @@ -75,25 +75,25 @@ (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]" +\[EMACS 20 emulating function]" (code-convert-region start end *internal* coding-system) ) (defun decode-coding-region (start end coding-system) "Decode the text between START and END which is encoded in CODING-SYSTEM. -\[emu-mule.el; EMACS 20 emulating function]" +\[EMACS 20 emulating function]" (code-convert-region start end coding-system *internal*) ) (defun encode-coding-string (str coding-system) "Encode the STRING to CODING-SYSTEM. -\[emu-mule.el; EMACS 20 emulating function]" +\[EMACS 20 emulating function]" (code-convert-string str *internal* coding-system) ) (defun decode-coding-string (str coding-system) "Decode the string STR which is encoded in CODING-SYSTEM. -\[emu-mule.el; EMACS 20 emulating function]" +\[EMACS 20 emulating function]" (let ((len (length str)) ret) (while (and @@ -158,36 +158,37 @@ find-file-hooks, etc. ;;; @ MIME charset ;;; -(defvar charsets-mime-charset-alist - (list - (cons (list lc-ascii) 'us-ascii) - (cons (list lc-ascii lc-ltn1) 'iso-8859-1) - (cons (list lc-ascii lc-ltn2) 'iso-8859-2) - (cons (list lc-ascii lc-ltn3) 'iso-8859-3) - (cons (list lc-ascii lc-ltn4) 'iso-8859-4) -;;;(cons (list lc-ascii lc-crl) 'iso-8859-5) - (cons (list lc-ascii lc-crl) 'koi8-r) - (cons (list lc-ascii lc-arb) 'iso-8859-6) - (cons (list lc-ascii lc-grk) 'iso-8859-7) - (cons (list lc-ascii lc-hbw) 'iso-8859-8) - (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) - (cons (list lc-ascii lc-roman lc-ltn1 lc-grk - lc-jpold lc-cn lc-jp lc-kr lc-jp2 - lc-cns1 lc-cns2) 'iso-2022-int-1) - (cons (list lc-ascii lc-roman - lc-ltn1 lc-ltn2 lc-crl lc-grk - lc-jpold lc-cn lc-jp lc-kr lc-jp2 - lc-cns1 lc-cns2 lc-cns3 lc-cns4 - lc-cns5 lc-cns6 lc-cns7) 'iso-2022-int-1) - )) - -(defvar default-mime-charset 'x-ctext) +(defun encode-mime-charset-region (start end charset) + "Encode the text between START and END as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset))) + (if cs + (code-convert start end *internal* cs) + ))) + +(defun decode-mime-charset-region (start end charset) + "Decode the text between START and END as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset))) + (if cs + (code-convert start end cs *internal*) + ))) + +(defun encode-mime-charset-string (string charset) + "Encode the STRING as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset))) + (if cs + (code-convert-string string *internal* cs) + string))) + +(defun decode-mime-charset-string (string charset) + "Decode the STRING which is encoded in MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset))) + (if cs + (decode-coding-string string cs) + string))) + + +;;; @@ to coding-system +;;; (defvar mime-charset-coding-system-alist '((iso-8859-1 . *ctext*) @@ -215,41 +216,64 @@ find-file-hooks, etc. (intern (concat (symbol-name cs) (symbol-name lbt))) ))) -(defun detect-mime-charset-region (start end) - "Return MIME charset for region between START and END. -\[emu-mule.el]" - (charsets-to-mime-charset - (cons lc-ascii (find-charset-region start end)))) -(defun encode-mime-charset-region (start end charset) - "Encode the text between START and END as MIME CHARSET. -\[emu-mule.el]" - (let ((cs (mime-charset-to-coding-system charset))) - (if cs - (code-convert start end *internal* cs) - ))) +;;; @@ detection +;;; -(defun decode-mime-charset-region (start end charset) - "Decode the text between START and END as MIME CHARSET. -\[emu-mule.el]" - (let ((cs (mime-charset-to-coding-system charset))) - (if cs - (code-convert start end cs *internal*) - ))) +(defvar charsets-mime-charset-alist + (let ((alist + '(((lc-ascii) . 'us-ascii) + ((lc-ascii lc-ltn1) . 'iso-8859-1) + ((lc-ascii lc-ltn2) . 'iso-8859-2) + ((lc-ascii lc-ltn3) . 'iso-8859-3) + ((lc-ascii lc-ltn4) . 'iso-8859-4) +;;; ((lc-ascii lc-crl) . 'iso-8859-5) + ((lc-ascii lc-crl) . 'koi8-r) + ((lc-ascii lc-arb) . 'iso-8859-6) + ((lc-ascii lc-grk) . 'iso-8859-7) + ((lc-ascii lc-hbw) . 'iso-8859-8) + ((lc-ascii lc-ltn5) . 'iso-8859-9) + ((lc-ascii lc-roman lc-jpold lc-jp) . 'iso-2022-jp) + ((lc-ascii lc-kr) . 'euc-kr) + ((lc-ascii lc-cn) . 'gb2312) + ((lc-ascii lc-big5-1 lc-big5-2) . 'big5) + ((lc-ascii lc-roman lc-ltn1 lc-grk + lc-jpold lc-cn lc-jp lc-kr + lc-jp2) . 'iso-2022-jp-2) + ((lc-ascii lc-roman lc-ltn1 lc-grk + lc-jpold lc-cn lc-jp lc-kr lc-jp2 + lc-cns1 lc-cns2) . 'iso-2022-int-1) + ((lc-ascii lc-roman + lc-ltn1 lc-ltn2 lc-crl lc-grk + lc-jpold lc-cn lc-jp lc-kr lc-jp2 + lc-cns1 lc-cns2 lc-cns3 lc-cns4 + lc-cns5 lc-cns6 lc-cns7) . 'iso-2022-int-1) + )) + dest) + (while alist + (catch 'not-found + (let ((pair (car alist))) + (setq dest + (cons (mapcar (function + (lambda (cs) + (if (boundp cs) + (symbol-value cs) + (throw 'not-found nil) + ))) + (car pair)) + (cdr pair))))) + (setq alist (cdr alist)))) + ) -(defun encode-mime-charset-string (string charset) - "Encode the STRING as MIME CHARSET. [emu-mule.el]" - (let ((cs (mime-charset-to-coding-system charset))) - (if cs - (code-convert-string string *internal* cs) - string))) +(defvar default-mime-charset 'x-ctext + "Default value of MIME-charset. +It is used when MIME-charset is not specified. +It must be symbol.") -(defun decode-mime-charset-string (string charset) - "Decode the STRING which is encoded in MIME CHARSET. [emu-mule.el]" - (let ((cs (mime-charset-to-coding-system charset))) - (if cs - (decode-coding-string string cs) - string))) +(defun detect-mime-charset-region (start end) + "Return MIME charset for region between START and END." + (charsets-to-mime-charset + (cons lc-ascii (find-charset-region start end)))) ;;; @ character diff --git a/emu-x20.el b/emu-x20.el index ba3240a..907b2c7 100644 --- a/emu-x20.el +++ b/emu-x20.el @@ -1,9 +1,9 @@ -;;; emu-x20.el --- emu API implementation for XEmacs 20 with mule +;;; emu-x20.el --- emu API implementation for XEmacs with mule ;; Copyright (C) 1994,1995,1996,1997 MORIOKA Tomohiko ;; Author: MORIOKA Tomohiko -;; Version: $Id: emu-x20.el,v 7.66 1997/08/30 07:09:21 morioka Exp $ +;; Version: $Id: emu-x20.el,v 7.68 1997/11/04 07:41:28 morioka Exp $ ;; Keywords: emulation, compatibility, Mule, XEmacs ;; This file is part of XEmacs. @@ -36,14 +36,43 @@ ;;; @ MIME charset ;;; +(defsubst encode-mime-charset-region (start end charset) + "Encode the text between START and END as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset))) + (if cs + (encode-coding-region start end cs) + ))) + +(defsubst decode-mime-charset-region (start end charset) + "Decode the text between START and END as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset))) + (if cs + (decode-coding-region start end cs) + ))) + +(defsubst encode-mime-charset-string (string charset) + "Encode the STRING as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset))) + (if cs + (encode-coding-string string cs) + string))) + +(defsubst decode-mime-charset-string (string charset) + "Decode the STRING as MIME CHARSET." + (let ((cs (mime-charset-to-coding-system charset))) + (if cs + (decode-coding-string string cs) + string))) + + (defvar charsets-mime-charset-alist '(((ascii) . us-ascii) ((ascii latin-iso8859-1) . iso-8859-1) ((ascii latin-iso8859-2) . iso-8859-2) ((ascii latin-iso8859-3) . iso-8859-3) ((ascii latin-iso8859-4) . iso-8859-4) -;;; ((ascii cyrillic-iso8859-5) . iso-8859-5) - ((ascii cyrillic-iso8859-5) . koi8-r) + ((ascii cyrillic-iso8859-5) . iso-8859-5) +;;; ((ascii cyrillic-iso8859-5) . koi8-r) ((ascii arabic-iso8859-6) . iso-8859-6) ((ascii greek-iso8859-7) . iso-8859-7) ((ascii hebrew-iso8859-8) . iso-8859-8) diff --git a/file-detect.el b/file-detect.el index 019030d..ad6dbe9 100644 --- a/file-detect.el +++ b/file-detect.el @@ -3,9 +3,8 @@ ;; Copyright (C) 1996,1997 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Version: -;; $Id: file-detect.el,v 3.4 1997/06/28 07:18:31 morioka Exp $ -;; Keywords: install, module +;; Version: $Id: file-detect.el,v 4.1 1997/11/04 09:02:49 morioka Exp $ +;; Keywords: file detection, install, module ;; This file is part of APEL (A Portable Emacs Library). diff --git a/install.el b/install.el index b5db039..d683f78 100644 --- a/install.el +++ b/install.el @@ -3,11 +3,11 @@ ;; Copyright (C) 1996 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; Created: 1996/8/18 -;; Version: $Id: install.el,v 3.1 1996/11/26 19:55:55 shuhei-k Exp $ -;; Keywords: install +;; Created: 1996/08/18 +;; Version: $Id: install.el,v 4.1 1997/11/04 09:05:22 morioka Exp $ +;; Keywords: install, byte-compile, directory detection -;; This file is part of tl (Tiny Library). +;; This file is part of APEL (A Portable Emacs Library). ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License as @@ -29,6 +29,7 @@ (require 'emu) (require 'file-detect) + ;;; @ compile Emacs Lisp files ;;;