Subject: ikazuhiro's branch
Origin: https://github.com/ikazuhiro/apel/commits/master
2013-08-07 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
* poe.el: Fix the case that `make-temp-file' is byte compiled with
lexical-binding.
Cf. https://github.com/ikazuhiro/apel/pull/3
2013-07-05 Tatsuya Kinoshita <tats@vega.ocn.ne.jp>
* mcs-20.el: Really check whether the mule-vesion variable is defined.
2013-07-04 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
* mcs-20.el: Check whether the mule-vesion variable is defined.
Cf. https://github.com/ikazuhiro/apel/commit/328c02e022340b36dd7e5f9250c7f86d2bafd793
2013-03-24 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
* mcs-20.el (mime-charset-to-coding-system): Display the message
and use charset name as coding system when
`mime-charset-coding-system-alist' indicates invalid coding
system.
2012-09-07 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
* mcs-e20.el (coding-system-to-mime-charset): Coding system's
setting is preferred to mime-charset-coding-system-alist's value.
Detect MIME name from mime-charset-coding-system-alist's value
more permissively.
2012-08-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
* poe.el (next-command-event): Fix that Emacs 21 and later were
treated as 'Emacs 19, 20.1 and 20.2'.
2012-07-28 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
* mcs-e20.el (charsets-mime-charset-alist): Do not use
`iso-2022-jp-2'.
2012-07-28 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
* mcs-20.el (detect-mime-charset-string): (Emacs23 and later) New
function.
(detect-mime-charset-region): Use it.
2011-06-17 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
* mcs-20.el (detect-mime-charset-region): (Emacs23 and later) Do
not check whether `charsets-mime-charset-alist' contains non
charset symbol.
* mcs-e20.el (charsets-mime-charset-alist): Remove non charset
symbol for Emacs 23 and later.
2010-03-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp>
* mcs-20.el (detect-mime-charset-region): Do not care priority of
charsets on Emacs 23 and later.
diff --git a/atype.el b/atype.el
index d7e17ca..e199783 100644
--- a/atype.el
+++ b/atype.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1994,1995,1996,1997 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: atype.el,v 6.6 1997/03/10 14:11:23 morioka Exp $
+;; Version: $Id$
;; Keywords: atype
;; This file is part of APEL (A Portable Emacs Library).
diff --git a/file-detect.el b/file-detect.el
index 360c3a5..bc86dcb 100644
--- a/file-detect.el
+++ b/file-detect.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1996,1997 Free Software Foundation, Inc.
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: file-detect.el,v 7.1 1997/11/08 07:40:52 morioka Exp $
+;; Version: $Id$
;; Keywords: file detection, install, module
;; Status: obsoleted
diff --git a/filename.el b/filename.el
index 6aa4edd..c47b532 100644
--- a/filename.el
+++ b/filename.el
@@ -3,7 +3,7 @@
;; Copyright (C) 1996,1997 MORIOKA Tomohiko
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: filename.el,v 2.1 1997/11/06 15:50:53 morioka Exp $
+;; Version: $Id$
;; Keywords: file name, string
;; This file is part of APEL (A Portable Emacs Library).
diff --git a/make1.bat b/make1.bat
index 65f5023..fe72595 100755
--- a/make1.bat
+++ b/make1.bat
@@ -1,8 +1,8 @@
echo off
rem MAKE1.BAT for APEL.
rem
-rem Version: $Id: make1.bat,v 1.1 2001-02-01 03:19:36 minakaji Exp $
-rem Last Modified: $Date: 2001-02-01 03:19:36 $
+rem Version: $Id$
+rem Last Modified: $Date$
rem --- argument
rem --- elc : byte compile
diff --git a/makeit.bat b/makeit.bat
index 16c65e4..38edd49 100755
--- a/makeit.bat
+++ b/makeit.bat
@@ -5,8 +5,8 @@ rem --- 1999/07/07, Masaki YATSU mailto:yatsu@aurora.dti.ne.jp
rem --- cmail ML member
rem --- modified 1999/12/01, Yuh Ohmura, mailto:yutopia@t3.rim.or.jp
rem --- modified 2000/12/26, Takeshi Morishima mailto:tm@interaccess.com
-rem --- date $Date: 2001-02-01 03:19:36 $
-rem --- version $Id: makeit.bat,v 1.1 2001-02-01 03:19:36 minakaji Exp $
+rem --- date $Date$
+rem --- version $Id$
set ELISPMK_APP=apel
diff --git a/mcs-20.el b/mcs-20.el
index 944384b..c153c9c 100644
--- a/mcs-20.el
+++ b/mcs-20.el
@@ -84,11 +84,13 @@ is specified, it is used as line break code type of coding-system."
(if (stringp charset)
(setq charset (intern (downcase charset)))
)
- (let ((cs (assq charset mime-charset-coding-system-alist)))
- (setq cs
- (if cs
- (cdr cs)
- charset))
+ (let ((cs (cdr (assq charset mime-charset-coding-system-alist))))
+ (unless (or (null cs) (find-coding-system cs))
+ (message
+ "Invalid coding system: %s. Confirm mime-charset-coding-system-alist."
+ cs)
+ (setq cs nil))
+ (unless cs (setq cs charset))
(if lbt
(setq cs (intern (format "%s-%s" cs
(cond ((eq lbt 'CRLF) 'dos)
@@ -96,12 +98,11 @@ is specified, it is used as line break code type of coding-system."
((eq lbt 'CR) 'mac)
(t lbt)))))
)
- (if (find-coding-system cs)
- cs
- (if mime-charset-to-coding-system-default-method
- (funcall mime-charset-to-coding-system-default-method
- charset lbt cs)
- ))))
+ (or (find-coding-system cs)
+ (if mime-charset-to-coding-system-default-method
+ (funcall mime-charset-to-coding-system-default-method
+ charset lbt cs)
+ ))))
(defalias 'mime-charset-p 'mime-charset-to-coding-system)
@@ -209,6 +210,34 @@ It must be symbol."
(setq rest (cdr rest)))
default-mime-charset-for-write)))
)
+
+((eval-when-compile (and (boundp 'mule-version)
+ (null (string< mule-version "6.0"))))
+;; for Emacs 23 and later
+(defun detect-mime-charset-string (string)
+ "Return MIME charset for STRING."
+ (let ((src (string-to-list string))
+ tmp)
+ (setq tmp src)
+ ;; Uniquify the list of characters.
+ (while tmp
+ (setq tmp (setcdr tmp (delq (car tmp) (cdr tmp)))))
+ ;; Detect charset from the list of characters.
+ (catch 'found
+ (mapc (lambda (cons)
+ (catch 'next
+ (mapc (lambda (ch) (unless (char-charset ch (car cons))
+ (throw 'next nil)))
+ src)
+ (throw 'found (cdr cons))))
+ charsets-mime-charset-alist)
+ default-mime-charset-for-write)))
+
+(defsubst detect-mime-charset-region (start end)
+ "Return MIME charset for region between START and END."
+ (detect-mime-charset-string
+ (buffer-substring-no-properties start end))))
+
(t
;; for legacy Mule
(defun detect-mime-charset-region (start end)
diff --git a/mcs-e20.el b/mcs-e20.el
index 908dcad..1c8ec60 100644
--- a/mcs-e20.el
+++ b/mcs-e20.el
@@ -90,11 +90,15 @@
((ascii korean-ksc5601) . euc-kr)
((ascii chinese-gb2312) . gb2312)
((ascii chinese-big5-1 chinese-big5-2) . big5)
- ((ascii thai-tis620 composition) . tis-620)
- ((ascii latin-iso8859-1 greek-iso8859-7
- latin-jisx0201 japanese-jisx0208-1978
- chinese-gb2312 japanese-jisx0208
- korean-ksc5601 japanese-jisx0212) . iso-2022-jp-2)
+ ,(static-cond
+ ((null (string< mule-version "6.0"))
+ '((ascii thai-tis620) . tis-620))
+ (t
+ '((ascii thai-tis620 composition) . tis-620)))
+ ;; ((ascii latin-iso8859-1 greek-iso8859-7
+ ;; latin-jisx0201 japanese-jisx0208-1978
+ ;; chinese-gb2312 japanese-jisx0208
+ ;; korean-ksc5601 japanese-jisx0212) . iso-2022-jp-2)
;;((ascii latin-iso8859-1 greek-iso8859-7
;; latin-jisx0201 japanese-jisx0208-1978
;; chinese-gb2312 japanese-jisx0208
@@ -119,8 +123,16 @@
(defun coding-system-to-mime-charset (coding-system)
"Convert CODING-SYSTEM to a MIME-charset.
Return nil if corresponding MIME-charset is not found."
- (or (car (rassq coding-system mime-charset-coding-system-alist))
- (coding-system-get coding-system 'mime-charset)
+ (or (coding-system-get coding-system 'mime-charset)
+ (let ((coding (coding-system-base coding-system))
+ (alist mime-charset-coding-system-alist)
+ result)
+ (while alist
+ (if (eq (coding-system-base (cdar alist)) coding)
+ (setq result (caar alist)
+ alist nil)
+ (setq alist (cdr alist))))
+ result)
))
(defun-maybe-cond mime-charset-list ()
diff --git a/poe.el b/poe.el
index 0c7b4ff..2b11f05 100644
--- a/poe.el
+++ b/poe.el
@@ -1638,14 +1638,14 @@ See `walk-windows' for the meaning of MINIBUF and FRAME."
(or (getenv "TMPDIR") (getenv "TMP") (getenv "TEMP") "/tmp"))))
"The directory for writing temporary files.")
-;; Emacs 21 CVS ; nothing to do.
+;; Emacs 21 CVS and later ; nothing to do.
;; (make-temp-file PREFIX &optional DIR-FLAG SUFFIX)
;;
-;; Emacs 21.1-21.3 ; replace with CVS version of `make-temp-file'.
+;; Emacs 21.1-21.3 ; replace with CVS version of `make-temp-file'.
;; (make-temp-file PREFIX &optional DIR-FLAG)
;;
-;; Emacs 20 and earlier ; install our version of `make-temp-file', for
-;; or XEmacs ; single-user system or for multi-user system.
+;; Emacs 20 and earlier ; install our version of `make-temp-file', for
+;; or XEmacs ; single-user system or for multi-user system.
(eval-when-compile
(cond
((get 'make-temp-file 'defun-maybe)
@@ -1667,11 +1667,15 @@ See `walk-windows' for the meaning of MINIBUF and FRAME."
)))
;; arglist: (prefix &optional dir-flag suffix)
(cond
- ((not arglist)
- ;; `make-temp-file' is a built-in; expects 3-args.
- (put 'make-temp-file 'defun-maybe '3-args))
- ((> (length arglist) 3)
- ;; Emacs 21 CVS.
+ ((or
+ ;; `make-temp-file' is a built-in.
+ (not arglist)
+ ;; Emacs trunk r113642 and later.
+ ;; `make-temp-file' is byte compiled with lexical-binding.
+ (integerp arglist)
+ ;; Emacs 21 CVS and later.
+ ;; `make-temp-file' is byte compiled.
+ (> (length arglist) 3))
(put 'make-temp-file 'defun-maybe '3-args))
(t
;; Emacs 21.1-21.3
@@ -1996,8 +2000,9 @@ in and returned; otherwise a new event object will be created and
returned.
If PROMPT is non-nil, it should be a string and will be displayed in
the echo area while this function is waiting for an event."
- ((and (>= emacs-major-version 20)
- (>= emacs-minor-version 4))
+ ((or (>= emacs-major-version 21)
+ (and (>= emacs-major-version 20)
+ (>= emacs-minor-version 4)))
;; Emacs 20.4 and later.
(read-event prompt)) ; should specify 2nd arg?
((and (= emacs-major-version 20)
diff --git a/richtext.el b/richtext.el
index e136950..fb54481 100644
--- a/richtext.el
+++ b/richtext.el
@@ -4,7 +4,7 @@
;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
;; Created: 1995/7/15
-;; Version: $Id: richtext.el,v 3.6 1997/06/28 17:58:34 morioka Exp $
+;; Version: $Id$
;; Keywords: wp, faces, MIME, multimedia
;; This file is not part of GNU Emacs yet.
diff --git a/tinyrich.el b/tinyrich.el
index 2cfee07..ea36853 100644
--- a/tinyrich.el
+++ b/tinyrich.el
@@ -1,5 +1,5 @@
;;;
-;;; $Id: tinyrich.el,v 5.0 1995/09/20 14:45:56 morioka Exp $
+;;; $Id$
;;;
;;; by MORIOKA Tomohiko <morioka@jaist.ac.jp>
;;; modified by YAMATE Keiichirou <ics9118@sem1.info.osaka-cu.ac.jp>