[Top][All Lists]

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

Proposal: new syntax for eshell-buffer-shorthand (related: bug#19391)

From: Samer Masterson
Subject: Proposal: new syntax for eshell-buffer-shorthand (related: bug#19391)
Date: Thu, 05 Mar 2015 00:20:01 -0800

Hi list,

Eshell has a buffer shorthand, which you can enable by making "eshell-buffer-shorthand" non-nil. The shorthand looks like this:

~$ echo "words" > '*scratch*

It's currently broken in two ways:
 - Creating a symbol with a single quote doesn't work in eshell, because the single quote starts a string (which follows POSIX).
 - The feature works by adding a branch to eshell-get-target that checks if the target is a symbol, which means internal eshell functions that create symbols to be evaluated are broken, like the external subshell syntax (bug#19391).

I propose that we change eshell-buffer-shorthand in the following 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 (such as bug#19391). 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 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.

So the above example would look like:

~$ echo "words" > #<*scratch*>

I haven't looked into how eshell reads input, so I don't know if there are any significant technical issues with using this syntax. If there aren't any, I'll start working on this. Let me know if you have any questions.


reply via email to

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