From: ueno Date: Sun, 28 Aug 2005 09:20:50 +0000 (+0000) Subject: Added comment. X-Git-Tag: channel-coding-mergepoint~15 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=4c23162fb1daf4e8413c7b72c5ed59524a8b8f82;p=elisp%2Friece.git Added comment. --- diff --git a/lisp/riece-coding.el b/lisp/riece-coding.el index e46db0b..454da73 100644 --- a/lisp/riece-coding.el +++ b/lisp/riece-coding.el @@ -89,24 +89,31 @@ specifying the coding systems for decoding and encoding respectively." (throw 'found (cdr (car alist)))) (setq alist (cdr alist)))))) -(defun riece-decoded-coding-system (string) - (get-text-property 0 'riece-coding-decoded-coding-system string)) - -(defun riece-encoded-string (string) - (get-text-property 0 'riece-coding-encoded-string string)) +;; The following functions are API used from handler functions. For +;; the meantime DECODED is actually a string (with some text properties). +;; In the future, however, the implementation _should_ be changed string +;; so that decoding phase is delayed until the body of handler functions. +(defun riece-decoded-coding-system (decoded) + "Return the coding-system used for decoding DECODED." + (get-text-property 0 'riece-coding-decoded-coding-system decoded)) + +(defun riece-encoded-string (decoded) + "Return the string before decoding." + (get-text-property 0 'riece-coding-encoded-string decoded)) (defalias 'riece-decoded-string 'identity) -(defun riece-decoded-string-for-identity (string identity) +(defun riece-decoded-string-for-identity (decoded identity) + "Return the string decoded for IDENTITY." (let ((coding-system (riece-coding-system-for-prefix-server (riece-identity-prefix identity) (riece-identity-server identity)))) (if (and coding-system (not (eq (riece-decoded-coding-system string) coding-system))) - (riece-decode-coding-string-1 (riece-encoded-string string) + (riece-decode-coding-string-1 (riece-encoded-string decoded) coding-system) - string))) + decoded))) (provide 'riece-coding)