summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-spec.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/gnus/gnus-spec.el')
-rw-r--r--lisp/gnus/gnus-spec.el16
1 files changed, 7 insertions, 9 deletions
diff --git a/lisp/gnus/gnus-spec.el b/lisp/gnus/gnus-spec.el
index d96e9f2aed7..47d722c9144 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)
@@ -150,7 +150,7 @@ Return a list of updated types."
(let ((buffer (intern (format "gnus-%s-buffer" type))))
(when (and (boundp buffer)
(setq val (symbol-value buffer))
- (gnus-buffer-exists-p val))
+ (gnus-buffer-live-p val))
(set-buffer val))
(setq new-format (symbol-value
(intern (format "gnus-%s-line-format" type)))))
@@ -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))))