From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Samer Masterson Newsgroups: gmane.emacs.devel Subject: Proposal: new syntax for eshell-buffer-shorthand (related: bug#19391) Date: Thu, 05 Mar 2015 00:20:01 -0800 Message-ID: <1425543601.2108.0@mail.samertm.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=-GqLrpa3ZJlvtm04E6jGD" X-Trace: ger.gmane.org 1425543651 12448 80.91.229.3 (5 Mar 2015 08:20:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 5 Mar 2015 08:20:51 +0000 (UTC) Cc: Eli Zaretskii To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Mar 05 09:20:33 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YTR1F-00069O-2R for ged-emacs-devel@m.gmane.org; Thu, 05 Mar 2015 09:20:33 +0100 Original-Received: from localhost ([::1]:50110 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTR1D-00075T-TT for ged-emacs-devel@m.gmane.org; Thu, 05 Mar 2015 03:20:31 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTR16-000714-11 for emacs-devel@gnu.org; Thu, 05 Mar 2015 03:20:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YTR15-0004iJ-0Q for emacs-devel@gnu.org; Thu, 05 Mar 2015 03:20:23 -0500 Original-Received: from ec2-52-0-7-12.compute-1.amazonaws.com ([52.0.7.12]:50330 helo=samertm.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YTR10-0004hP-4e; Thu, 05 Mar 2015 03:20:18 -0500 Original-Received: from [10.1.10.16] (c-98-210-154-226.hsd1.ca.comcast.net [98.210.154.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by samertm.com (Postfix) with ESMTPSA id 5138B42D22; Thu, 5 Mar 2015 08:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samertm.com; s=mail; t=1425543602; bh=V+XyriZd7RBoMq1dxu9bBMP3i82Qav23Ii6qmMhmbuk=; h=Date:From:Subject:To:Cc:From; b=uv1NBFYjfHE/y2tTum9WFzBPrALgAT/kevRlXBhv2tA+pwLfUU4So1hfkAuC1qlau uoD9SULhcxZ0ti7Sz46O6f8TKZhTcSUksquXbqFnvriyDrbHFNvq0umIglrL94+cH1 4+oCw2KJJ1SkjkwzuF3kq9dM0uixHkbLtyFPoMVY= X-Mailer: geary/0.9.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 52.0.7.12 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:183659 Archived-At: --=-GqLrpa3ZJlvtm04E6jGD Content-Type: text/plain; charset=utf-8; format=flowed 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 # would work. - The shorthand should be processed as a buffer (similar to how # 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. -samer --=-GqLrpa3ZJlvtm04E6jGD Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi list,

Eshell has a buffer shorthand, which you can en= able 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 quo= te starts a string (which follows POSIX).
 - The feature wor= ks by adding a branch to eshell-get-target that checks if the target is a s= ymbol, which means internal eshell functions that create symbols to be eval= uated are broken, like the external subshell syntax (bug#19391).
=
I propose that we change eshell-buffer-shorthand in the foll= owing ways:
 - The syntax for the shorthand should be distin= ct 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 (suc= h as bug#19391). Something like #<name-of-buffer> would work.
 - The shorthand should be processed as a buffer (similar to how #&= lt;buffer name-of-buffer> is processed). That means the shorthand won't = require extra code anywhere except for the reader.
 - The sh= orthand 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 invitin= g bugs when we shouldn't be.

So the above example = would look like:

~$ echo "words" > #<*scratc= h*>

I haven't looked into how eshell reads inpu= t, 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.

-samer
= --=-GqLrpa3ZJlvtm04E6jGD--