Subject: Re: [PATCH] bug#19391: 25.0.50; eshell-buffer-shorthand breaks command dollar expansion

From: Samer Masterson <[email-masked]>
Date: Tue, 03 Mar 2015 23:50:34 -0800

On Tue, Mar 3, 2015 at 7:56 AM, Eli Zaretskii <[email-masked]> wrote:
> Can you explain why we should lose this user option?  I understand
> that it causes trouble in this scenario, but can we solve the bug
> without losing the option?  If not, why having the limitation
> documented in the doc string is not good enough?
> 
> Thanks.

I think the strongest reason for losing the option is that it currently 
doesn't work: If you type "echo hello > '*scratch" into eshell and 
press enter, eshell adds a newline without evaluating the command 
because it thinks it's in a string because of the unmatched single 
quote. Its implementation also makes eshell more complex, because 
eshell-get-target *only* checks for symbols if the option is selected, 
and then gets-or-creates a buffer with the symbol name.

I think having a shorthand for buffers in eshell is a good thing, but 
it should be different in three ways:
 - The syntax for the shorthand should be distinct from any other lisp 
objects, so that we don't have to put out fires when people try to do 
things that are valid but overlap with the shorthand (e.g. this bug was 
caused by eshell's external shell feature redirecting to a symbol.) 
Something like #<name-of-buffer> would work.
 - The shorthand should be processed as a buffer (similar to how 
#<buffer name-of-buffer> is processed). That means the shorthand won't 
require extra code anywhere except for the reader.
 - The shorthand should be on by default, and probably shouldn't have 
an option to disable it. The reason for this is that the shorthand 
would be universally beneficial and backwards compatible, and making it 
controlled by an option is inviting bugs when we shouldn't be.

Let me know what you think of the above, and I can add more detail to 
the proposal and submit it to emacs-devel.

Best,
Samer