* gnus-spec.el (gnus-correct-length, gnus-correct-substring):
authorJesper Harder <harder@ifa.au.dk>
Mon, 5 Jan 2004 19:47:22 +0000 (19:47 +0000)
committerJesper Harder <harder@ifa.au.dk>
Mon, 5 Jan 2004 19:47:22 +0000 (19:47 +0000)
Replace gnus-char-width with char-width.

* gnus-ems.el (gnus-char-width): Remove.

lisp/ChangeLog
lisp/gnus-ems.el
lisp/gnus-spec.el

index bd649c9..fbd8573 100644 (file)
@@ -1,5 +1,10 @@
 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.
index 153a02b..9b36a6d 100644 (file)
         (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)
index 393c8a1..0ada383 100644 (file)
@@ -290,7 +290,7 @@ text properties. This is only needed on XEmacs, as FSF Emacs does this anyway."
 (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)
@@ -303,14 +303,14 @@ text properties. This is only needed on XEmacs, as FSF Emacs does this anyway."
     ;; 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))))