[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon May 9 13:27:11 2001 
Subject:Re: Editing filenames with spaces 
From:jonathan . cunningham 
Volume-ID:1010509.03 

-----Original Message-----
From: Stephen Isard <S.IsardDeleteThis@ed.ac.uk>
To: pop-forum@cs.bham.ac.uk <pop-forum@cs.bham.ac.uk>
Date: 09 May 2001 13:18
Subject: Re: Editing filenames with spaces


>Aaron Sloman See text for reply address wrote:
>
>>    ENTER ved my report
>> 
>> makes Ved attempt to read in a file called "my" and a file called
>> "report".
>> 
(snip)
>I think the most natural thing would be to require the user to quote
>names containing spaces (or other abnormal characters) in the way that
>shells do.  The procedure vedfilecomplete (bound to ESC 3 on my solaris
>xved) could be made to assist the user by inserting quotes around words
>that need them in the way that file completion in the bash shell does.
>At the moment, if I have a file named 'junk 1', and ask ved to complete
>a filename beginning with 'junk', it offers me 'junk 1' as a choice, but
>then behaves as Aaron describes if I accept that choice.


I don't know if the following is of interest, but it might be :-),

In Windows, if you drag files onto the icon for an executable program (or
shortcut [== symbolic link] to a program) it runs it with command line
arguments consisting of the filenames. (Presumably it ought to be
possible to edit a file by dragging it onto a VED icon ... does that
work? But I digress.) E.g. dragging (the icon for) file "rhubarb.txt"
onto (the icon for) file "myprog.exe" runs myprog with a command
line of 'MYPROG.EXE RHUBARB.TXT'. Actually, that's not true, it uses
the full pathname, e.g.
    'C:\\PROGRA~1\\MYPROG.EXE C:\\MYDOCU~1\\RHUBARB.TXT'

As far as I can tell, up until Windows ME, the command-line used the
old 8.3 DOS filenames, even though the GUI shows longer filenames. In
Windows ME and Windows 2000 this has changed, so that
the new "command line" the very same program receives would be,
    '"C:\\Program Files\\myprog.exe" "C:\\My Documents\\rhubarb.txt"'

i.e. it gets quoted pathnames (in double quotes). (The single quotes
are pop string quotes which I've inserted in the faint hope of making
my post to popforum clearer.)

Anyway, the point of all this, is that you might just conceivably
want to parse the ved command line in a similar way, at least as an
option.

I suppose it is too late to swap the roles of single and double
quotes in the pop11 language, but if we were designing it now, I
suspect we would use double quotes as string quotes.

How about this, as a new lexical syntax proposal (somewhat tongue-in
cheek, since no one will take it seriously):

OLD
'this is a string'
"word"
'c' ;;; a character

NEW
"this is a string"
'word
'c' ;;; a character

Note that word quote is an *un* matched single quote. The single quote
for quoting words is, of course, lisp-like. And quite unambiguous, I
think.

Some more examples of the putative new syntax,
  'this\ is\ a\ word
  'this\ is\ two\ words'.
  "this\ is\ a\ string". ;;; followed by a dot
  'c'-> foo; assigning a character to foo
  'c' -> foo; assigning a character to foo
  'c '-> foo; a syntax error
  'c-> foo; assigning a word to foo
  '+ -> foo; assigning a word to foo
  '+-> foo; a syntax error
  '+'-> foo; assigning a character to foo
  '+-> ->foo; assigning a word to foo

Jonathan