2004-01-05 Jesper Harder <harder@ifa.au.dk>
+ * gnus-spec.el (gnus-correct-length, gnus-correct-substring):
+ Replace gnus-char-width with char-width.
+
+ * gnus-ems.el (gnus-char-width): Remove.
+
* spam-stat.el (with-syntax-table): Remove with-syntax-table
definition.
Remove Emacs 20 hash table compatibility code.
(truncate-string-to-width valstr ,max-width)
valstr)))
-(eval-and-compile
- (defalias 'gnus-char-width
- (if (fboundp 'char-width)
- 'char-width
- (lambda (ch) 1)))) ;; A simple hack.
-
(eval-and-compile
(if (featurep 'xemacs)
(gnus-xmas-define)
(defun gnus-correct-length (string)
"Return the correct width of STRING."
(let ((length 0))
- (mapcar (lambda (char) (incf length (gnus-char-width char))) string)
+ (mapcar (lambda (char) (incf length (char-width char))) string)
length))
(defun gnus-correct-substring (string start &optional end)
;; Find the start position.
(while (and (< seek length)
(< wseek start))
- (incf wseek (gnus-char-width (aref string seek)))
+ (incf wseek (char-width (aref string seek)))
(incf seek))
(setq wstart seek)
;; Find the end position.
(while (and (<= seek length)
(or (not end)
(<= wseek end)))
- (incf wseek (gnus-char-width (aref string seek)))
+ (incf wseek (char-width (aref string seek)))
(incf seek))
(setq wend seek)
(substring string wstart (1- wend))))