Annotation of OpenXM_contrib/pari/emacs/pari.el-changes, Revision 1.1
1.1 ! maekawa 1: CHANGE HISTORY of pari.el
! 2: ========================
! 3:
! 4: ==== Version 1 (90)
! 5: Modified Annete Hoffman's code, replacing her help routines by the
! 6: system searching the TeX source of the manual. Added support for
! 7: editing and re-entering previous expressions.
! 8:
! 9: ==== Version 2 (23/11/90)
! 10: gp-get-man-entry fixed to work with the 1.34 version of the manual
! 11: (the TeX format for entries such as + * etc had changed)
! 12: gp-send-input and gp-copy-input now do the right thing on previous
! 13: commands of the form ?command or \parameter=
! 14: (they just send one line)
! 15: Regexp for end of expression changed from "time =" to "time",
! 16: so that it also matches "timer on" and "timer off".
! 17:
! 18: ==== Version 2.1 (27/11/90)
! 19: Changed bin-dir to gp-file-name, mainly so that all global variables
! 20: start with gp-.
! 21: (let ((auto-load-alist nil))) in gp-get-man-entry to stop it loading
! 22: TeX-mode.
! 23: Various functions added bound to the M-\ key prefix. These shadow the
! 24: gp meta commands \c \d \t \w \r .
! 25: M-\ p this was on M-p, sets gp prompt.
! 26: M-\ c Starts up a menu-driven version of gp-get-man-entry.
! 27: M-\ t Like \t in gp, but the output is sent to another buffer.
! 28: M-\ d Like \d in gp, but the output is sent to another buffer.
! 29: M-\ w Like \w in gp, but allows use of file-name completion
! 30: in the mini-buffer.
! 31: M-\ r Like \r in gp, but allows use of file-name completion
! 32: in the mini-buffer.
! 33: The menu feature requires a file (pari.menu) the pathname for this is set
! 34: in the new global variable gp-menu.
! 35: I made pari.menu by editing users.toc, the TeX source for the table of
! 36: contents of the manual. This file may be edited by hand, so as to
! 37: group the gp commands under any desired headings. (The first word of
! 38: each heading must be unique)
! 39:
! 40: ==== Version 2.2 (2/12/90)
! 41: Renamed gp-meta-dt to gp-meta-command.
! 42: Replaced (sit-for 1) in gp-meta-command by gp-wait-for-output.
! 43: (sit-for 1) was too long for short output like \v, but not long enough
! 44: for commands like \x if the last object was large.
! 45: Replaced the two kill-line's in gp-meta-command by delete-regions, so as
! 46: not to mess up the kill-ring. Also replaced a (forward-line -1) by
! 47: (beginning-of-line) so that only the last line deleted.
! 48: Simplified the process sentinels. gp-sentinel now kills all related
! 49: buffers such as *gp-help* if they are present when gp quits.
! 50: Added a few more of gp's meta commands.
! 51: M-\ v Like \v in gp, but the output is sent to another buffer.
! 52: M-\ x Like \x in gp, but the output is sent to another buffer.
! 53: M-\ s Like \s in gp, but the output is sent to another buffer.
! 54: (prompts for an argument, just hit RET to send \s)
! 55: M-\ b Like \b in gp, but the output is sent to another buffer.
! 56: (prompts for an argument, just hit RET to send \b)
! 57: M-\ k Like \k in gp, but asks for confimation.
! 58: M-\ q Like \q in gp, but asks for confimation.
! 59: Added (ding) to gp-help-menu, when point wraps arround buffer.
! 60: Took out the (if gp-map nil) stuff. The gp-map is now set up at
! 61: the `outer level'.
! 62: Added ! <-> fact to the special cases of gp-get-man-entry
! 63: Added gp-interupt, bound to C-c
! 64: Replaced the nested (if )'s in gp-get-man-entry by a (cond )
! 65: Modified gp-help-menu, so that the whole line of the section
! 66: is significant, previous version only used the first word.
! 67:
! 68:
! 69: ==== Version 2.3 (5/12/90)
! 70: Let (gp) take a prefix argument. Any non-nil argument causes gp to prompt
! 71: for the stack size and prime limit.
! 72: NOTE
! 73: With pari 1.35 the syntax will change. The following four lines in
! 74: the definition of gp will be have to be changed.
! 75: Delete the second two lines, and take the comment
! 76: ;; pari 1.35
! 77: out of the first two lines.
! 78:
! 79: ;; pari 1.35 " -s " (read-input "stack size ? ")
! 80: ;; pari 1.35 " -p " (read-input "prime limit ? ")))
! 81: " " (read-input "stack size ? ")
! 82: " " (read-input "prime limit ? ")))
! 83:
! 84: The file will then need to be (re-) byte-compiled.
! 85: Changed the name of the variable gp-arguments to gp-default-arguments.
! 86:
! 87:
! 88: ==== Version 2.4 (6/12/90)
! 89: Added (run-hooks 'gp-mode-hook) to (gp). Individual users can now set up
! 90: their preferences in gp-mode-hook in their .emacs.
! 91: Added (run-hooksÿÿÿÿÿÿ x>u P”Óè P”ΰP”ɸhook specifies a
! 92: different version of the manual, and (gpman) is called before (gp).
! 93:
! 94:
! 95: ==== Version 2.5 (20/12/90)
! 96: Added det2 <-> det to the special cases of (gp-get-man-entry). Also
! 97: added det2 to the file pari.menu.
! 98: Modified (gp-get-man-entry).
! 99: ==========================
! 100: So that if no entry is found, it calls (gp-meta-command "?fn").
! 101: To make this work, took the (concat "\\" ) out of
! 102: (gp-meta-command) and replaced eg (gp-meta-command "s") by
! 103: (gp-meta-command "\\s"). So (gp-get-man-entry) now works with
! 104: user-defined functions.
! 105: Re-did (gp-send-input) and (gp-copy-input).
! 106: =========================================
! 107: (gp-send-input) now calls (gp-copy-input) to save on duplication of
! 108: most of the code. Method for determining the extent of the
! 109: current expression changed. Previous versions searched back to a
! 110: prompt, then if the first non space character was \ or ? sent one
! 111: line, otherwise searched forward to the next prompt or error
! 112: message. This failed spectacularly if the expression involved
! 113: commands such as print or texprint. Also they did not treat the
! 114: last expression very well, hence the need to use LFD when
! 115: entering the last expression. Now, search back to a prompt, then
! 116: if the first non space is {, search forward to the next } (or
! 117: prompt/error message in case of bad expressions) otherwise search
! 118: forward for the first line which does not end with a \ character.
! 119: The markers last-input-end last-input-start is no longer needed.
! 120: So removed from various points. These new versions also let you
! 121: edit ALL lines of the last expression. So the section of
! 122: pari.txt suggesting the use of LFD is deleted. However can not
! 123: now send eg, {print("}")}, but do you want to? In any case
! 124: expressions involving "}" still work if used with the \
! 125: convention.
! 126: (gp-set-prompt) modified so that the new gp-prompt-string matches the
! 127: new prompt AND all the old prompts. The section of pari.txt suggesting
! 128: that this is only used once is deleted.
! 129: (while) loop moved inside (gp-wait-for-output), so that the waiting *is*
! 130: actually done by this function.
! 131: (gp-meta-command) now sends string directly to pari-process, rather than
! 132: inserting in *PARI* and calling (gp-send-input).
! 133:
! 134:
! 135: ==== Version 2.6 (14/2/91)
! 136: (gp-send-input) modified to send three \n's. This flushes out the output
! 137: of \c. The old version of (gp-send-input) became confused when RET
! 138: was pressed in response to the prompt:
! 139: ---- (type return to continue) ----
! 140: (gp-meta-r) renamed to (gp-meta-R) and bound to M-\ R. A new (gp-meta-r)
! 141: brings the file into emacs, and then sends the file to pari via
! 142: (process-send-region). This causes function definitions, multi-line
! 143: expressions and white space to be read correctly.
! 144: These next changes were made in response to H. Cohen's mail (29/1/91).
! 145: gp-prompt-pattern now does not start with "^", so it matches prompts that
! 146: are not at the beginning of a line. This can happen with, eg:
! 147: for(k=1,5,print1(k," "))
! 148: (gp-set-prompt) modified so as not to add a "^" to the user supplied string.
! 149: (gp-copy-input) would have worked unchanged with the new prompt regexp,
! 150: except that help commands are not understood. ?cos would have been
! 151: interpreted as "cos" typed to the prompt "?". So I modified the
! 152: algorithm for finding the start of the expression to the following:
! 153: Search back to the prompt. Then move to the beginning of that line and
! 154: search forward to a prompt. Thus if two `prompts' appear on one line,
! 155: then the expression is taken to start after the FIRST. So:
! 156: ? ?cos
! 157: Is taken as the expression "?cos" typed to the first "?" prompt.
! 158: (gp-process-sentinel) modified so as NOT to kill the *PARI* buffer. It
! 159: deletes the window, but leaves the buffer in emacs. It also inserts
! 160: any message from the exiting process at the end of the buffer.
! 161: Other buffers eg pari.menu are still killed.
! 162: (gp-meta-q) no longer asks for confirmation before killing the pari
! 163: buffers, as *PARI* is not now killed by (gp-process-sentinel).
! 164: (gp t) now asks for the gp file name and buffer size as well as the stack
! 165: size and prime limit. The variable gp-default-argument replaced by the
! 166: three variables: gp-stack-size, gp-buffer-size and gp-prime-limit.
! 167: Just pressing RET in response to a prompt causes the argument to be
! 168: set to the default. gp-stack-size should be a string representing the
! 169: stack size, or "" in which case the "-s" argument is not sent to gp.
! 170: As a special case if a space is sent to the prompt, the stack-size
! 171: argument is not sent to gp. This allows (gp t) to a override non-empty
! 172: default setting of gp-stack-size.
! 173: Similarly for gp-buffer-size and gp-prime-limit.
! 174: This has been simplified by the introduction of the `internal' function
! 175: (gp-read-input) which deals with the handling of default argument strings.
! 176: The command sent to the shell to start gp is now inserted in *PARI* buffer
! 177: for the user's information.
! 178: Back to me ...
! 179: (gp-sentinel) modified to work correctly with alternative menu and TeX
! 180: files. It now uses the variables gp-menu and gp-chap3.
! 181: gp-prompt-pattern initialsed with defvar rather than defconst.
! 182: Added new variable, gp-prompt-for-args. If users set this to a non-nil
! 183: value in their gp-mode-hook, M-x gp acts like C-u M-x gp.
! 184: Replaced instances of (delete-region (point-min) (point-max)) by
! 185: (erase-buffer) at various points.
! 186: (gp-meta-k) rewritten. (No change to its functionality.)
! 187: (gpman) now uses (set-buffer) rather than (switch-to-buffer).
! 188:
! 189:
! 190: ==== Version 2.7 (20/2/91)
! 191: Undid the change to (gp-send-input) made in V2.6. Sending three
! 192: consecutive new-lines does not work with pari 1.34.95 (aka 1.35)
! 193: --- it causes three prompts to be printed.
! 194: Instead of the above, add "---- (type return to continue) ----" to the regexp
! 195: gp-prompt-pattern. Actually this causes two new-lines to be sent to this prompt
! 196: (but who cares).
! 197: Changed pari-process to gp-process, so that now all global variables have names
! 198: starting with gp-
! 199: Initialise gp-stack-size etc to "4000000" rather than "". This means
! 200: that the default is for gp to have the argument "-s 4000000" rather
! 201: than no argument. These are equivalent, but it makes the use of C-u M-x gp
! 202: easier to describe.
! 203: Moved (gp-meta-R) back to (gp-meta-r) (\r seems to work better in pari 1.34.95).
! 204:
! 205: ==== Version 2.7 (10/3/91)
! 206: Take the version of 2.7 from the official release of pari-1.35.
! 207: This is the same as my version except for the initial values of
! 208: gp-man-dvi etc.
! 209:
! 210: ==== Version 2.8 (22/4/91)
! 211: Added (message) commands to (gpman) and (gp-man-sentinel).
! 212: Changed regexp for end of expression in (gp-copy-input) from
! 213: "}" to "}$"
! 214: This is more in line with what gp accepts and also allows
! 215: expressions of the form:
! 216: {print("}")}
! 217: Redo the help menu. This is now a major mode rather than a lisp-loop.
! 218: This has the advantage that the user can move around the menu
! 219: using standard emacs commands, or the mouse as well as using SPC
! 220: and DEL. Also can switch to/from the pari.menu buffer using
! 221: standard commands. This involves the new keymap gp-menu-map,
! 222: The help command is now (gp-menu), bound to M-\ c in *PARI* buffer.
! 223: The commands (gp-menu-quit) (gp-menu-select) (gp-menu-previous)
! 224: (gp-menu-next) are more or less taken straight from the main loop of 2.7
! 225: (gp-menu-main) is 2.7's (gp-main-menu) except that it is (interactive).
! 226: (gp-menu-scroll) is a new command, bound to s, which scrolls the
! 227: help window.
! 228: (gp-menu-info) is just (message <the instructions>).
! 229: Replaced the (other-window 1) commands in (gp-meta-command) and
! 230: (gp-get-man-entry) by
! 231: (let ((wind (selected-window)) ... (select-window wind))
! 232: so that you return
! 233: to the correct window when more than two windows are visible.
! 234: Introduced (gp-replace a b) this replaces a by b everywhere in the
! 235: current buffer.
! 236: Removed each of the (goto-char (point-min)) (perform-replace ...)
! 237: in (gp-get-man-entry) by (gp-replace ...). This saves the
! 238: overheads of messing about with the mark, and (message) that the
! 239: standard emacs replace functions do.
! 240: Added the command (gp-break-long-line) after mail from H. Cohen. gp will not
! 241: accept lines longer than 256 chars. gp-break-long-line (bound to
! 242: M-\ \) breaks the current line at column 100, inserting \ as necessary.
! 243:
! 244:
! 245: ==== Version 2.8+ (24/4/91) (Modification sent to H. Cohen)
! 246: (gp-send-input) now uses a temporary file, gp-temp-file, which is read
! 247: using \r if the expression contains more than 255 chars. This
! 248: gets around the following two problems.
! 249: 1) gp can not accept more than 255 chars in one line.
! 250: 2) emacs can not send any string of more than 1500 or so
! 251: characters using process-send-region.
! 252: (gp-sentinel) modified to remove the file gp-temp-file if it exists.
! 253:
! 254:
! 255: ==== Version 2.9 (13/12/91)
! 256: Made (gp-break-long-line) base line-length on (screen width).
! 257: The following changes were in response to Henri Cohen's mail of
! 258: 13/12/91.
! 259: Changed the regexp for "last expresion" in (gp-copy-input)
! 260: so that:
! 261: %[number] =
! 262: Must come at the beginning of a line, and be followed by a space
! 263: to be considered to be the result of gp returning a value.
! 264: ***
! 265: Must be the first thing on the line except for spaces to be
! 266: considered an error message.
! 267: So now you can enter the expressions %1 == %2 and print("***").
! 268: Added (let (shell-file-name "/bin/sh" ... to (gp-sentinel), hopefully
! 269: this will avoid problems with people who alias rm to rm -i in
! 270: their .\(k\|c\|ba\)shrc files.
! 271: Added gp-meta-a and gp-meta-m identical to gp-meta-b except they
! 272: send \a and \b. Bound them to M-\ a and M-\ m.
! 273:
! 274: ==== Version 2.9+ (16/12/91)
! 275: Moved the call to (delete-windows-on "*PARI*") further down
! 276: (gp-sentinel) so that the *PARI* buffer is never displayed
! 277: after quiting gp. With the previous version, the current buffer
! 278: could get set to the menu buffer, which was then immediately
! 279: killed, causing the *PARI* buffer to be redisplayed.
! 280: Modified the regexp in (gp-copy-input) for "time" and "unused
! 281: characters" to match "***". Thus you can now enter
! 282: print("time")
! 283:
! 284: ==== Version 2.10 (3/6/92)
! 285: New version prompted by the release of pari-1.37!
! 286: Replaced the shell-file-name stuff introduced in 2.9 by a call to
! 287: (delete-file)
! 288: Set process-mark in (gp-meta-command), and added (save-excursion)
! 289: so that it works if not at the end of the buffer.
! 290: Added completion functions.
! 291: In the *PARI* buffer M-TAB calls (gp-complete) which will attempt
! 292: to complete a fuction name. Repeating this causes a list of
! 293: possible completions to be displayed.
! 294: (gp-get-man-entry) if called interactively (M-?) now defaults
! 295: to the word before point, and uses completion (with SPACE or
! 296: TAB) in the minbuffer to enter the function name.
! 297: Initially completion will only work on the functions listed in
! 298: pari.menu. If M-? is used on a user-defined function, then the
! 299: completion functions will `know' this new function.
! 300: (gp-add-symbol) has been added to (gp-get-man-entry).
! 301: Two new functions may be used in a gp-mode-hook (or interactively)
! 302: to teach the completion system about more user-defined
! 303: commands.
! 304: (gp-completion-list "fooa" "foob" "fooc")
! 305: Will let completion work for these three commands.
! 306: (gp-completion-file my-command-file)
! 307: Will add all the commands listed in the file, my-command-file.
! 308: This should have the same format as pari.menu.
! 309: one command per line, comments start with #, ALL TEXT BEFORE THE
! 310: FIRST COMMENT IS IGNORED.
! 311: The completion symbols are stored in the obarray gp-c-array, this
! 312: has size gp-max-completions, which should be set large enough
! 313: to store all possible command names.
! 314:
! 315:
! 316: ==== Version 2.10+ (4/6/92)
! 317: Replaced (gp-last-word) and [^ \t] by (forward-word +/- 1) in by
! 318: gp-get-man-entry and gp-complete. gp-last-word deleted. It was
! 319: originally like this, I changed it, but it is better this way
! 320: now that save-excursion is used in gp-get-man-entry.
! 321: Removed gp-max-completions which was incorrectly documented as
! 322: "Maximum number of command names that may be used in completion"
! 323: Actually any number of symbols can go in each `bucket' of the
! 324: hash table, so this is not a hard limit. Array size now set
! 325: directly (to 509).
! 326:
! 327: ==== Version 2.10++ (5/6/92)
! 328: After mail from Henri Cohen:
! 329: Added the : back to the prompt in (gp-get-man-entry.)
! 330: Re-did (gp-complete). Now the help window does appear if there are
! 331: possible further completions, even if some progress has been
! 332: made. The window is deleted if a unique completion has been
! 333: found.
! 334: (Back to me.)
! 335: Modified (gp-get-man-entry) so that if no definition is found the
! 336: help window is not displayed.
! 337: Modified (gp-get-man-entry) so that \vers is replaced by
! 338: gp-version, a new variable set at the top of the file.
! 339:
! 340: ==== Version 2.11 (9/6/92)
! 341: Got back a version of 2.10+ from H. Cohen, incorporating the new
! 342: (gp-complete)
! 343: Merged in the new (gp-get-man-entry) from 2.10++, and renamed to
! 344: 2.11, so we should now be back in step.
! 345: Modified (gp) to get gp-version from the start-up banner printed
! 346: by gp. gp-version now not defined at top of file.
! 347: Modified (gp) to check that gp is actually running, not just that
! 348: gp-process is non-nil. This helps me when debugging,
! 349: gp-sentinel is supposed to clear gp-process, but if there are
! 350: errors in the elisp, it may not be called at the right time.
! 351: Modified (gp-get-man-entry) to only offer a default function name
! 352: If the word before point is already in the completion array.
! 353: (H.C. complained that the initial default of 30000 was not very
! 354: helpful!)
! 355:
! 356: ==== Version 2.11+ (10/6/92)
! 357: Allow (gp-complete) to complete words beginning with "\"
! 358: Added (gp-completion-list
! 359: "\\precision" "\\serieslength" "\\format")
! 360: So that these standard parameters may be completed. (Not \prompt,
! 361: as if you change the prompt other than by M-\ p, pari.el will
! 362: become very confused.
! 363: Add (if (get-buffer "*gp-help*" .... to (gp-complete) to check the
! 364: help buffer exists before deleting its window.
! 365:
! 366: ==== Version 2.12 (11/8/92)
! 367: Modify (gp-complete) so completing on the single character `\`
! 368: works as expected.
! 369: Fixed typo in (gp-complete) `(' in wrong place in case (1) of
! 370: possible completions.
! 371: Modify (gp-get-man-entry) so that it does not put the default
! 372: into the minibuffer, only into the prompt string. This is
! 373: better, as if you know what function you want, you can M-? and
! 374: then type ahead with the function name, without having to check
! 375: that a default entry needs to be deleted first.
! 376:
! 377: ==== Version 2.12+ (4/9/92)
! 378: Modify (gp-wait-for-output) so that it does not wait if gp is not
! 379: running. Previous version went into an infinite loop looking
! 380: for the version number if gp could not start for some reason.
! 381: Like someone moving all the X-window libs!
! 382: Slightly modified the prompt offered by (gp-get-man-entry).
! 383: (downcase) the string returned by (buffer-substring) in
! 384: (gp-complete) and (gp-get-man-entry). This enables completion
! 385: to work on Mma style ForPrime etc. This required modifying
! 386: (gp-complete) only to insert the NEW part of the completion,
! 387: leaving the original, possibly uppercase, string in the *PARI*
! 388: buffer.
! 389: This showed up a `feature' of gp. ?COS does not work, so add
! 390: (downcase) before (gp-get-man-entry) passes ?fn to gp.
! 391: Add (downcase) to (gp-add-symbol).
! 392:
! 393:
! 394: === Version 2.14 (28/10/96) (K.B.)
! 395: Fixed gp-set-prompt for gp2 (use default())
! 396: Added the switch -emacs on command line so that gp knows who is in
! 397: charge.
! 398: Defined gp-complete2 to use gp built-in readline completion instead of
! 399: ours
! 400: Bound <TAB> to gp-complete2. \M-<TAB> to gp-complete (should be
! 401: suppressed)
! 402: Look for system messages (between *******) at beginning
! 403:
! 404: === Version 2.15 (01/01/97) (K.B.)
! 405: Wrote pari.el.in
! 406: added backward-kill-word-if-far-enough
! 407:
! 408: === Version 2.16 (30/03/97) (K.B.)
! 409: fixed completion with respect to special characters (removed
! 410: backward-kill-word-if-far-enough)
! 411:
! 412: === Version 2.17 (14/04/97) (K.B.)
! 413: wrote compile: creation of pari.elc by Configure.
! 414:
! 415: === Version 2.18 (28/11/97) (K.B.)
! 416: now that prompt is guaranteed to be in first column, change algorithm in
! 417: gp-copy-input and anchor prompt (add ^ at beginning of regexp)
! 418:
! 419: === Version 2.19 (06/01/98) (K.B.)
! 420: add color support for PARI buffer and gp scripts (hilit19)
! 421: new major mode gp-script-mode enabled for *.gp files.
! 422: remove system messages support (introduced 2.14)
! 423: gp-version now set by Configure.
! 424: fixed pari.menu, added special cases to gp-get-man-entry
! 425: removed all the (downcase ...)
! 426: send readline commands to GP only in gp-complete2 now.
! 427: removed gp-completion-list
! 428:
! 429: === Version 2.20 (18/01/98) (K.B.)
! 430: fixed gp-timer regexp.
! 431: put back @completionfun@ removed inadvertently in 2.19.
! 432: fixed gp-wait-for-output so that it flushes regularly its buffer
! 433: (tnx again Gerhard!)
! 434:
! 435: === Version 2.21 (18/02/98) (K.B.)
! 436: increased the priority of gp-string for highlighting.
! 437:
! 438: === Version 2.22 (17/03/98) (K.B.)
! 439: added [+++] (from default(lines,...)) to the error patterns.
! 440: removed gp-temp-file send all text to gp directly (the 1k limit has
! 441: been removed)
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>