From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from resqmta-ch2-10v.sys.comcast.net (resqmta-ch2-10v.sys.comcast.net [IPv6:2001:558:fe21:29:69:252:207:42]) by hurricane.the-brannons.com (Postfix) with ESMTPS id 96FD87AEC5 for ; Fri, 17 Apr 2015 11:02:17 -0700 (PDT) Received: from resomta-ch2-15v.sys.comcast.net ([69.252.207.111]) by resqmta-ch2-10v.sys.comcast.net with comcast id H60z1q0022Qkjl90161DDS; Fri, 17 Apr 2015 18:01:13 +0000 Received: from eklhad ([IPv6:2601:4:5380:4ee:21e:4fff:fec2:a0f1]) by resomta-ch2-15v.sys.comcast.net with comcast id H61D1q00B5LMg210161DCH; Fri, 17 Apr 2015 18:01:13 +0000 To: Edbrowse-dev@lists.the-brannons.com From: Karl Dahlke Reply-to: Karl Dahlke References: <20150316174053.eklhad@comcast.net> <20150417125002.GA14517@toaster.adamthompson.me.uk> User-Agent: edbrowse/3.5.3+ Date: Fri, 17 Apr 2015 14:01:13 -0400 Message-ID: <20150317140113.eklhad@comcast.net> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1429293673; bh=y6Apj33MS7+Lse8QV9RaPypm/8T+yvK/bJKV0C/sfAc=; h=Received:Received:To:From:Reply-to:Subject:Date:Message-ID: Mime-Version:Content-Type; b=qf/kZoy5RaB4uyQyU7YK2zCNjjRIhljLa0/lcOFxLpfkEHKeWpK2DARtAcRJTo6/C FqE2bdpVfc6CN2eXjso7gYsUcCz4IJ3kCDX8Pmk9Sd6JzSZninis8ZXFM0WqLcz1jC 2O6EiuJUiOQ5eqhhwVdrLWQVsgjh7I8QFxrtjdBNXbEEWUDdjcJlJKpXkugbY7n9TS bxVfGYBzPnIDcu3QezRmqulrt35QboIIL/bRkFk2wuNzpMUfEqFmn2Sy/7dzfr76Np UvP8xISkatdBvglmuypsVTjFn0cZspog5MZpWeT8x7JUCW/0O5756j+Hrh7W5BYvBE AVSsviwOE/zQw== Subject: [Edbrowse-dev] wordexp again X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2015 18:02:18 -0000 I pulled the latest, withthe quick check removed, and I don't like it, or I'm just not use to it. This is a change in the user interface, and if we all agree it should be made, then I also need to change the documentation. I designed it so that it would not be hard or complicated or confusing to edit files, like a'b or a(b or a|b or a[b, and now these all produce errors, where they didn't before. Errors because they all run through wordexp, and they didn't before. e a(b unexpected error while evaluating the shell pattern What is the user suppose to do with that?? edbrowse use to run filenames through wordexp when it is "reasonable" to do so, as per my check, and as per the following section from my documentation. ------------------------------------------------------------ Whenever a file is read from or written to disk, $var, in the filename, is replaced with the corresponding environment variable. Thus you can edit your address book at any time via `e $adbook', provided $adbook has been set in your environment. Also, a leading ~/ is replaced with $HOME/, making it easy to edit files in your home directory such as ~/.profile. Shell meta characters are also expanded, provided the result is one file name. You can read or write a file by typing a minimal portion of its name. e work/foo* to get work/foobar. Expansion is performed by wordexp(3), simulating a posix shell. Unfortunately this has certain side effects. Meta characters such as | & ' < ; etc will derail the expansion, unless escaped by a backslash. This is confusing at first, so think of it this way: "If I want to expand a file name using variables or wild cards, i.e. a string containing $ [] * ? or a leading ~/, I have to type it in as though I were typing at the shell." An example might be $phones/at\&t. Even spaces must be escaped with backslash or put in quotes. This complexity only occurs if you are accessing environment variables or globbing. ------------------------------------------------------------ So the quick check was there for a reason, and I don't think it was particularly buggy. I don't want us to undo each other's work, that isn't productive, so we should decide if we want this feature, yes or no, and if we do put it back in, and if we don't then I need to change the documentation. I like the feature, because I don't want to have to escape things with backslashes all the time, except on that rare occasion that I am invoking wordexp and need to escape things for wordexp. Another option is to forget wordexp and go back to the code that I wrote 5 years ago, my own variable expansion and globbing, which worked, and didn't have any of this '"()|; confusion around it. It did what you want and didn't have any side effects. Maybe I should have left well enough alone. But we are where we are, and from here I guess I'd like to put my quick check back in, perhaps modified if you think it has some bugs. By the way, removing quick check had nothing to do with the bug that I posted at the top of this thread. You stil can't edit a directory with backslash in the name, and I think that is a bug in wordexp that we can't get around. That's maybe another reason to go back to my home grown code. Karl Dahlke