diff options
| author | Stefan Kangas <stefan@marxist.se> | 2021-04-03 01:21:32 +0200 |
|---|---|---|
| committer | Stefan Kangas <stefan@marxist.se> | 2021-04-03 03:11:35 +0200 |
| commit | cd5dfa086d204c01791bfdcdf9fe1215c4bf1e42 (patch) | |
| tree | b87b59c29cc57b6d19048ba60e8e5b1356eacc38 /lisp/wid-edit.el | |
| parent | be9e3c48fab335c9084e472acef2065f41d20969 (diff) | |
| download | emacs-cd5dfa086d204c01791bfdcdf9fe1215c4bf1e42.tar.gz | |
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.
Diffstat (limited to 'lisp/wid-edit.el')
| -rw-r--r-- | lisp/wid-edit.el | 19 |
1 files changed, 5 insertions, 14 deletions
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) |
