aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/emacs-lisp/seq.el1
-rw-r--r--lisp/eshell/em-hist.el2
-rw-r--r--lisp/eshell/esh-util.el20
-rw-r--r--lisp/wid-edit.el19
4 files changed, 15 insertions, 27 deletions
diff --git a/lisp/emacs-lisp/seq.el b/lisp/emacs-lisp/seq.el
index 2b8807faad5..f2f7d677e88 100644
--- a/lisp/emacs-lisp/seq.el
+++ b/lisp/emacs-lisp/seq.el
@@ -147,6 +147,7 @@ the sequence, and its index within the sequence."
147 "Return a shallow copy of SEQUENCE." 147 "Return a shallow copy of SEQUENCE."
148 (copy-sequence sequence)) 148 (copy-sequence sequence))
149 149
150;;;###autoload
150(cl-defgeneric seq-subseq (sequence start &optional end) 151(cl-defgeneric seq-subseq (sequence start &optional end)
151 "Return the sequence of elements of SEQUENCE from START to END. 152 "Return the sequence of elements of SEQUENCE from START to END.
152END is exclusive. 153END is exclusive.
diff --git a/lisp/eshell/em-hist.el b/lisp/eshell/em-hist.el
index b7b1778ebb1..e559f5b39fe 100644
--- a/lisp/eshell/em-hist.el
+++ b/lisp/eshell/em-hist.el
@@ -758,7 +758,7 @@ matched."
758 (setq nth (eshell-hist-word-reference nth))) 758 (setq nth (eshell-hist-word-reference nth)))
759 (unless (numberp mth) 759 (unless (numberp mth)
760 (setq mth (eshell-hist-word-reference mth))) 760 (setq mth (eshell-hist-word-reference mth)))
761 (cons (mapconcat #'identity (eshell-sublist textargs nth mth) " ") 761 (cons (mapconcat #'identity (seq-subseq textargs nth (1+ mth)) " ")
762 end)))) 762 end))))
763 763
764(defun eshell-hist-parse-modifier (hist reference) 764(defun eshell-hist-parse-modifier (hist reference)
diff --git a/lisp/eshell/esh-util.el b/lisp/eshell/esh-util.el
index 8ef1ac9c345..1dcbed3d961 100644
--- a/lisp/eshell/esh-util.el
+++ b/lisp/eshell/esh-util.el
@@ -223,18 +223,6 @@ then quoting is done by a backslash, rather than a doubled delimiter."
223 (string-to-number string) 223 (string-to-number string)
224 string)))))) 224 string))))))
225 225
226(defun eshell-sublist (l &optional n m)
227 "Return from LIST the N to M elements.
228If N or M is nil, it means the end of the list."
229 (let ((a (copy-sequence l)))
230 (if (and m (consp (nthcdr m a)))
231 (setcdr (nthcdr m a) nil))
232 (if n
233 (setq a (nthcdr n a))
234 (setq n (1- (length a))
235 a (last a)))
236 a))
237
238(defvar-local eshell-path-env (getenv "PATH") 226(defvar-local eshell-path-env (getenv "PATH")
239 "Content of $PATH. 227 "Content of $PATH.
240It might be different from \(getenv \"PATH\"), when 228It might be different from \(getenv \"PATH\"), when
@@ -710,9 +698,17 @@ gid format. Valid values are `string' and `integer', defaulting to
710; (or result 698; (or result
711; (file-attributes filename)))) 699; (file-attributes filename))))
712 700
701;; Obsolete.
702
713(define-obsolete-function-alias 'eshell-copy-tree #'copy-tree "28.1") 703(define-obsolete-function-alias 'eshell-copy-tree #'copy-tree "28.1")
714(define-obsolete-function-alias 'eshell-user-name #'user-login-name "28.1") 704(define-obsolete-function-alias 'eshell-user-name #'user-login-name "28.1")
715 705
706(defun eshell-sublist (l &optional n m)
707 "Return from LIST the N to M elements.
708If N or M is nil, it means the end of the list."
709 (declare (obsolete seq-subseq "28.1"))
710 (seq-subseq l n (1+ m)))
711
716(provide 'esh-util) 712(provide 'esh-util)
717 713
718;;; esh-util.el ends here 714;;; esh-util.el ends here
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'."
1878 (let ((value (widget-get widget :value))) 1878 (let ((value (widget-get widget :value)))
1879 (and (listp value) 1879 (and (listp value)
1880 (<= (length value) (length vals)) 1880 (<= (length value) (length vals))
1881 (let ((head (widget-sublist vals 0 (length value)))) 1881 (let ((head (seq-subseq vals 0 (length value))))
1882 (and (equal head value) 1882 (and (equal head value)
1883 (cons head (widget-sublist vals (length value)))))))) 1883 (cons head (seq-subseq vals (length value))))))))
1884
1885(defun widget-sublist (list start &optional end)
1886 "Return the sublist of LIST from START to END.
1887If END is omitted, it defaults to the length of LIST."
1888 (if (> start 0) (setq list (nthcdr start list)))
1889 (if end
1890 (unless (<= end start)
1891 (setq list (copy-sequence list))
1892 (setcdr (nthcdr (- end start 1) list) nil)
1893 list)
1894 (copy-sequence list)))
1895 1884
1896(defun widget-item-action (widget &optional event) 1885(defun widget-item-action (widget &optional event)
1897 ;; Just notify itself. 1886 ;; Just notify itself.
@@ -4117,7 +4106,9 @@ is inline."
4117 (setq help-echo (funcall help-echo widget))) 4106 (setq help-echo (funcall help-echo widget)))
4118 (if help-echo (message "%s" (eval help-echo))))) 4107 (if help-echo (message "%s" (eval help-echo)))))
4119 4108
4120;;; The End: 4109;;; Obsolete.
4110
4111(define-obsolete-function-alias 'widget-sublist #'seq-subseq "28.1")
4121 4112
4122(provide 'wid-edit) 4113(provide 'wid-edit)
4123 4114