From 706c46fc928d868383c10488b5ee3e74faec2bb3 Mon Sep 17 00:00:00 2001 From: morioka Date: Thu, 17 Sep 1998 17:16:51 +0000 Subject: [PATCH] (decode-coding-string): Regard integer as coding-system. (encode-coding-string): Likewise. (decode-coding-region): Likewise. (encode-coding-region): Likewise. --- poem-nemacs.el | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/poem-nemacs.el b/poem-nemacs.el index e5c6e9d..6738d19 100644 --- a/poem-nemacs.el +++ b/poem-nemacs.el @@ -112,7 +112,9 @@ (defun decode-coding-string (string coding-system) "Decode the STRING which is encoded in CODING-SYSTEM. \[emu-nemacs.el; EMACS 20 emulating function]" - (let ((code (cdr (assq coding-system coding-system-kanji-code-alist)))) + (let ((code (if (integerp coding-system) + coding-system + (cdr (assq coding-system coding-system-kanji-code-alist))))) (if (eq code 3) string (convert-string-kanji-code string code 3) @@ -121,7 +123,9 @@ (defun encode-coding-string (string coding-system) "Encode the STRING to CODING-SYSTEM. \[emu-nemacs.el; EMACS 20 emulating function]" - (let ((code (cdr (assq coding-system coding-system-kanji-code-alist)))) + (let ((code (if (integerp coding-system) + coding-system + (cdr (assq coding-system coding-system-kanji-code-alist))))) (if (eq code 3) string (convert-string-kanji-code string 3 code) @@ -130,7 +134,9 @@ (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]" - (let ((code (cdr (assq coding-system coding-system-kanji-code-alist)))) + (let ((code (if (integerp coding-system) + coding-system + (cdr (assq coding-system coding-system-kanji-code-alist))))) (save-excursion (save-restriction (narrow-to-region start end) @@ -140,7 +146,9 @@ (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]" - (let ((code (cdr (assq coding-system coding-system-kanji-code-alist)))) + (let ((code (if (integerp coding-system) + coding-system + (cdr (assq coding-system coding-system-kanji-code-alist))))) (save-excursion (save-restriction (narrow-to-region start end) -- 1.7.10.4