]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't use 'eshell-eval-using-options' for 'eshell/source' or 'eshell/.'
authorJim Porter <jporterbugs@gmail.com>
Fri, 21 Jan 2022 03:51:39 +0000 (19:51 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Fri, 21 Jan 2022 12:06:34 +0000 (13:06 +0100)
This makes 'source' and '.' in Eshell more compatible with regular
shells, which just treat the first argument as the file to source and
all subsequent arguments as arguments to that file.

* lisp/eshell/em-script.el (eshell/source, eshell/.): Don't use
'eshell-eval-using-options'.

* etc/NEWS: Announce the change (bug#53293)

etc/NEWS
lisp/eshell/em-script.el

index 4cf99490ce51c75c4d69243143a259f4876a25f1..a4908017a28a7ff7504b8321b052ad166aff3190 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -104,6 +104,11 @@ files that were compiled with an old EIEIO (Emacs<25).
 ** 'C-x 8 .' has been moved to 'C-x 8 . .'.
 This is to open up the 'C-x 8 .' map to bind further characters there.
 
+---
+** 'source' and '.' in Eshell no longer accept the '--help' option.
+This is for compatibility with the shell versions of these commands,
+which don't handle options like '--help' in any special way.
+
 \f
 * Changes in Emacs 29.1
 
index e8459513f39294d5b100332857b7e2bdd4803b9e..e0bcd8b099fdc7f1e0ff98625247e6dadd7ab4ad 100644 (file)
@@ -113,27 +113,13 @@ Comments begin with `#'."
 
 (defun eshell/source (&rest args)
   "Source a file in a subshell environment."
-  (eshell-eval-using-options
-   "source" args
-   '((?h "help" nil nil "show this usage screen")
-     :show-usage
-     :usage "FILE [ARGS]
-Invoke the Eshell commands in FILE in a subshell, binding ARGS to $1,
-$2, etc.")
-   (eshell-source-file (car args) (cdr args) t)))
+  (eshell-source-file (car args) (cdr args) t))
 
 (put 'eshell/source 'eshell-no-numeric-conversions t)
 
 (defun eshell/. (&rest args)
   "Source a file in the current environment."
-  (eshell-eval-using-options
-   "." args
-   '((?h "help" nil nil "show this usage screen")
-     :show-usage
-     :usage "FILE [ARGS]
-Invoke the Eshell commands in FILE within the current shell
-environment, binding ARGS to $1, $2, etc.")
-   (eshell-source-file (car args) (cdr args))))
+  (eshell-source-file (car args) (cdr args)))
 
 (put 'eshell/. 'eshell-no-numeric-conversions t)