Problems with APEL

Katsumi Yamaoka yamaoka at jpl.org
Wed May 24 13:50:52 JST 2000


Hi, thank you for the report.

>>>>> In <41bt1xuw9y.fsf at sen2.ida.liu.se> 
>>>>>	David Byers <davby at ida.liu.se> wrote:

David> I recently had problems with the APEL package included in
David> XEmacs 21.1.8. The file pces-raw.el containts the following
David> function definitions:

David>     (defun decode-coding-string (string coding-system)
David>       "Decode the STRING which is encoded in CODING-SYSTEM."
David>       string)

David>     (defun encode-coding-string (string coding-system)
David>       "Encode the STRING as CODING-SYSTEM."
David>       string)

David> These are inconsistent with the semantics of
David> encode-coding-string and decode-coding-string in MULE versions
David> of Emacs and XEmacs. In the MULE versions encode-coding-string
David> and decode-coding-string *always* copy their arguments, even if
David> no encoding/decoding is required.

You mean the following code should return nil.

(let* ((string "abc")
       (copy (decode-coding-string string 'binary)))
  (aset string 1 ?x)
  (string-equal string copy))

David> The emulation functions in APEL should do the same, or they can
David> cause problems with programs that assume the copying semantics
David> of encode-coding-string and decode-coding-string.

I wish to revise the code in the m17n CVS server as follows.

(defun decode-coding-string (string coding-system)
  "Decode the STRING which is encoded in CODING-SYSTEM."
  (copy-sequence string))

(defun encode-coding-string (string coding-system)
  "Encode the STRING as CODING-SYSTEM."
  (copy-sequence string))

Developers, is it a right way?
-- 
Katsumi Yamaoka <yamaoka at jpl.org>




More information about the APEL-en mailing list