From cd5dfa086d204c01791bfdcdf9fe1215c4bf1e42 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Sat, 3 Apr 2021 01:21:32 +0200 Subject: Replace two functions with seq-subseq * lisp/emacs-lisp/seq.el (seq-subseq): Add autoload cookie. * lisp/eshell/esh-util.el (eshell-sublist): Redefine using seq-subseq and make obsolete. Update callers. * lisp/wid-edit.el (widget-sublist): Redefine as obsolete function alias for seq-subseq. Update callers. --- lisp/wid-edit.el | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'lisp/wid-edit.el') diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el index e71290c7ef9..51c6b49e6df 100644 --- a/lisp/wid-edit.el +++ b/lisp/wid-edit.el @@ -1878,20 +1878,9 @@ as the argument to `documentation-property'." (let ((value (widget-get widget :value))) (and (listp value) (<= (length value) (length vals)) - (let ((head (widget-sublist vals 0 (length value)))) + (let ((head (seq-subseq vals 0 (length value)))) (and (equal head value) - (cons head (widget-sublist vals (length value)))))))) - -(defun widget-sublist (list start &optional end) - "Return the sublist of LIST from START to END. -If END is omitted, it defaults to the length of LIST." - (if (> start 0) (setq list (nthcdr start list))) - (if end - (unless (<= end start) - (setq list (copy-sequence list)) - (setcdr (nthcdr (- end start 1) list) nil) - list) - (copy-sequence list))) + (cons head (seq-subseq vals (length value)))))))) (defun widget-item-action (widget &optional event) ;; Just notify itself. @@ -4117,7 +4106,9 @@ is inline." (setq help-echo (funcall help-echo widget))) (if help-echo (message "%s" (eval help-echo))))) -;;; The End: +;;; Obsolete. + +(define-obsolete-function-alias 'widget-sublist #'seq-subseq "28.1") (provide 'wid-edit) -- cgit v1.2.1