all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jim Porter <jporterbugs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: larsi@gnus.org, 54190@debbugs.gnu.org, monnier@iro.umontreal.ca
Subject: bug#54190: 29.0.50; [PATCH] Incorrect/missing documentation for some Eshell "$" syntaxes
Date: Thu, 3 Mar 2022 21:55:41 -0800	[thread overview]
Message-ID: <797bb243-5397-bb8f-0902-7f96273e913f@gmail.com> (raw)
In-Reply-To: <83ilsxlsx0.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 998 bytes --]

On 3/1/2022 5:10 AM, Eli Zaretskii wrote:
> Thanks, installed on the emacs-28 branch.  (But the markup in the
> manual part was wrong; see my followup changes.)

Thanks for fixing that up.

> Fine with me.  It's up to you whether to close this bug or leave it
> open until a better solution is found for master.

After a bit of looking at the `eshell-do-eval' implementation, I 
realized that there's a better solution that's very simple. See the 
attached patch. It's simple enough that it might be fine for Emacs 28, 
but the existing change on the 28 branch is probably a bit safer, since 
that change was just a partial revert. I'm not aware of anything that 
could be broken by this new patch, but you never know...

This doesn't do anything more elaborate like using generator.el's 
machinery here; while (I think) that would be nice to have eventually, 
we can address that in a separate bug, since it'd be a pretty big 
change. We could probably close this bug after this new patch merges.

[-- Attachment #2: 0001-Fix-Eshell-s-command-forms-in-a-better-way.patch --]
[-- Type: text/plain, Size: 1856 bytes --]

From 48387e827cd8d550e9627df7256fd3f1a9705a26 Mon Sep 17 00:00:00 2001
From: Jim Porter <jporterbugs@gmail.com>
Date: Thu, 3 Mar 2022 21:46:11 -0800
Subject: [PATCH] Fix Eshell's '$<command>' forms in a better way

* lisp/eshell/esh-cmd.el (eshell-do-eval): Handle 'lambda' forms.
* lisp/eshell/esh-var.el (eshell-parse-variable-ref): Remove
workaround from commit 9e257ae (bug#54190).
---
 lisp/eshell/esh-cmd.el | 2 +-
 lisp/eshell/esh-var.el | 8 ++------
 2 files changed, 3 insertions(+), 7 deletions(-)

diff --git a/lisp/eshell/esh-cmd.el b/lisp/eshell/esh-cmd.el
index 04b54d9d79..484888ec47 100644
--- a/lisp/eshell/esh-cmd.el
+++ b/lisp/eshell/esh-cmd.el
@@ -1077,7 +1077,7 @@ eshell-do-eval
   (cond
    ((not (listp form))
     (list 'quote (eval form)))
-   ((memq (car form) '(quote function))
+   ((memq (car form) '(quote function lambda))
     form)
    (t
     ;; skip past the call to `eshell-do-eval'
diff --git a/lisp/eshell/esh-var.el b/lisp/eshell/esh-var.el
index af89e35f55..092f9f87a4 100644
--- a/lisp/eshell/esh-var.el
+++ b/lisp/eshell/esh-var.el
@@ -458,12 +458,8 @@ eshell-parse-variable-ref
                        (eshell-parse-command cmd)))
                    (ignore
                     (nconc eshell-this-command-hook
-                           ;; Quote this lambda; it will be evaluated
-                           ;; by `eshell-do-eval', which requires very
-                           ;; particular forms in order to work
-                           ;; properly.  See bug#54190.
-                           (list (function (lambda ()
-                                   (delete-file ,temp))))))
+                           (list (lambda ()
+                                   (delete-file ,temp)))))
                    (quote ,temp)))
             (goto-char (1+ end)))))))
    ((eq (char-after) ?\()
-- 
2.25.1


  reply	other threads:[~2022-03-04  5:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-27 21:34 bug#54190: 29.0.50; [PATCH] Incorrect/missing documentation for some Eshell "$" syntaxes Jim Porter
2022-02-28  6:11 ` Jim Porter
2022-02-28  8:16   ` Jim Porter
2022-02-28  9:38     ` Lars Ingebrigtsen
2022-02-28 13:18       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-02-28 13:28         ` Eli Zaretskii
2022-02-28 17:47         ` Jim Porter
2022-03-01 13:10           ` Eli Zaretskii
2022-03-04  5:55             ` Jim Porter [this message]
2022-03-04  7:16               ` Eli Zaretskii
2022-03-04 13:35               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-03-04 18:04                 ` Jim Porter
2022-09-06 11:28               ` Lars Ingebrigtsen
2022-09-07  3:50                 ` Jim Porter
2022-09-07  3:59                   ` 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=797bb243-5397-bb8f-0902-7f96273e913f@gmail.com \
    --to=jporterbugs@gmail.com \
    --cc=54190@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=monnier@iro.umontreal.ca \
    /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.