2001-08-18 19:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
+ * gnus-spec.el (gnus-char-width): New.
+ (gnus-correct-substring, gnus-correct-length): Use it.
+
* message.el (message-required-mail-headers): Fix doc.
2001-08-18 18:00:00 ShengHuo ZHU <zsh@cs.rochester.edu>
'balloon-help
,(intern (format "gnus-balloon-face-%d" type))))
+(eval-and-compile
+ (defalias 'gnus-char-width
+ (if (fboundp 'char-width)
+ 'char-width
+ (lambda (ch) 1)))) ;; A simple hack.
+
(defun gnus-correct-length (string)
"Return the correct width of STRING."
(let ((length 0))
- (mapcar (lambda (char) (incf length (char-width char))) string)
+ (mapcar (lambda (char) (incf length (gnus-char-width char))) string)
length))
(defun gnus-correct-substring (string start end)
;; Find the start position.
(while (and (< seek length)
(< wstart start))
- (incf wstart (char-width (aref string seek)))
+ (incf wstart (gnus-char-width (aref string seek)))
(incf seek))
(setq wend wstart
wstart seek)
;; Find the end position.
(while (and (< seek length)
(< wend end))
- (incf wend (char-width (aref string seek)))
+ (incf wend (gnus-char-width (aref string seek)))
(incf seek))
(setq wend seek)
(substring string wstart (1- wend))))