* 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.
"Return a shallow copy of SEQUENCE."
(copy-sequence sequence))
+;;;###autoload
(cl-defgeneric seq-subseq (sequence start &optional end)
"Return the sequence of elements of SEQUENCE from START to END.
END is exclusive.
(setq nth (eshell-hist-word-reference nth)))
(unless (numberp mth)
(setq mth (eshell-hist-word-reference mth)))
- (cons (mapconcat #'identity (eshell-sublist textargs nth mth) " ")
+ (cons (mapconcat #'identity (seq-subseq textargs nth (1+ mth)) " ")
end))))
(defun eshell-hist-parse-modifier (hist reference)
(string-to-number string)
string))))))
-(defun eshell-sublist (l &optional n m)
- "Return from LIST the N to M elements.
-If N or M is nil, it means the end of the list."
- (let ((a (copy-sequence l)))
- (if (and m (consp (nthcdr m a)))
- (setcdr (nthcdr m a) nil))
- (if n
- (setq a (nthcdr n a))
- (setq n (1- (length a))
- a (last a)))
- a))
-
(defvar-local eshell-path-env (getenv "PATH")
"Content of $PATH.
It might be different from \(getenv \"PATH\"), when
; (or result
; (file-attributes filename))))
+;; Obsolete.
+
(define-obsolete-function-alias 'eshell-copy-tree #'copy-tree "28.1")
(define-obsolete-function-alias 'eshell-user-name #'user-login-name "28.1")
+(defun eshell-sublist (l &optional n m)
+ "Return from LIST the N to M elements.
+If N or M is nil, it means the end of the list."
+ (declare (obsolete seq-subseq "28.1"))
+ (seq-subseq l n (1+ m)))
+
(provide 'esh-util)
;;; esh-util.el ends here
(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.
(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)