X-Git-Url: http://git.chise.org/gitweb/?p=elisp%2Fegg.git;a=blobdiff_plain;f=egg-com.el;h=12d9cc4651000d75ca675fd2050d9105657ac833;hp=a45871fe6dbf409edb2b136dcc9f4b9aa7bb77b7;hb=cfd2771a57243d763ff08dfd2e78cb2ddbc3b546;hpb=0db6050c7bc8d536788b1d424357695375d768e2 diff --git a/egg-com.el b/egg-com.el index a45871f..12d9cc4 100644 --- a/egg-com.el +++ b/egg-com.el @@ -10,7 +10,7 @@ ;; KATAYAMA Yoshio ; Korean, Chinese support. ;; Maintainer: NIIBE Yutaka -;; This file will be part of GNU Emacs (in future). +;; This file is part of EGG. ;; EGG is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by @@ -689,6 +689,10 @@ v means 8-bit vector." 'progn result))) +(if (not (fboundp 'string-as-multibyte)) + (defsubst string-as-multibyte (str) + str)) + ;; Do not move the point, leave it where it was. (defun comm-accept-process-output (proc) (let ((p (point))) @@ -744,20 +748,22 @@ v means 8-bit vector." (let ((start (point))) (while (not (search-forward "\0\0" nil t)) (comm-accept-process-output proc)) - (set s (buffer-substring start - (+ start - (decode-coding-region start (- (point) 2) - egg-fixed-euc)))))) + (set s (string-as-multibyte + (buffer-substring start + (+ start + (decode-coding-region start (- (point) 2) + egg-fixed-euc))))))) ;;; XXX should support other conversion (euc-kr, cns) (defsubst comm-unpack-mb-string (proc s) (let ((start (point))) (while (not (search-forward "\0" nil t)) (comm-accept-process-output proc)) - (set s (buffer-substring start - (+ start - (decode-coding-region start (- (point) 1) - egg-mb-euc)))))) + (set s (string-as-multibyte + (buffer-substring start + (+ start + (decode-coding-region start (- (point) 1) + egg-mb-euc))))))) (defsubst comm-unpack-u8-string (proc s) (let ((start (point)))