diff options
Diffstat (limited to 'lisp/gnus/gnus-spec.el')
-rw-r--r-- | lisp/gnus/gnus-spec.el | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el index 082ebf15529..4b5f15fbc6d 100644 --- a/lisp/gnus/gnus-spec.el +++ b/lisp/gnus/gnus-spec.el @@ -24,7 +24,7 @@ ;;; Code: -(eval-when-compile (require 'cl)) +(eval-when-compile (require 'cl-lib)) (defvar gnus-newsrc-file-version) (require 'gnus) @@ -271,9 +271,7 @@ Return a list of updated types." (insert " "))) (insert-char ? (max (- ,column (current-column)) 0)))))) -(defun gnus-correct-length (string) - "Return the correct width of STRING." - (apply #'+ (mapcar #'char-width string))) +(define-obsolete-function-alias 'gnus-correct-length 'string-width "27.1") (defun gnus-correct-substring (string start &optional end) (let ((wstart 0) @@ -285,15 +283,15 @@ Return a list of updated types." ;; Find the start position. (while (and (< seek length) (< wseek start)) - (incf wseek (char-width (aref string seek))) - (incf seek)) + (cl-incf wseek (char-width (aref string seek))) + (cl-incf seek)) (setq wstart seek) ;; Find the end position. (while (and (<= seek length) (or (not end) (<= wseek end))) - (incf wseek (char-width (aref string seek))) - (incf seek)) + (cl-incf wseek (char-width (aref string seek))) + (cl-incf seek)) (setq wend seek) (substring string wstart (1- wend)))) |