# HG changeset patch # User Stefan Monnier # Date 1209059814 0 # Node ID 742e69ab5179c3baab268786291f1aa4f9aad032 # Parent ff97f6b52868430492958c9e351569c3628490d6 (sieve-string-bytes): Remove. (sieve-manage-putscript): Use length instead: `string-bytes' gives the correct byte-length only if the process's coding-system is the same as the one used internally by Emacs to represent strings. diff -r ff97f6b52868 -r 742e69ab5179 lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Thu Apr 24 15:36:54 2008 +0000 +++ b/lisp/gnus/ChangeLog Thu Apr 24 17:56:54 2008 +0000 @@ -1,3 +1,10 @@ +2008-04-24 Stefan Monnier + + * sieve-manage.el (sieve-string-bytes): Remove. + (sieve-manage-putscript): Use length instead: `string-bytes' gives the + correct byte-length only if the process's coding-system is the same as + the one used internally by Emacs to represent strings. + 2008-04-22 Juri Linkov * mailcap.el (mailcap-file-default-commands): New function. @@ -24,7 +31,7 @@ 2008-04-09 Teodor Zlatanov * auth-source.el: Added docs. - (auth-sources): Modified format to support server. + (auth-sources): Modify format to support server. (auth-source-pick, auth-source-user-or-password) (auth-source-user-or-password-imap) (auth-source-user-or-password-pop3, auth-source-user-or-password-ssh) diff -r ff97f6b52868 -r 742e69ab5179 lisp/gnus/sieve-manage.el --- a/lisp/gnus/sieve-manage.el Thu Apr 24 15:36:54 2008 +0000 +++ b/lisp/gnus/sieve-manage.el Thu Apr 24 17:56:54 2008 +0000 @@ -570,15 +570,14 @@ (sieve-manage-send (format "HAVESPACE \"%s\" %s" name size)) (sieve-manage-parse-okno))) -(eval-and-compile - (if (fboundp 'string-bytes) - (defalias 'sieve-string-bytes 'string-bytes) - (defalias 'sieve-string-bytes 'length))) - (defun sieve-manage-putscript (name content &optional buffer) (with-current-buffer (or buffer (current-buffer)) (sieve-manage-send (format "PUTSCRIPT \"%s\" {%d+}%s%s" name - (sieve-string-bytes content) + ;; Here we assume that the coding-system will + ;; replace each char with a single byte. + ;; This is always the case if `content' is + ;; a unibyte string. + (length content) sieve-manage-client-eol content)) (sieve-manage-parse-okno)))