From: Jim Porter <jporterbugs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Shell quoting in Eshell (was: eshell-batch-file)
Date: Sun, 9 Jun 2024 15:37:05 -0700 [thread overview]
Message-ID: <aacbeb5b-3037-67ca-925f-a899022ecfbc@gmail.com> (raw)
In-Reply-To: <abfd353c-fedf-1587-a218-60f5de8bbfc4@gmail.com>
On 6/9/2024 1:07 PM, Jim Porter wrote:
> On 6/9/2024 12:15 PM, Eli Zaretskii wrote:
>> Curiously, there is already eshell-quote-argument, but it doesn't
>> produce the same effect as shell-quote-argument with 2nd arg non-nil,
>> which is why in esh-proc-tests.el I couldn't use
>> eshell-quote-argument. Any idea why eshell-quote-argument is
>> different?
>
> Hmm, I'm not immediately sure, although I have a feeling that's a bug.
> In particular, 'eshell-quote-argument' doesn't quote parens, which seems
> like a problem since that's how you write Lisp forms in Eshell. Surely
> we'd want to quote those. I'll take a look though, and see if I can fix
> things so we can use 'eshell-quote-argument' in the tests at the right
> spots.
Ah, I figured it out. 'eshell-quote-argument' only produces accurate
results when called from inside an Eshell buffer. It also had a bug
where quoting newlines didn't work properly. I've fixed the latter issue
and documented/worked-around the former, and then updated the tests
where appropriate.
There are just two changes you made that I'm not quite sure what to do
about. When you get the chance, could you apply the following patch and
report back the test failures you get?
--------------------------------------------------
diff --git a/test/lisp/eshell/esh-proc-tests.el
b/test/lisp/eshell/esh-proc-tests.el
index 90bbb4fa14e..6dca1f7ec1c 100644
--- a/test/lisp/eshell/esh-proc-tests.el
+++ b/test/lisp/eshell/esh-proc-tests.el
@@ -289,7 +289,7 @@ esh-proc-test/kill-pipeline
(eshell-wait-for-subprocess t)
(should (string-match-p
;; "interrupt\n" is for MS-Windows.
- (rx (or "interrupt\n" "killed\n" "killed: 9\n" ""))
+ (rx (or "interrupt\n" "killed\n" "killed: 9\n"))
(buffer-substring-no-properties
output-start (eshell-end-of-output)))))))
diff --git a/test/lisp/eshell/eshell-tests-helpers.el
b/test/lisp/eshell/eshell-tests-helpers.el
index acbe57a7283..bfd829c95e9 100644
--- a/test/lisp/eshell/eshell-tests-helpers.el
+++ b/test/lisp/eshell/eshell-tests-helpers.el
@@ -179,12 +179,7 @@ eshell-test-command-result
(defun eshell-command-result--equal (_command actual expected)
"Compare the ACTUAL result of a COMMAND with its EXPECTED value."
- (or (equal actual expected)
- ;; Compare case-isensitively on case-insensitive filesystems.
- (and (memq system-type '(windows-nt ms-dos))
- (stringp actual)
- (stringp expected)
- (string-equal-ignore-case actual expected))))
+ (equal actual expected))
(defun eshell-command-result--equal-explainer (command actual expected)
"Explain the result of `eshell-command-result--equal'."
next prev parent reply other threads:[~2024-06-09 22:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-09 6:11 eshell-batch-file Eli Zaretskii
2024-06-09 18:55 ` eshell-batch-file Jim Porter
2024-06-09 19:06 ` eshell-batch-file Eli Zaretskii
2024-06-09 19:15 ` Shell quoting in Eshell (was: eshell-batch-file) Eli Zaretskii
2024-06-09 20:07 ` Jim Porter
2024-06-09 22:37 ` Jim Porter [this message]
2024-06-15 9:38 ` Eli Zaretskii
2024-06-15 18:36 ` Jim Porter
2024-06-15 19:10 ` Eli Zaretskii
2024-06-15 20:06 ` Jim Porter
2024-06-16 5:21 ` Eli Zaretskii
2024-06-16 5:57 ` Jim Porter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aacbeb5b-3037-67ca-925f-a899022ecfbc@gmail.com \
--to=jporterbugs@gmail.com \
--cc=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.