edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
* [Edbrowse-dev]  glob
@ 2014-12-29 18:22 Karl Dahlke
  2014-12-29 23:26 ` Adam Thompson
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Dahlke @ 2014-12-29 18:22 UTC (permalink / raw)
  To: Edbrowse-dev

I might turn my head around again on this, in that,
I didn't want to think, or be confused,
wondering why I can't read
$phones/at&t
that was my quick example,
but I couldn't type that in at the shell and expect it to work either.
There's something to be said for consistency,
even if it's not the best standard, it's a standard.

My ` escape, I think you're confusing it with the individual excape character,
which it is not, that would still be the backslash.
Rather, ` at the very beginning of a filename
means don't interpret anything in that filename, don't glob,
just leave it be.
I think we may still want that feature, as distinct from \ escape individual characters.

Karl Dahlke

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Edbrowse-dev] glob
  2014-12-29 18:22 [Edbrowse-dev] glob Karl Dahlke
@ 2014-12-29 23:26 ` Adam Thompson
  0 siblings, 0 replies; 4+ messages in thread
From: Adam Thompson @ 2014-12-29 23:26 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: Edbrowse-dev

[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]

On Mon, Dec 29, 2014 at 01:22:29PM -0500, Karl Dahlke wrote:
> I might turn my head around again on this, in that,
> I didn't want to think, or be confused,
> wondering why I can't read
> $phones/at&t
> that was my quick example,
> but I couldn't type that in at the shell and expect it to work either.
> There's something to be said for consistency,
> even if it's not the best standard, it's a standard.

Agreed it's annoying to have to shell escape stuff (particularly some of the
file names I get sent by my Windows using friends),
but at least it's a standard, and I suspect most (all?)
edbrowse users are also command line users.
It'd also be nice to make readline's tab completion produce suitable file
names for this as otherwise that'll get really iritating (at least for
people like me who use readline and tab completion a lot).

> My ` escape, I think you're confusing it with the individual excape character,
> which it is not, that would still be the backslash.
> Rather, ` at the very beginning of a filename
> means don't interpret anything in that filename, don't glob,
> just leave it be.
> I think we may still want that feature, as distinct from \ escape individual characters.

Yeah, I got confused by that. Personally I'd prefer a toggle command,
but I agree we definitely need a way to turn off this feature for really...
interesting... file names.

Cheers,
Adam.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Edbrowse-dev] glob
  2014-12-29  1:03 Karl Dahlke
@ 2014-12-29 16:42 ` Adam Thompson
  0 siblings, 0 replies; 4+ messages in thread
From: Adam Thompson @ 2014-12-29 16:42 UTC (permalink / raw)
  To: Karl Dahlke; +Cc: Edbrowse-dev

[-- Attachment #1: Type: text/plain, Size: 1109 bytes --]

On Sun, Dec 28, 2014 at 08:03:09PM -0500, Karl Dahlke wrote:
> By using wordexp, Adam suggests
> 
> > "posix shell" or words to that effect and then it becomes fairly clear
> 
> Clear? Really? To you and me maybe. Bash does so many crazy things
> at the shell ... arithmetic, regexp substitution,
> and tries to interpret so many characters as something,
> I really don't want to go there.
> I should be able to call up a file called $phones/at&t
> without having to think about it.

Ok, a couple of things:
wordexp is posix *not* bash. There's an important difference in that it
doesn't do as many crazy substitutions as bash does.
Also we can switch off the command substitution feature which makes things a
little simpler.

In addition, we need to standardise the escape character I think if we use glob as otherwise we're going to have ` for some things and \ for others, that's just a mess.
If you really want to keep your hand-rolled env var expansion,
then we definitely need the ${var} syntax,
and probably the \ as escape character to work with the glob call.

Cheers,
Adam.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Edbrowse-dev] glob
@ 2014-12-29  1:03 Karl Dahlke
  2014-12-29 16:42 ` Adam Thompson
  0 siblings, 1 reply; 4+ messages in thread
From: Karl Dahlke @ 2014-12-29  1:03 UTC (permalink / raw)
  To: Edbrowse-dev

By using wordexp, Adam suggests

> "posix shell" or words to that effect and then it becomes fairly clear

Clear? Really? To you and me maybe. Bash does so many crazy things
at the shell ... arithmetic, regexp substitution,
and tries to interpret so many characters as something,
I really don't want to go there.
I should be able to call up a file called $phones/at&t
without having to think about it.
And no idea what a mac or windows user would think of all that complexity.
What I have is generally liked, with no reported problems,
though there may be some hidden bugs and some concerns.
I like the idea of keeping my variable expansion,
perhaps augmented with ${var} or $(var) (makefile style),
and then call glob for the rest.
Glob is the hard part anyways, and the potentially unportable part,
so good to have a library do it.

This expansion can be suspended individually by ``
as in

r ``*
to read in the contents of a file called *

Karl Dahlke

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-12-29 23:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-29 18:22 [Edbrowse-dev] glob Karl Dahlke
2014-12-29 23:26 ` Adam Thompson
  -- strict thread matches above, loose matches on Subject: below --
2014-12-29  1:03 Karl Dahlke
2014-12-29 16:42 ` Adam Thompson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).