home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / vms / 17628 < prev    next >
Encoding:
Internet Message Format  |  1992-11-08  |  5.5 KB

  1. Path: sparky!uunet!spool.mu.edu!agate!ucbvax!BARRA.COM!louis
  2. From: louis@BARRA.COM (Louis Dunne)
  3. Newsgroups: comp.os.vms
  4. Subject: Re: EMACS as default mail editor?
  5. Message-ID: <9211072250.AA13539@hermann.barra.COM>
  6. Date: 7 Nov 92 22:50:40 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: BARRA Inc., Berkeley, California.
  10. Lines: 115
  11.  
  12. On Nov 6, 12:12pm, Harvey Brydon (918)250-4312 wrote:
  13. > Subject: Re: EMACS as default mail editor?
  14. >In article <1992Nov4.162506.13620@synapse.bms.com>, kaz@bms.com writes:
  15. >>Does anyone know if it's possile to specify EMACS as as the default
  16. >>editor in MAIL?
  17. >>
  18. >>The documentation for SET EDITOR in MAIL says to specify any callable
  19. >>editor.  I don't beleive that EMACS is callable, but I'm not sure about
  20. >>that.
  21. >>
  22. >>I'm running EMACS v18.58.1 on VMS 5.4-2.
  23. >
  24. >If it has an executable in sys$share of the form xxxSHR.EXE with some required
  25. >entry points, it can be considered callable by mail and other applications.
  26. >Do:
  27. >
  28. >$ dir sys$share:*shr.exe
  29. >
  30. >If Emacs shows up in the list, you're in business.  If not, you're not.  There
  31. >are a legion of other files matching this filespec that are not editors, by
  32. >the way.  UISSHR.EXE is not an editor...
  33.  
  34.     If your editor isin't callable, then use the MAIL$EDIT logical.
  35.     Point this a command procedure to be invoked. When MAIL needs to
  36.     invoke an editor (e.g. via a SEND/EDIT) it will create a sub-process
  37.     to execute this command procedure. You can then do anything you
  38.     like in this command procedure, as long as you leave behind a file
  39.     of the name that MAIL expects (which you can see from the example
  40.     below).
  41.  
  42.     NOTE:    You are not limited to just editors; you can do ANYTHING
  43.         as long as the file exists when the command procedure exits.
  44.         If the file does not exist no message will be sent.
  45.  
  46.     For example:
  47.         $ sh log mail$edit
  48.            "MAIL$EDIT" = "VI$DIR:VI_MAIL.COM" (LNM$PROCESS_TABLE)
  49.  
  50.         $ type mail$edit
  51.         $ assign/nolog sys$command sys$input
  52.         $ vi home:[000000]mail_'f$getjpi("","master_pid")'_send.tmp
  53.         $ deass sys$input
  54.  
  55.     One downside is that it takes a while (on most systems) to create the
  56.     sub-process, which is not nearly as fast (or efficient) as using a
  57.     callable interface to the editor.
  58.  
  59.  
  60.     BUT, in reality most editors you will use will have been written using
  61.     TPU, your version of EMACS included. Usually you will have (or you can
  62.     make) a section file which contains the TPU routines that constitute
  63.     your editor. If you define the logical TPU$SECTION to point to this
  64.     section file, then it will be read and executed every time TPU starts
  65.     up unless you tell it otherwise using command line qualifiers.
  66.     TPU$SECTION by default point to EVE$SECTION, which is not normally
  67.     defined. So, you can point TPU$SECTION or EVE$SECTION to the section
  68.     file containing your editor. But you should really re-define TPU$SECTION,
  69.     because you're not using EVE!
  70.     For example:
  71.  
  72.         $ sh log tpu$section
  73.            "TPU$SECTION" = "EVE$SECTION" (LNM$SYSTEM_TABLE)
  74.         $ sh log eve$section
  75.         %SHOW-S-NOTRAN, no translation for logical name EVE$SECTION
  76.         $ edit/tpu
  77.             [invokes EVE]
  78.     
  79.         $ assign/nolog vi$dir:vi.gbl tpu$section
  80.         $ edit/tpu
  81.             [invokes VI]    (or whatever)
  82.  
  83.     The same goes for MAIL too. Set your editor to TPU and have
  84.     TPU$SECTION pointing at your editor's section file. MAIL will then
  85.     start TPU which will read and execute that section file and hence
  86.     your editor.
  87.  
  88.     There is one annoying caveat I've found in doing this. Often your
  89.     editor (within it's TPU code) will issue CALL_USER calls to invoke
  90.     code written in other languages. This "other" code by default should
  91.     reside in SYS$SHARE:TPUSHR.EXE. The usuall way to get TPU to look
  92.     at routines you've written is to define the TPU$CALLUSER logical
  93.     to point to a sharable image that you've writen which contains
  94.     the given routines (to be called from the TPU code). Anyhow, the
  95.     annoying caveat is this: when invoked from MAIL the image pointed
  96.     to by TPU$CALLUSER seems to be ignored. I'm not entirely sure why
  97.     this happens (I don't have sources), and I would have thought that
  98.     this has little to do with MAIL and more to do with the TPU side
  99.     of things. So the result is when your editor uses CALL_USER, the
  100.     routine can't be found, and TPU issues error messages.
  101.  
  102.     I suspect that if the TPU$CALLUSER is defined in a higher access
  103.     mode it would work. MAIL is probably guarding against users
  104.     intercepting the CALL_USER calls that EVE would make with code in
  105.     their own image, thus producing a loophole if that account where
  106.     captive. As I have said, I don't don't have the sources so I can't
  107.     verify that these are MAIL's motives. Perhaps a TPU developer or
  108.     someone with sources could verify this.
  109.  
  110.     So, the bottom line is:
  111.         1) If you don't mind the overhead, use the MAIL$EDIT
  112.            approach.
  113.         2) Try the TPU$SECTION approach, and if your editor
  114.            has problems locating it's code on calls to CALL_USER
  115.            then try defining TPU$CALLUSER in a higher access mode.
  116.  
  117. Louis
  118.        -------------------------------------------------------------------------
  119.       / Louis Dunne                          /                                /
  120.      /  VMS/UNIX Systems                    /  Internet:   louis@barra.com   /
  121.     /                                      /   Phone:      +1 510 649-4229  / 
  122.    /    BARRA, Inc.                       /    Fax:        +1 510 548-4374 /
  123.   /     1995 University Ave., Suite 400  /                                /
  124.  /      Berkeley, CA 94704              /                                /
  125. -------------------------------------------------------------------------
  126.  
  127.