From: ichikawa Date: Sun, 23 Aug 1998 02:46:48 +0000 (+0000) Subject: Update with shue-gnus chanhe. X-Git-Tag: ichikawa-199811302358~14 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97e1968f4b3c2be0729c00cd8917a3bc5f37520e;p=elisp%2Fgnus.git- Update with shue-gnus chanhe. --- diff --git a/lisp/gnus-spec.el b/lisp/gnus-spec.el index 23215fb..281cd21 100644 --- a/lisp/gnus-spec.el +++ b/lisp/gnus-spec.el @@ -245,32 +245,40 @@ "Return a form that limits EL to MAX-WIDTH." (let ((max (abs max-width))) (if (symbolp el) - `(if (> (length ,el) ,max) + `(if (> (gnus-string-width ,el) ,max) ,(if (< max-width 0) - `(substring ,el (- (length el) ,max)) - `(substring ,el 0 ,max)) + `(gnus-truncate-string + ,el (gnus-string-width ,el) + (- (gnus-string-width ,el) ,max)) + `(gnus-truncate-string ,el ,max)) ,el) `(let ((val (eval ,el))) - (if (> (length val) ,max) + (if (> (gnus-string-width val) ,max) ,(if (< max-width 0) - `(substring val (- (length val) ,max)) - `(substring val 0 ,max)) + `(gnus-truncate-string + val (gnus-string-width val) + (- (gnus-string-width val) ,max)) + `(gnus-truncate-string val ,max)) val))))) (defun gnus-tilde-cut-form (el cut-width) "Return a form that cuts CUT-WIDTH off of EL." (let ((cut (abs cut-width))) (if (symbolp el) - `(if (> (length ,el) ,cut) + `(if (> (gnus-string-width ,el) ,cut) ,(if (< cut-width 0) - `(substring ,el 0 (- (length el) ,cut)) - `(substring ,el ,cut)) + `(gnus-truncate-string + ,el (- (gnus-string-width ,el) ,cut)) + `(gnus-truncate-string + ,el (- (gnus-string-width ,el) ,cut) ,cut)) ,el) `(let ((val (eval ,el))) - (if (> (length val) ,cut) + (if (> (gnus-string-width val) ,cut) ,(if (< cut-width 0) - `(substring val 0 (- (length val) ,cut)) - `(substring val ,cut)) + `(gnus-truncate-string + val (- (gnus-string-width val) ,cut)) + `(gnus-truncate-string + val (- (gnus-string-width val) ,cut) ,cut)) val))))) (defun gnus-tilde-ignore-form (el ignore-value) diff --git a/lisp/gnus-util.el b/lisp/gnus-util.el index 4e437f5..876e2fc 100644 --- a/lisp/gnus-util.el +++ b/lisp/gnus-util.el @@ -75,6 +75,9 @@ (set symbol nil)) symbol)) +(defun gnus-string-width (str) + (length str)) + (defun gnus-truncate-string (str width) (substring str 0 width)) @@ -723,7 +726,8 @@ with potentially long computations." (setq filename (expand-file-name filename)) (setq rmail-default-rmail-file filename) (let ((artbuf (current-buffer)) - (tmpbuf (gnus-get-buffer-create " *Gnus-output*"))) + (tmpbuf (gnus-get-buffer-create " *Gnus-output*")) + (coding-system-for-write 'binary)) (save-excursion (or (get-file-buffer filename) (file-exists-p filename)