]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix definitions of Eshell "xtra" functions
authorJim Porter <jporterbugs@gmail.com>
Mon, 28 Oct 2024 04:13:56 +0000 (21:13 -0700)
committerEshel Yaron <me@eshelyaron.com>
Tue, 29 Oct 2024 09:57:06 +0000 (10:57 +0100)
* lisp/eshell/em-xtra.el (eshell-parse-command): Remove unnecessary
autoload.
(eshell/substitute): Pass the correct number of arguments to
'cl-substitute'.
(eshell/count, eshell/union, eshell/mismatch, eshell/intersection)
(eshell/set-difference, eshell/set-exclusive-or): Use named arguments
for the required arguments (bug#73738).

(cherry picked from commit ea685170063b59855322ceffdeaaab4acaf8e388)

lisp/eshell/em-xtra.el

index 0a032395fd308462f0fdd81f6265a5a00d197234..263ec37a720e5edb7122c8f956236d1efa5b1c73 100644 (file)
@@ -40,46 +40,37 @@ naturally accessible within Emacs."
 
 ;;; Functions:
 
-(autoload 'eshell-parse-command "esh-cmd")
-
 (defun eshell/expr (&rest args)
   "Implementation of expr, using the calc package."
   (calc-eval (eshell-flatten-and-stringify args)))
 
-(defun eshell/substitute (&rest args)
+(defun eshell/substitute (new old seq &rest args)
   "Easy front-end to `cl-substitute', for comparing lists of strings."
-  (apply #'cl-substitute (car args) (cadr args) :test #'equal
-        (cddr args)))
+  (apply #'cl-substitute new old seq :test #'equal args))
 
-(defun eshell/count (&rest args)
+(defun eshell/count (item seq &rest args)
   "Easy front-end to `cl-count', for comparing lists of strings."
-  (apply #'cl-count (car args) (cadr args) :test #'equal
-        (cddr args)))
+  (apply #'cl-count item seq :test #'equal args))
 
-(defun eshell/mismatch (&rest args)
+(defun eshell/mismatch (seq1 seq2 &rest args)
   "Easy front-end to `cl-mismatch', for comparing lists of strings."
-  (apply #'cl-mismatch (car args) (cadr args) :test #'equal
-        (cddr args)))
+  (apply #'cl-mismatch seq1 seq2 :test #'equal args))
 
-(defun eshell/union (&rest args)
+(defun eshell/union (list1 list2 &rest args)
   "Easy front-end to `cl-union', for comparing lists of strings."
-  (apply #'cl-union (car args) (cadr args) :test #'equal
-        (cddr args)))
+  (apply #'cl-union list1 list2 :test #'equal args))
 
-(defun eshell/intersection (&rest args)
+(defun eshell/intersection (list1 list2 &rest args)
   "Easy front-end to `cl-intersection', for comparing lists of strings."
-  (apply #'cl-intersection (car args) (cadr args) :test #'equal
-        (cddr args)))
+  (apply #'cl-intersection list1 list2 :test #'equal args))
 
-(defun eshell/set-difference (&rest args)
+(defun eshell/set-difference (list1 list2 &rest args)
   "Easy front-end to `cl-set-difference', for comparing lists of strings."
-  (apply #'cl-set-difference (car args) (cadr args) :test #'equal
-        (cddr args)))
+  (apply #'cl-set-difference list1 list2 :test #'equal args))
 
-(defun eshell/set-exclusive-or (&rest args)
+(defun eshell/set-exclusive-or (list1 list2 &rest args)
   "Easy front-end to `cl-set-exclusive-or', for comparing lists of strings."
-  (apply #'cl-set-exclusive-or (car args) (cadr args) :test #'equal
-        (cddr args)))
+  (apply #'cl-set-exclusive-or list1 list2 :test #'equal args))
 
 (defalias 'eshell/ff #'find-name-dired)
 (defalias 'eshell/gf #'find-grep-dired)