home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / progs / pari / pari_137 / pari.txt < prev    next >
Lisp/Scheme  |  1992-05-20  |  9KB  |  226 lines

  1.  
  2.                Some Notes on pari-mode
  3.                =======================
  4.  
  5.  
  6. pari-mode runs pari-gp as a sub process of (gnu-)emacs.
  7.  
  8. INSTALATION.
  9. ===========
  10.  
  11. pari-mode consists of three files: pari.txt, pari.el and pari.menu.
  12.  
  13. 1) pari.menu should be placed in any convenient directory, and pari.el
  14.    edited accordingly (see below).
  15.  
  16. 2) pari.el should be installed in a directory in your EMACSLOADPATH.
  17.    At the top of the file five constants are declared.
  18.    gp-chap3, gp-dvi-preview, gp-man-dvi, gp-file-name, gp-menu
  19.    These declarations must be edited to refer to the pathnames
  20.    of the relevant files at your site.
  21.  
  22.    pari.el should then by byte-compiled (using M-x byte-compile-file in
  23.    emacs). This should produce a compiled version pari.elc.
  24.  
  25. 3) pari.txt (this file) is for information only.
  26.  
  27.  
  28. USE
  29. ===
  30.  
  31. To use pari-mode, users should add the following two lines to their .emacs
  32.  
  33. (autoload 'gp "pari" " pari-gp" t)
  34. (autoload 'gpman "pari" " pari-gp manual" t)
  35.  
  36. Or alternatively, if you always want pari to be loaded, just add the line
  37.  
  38. (load "pari" nil t)
  39.  
  40. In either case, three new commands are made available.
  41.  
  42. M-x gp     This starts up the pari-gp process in a new buffer,  *PARI*.
  43. C-u M-x gp The same as M-x gp, but  prompts for the command line arguments.
  44. M-x gpman  This starts up a dvi previewer with the PARI-GP manual.
  45.  
  46.  
  47.  
  48. ===========================================================================
  49.  
  50. PARI-MODE
  51. =========
  52.  
  53. Inside the buffer *PARI*, the following extra commands are available.
  54.  
  55.  KEY       LISP-NAME             DESCRIPTION
  56.  ===       =========             ===========
  57. RET      gp-send-input         Copy current expression to the end,
  58.                                   and send to gp.
  59. M-RET    gp-copy-input         Copy current expression to the end.
  60. M-?      gp-get-man-entry      Display the manual entry for a gp command.
  61. M-\ p    gp-set-prompt         Set the gp prompt.
  62. M-\ c    gp-help-menu          Menu driven help. (Uses the file pari.menu.)
  63. M-\ t    gp-meta-t       \
  64. M-\ d    gp-meta-d        |                                 
  65. M-\ r    gp-meta-r        |        
  66. M-\ w    gp-meta-w        |    
  67. M-\ v    gp-meta-v        |   
  68. M-\ x    gp-meta-x         \  Versions of the gp meta-commands, which    
  69. M-\ s    gp-meta-s         /  prompt for arguments in the mini-buffer  
  70. M-\ a    gp-meta-a        |    and display output in the help buffer.     
  71. M-\ b    gp-meta-b        |        
  72. M-\ m    gp-meta-m        |        
  73. M-\ k    gp-meta-k        |       
  74. M-\ q    gp-meta-q       /        
  75. M-\ \    gp-break-long-line    Break a long line at col. 100, inserting \.
  76.  
  77. Note that most of these commands use the emacs meta key.
  78. This may be marked `left' `right' `extended character'  `<>'
  79. or various other markings. If your keyboard has not got a meta key. You
  80. can use the escape key as a prefix.
  81.  
  82. Thus M-\ corresponds to pressing meta and \ together, or pressing 
  83. ESC followed by \ .
  84.  
  85. ===========================================================================
  86.  
  87. RET
  88. ===
  89. If point is after the last gp-prompt,  pressing RET sends current gp
  90. expression to the gp process. If point is at some previous expression, this
  91. expression (which may be several lines long) is copied to the end of the
  92. buffer and then executed.
  93.  
  94. M-RET
  95. =====
  96. M-RET, acts like RET, except that the expression is not sent to the gp
  97. process. It is just copied to the end, so that it may be edited, and then
  98. RET pressed, to send the new expression to gp.
  99.  
  100. M-?
  101. ===
  102. M-? prompts for the name of a gp command (which may include symbolic names
  103. like +). It then finds the appropriate paragraphs of section 3 of the
  104. manual, strips off some of the TeX commands, and displays the result in a
  105. new window. If the command is not found in the manual, sends ?command to
  106. gp, and displays the output in the help window. Thus M-? also works with
  107. user-defined commands.
  108.  
  109. M-\ p
  110. =====
  111. M-\ p prompts for a new string in the mini-buffer. The command
  112. \prompt=<new string>
  113. is then sent to gp, so that gp will now prompt for input with <new string>.
  114. The variable gp-prompt-string is also reset so that RET and M-RET, know
  115. that gp expressions now start with <new string>. Expressions typed to the
  116. old prompt are still recognised.
  117.  
  118. M-\ c
  119. =====
  120. This shows a menu of subject headings. Pressing RET selects the menu of
  121. commands for that heading. Pressing RET by one of the commands displays the
  122. manual entry for that command, as if M-? command had been typed.
  123. (Instructions are displayed in the mini-buffer.)
  124.  
  125. M-\ \
  126. =====
  127. If the line is longer than 100, a \<newline> is inserted every 100 characters.
  128. This is necessary if the line is longer than 256 characters as gp can not accept
  129. line longer than this. M-\ \ moves point to the end of the current line.
  130.  
  131. M-\ 
  132. ===
  133. The other comands on the M-\ prefix send the appropriate meta command to
  134. gp. However they use the mini-buffer to read arguments (eg so that you can
  135. use filename completion) and display any output in the *gp-help* buffer.
  136.  
  137. ===========================================================================
  138.  
  139. Notes
  140. =====
  141.  
  142. 1) You may edit previous expressions, and then type RET to send them to gp.
  143.    However if you want the *PARI* buffer to contain a script of a valid gp
  144.    session, you may prefer to use M-RET to copy the expression to the end
  145.    of the buffer, before editing it.
  146.  
  147. 2) M-\ c is supposed to be a version of the gp meta comand \c, although
  148.    it does not send \c to gp.
  149.    M-\ p does not correspond to the gp meta command \p but rather to the
  150.    command \prompt=  . If this disturbs you it is easy enough to bind
  151.    M-\ p to a command that inserts \p into the *PARI* buffer. 
  152.    The command gp-set-prompt can then be bound to any key sequence that
  153.    you wish. 
  154.    All the other commands on the M-\ prefix do work by sending a gp meta
  155.    command to the *PARI* buffer.
  156.  
  157. 3) The menu of commands produced by M-\ c is contained in the file
  158.    pari.menu. The functions do not assume any particular grouping of the gp
  159.    functions into sections. Also the same gp command can appear in more
  160.    than one section ( ^ already appears in two sections). The format of the
  161.    file should be clear, and it can easily be edited to suit your
  162.    requirements. 
  163.    There should be no blank lines at the beginning, and the file should end
  164.    with a line just containing ###.
  165.    The pari.menu file distributed is based on the table of contents of the
  166.    user manual. 
  167.  
  168. 4) gp-mode-hook.
  169.    Individual users can customise gp-mode without having to make copies of
  170.    the file pari.el.
  171.    In your .emacs define a gp-mode-hook, this will be run by the gp command.
  172.    The format is:
  173.  
  174.        (setq gp-mode-hook 
  175.          (function (lambda ()
  176.        < list of commands to run when starting up gp >
  177.         )))
  178.  
  179.    An example is:
  180.  
  181.        (setq gp-mode-hook 
  182.          (function (lambda ()
  183.            (define-key gp-map "\M-\\p" 'gp-meta-p)
  184.            (define-key gp-map "\M-p" 'gp-set-prompt)
  185.            (setq gp-stack-size "1000000")
  186.            (setq gp-prime-limit "2000")
  187.            (setq gp-menu "my-menu")
  188.        )))
  189.  
  190.   This: 
  191.         Binds a function which sends \p to gp (which would need to be defined
  192.              somewhere else), to M-\ p.
  193.         Binds gp-set-prompt to M-p.
  194.         Defines the default stack size and prime limit as 10000 and 2000.
  195.         Defines the menu file to be my-menu rather than the file pari.menu.
  196.  
  197. 5) Command line arguments.
  198.    The gp executable file is specified in the variable gp-file-name. This
  199.    is set in the file pari.el, but users can override this setting, either
  200.    in their gp-mode-hook, or by using the C-u prefix to gp. In either case,
  201.    the full path name need not be given if gp is in a directory specified
  202.    in your PATH variable (or the equivalent in csh).
  203.    The variables gp-stack-size, gp-buffer-size and gp-prime-limit should be
  204.    set to strings specifying the arguments to gp. See the above example.
  205.  
  206.  
  207.    If these variables are  set to "", then the appropriate flags 
  208.       "-s", "-b" or "-p" are *not* sent to gp. 
  209.    If RET is typed in response to any of the prompts produced by C-u M-x gp
  210.       then the default value, ie., the value of gp-file-name, gp-stack-size,
  211.        gp-buffer-size or gp-prime-limit, is assumed. 
  212.    If a space is sent to the prompt (ie SPC RET) then the appropriate argument
  213.        is not  sent to gp, even if the default is non-empty.
  214.  
  215.    Developers of pari-gp, and others who often use different settings for
  216.    these arguments, may like to add the line
  217.    (setq gp-prompt-for-args t)
  218.    to their gp-mode-hook. Setting this variable to a non-nil value such as t
  219.    makes M-x gp act like C-u M-x gp.
  220.  
  221. ===========================================================================
  222.  
  223.   David Carlisle
  224.  
  225.         16/12/91  ( This file refers to pari.el version 2.9 )
  226.