bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#54227: 29.0.50; [PATCH] Inconsistencies with Eshell variable interpo


From: Eli Zaretskii
Subject: bug#54227: 29.0.50; [PATCH] Inconsistencies with Eshell variable interpolation
Date: Thu, 03 Mar 2022 19:03:42 +0200

> From: Jim Porter <jporterbugs@gmail.com>
> Date: Wed, 2 Mar 2022 22:35:22 -0800
> 
> +(defmacro eshell-with-temp-command (command &rest body)
> +  "Narrow the buffer to COMMAND and execute the forms in BODY.

What does it mean to "narrow the buffer to COMMAND"?

Imagine that the user only sees this one line of the doc string --
that actually happens in apropos commands.  How can such a user
understand what this macro does?

> +COMMAND can either be a string, or a cons cell demarcating a
> +buffer region.  If COMMAND is a string, temporarily insert it
> +into the buffer before narrowing.  Point will be set to the
> +beginning of the narrowed region.

After reading this several time and looking at the implementation, I'm
beginning to think that COMMAND is not a good name for this argument.

> +(defun eshell-parse-inner-double-quote (bound)
> +  "Parse the inner part of a double quoted string.
> +The string to parse starts at point and ends at BOUND.
> +
> +If Eshell is currently parsing a quoted string and there are any
> +backslash-escaped characters, this will return the unescaped
> +string, updating point to BOUND.  Otherwise, this returns nil and
> +leaves point where it was."

This seems to just unescape characters in the string?  If so, "parse"
is not the best name for it, and the first line of the doc string
should say "unescape", not "parse".

Thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]