Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Sync up with APEL 8.3.

  • Loading branch information...
commit 5f413a0aa097683cc0adbedc4c25c39ac0a4b122 1 parent 16dcc23
morioka authored
55 ChangeLog
... ... @@ -1,3 +1,58 @@
  1 +1998-04-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
  2 +
  3 + * README.en (What's APEL?): Modify for latest emu.
  4 +
  5 +1998-04-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
  6 +
  7 + * emu-nemacs.el, emu-mule.el, emu-latin1.el, emu-e20_2.el,
  8 + emu-e20_3.el, emu-x20.el (char-next-index): Fixed.
  9 +
  10 +1998-04-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
  11 +
  12 + * EMU-ELS (emu-modules): Add 'emu-e20_3 for Emacs 20.3.
  13 +
  14 + * emu-e20_3.el: New module.
  15 +
  16 + * emu-e20.el: Select to require 'emu-e20_2 or 'emu-e20_3.
  17 +
  18 + * emu-e20_2.el (set-buffer-multibyte): New function.
  19 +
  20 + * emu-e20.el (insert-file-contents-as-binary): Use
  21 + 'set-buffer-multibyte.
  22 +
  23 +1998-04-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
  24 +
  25 + * emu-e20_2.el, emu-e20.el, EMU-ELS: Separate Emacs 20.1 and 20.2
  26 + depended definitions from emu-e20.el to emu-e20_2.el.
  27 +
  28 +1998-04-17 MORIOKA Tomohiko <morioka@jaist.ac.jp>
  29 +
  30 + * emu.el: emu-x20.el doesn't require 'emu-xemacs and 'emu-20.
  31 +
  32 +1998-04-16 MORIOKA Tomohiko <morioka@jaist.ac.jp>
  33 +
  34 + * emu-x20.el: Don't require 'emu-xemacs and 'emu-20.
  35 +
  36 + * emu.el: emu-latin1.el does not require 'emu-xemacs or 'emu-e19.
  37 +
  38 + * emu-latin1.el: Don't require 'emu-xemacs or 'emu-e19.
  39 +
  40 +1998-04-16 MORIOKA Tomohiko <morioka@jaist.ac.jp>
  41 +
  42 + * emu-mule.el, emu-latin1.el, emu-e20.el, emu-e19.el, emu-19.el,
  43 + EMU-ELS: Rename emu-19.el -> emu-e19.el.
  44 +
  45 + * emu.el, emu-latin1.el, emu-e19.el, EMU-ELS: Rename emu-e19.el ->
  46 + emu-latin1.el.
  47 +
  48 +1998-04-13 MORIOKA Tomohiko <morioka@jaist.ac.jp>
  49 +
  50 + * README.en (What's APEL?): Remove description about std11.el and
  51 + std11-parse.el.
  52 +
  53 + * install.el (install-detect-elisp-directory): Modify regexp to
  54 + allow trailing `/'.
  55 +
1 56 1998-04-13 MORIOKA Tomohiko <morioka@jaist.ac.jp>
2 57
3 58 * README.en (What's APEL?): Remove description about std11.el and
107 emu-19.el
... ... @@ -1,107 +0,0 @@
1   -;;; emu-19.el --- emu API implementation for Emacs 19.*
2   -
3   -;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
4   -
5   -;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
6   -;; Version: $Id$
7   -;; Keywords: emulation, compatibility
8   -
9   -;; This file is part of emu.
10   -
11   -;; This program is free software; you can redistribute it and/or
12   -;; modify it under the terms of the GNU General Public License as
13   -;; published by the Free Software Foundation; either version 2, or (at
14   -;; your option) any later version.
15   -
16   -;; This program is distributed in the hope that it will be useful, but
17   -;; WITHOUT ANY WARRANTY; without even the implied warranty of
18   -;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   -;; General Public License for more details.
20   -
21   -;; You should have received a copy of the GNU General Public License
22   -;; along with GNU Emacs; see the file COPYING. If not, write to the
23   -;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
24   -;; Boston, MA 02111-1307, USA.
25   -
26   -;;; Code:
27   -
28   -;;; @ face
29   -;;;
30   -
31   -(defun-maybe find-face (face)
32   - (car (memq face (face-list)))
33   - )
34   -
35   -
36   -;;; @ for tm-7.106
37   -;;;
38   -
39   -(defalias 'tl:make-overlay 'make-overlay)
40   -(defalias 'tl:overlay-put 'overlay-put)
41   -(defalias 'tl:overlay-buffer 'overlay-buffer)
42   -
43   -(make-obsolete 'tl:make-overlay 'make-overlay)
44   -(make-obsolete 'tl:overlay-put 'overlay-put)
45   -(make-obsolete 'tl:overlay-buffer 'overlay-buffer)
46   -
47   -
48   -;;; @ visible/invisible
49   -;;;
50   -
51   -(defmacro enable-invisible ())
52   -
53   -(defmacro end-of-invisible ())
54   -
55   -(defun invisible-region (start end)
56   - (if (save-excursion
57   - (goto-char (1- end))
58   - (eq (following-char) ?\n)
59   - )
60   - (setq end (1- end))
61   - )
62   - (put-text-property start end 'invisible t)
63   - )
64   -
65   -(defun visible-region (start end)
66   - (put-text-property start end 'invisible nil)
67   - )
68   -
69   -(defun invisible-p (pos)
70   - (get-text-property pos 'invisible)
71   - )
72   -
73   -(defun next-visible-point (pos)
74   - (save-excursion
75   - (goto-char (next-single-property-change pos 'invisible))
76   - (if (eq (following-char) ?\n)
77   - (forward-char)
78   - )
79   - (point)
80   - ))
81   -
82   -
83   -;;; @ mouse
84   -;;;
85   -
86   -(defvar mouse-button-1 [mouse-1])
87   -(defvar mouse-button-2 [mouse-2])
88   -(defvar mouse-button-3 [down-mouse-3])
89   -
90   -
91   -;;; @ string
92   -;;;
93   -
94   -(defmacro char-list-to-string (char-list)
95   - "Convert list of character CHAR-LIST to string. [emu-19.el]"
96   - (` (mapconcat (function char-to-string)
97   - (, char-list)
98   - "")
99   - ))
100   -
101   -
102   -;;; @ end
103   -;;;
104   -
105   -(provide 'emu-19)
106   -
107   -;;; emu-19.el ends here
84 emu-e20_2.el
... ... @@ -0,0 +1,84 @@
  1 +;;; emu-e20_2.el --- emu API implementation for Emacs 20.1 and 20.2
  2 +
  3 +;; Copyright (C) 1996,1997,1998 Free Software Foundation, Inc.
  4 +
  5 +;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
  6 +;; Keywords: emulation, compatibility, Mule
  7 +
  8 +;; This file is part of emu.
  9 +
  10 +;; This program is free software; you can redistribute it and/or
  11 +;; modify it under the terms of the GNU General Public License as
  12 +;; published by the Free Software Foundation; either version 2, or (at
  13 +;; your option) any later version.
  14 +
  15 +;; This program is distributed in the hope that it will be useful, but
  16 +;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18 +;; General Public License for more details.
  19 +
  20 +;; You should have received a copy of the GNU General Public License
  21 +;; along with GNU Emacs; see the file COPYING. If not, write to the
  22 +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  23 +;; Boston, MA 02111-1307, USA.
  24 +
  25 +;;; Commentary:
  26 +
  27 +;; This module requires Emacs 20.1 and 20.2.
  28 +
  29 +;;; Code:
  30 +
  31 +(defsubst-maybe set-buffer-multibyte (flag)
  32 + "Set the multibyte flag of the current buffer to FLAG.
  33 +If FLAG is t, this makes the buffer a multibyte buffer.
  34 +If FLAG is nil, this makes the buffer a single-byte buffer.
  35 +The buffer contents remain unchanged as a sequence of bytes
  36 +but the contents viewed as characters do change."
  37 + (setq enable-multibyte-characters flag)
  38 + )
  39 +
  40 +
  41 +;;; @ character
  42 +;;;
  43 +
  44 +(defalias 'char-length 'char-bytes)
  45 +
  46 +(defmacro char-next-index (char index)
  47 + "Return index of character succeeding CHAR whose index is INDEX."
  48 + `(+ ,index (char-bytes ,char)))
  49 +
  50 +
  51 +;;; @ string
  52 +;;;
  53 +
  54 +(defalias 'sset 'store-substring)
  55 +
  56 +(defun string-to-char-list (string)
  57 + "Return a list of which elements are characters in the STRING."
  58 + (let* ((len (length string))
  59 + (i 0)
  60 + l chr)
  61 + (while (< i len)
  62 + (setq chr (sref string i))
  63 + (setq l (cons chr l))
  64 + (setq i (+ i (char-bytes chr)))
  65 + )
  66 + (nreverse l)
  67 + ))
  68 +
  69 +(defalias 'string-to-int-list 'string-to-char-list)
  70 +
  71 +;;; @@ obsoleted aliases
  72 +;;;
  73 +;;; You should not use them.
  74 +
  75 +(defalias 'string-columns 'string-width)
  76 +(make-obsolete 'string-columns 'string-width)
  77 +
  78 +
  79 +;;; @ end
  80 +;;;
  81 +
  82 +(provide 'emu-e20_2)
  83 +
  84 +;;; emu-e20_2.el ends here
60 emu-e20_3.el
... ... @@ -0,0 +1,60 @@
  1 +;;; emu-e20_3.el --- emu API implementation for Emacs 20.3.
  2 +
  3 +;; Copyright (C) 1998 Free Software Foundation, Inc.
  4 +
  5 +;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
  6 +;; Keywords: emulation, compatibility, Mule
  7 +
  8 +;; This file is part of emu.
  9 +
  10 +;; This program is free software; you can redistribute it and/or
  11 +;; modify it under the terms of the GNU General Public License as
  12 +;; published by the Free Software Foundation; either version 2, or (at
  13 +;; your option) any later version.
  14 +
  15 +;; This program is distributed in the hope that it will be useful, but
  16 +;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18 +;; General Public License for more details.
  19 +
  20 +;; You should have received a copy of the GNU General Public License
  21 +;; along with GNU Emacs; see the file COPYING. If not, write to the
  22 +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  23 +;; Boston, MA 02111-1307, USA.
  24 +
  25 +;;; Commentary:
  26 +
  27 +;; This module requires Emacs 20.2.91 or later.
  28 +
  29 +;;; Code:
  30 +
  31 +;;; @ character
  32 +;;;
  33 +
  34 +(defsubst char-length (char)
  35 + "Return indexing length of multi-byte form of CHAR."
  36 + 1)
  37 +
  38 +(defmacro char-next-index (char index)
  39 + "Return index of character succeeding CHAR whose index is INDEX."
  40 + `(1+ ,index))
  41 +
  42 +
  43 +;;; @ string
  44 +;;;
  45 +
  46 +(defalias 'sset 'store-substring)
  47 +
  48 +(defun string-to-char-list (string)
  49 + "Return a list of which elements are characters in the STRING."
  50 + (mapcar #'identity string))
  51 +
  52 +(defalias 'string-to-int-list 'string-to-char-list)
  53 +
  54 +
  55 +;;; @ end
  56 +;;;
  57 +
  58 +(provide 'emu-e20_3)
  59 +
  60 +;;; emu-e20_3.el ends here
286 emu-latin1.el
... ... @@ -0,0 +1,286 @@
  1 +;;; emu-latin1.el --- emu module for Emacs 19 and XEmacs without MULE
  2 +
  3 +;; Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
  4 +
  5 +;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
  6 +;; Keywords: emulation, compatibility, mule, Latin-1
  7 +
  8 +;; This file is part of emu.
  9 +
  10 +;; This program is free software; you can redistribute it and/or
  11 +;; modify it under the terms of the GNU General Public License as
  12 +;; published by the Free Software Foundation; either version 2, or (at
  13 +;; your option) any later version.
  14 +
  15 +;; This program is distributed in the hope that it will be useful, but
  16 +;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17 +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18 +;; General Public License for more details.
  19 +
  20 +;; You should have received a copy of the GNU General Public License
  21 +;; along with GNU Emacs; see the file COPYING. If not, write to the
  22 +;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  23 +;; Boston, MA 02111-1307, USA.
  24 +
  25 +;;; Code:
  26 +
  27 +;;; @ version and variant specific features
  28 +;;;
  29 +
  30 +;; (cond (running-xemacs
  31 +;; (require 'emu-xemacs))
  32 +;; (running-emacs-19
  33 +;; (require 'emu-e19)
  34 +;; ))
  35 +
  36 +
  37 +;;; @ character set
  38 +;;;
  39 +
  40 +(put 'ascii 'charset-description "Character set of ASCII")
  41 +(put 'ascii 'charset-registry "ASCII")
  42 +
  43 +(put 'latin-iso8859-1 'charset-description "Character set of ISO-8859-1")
  44 +(put 'latin-iso8859-1 'charset-registry "ISO8859-1")
  45 +
  46 +(defun charset-description (charset)
  47 + "Return description of CHARSET."
  48 + (get charset 'charset-description)
  49 + )
  50 +
  51 +(defun charset-registry (charset)
  52 + "Return registry name of CHARSET."
  53 + (get charset 'charset-registry)
  54 + )
  55 +
  56 +(defun charset-width (charset)
  57 + "Return number of columns a CHARSET occupies when displayed."
  58 + 1)
  59 +
  60 +(defun charset-direction (charset)
  61 + "Return the direction of a character of CHARSET by
  62 + 0 (left-to-right) or 1 (right-to-left)."
  63 + 0)
  64 +
  65 +(defun find-charset-string (str)
  66 + "Return a list of charsets in the string."
  67 + (if (string-match "[\200-\377]" str)
  68 + '(latin-iso8859-1)
  69 + ))
  70 +
  71 +(defalias 'find-non-ascii-charset-string 'find-charset-string)
  72 +
  73 +(defun find-charset-region (start end)
  74 + "Return a list of charsets in the region between START and END."
  75 + (if (save-excursion
  76 + (goto-char start)
  77 + (re-search-forward "[\200-\377]" end t)
  78 + )
  79 + '(latin-iso8859-1)
  80 + ))
  81 +
  82 +(defalias 'find-non-ascii-charset-region 'find-charset-region)
  83 +
  84 +
  85 +;;; @ coding-system
  86 +;;;
  87 +
  88 +(defconst *internal* nil)
  89 +(defconst *ctext* nil)
  90 +(defconst *noconv* nil)
  91 +
  92 +(defun decode-coding-string (string coding-system)
  93 + "Decode the STRING which is encoded in CODING-SYSTEM."
  94 + string)
  95 +
  96 +(defun encode-coding-string (string coding-system)
  97 + "Encode the STRING as CODING-SYSTEM."
  98 + string)
  99 +
  100 +(defun decode-coding-region (start end coding-system)
  101 + "Decode the text between START and END which is encoded in CODING-SYSTEM."
  102 + 0)
  103 +
  104 +(defun encode-coding-region (start end coding-system)
  105 + "Encode the text between START and END to CODING-SYSTEM."
  106 + 0)
  107 +
  108 +(defun detect-coding-region (start end)
  109 + "Detect coding-system of the text in the region between START and END."
  110 + )
  111 +
  112 +(defun set-buffer-file-coding-system (coding-system &optional force)
  113 + "Set buffer-file-coding-system of the current buffer to CODING-SYSTEM."
  114 + )
  115 +
  116 +(defmacro as-binary-process (&rest body)
  117 + (` (let (selective-display) ; Disable ^M to nl translation.
  118 + (,@ body)
  119 + )))
  120 +
  121 +(defmacro as-binary-input-file (&rest body)
  122 + (` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2
  123 + (,@ body)
  124 + )))
  125 +
  126 +(defmacro as-binary-output-file (&rest body)
  127 + (` (let ((emx-binary-mode t)) ; Stop CRLF to LF conversion in OS/2
  128 + (,@ body)
  129 + )))
  130 +
  131 +
  132 +;;; @@ for old MULE emulation
  133 +;;;
  134 +
  135 +(defun code-convert-string (str ic oc)
  136 + "Convert code in STRING from SOURCE code to TARGET code,
  137 +On successful converion, returns the result string,
  138 +else returns nil. [emu-latin1.el; old MULE emulating function]"
  139 + str)
  140 +
  141 +(defun code-convert-region (beg end ic oc)
  142 + "Convert code of the text between BEGIN and END from SOURCE
  143 +to TARGET. On successful conversion returns t,
  144 +else returns nil. [emu-latin1.el; old MULE emulating function]"
  145 + t)
  146 +
  147 +
  148 +;;; @ binary access
  149 +;;;
  150 +
  151 +(defun insert-file-contents-as-binary (filename
  152 + &optional visit beg end replace)
  153 + "Like `insert-file-contents', q.v., but don't code and format conversion.
  154 +Like `insert-file-contents-literary', but it allows find-file-hooks,
  155 +automatic uncompression, etc.
  156 +
  157 +Namely this function ensures that only format decoding and character
  158 +code conversion will not take place."
  159 + (let ((emx-binary-mode t))
  160 + (insert-file-contents filename visit beg end replace)
  161 + ))
  162 +
  163 +(defalias 'insert-binary-file-contents 'insert-file-contents-as-binary)
  164 +(make-obsolete 'insert-binary-file-contents 'insert-file-contents-as-binary)
  165 +
  166 +(defun insert-binary-file-contents-literally (filename
  167 + &optional visit beg end replace)
  168 + "Like `insert-file-contents-literally', q.v., but don't code conversion.
  169 +A buffer may be modified in several ways after reading into the buffer due
  170 +to advanced Emacs features, such as file-name-handlers, format decoding,
  171 +find-file-hooks, etc.
  172 + This function ensures that none of these modifications will take place."
  173 + (let ((emx-binary-mode t))
  174 + (insert-file-contents-literally filename visit beg end replace)
  175 + ))
  176 +
  177 +(defun write-region-as-binary (start end filename
  178 + &optional append visit lockname)
  179 + "Like `write-region', q.v., but don't code conversion."
  180 + (let ((emx-binary-mode t))
  181 + (write-region start end filename append visit lockname)
  182 + ))
  183 +
  184 +
  185 +;;; @ MIME charset
  186 +;;;
  187 +
  188 +(defvar charsets-mime-charset-alist
  189 + '(((ascii) . us-ascii)))
  190 +
  191 +(defvar default-mime-charset 'iso-8859-1)
  192 +
  193 +(defun mime-charset-to-coding-system (charset)
  194 + (if (stringp charset)
  195 + (setq charset (intern (downcase charset)))
  196 + )
  197 + (and (memq charset (list 'us-ascii default-mime-charset))
  198 + charset)
  199 + )
  200 +
  201 +(defun detect-mime-charset-region (start end)
  202 + "Return MIME charset for region between START and END."
  203 + (if (save-excursion
  204 + (goto-char start)
  205 + (re-search-forward "[\200-\377]" end t)
  206 + )
  207 + default-mime-charset
  208 + 'us-ascii))
  209 +
  210 +(defun encode-mime-charset-region (start end charset)
  211 + "Encode the text between START and END as MIME CHARSET."
  212 + )
  213 +
  214 +(defun decode-mime-charset-region (start end charset)
  215 + "Decode the text between START and END as MIME CHARSET."
  216 + )
  217 +
  218 +(defun encode-mime-charset-string (string charset)
  219 + "Encode the STRING as MIME CHARSET."
  220 + string)
  221 +
  222 +(defun decode-mime-charset-string (string charset)
  223 + "Decode the STRING as MIME CHARSET."
  224 + string)
  225 +
  226 +
  227 +;;; @ character
  228 +;;;
  229 +
  230 +(defun char-charset (char)
  231 + "Return the character set of char CHAR."
  232 + (if (< chr 128)
  233 + 'ascii
  234 + 'latin-iso8859-1))
  235 +
  236 +(defun char-bytes (char)
  237 + "Return number of bytes a character in CHAR occupies in a buffer."
  238 + 1)
  239 +
  240 +(defun char-width (char)
  241 + "Return number of columns a CHAR occupies when displayed."
  242 + 1)
  243 +
  244 +(defalias 'char-length 'char-bytes)
  245 +
  246 +(defmacro char-next-index (char index)
  247 + "Return index of character succeeding CHAR whose index is INDEX."
  248 + (` (1+ (, index))))
  249 +
  250 +
  251 +;;; @ string
  252 +;;;
  253 +
  254 +(defalias 'string-width 'length)
  255 +
  256 +(defun string-to-char-list (str)
  257 + (mapcar (function identity) str)
  258 + )
  259 +
  260 +(defalias 'string-to-int-list 'string-to-char-list)
  261 +
  262 +(defalias 'sref 'aref)
  263 +
  264 +(defun truncate-string (str width &optional start-column)
  265 + "Truncate STR to fit in WIDTH columns.
  266 +Optional non-nil arg START-COLUMN specifies the starting column.
  267 +\[emu-latin1.el; MULE 2.3 emulating function]"
  268 + (or start-column
  269 + (setq start-column 0))
  270 + (substring str start-column width)
  271 + )
  272 +
  273 +;;; @@ obsoleted aliases
  274 +;;;
  275 +;;; You should not use them.
  276 +
  277 +(defalias 'string-columns 'length)
  278 +(make-obsolete 'string-columns 'string-width)
  279 +
  280 +
  281 +;;; @ end
  282 +;;;
  283 +
  284 +(provide 'emu-latin1)
  285 +
  286 +;;; emu-latin1.el ends here

0 comments on commit 5f413a0

Please sign in to comment.
Something went wrong with that request. Please try again.