home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / amiga / programm / 18171 < prev    next >
Encoding:
Text File  |  1993-01-05  |  3.2 KB  |  82 lines

  1. Newsgroups: comp.sys.amiga.programmer
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!bnrgate!bcars6a8!keithh
  3. From: keithh@bnr.ca (Keith Hanlan)
  4. Subject: Trouble with public screens
  5. Message-ID: <1993Jan5.192631.11275@bcars6a8.bnr.ca>
  6. Sender: usenet@bcars6a8.bnr.ca (Use Net)
  7. Nntp-Posting-Host: bcarh10f
  8. Organization: Bell-Northern Research Ltd., Ottawa
  9. Date: Tue, 5 Jan 1993 19:26:31 GMT
  10. Lines: 70
  11.  
  12. I've written a GnuClient for the Amiga port of GnuEmacs 18.58. It does
  13. a number of things nice and fast but I'm currently having problems
  14. getting it to create a public screen that can be closed later. I'm
  15. using V39.106/V39.48 on an A2000/030 with SAS/C 6.1.
  16.  
  17. My approach is to
  18.     OpenScreenTags(NULL,
  19.                    SA_LikeWorkbench,  TRUE,
  20.                        SA_Height,         STDSCREENHEIGHT,  // -1L
  21.                        SA_Width,          STDSCREENWIDTH,   // -1L
  22.                        SA_PubName,        new_name,         // "Emacs Screen"
  23.                        SA_ErrorCode,      &return_code,
  24.                SA_Depth,          2,
  25.                        NULL)
  26.  
  27. which works except that I get enforcer hits WORD-READs from 0x0 and
  28. 0xC. Interestingly, these hits are the same as the ones I get from
  29. IPrefs when I am booting the machine.  The hits are coming from within
  30. the OpenScreenTags() call itself. I'd really like to get rid of these
  31. hits. I originally wrote this without the V39 SA_LikeWorkbench tag
  32. using the long form recipe of copying pens and so forth. I got the
  33. same hits.
  34.  
  35. After successfully opening the screen I do a
  36.     PubScreenStatus( new_screen, 0L );
  37.  
  38. which is supposed to make it a public screen and seems to work as
  39. well. Certainly Emacs is able to open its window successfully on this
  40. public screen.
  41.  
  42. However, when I try to close it using another process (the client is
  43. transient), it fails. PSX 1.3 is also unable to close it. I'm doing
  44.     screen = LockPubScreen( "Emacs Screen" );
  45.  
  46. which works
  47. and
  48.     CloseScreen(screen);
  49.  
  50. which fails!!!
  51.  
  52. Now the autodocs say that CloseScreen will fail (why is there no
  53. information return code!?) if the screen has windows. There are no
  54. windows however and I've even checked the screen structure's FirstWindow
  55. field and it is indeed NULL. It makes no difference whether my 
  56. UnlockPubScreen() call is before or after the CloseScreen().
  57.  
  58. Does anybody know what is going on?
  59.  
  60. By the way, if you use GnuEmacs and have a request list send it to me
  61. and I'll see about adding it. Currently, my GnuClient does the
  62. following:
  63.     o Opens a public screen if necessary. The name is obtained
  64.           from an environment variable and defaults to "Emacs Screen"
  65.     o Starts temacs itself if necessary. Replaces the Emacs
  66.       script.
  67.     o Does the find-file in such a way as to preserve the proper
  68.       case of the filename so that you don't wind up with multiple
  69.       buffers for the same file (eg <gnuclient.c> and
  70.       <GnuClient.c>. This was the original reason I wrote the
  71.       program.
  72.     o It runs from the CLI or from Workbench and thus can be used
  73.       as a tool.
  74.     o It is residentiable.
  75.  
  76. I'm also adding a hook to Emacs so that when it uniconifies, it makes
  77. sure that the screen is there. This is so that I can close the screen
  78. when its only window goes away.
  79.  
  80. Your help is appreciated,
  81. Keith Hanlan  KeithH@bnr.ca  Bell-Northern Research, Ottawa, Canada 613-765-4645
  82.