home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / pop / 61 < prev    next >
Encoding:
Internet Message Format  |  1992-11-18  |  4.1 KB

  1. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!spool.mu.edu!agate!doc.ic.ac.uk!uknet!news.cs.bham.ac.uk!axs
  2. From: axs@cs.bham.ac.uk (Aaron Sloman)
  3. Newsgroups: comp.lang.pop
  4. Subject: Re: Yet another anoying feature of VED
  5. Summary: making VED start up with several files
  6. Message-ID: <Bxvu20.K4I@cs.bham.ac.uk>
  7. Date: 17 Nov 92 22:49:12 GMT
  8. References: <TMR.92Nov17150129@emotsun.bham.ac.uk>
  9. Sender: news@cs.bham.ac.uk
  10. Organization: School of Computer Science, University of Birmingham, UK
  11. Lines: 113
  12. Nntp-Posting-Host: emotsun
  13.  
  14. tmr@cs.bham.ac.uk (Tim Read) writes:
  15.  
  16. > Organization: School of Computer Science, University of Birmingham, UK
  17. > Date: Tue, 17 Nov 1992 15:01:29 GMT
  18. >
  19. > I would like to be able to start up ved with several files at once, doing:
  20. >
  21. > ved foo1.p foo2.p foo3.p
  22. >
  23. > (after a long pause)
  24.  
  25. presumably compiling your init.p and your vedinit.p, and then
  26. (possibly) searching your vedsearchlist for a non-existent file
  27. whose name includes spaces.
  28.  
  29. You can reduce the pause by always using a saved image with your
  30. VED stuff pre-compiled. See below.
  31.  
  32. > ....just starts ved with one file called:
  33. >  "foo1.p foo2.p foo3.p" - not what I want.
  34.  
  35. > In emacs doing this (ie emacs foo1.p foo2.p foo3.p) will correctly
  36.                                                            ^^^^^^^^??
  37. > load in the files I require. Can some kind soul tell me how to do
  38. > this with ved?
  39.  
  40. This is correct relative to *your* intentions, but not everyone
  41. would agree. The above could not be the default behaviour because
  42. Unix allows file names with spaces, and if users wish to be able to
  43. edit them with VED they should be allowed to (though for students I
  44. usually redefine ved_ved so as to complain if the filename contains
  45. potentially troublesome characters).
  46.  
  47. There are various ways to make VED do what you want. Here's one.
  48.  
  49. When you give the command "ved" to the shell, this runs
  50. the $popsys/ved executable, which is actually just a link to
  51. $popsys/basepop11
  52.  
  53. Because basepop11 starts up via the command "ved", under Unix it
  54. looks to see whether there's an environment variable $pop_ved, and
  55. in fact there is, with the following setting, defined in
  56. $popsys/popenv
  57.  
  58.     setenv pop_ved "$pop_pop11 :sysinitcomp();ved"
  59.  
  60. and $pop_pop11 is defined thus:
  61.  
  62.     setenv pop_pop11 "-$popsavelib/startup.psv"
  63.  
  64. Thus, when you type "ved foo" that's interpreted as if you had
  65. typed
  66.  
  67.     basepop11  $pop_pop11 :sysinitcomp();ved foo
  68.  
  69. which is equivalent to
  70.  
  71.     basepop11 -$popsavelib/startup.psv :sysinitcomp();ved foo
  72.  
  73. And that runs the basepop11 executable, with the startup.psv saved
  74. image (providing various hooks for X) and then because it finds
  75. the colon it treats the rest of the line as a Pop-11 command. So it
  76. executes sysinitcomp(); (which compiles your init.p file), then
  77. ved runs with argument foo.
  78.  
  79. You can change the way it starts up by re-defining the pop_ved
  80. environment variable.
  81.  
  82.     e.g. setenv pop_ved "$pop_pop11 :sysinitcomp();myved"
  83.  
  84. and then in your init.p define myved to be a macro that reads in a
  85. string of file names separated by spaces, thus
  86.  
  87. define macro myved;
  88.     ;;; Read a string of file names, to end of line, and edit them.
  89.     ;;; Based on lib popvedcommand;
  90.  
  91.     lvars file,
  92.         args = sysparse_string(readstringline());
  93.  
  94.     unless args == [] then
  95.         ;;; make a list of edit commands
  96.         [% for file in args do edit(%file%) endfor %] -> args;
  97.  
  98.         ;;; Put all but the first, into VED's command input stream;
  99.         vedinput(back(args));
  100.  
  101.         ;;; run the first
  102.         front(args)()
  103.  
  104.     endunless;
  105. enddefine;
  106.  
  107. After that
  108.  
  109.     ved file1 file2 file3
  110.  
  111. will start off those three files.
  112.  
  113. If you wish to use your own saved image you can use syssave (see
  114. HLPE SYSSAVE), or mkimage (see HELP MKIMAGE) to create a re-usable
  115. saved image with your utilities precompiled. You can then make it
  116. start up by reading poparglist, and if there are several arguments
  117. it can treat them as file names, as the macro myved does above.
  118.  
  119. I hope this helps. As ever there are alternative solutions.
  120.  
  121. Aaron
  122. -- 
  123. Aaron Sloman, School of Computer Science,
  124. The University of Birmingham, B15 2TT, England
  125. EMAIL   A.Sloman@cs.bham.ac.uk  OR A.Sloman@bham.ac.uk
  126. Phone: +44-(0)21-414-3711       Fax:   +44-(0)21-414-4281
  127.