home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume13 / gmcalc / patch02 < prev    next >
Encoding:
Text File  |  1990-07-02  |  25.1 KB  |  679 lines

  1. Newsgroups: comp.sources.misc
  2. subject: v13i082: Patch for GNU Emacs Calc, version 1.02 -> 1.03
  3. from: daveg@csvax.caltech.edu (David Gillespie)
  4. Sender: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5.  
  6. Posting-number: Volume 13, Issue 82
  7. Submitted-by: daveg@csvax.caltech.edu (David Gillespie)
  8. Archive-name: gmcalc/patch02
  9.  
  10. The following patches convert Calc version 1.02 into Calc
  11. version 1.03.  To apply them automatically with Patch v2.0,
  12. first cd into your Calc distribution directory, then execute
  13. "patch -p0 <calc.patch", where "calc.patch" is the name of this file.
  14. You will want to re-byte-compile both parts, and re-format the
  15. manual, as explained in the INSTALL file.
  16.  
  17. These patches do not cover the README and INSTALL files.  The
  18. INSTALL file is just a copy of the "Installation" chapter of
  19. calc.texinfo, which is updated by this patch.  Note that some
  20. patches will add to the list of "autoload" commands recommended
  21. in that chapter.
  22.  
  23. Patches and complete tar files are also available from anonymous FTP
  24. on csvax.caltech.edu, in the "pub" subdirectory.
  25.  
  26. Enjoy!
  27.                             -- Dave
  28.  
  29. Dave Gillespie
  30. 256-80 Caltech, Pasadena CA 91125
  31. daveg@csvax.caltech.edu, ...!cit-vax!daveg
  32.  
  33.  
  34.  
  35. *** calc.el    Tue Jun 26 16:33:01 1990
  36. --- ../dist/calc.el    Tue Jun 26 17:02:14 1990
  37. ***************
  38. *** 1,4 ****
  39. ! ;; Calculator for GNU Emacs version 1.02
  40.   ;; Copyright (C) 1990 Dave Gillespie
  41.   
  42.   ;; This file is part of GNU Emacs.
  43. --- 1,4 ----
  44. ! ;; Calculator for GNU Emacs version 1.03
  45.   ;; Copyright (C) 1990 Dave Gillespie
  46.   
  47.   ;; This file is part of GNU Emacs.
  48. ***************
  49. *** 23,39 ****
  50.   ;;; commands only.  Assuming the autoload commands shown below have been
  51.   ;;; done, the Calculator will autoload the remaining commands from calc-ext.elc
  52.   ;;; whenever one is first needed.  If you wish, you can concatenate calc-ext
  53. ! ;;; onto the end of calc (.el or .elc) to make one big file.
  54.   
  55.   ;;; Suggested usage:
  56.   ;;;
  57.   ;;;   (autoload 'calc ".../calc.elc" "Calculator Mode" t nil)
  58.   ;;;   (autoload 'quick-calc ".../calc.elc" "Quick Calculator" t nil)
  59.   ;;;   (autoload 'calc-grab-region ".../calc-ext.elc" nil t nil)
  60.   ;;;   (autoload 'defmath ".../calc-ext.elc" nil t t)
  61.   ;;;   (autoload 'calc-extensions ".../calc-ext.elc" nil nil nil)
  62.   ;;;   (global-set-key "\e#" 'calc)
  63. ! ;;;   M-x calc
  64.   ;;;
  65.   ;;; where ".../calc.elc" represents the full path for "calc.elc",
  66.   ;;; and ".../calc-ext.elc" is the path of the companion file containing
  67. --- 23,41 ----
  68.   ;;; commands only.  Assuming the autoload commands shown below have been
  69.   ;;; done, the Calculator will autoload the remaining commands from calc-ext.elc
  70.   ;;; whenever one is first needed.  If you wish, you can concatenate calc-ext
  71. ! ;;; onto the end of calc to make one big file (.el or .elc).
  72.   
  73.   ;;; Suggested usage:
  74.   ;;;
  75.   ;;;   (autoload 'calc ".../calc.elc" "Calculator Mode" t nil)
  76.   ;;;   (autoload 'quick-calc ".../calc.elc" "Quick Calculator" t nil)
  77. + ;;;   (autoload 'full-calc ".../calc.elc" "Full-screen Calculator" t nil)
  78. + ;;;   (autoload 'calc-eval ".../calc.elc" "Call Calculator" nil nil)
  79.   ;;;   (autoload 'calc-grab-region ".../calc-ext.elc" nil t nil)
  80.   ;;;   (autoload 'defmath ".../calc-ext.elc" nil t t)
  81.   ;;;   (autoload 'calc-extensions ".../calc-ext.elc" nil nil nil)
  82.   ;;;   (global-set-key "\e#" 'calc)
  83. ! ;;;   `M-x calc' or `M-#' to start.
  84.   ;;;
  85.   ;;; where ".../calc.elc" represents the full path for "calc.elc",
  86.   ;;; and ".../calc-ext.elc" is the path of the companion file containing
  87. ***************
  88. *** 45,58 ****
  89.   ;;;   daveg@csvax.caltech.edu, ...!cit-vax!daveg.
  90.   ;;;
  91.   ;;; This file and the manual, calc.texinfo, are available from anonymous FTP
  92. ! ;;; on csvax.caltech.edu [192.12.18.1]; look in ~ftp/pub/calc.
  93.   ;;;
  94.   ;;; Bug reports and suggestions are always welcome!
  95.   
  96.   
  97.   ;;; All functions, macros, and Lisp variables defined here begin with one
  98. ! ;;; of the prefixes "math", "Math", or "calc", with the exception of
  99. ! ;;; "another-calc".  User-accessible variables begin with "var-".
  100.   
  101.   
  102.   
  103. --- 47,61 ----
  104.   ;;;   daveg@csvax.caltech.edu, ...!cit-vax!daveg.
  105.   ;;;
  106.   ;;; This file and the manual, calc.texinfo, are available from anonymous FTP
  107. ! ;;; on csvax.caltech.edu [192.12.18.1]; look in ~ftp/pub/calc*.
  108.   ;;;
  109.   ;;; Bug reports and suggestions are always welcome!
  110.   
  111.   
  112.   ;;; All functions, macros, and Lisp variables defined here begin with one
  113. ! ;;; of the prefixes "math", "Math", or "calc", with the exceptions of
  114. ! ;;; "full-calc", "another-calc", "quick-calc", "report-calc-bug",
  115. ! ;;; and "defmath".  User-accessible variables begin with "var-".
  116.   
  117.   
  118.   
  119. ***************
  120. *** 60,66 ****
  121.   
  122.   (defmacro calc-record-compilation-date-macro ()
  123.     (` (setq calc-version (concat "Emacs Calc Mode"
  124. !                 " v1.02 by Dave Gillespie"
  125.                   ", installed "
  126.                   (, (current-time-string))
  127.                   " by "
  128. --- 63,69 ----
  129.   
  130.   (defmacro calc-record-compilation-date-macro ()
  131.     (` (setq calc-version (concat "Emacs Calc Mode"
  132. !                 " v1.03 by Dave Gillespie"
  133.                   ", installed "
  134.                   (, (current-time-string))
  135.                   " by "
  136. ***************
  137. *** 143,148 ****
  138. --- 146,152 ----
  139.   ;;;
  140.   ;;;   Tim suggests adding spreadsheet-like features.
  141.   ;;;   How about ultra-low-resolution plots?  (Probably too slow.)
  142. + ;;;   How about running gnuplot to generate high-res plots?
  143.   ;;;   Implement language modes for Lisp, Ada, ...?
  144.   ;;;
  145.   
  146. ***************
  147. *** 794,811 ****
  148.          (calc-dollar-values calc-quick-prev-results)
  149.          (calc-dollar-used 0)
  150.          (enable-recursive-minibuffers t)
  151. !        (alg-exp (calc-do-alg-entry "" "Quick calc: ")))
  152. !       (let ((buf ""))
  153. !     (setq calc-quick-prev-results alg-exp)
  154. !     (while alg-exp
  155.         (setq buf (concat buf
  156.                   (if calc-extensions-loaded
  157. !                 (math-format-value (car alg-exp) 1000)
  158. !                   (math-format-flat-expr (car alg-exp) 0))
  159. !                 " ")
  160. !         alg-exp (cdr alg-exp)))
  161. !     (calc-handle-whys)
  162. !     (message buf))))
  163.   )
  164.   
  165.   (defun calc-summary (&optional full)
  166. --- 798,841 ----
  167.          (calc-dollar-values calc-quick-prev-results)
  168.          (calc-dollar-used 0)
  169.          (enable-recursive-minibuffers t)
  170. !        (alg-exp (calc-do-alg-entry "" "Quick calc: "))
  171. !        buf)
  172. !       (setq calc-quick-prev-results alg-exp)
  173. !       (while alg-exp
  174. !     (setq buf (concat buf
  175. !               (and buf " ")
  176. !               (if calc-extensions-loaded
  177. !                   (math-format-value (car alg-exp) 1000)
  178. !                 (math-format-flat-expr (car alg-exp) 0)))
  179. !           alg-exp (cdr alg-exp)))
  180. !       (calc-handle-whys)
  181. !       (message buf)))
  182. ! )
  183. ! (defun calc-eval (str &optional separator &rest args)
  184. !   "Do a quick calculation and return the result as a string.
  185. ! Return value will either be the formatted result in string form,
  186. ! or a list containing a character position and an error message in string form."
  187. !   (save-excursion
  188. !     (calc-create-buffer)
  189. !     (let* ((calc-command-flags nil)
  190. !        (calc-language (if (memq calc-language '(nil big))
  191. !                   'flat calc-language))
  192. !        (calc-dollar-values args)
  193. !        (calc-dollar-used 0)
  194. !        (res (math-read-exprs str))
  195. !        buf)
  196. !       (if (eq (car res) 'error)
  197. !       (cdr res)
  198. !     (setq res (mapcar 'calc-normalize res))
  199. !     (while res
  200.         (setq buf (concat buf
  201. +                 (and buf (or separator ", "))
  202.                   (if calc-extensions-loaded
  203. !                 (math-format-value (car res) 1000)
  204. !                   (math-format-flat-expr (car res) 0)))
  205. !         res (cdr res)))
  206. !     buf)))
  207.   )
  208.   
  209.   (defun calc-summary (&optional full)
  210. ***************
  211. *** 2598,2604 ****
  212.   
  213.   
  214.   ;;; Build a normalized fraction.  [R I I]
  215. ! ;;; (This could probably be implemented more efficiently than using the
  216.   ;;;  the plain gcd algorithm.)
  217.   (defun math-make-frac (num den)
  218.     (if (Math-integer-negp den)
  219. --- 2628,2634 ----
  220.   
  221.   
  222.   ;;; Build a normalized fraction.  [R I I]
  223. ! ;;; (This could probably be implemented more efficiently than using
  224.   ;;;  the plain gcd algorithm.)
  225.   (defun math-make-frac (num den)
  226.     (if (Math-integer-negp den)
  227. ***************
  228. *** 3802,3808 ****
  229.              exp-data (math-restore-dashes
  230.                    (math-match-substring exp-str 0))))
  231.           ((or (and (>= ch ?0) (<= ch ?9))
  232. !          (memq ch '(?\. ?_)))
  233.            (or (and (eq calc-language 'c)
  234.                 (string-match "0[xX][0-9a-fA-F]+" exp-str exp-pos))
  235.            (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\([0-9]+\\(#\\|\\^\\^\\)[0-9a-zA-Z:]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?" exp-str exp-pos))
  236. --- 3832,3842 ----
  237.              exp-data (math-restore-dashes
  238.                    (math-match-substring exp-str 0))))
  239.           ((or (and (>= ch ?0) (<= ch ?9))
  240. !          (eq ch '?\.)
  241. !          (and (eq ch '?_)
  242. !               (or (not (eq calc-language 'tex))
  243. !               (eq exp-pos 0)
  244. !               (memq (elt exp-str (1- exp-pos)) '(32 ?\()))))
  245.            (or (and (eq calc-language 'c)
  246.                 (string-match "0[xX][0-9a-fA-F]+" exp-str exp-pos))
  247.            (string-match "_?\\([0-9]+.?0*@ *\\)?\\([0-9]+.?0*' *\\)?\\([0-9]+\\(#\\|\\^\\^\\)[0-9a-zA-Z:]+\\|[0-9]+:[0-9:]+\\|[0-9.]+\\([eE][-+_]?[0-9]+\\)?\"?\\)?" exp-str exp-pos))
  248. ***************
  249. *** 4072,4078 ****
  250.     (interactive "sBug Subject: ")
  251.     (mail nil calc-bug-address topic)
  252.     (goto-char (point-max))
  253. !   (insert "\nIn Calc 1.02, Emacs " (emacs-version) "\n\n")
  254.     (message (substitute-command-keys "Type \\[mail-send] to send bug report."))
  255.   )
  256.   
  257. --- 4106,4112 ----
  258.     (interactive "sBug Subject: ")
  259.     (mail nil calc-bug-address topic)
  260.     (goto-char (point-max))
  261. !   (insert "\nIn Calc 1.03, Emacs " (emacs-version) "\n\n")
  262.     (message (substitute-command-keys "Type \\[mail-send] to send bug report."))
  263.   )
  264.   
  265. *** calc-ext.el    Wed Jun 13 11:27:16 1990
  266. --- ../dist/calc-ext.el    Tue Jun 26 17:02:21 1990
  267. ***************
  268. *** 1,4 ****
  269. ! ;; Calculator for GNU Emacs, part II
  270.   ;; Copyright (C) 1990 Dave Gillespie
  271.   
  272.   ;; This file is part of GNU Emacs.
  273. --- 1,4 ----
  274. ! ;; Calculator for GNU Emacs version 1.03, part II
  275.   ;; Copyright (C) 1990 Dave Gillespie
  276.   
  277.   ;; This file is part of GNU Emacs.
  278. ***************
  279. *** 1454,1466 ****
  280.      (t s))
  281.   )
  282.   
  283. ! (defun calc-grab-region (top bot)
  284.     "Parse the region as a matrix of numbers and push it on the Calculator stack.
  285.   This is intended to be used in a non-Calculator buffer!
  286.   If the start and the end of the region are in column zero, the contained lines
  287.   are parsed into rows of the matrix.  Otherwise, point and mark define a
  288. ! rectangle which is parsed into a matrix."
  289. !   (interactive "r")
  290.     (and (memq major-mode '(calc-mode calc-trail-mode))
  291.          (error "This command works only in a regular text buffer."))
  292.     (let* ((col1 (save-excursion (goto-char top) (current-column)))
  293. --- 1454,1480 ----
  294.      (t s))
  295.   )
  296.   
  297. ! (defun calc-grab-region (top bot arg)
  298.     "Parse the region as a matrix of numbers and push it on the Calculator stack.
  299.   This is intended to be used in a non-Calculator buffer!
  300.   If the start and the end of the region are in column zero, the contained lines
  301.   are parsed into rows of the matrix.  Otherwise, point and mark define a
  302. ! rectangle which is parsed into a matrix.
  303. ! With a positive numeric prefix N, each line is divided into columns of
  304. ! width N which become the elements of that row of the matrix.  With a
  305. ! prefix of zero, each line is interpreted in its entirety as a formula
  306. ! which becomes a row of the (one-column) matrix.
  307. ! Otherwise, if a line contains a portion delimited by square brackets
  308. ! or curly braces (possibly surrounded by other ignored text), that portion
  309. ! is interpreted as a vector which becomes a row of the matrix.  This can be
  310. ! suppressed by giving a negative numeric prefix argument.
  311. ! Otherwise, the entire contents of the line are parsed as if surrounded by
  312. ! brackets.  If a stack-style line number (as in \"23: \") is present it is
  313. ! first removed."
  314. !   (interactive "r\nP")
  315.     (and (memq major-mode '(calc-mode calc-trail-mode))
  316.          (error "This command works only in a regular text buffer."))
  317.     (let* ((col1 (save-excursion (goto-char top) (current-column)))
  318. ***************
  319. *** 1481,1505 ****
  320.       (calc)
  321.       (setq mat (list 'vec)
  322.         lnum 0)
  323.       (while data
  324. !       (if (string-match "[[{][^][{}]*[]}]" (car data))
  325. !       (setq pos (match-beginning 0)
  326. !         vals (math-read-expr (math-match-substring (car data) 0)))
  327. !     (if (string-match "\\`\\([0-9]+:[ \t]\\)?\\(.*[^, \t]\\)[, \t]*\\'" (car data))
  328.           (setq pos -1
  329. !           vals (math-read-expr (concat "["
  330. !                            (math-match-substring
  331. !                         (car data) 2)
  332. !                            "]")))
  333. !       (setq pos -1
  334. !         vals (math-read-expr (concat "[" (car data) "]")))))
  335.         (if (eq (car-safe vals) 'error)
  336.         (progn
  337.           (calc-quit)
  338.           (switch-to-buffer from-buffer)
  339.           (goto-char top)
  340. !         (next-line lnum)
  341. !         (forward-char (+ (nth 1 vals) pos))
  342.           (error (nth 2 vals))))
  343.         (setq mat (cons vals mat)
  344.           data (cdr data)
  345. --- 1495,1540 ----
  346.       (calc)
  347.       (setq mat (list 'vec)
  348.         lnum 0)
  349. +     (and arg
  350. +      (setq arg (prefix-numeric-value arg)))
  351.       (while data
  352. !       (if (natnump arg)
  353. !       (progn
  354. !         (if (= arg 0)
  355. !         (setq arg 1000000))
  356. !         (setq pos 0
  357. !           vals (list 'vec))
  358. !         (let ((w (length (car data)))
  359. !           j v)
  360. !           (while (< pos w)
  361. !         (setq j (+ pos arg)
  362. !               v (if (>= j w)
  363. !                 (math-read-expr (substring (car data) pos))
  364. !               (math-read-expr (substring (car data) pos j))))
  365. !         (if (eq (car-safe v) 'error)
  366. !             (setq vals v w 0)
  367. !           (setq vals (nconc vals (list v))
  368. !             pos j)))))
  369. !     (if (and (null arg)
  370. !          (string-match "[[{][^][{}]*[]}]" (car data)))
  371. !         (setq pos (match-beginning 0)
  372. !           vals (math-read-expr (math-match-substring (car data) 0)))
  373. !       (if (string-match "\\`\\([0-9]+:[ \t]\\)?\\(.*[^, \t]\\)[, \t]*\\'"
  374. !                 (car data))
  375. !           (setq pos -1
  376. !             vals (math-read-expr (concat "["
  377. !                          (math-match-substring
  378. !                           (car data) 2)
  379. !                          "]")))
  380.           (setq pos -1
  381. !           vals (math-read-expr (concat "[" (car data) "]"))))))
  382.         (if (eq (car-safe vals) 'error)
  383.         (progn
  384.           (calc-quit)
  385.           (switch-to-buffer from-buffer)
  386.           (goto-char top)
  387. !         (forward-line lnum)
  388. !         (forward-char (+ (nth 1 vals) (min col1 col2) pos))
  389.           (error (nth 2 vals))))
  390.         (setq mat (cons vals mat)
  391.           data (cdr data)
  392. ***************
  393. *** 2860,2865 ****
  394. --- 2895,2901 ----
  395.        ( \\tan       . calcFunc-tan )
  396.        ( \\sin       . calcFunc-sin )
  397.        ( \\sinh       . calcFunc-sinh )
  398. +      ( \\sqrt       . calcFunc-sqrt )
  399.        ( \\tanh       . calcFunc-tanh )
  400.        ( \\phi       . calcFunc-totient )
  401.        ( \\mu       . calcFunc-moebius )
  402. ***************
  403. *** 9917,9923 ****
  404.   
  405.   (defun math-choose (n m)   ; [I I I] [F F F] [Public]
  406.     (cond ((and (integerp n) (integerp m) (<= m n) (>= m 0))
  407. !      (math-choose-iter m n 1 1))
  408.       ((not (math-realp n))
  409.        (math-reject-arg n 'realp))
  410.       ((not (math-realp m))
  411. --- 9953,9961 ----
  412.   
  413.   (defun math-choose (n m)   ; [I I I] [F F F] [Public]
  414.     (cond ((and (integerp n) (integerp m) (<= m n) (>= m 0))
  415. !      (if (> m (/ n 2))
  416. !          (math-choose-iter (- n m) n 1 1)
  417. !        (math-choose-iter m n 1 1)))
  418.       ((not (math-realp n))
  419.        (math-reject-arg n 'realp))
  420.       ((not (math-realp m))
  421. ***************
  422. *** 10564,10570 ****
  423.   (fset 'calcFunc-rsh (symbol-function 'math-rshift-binary))
  424.   
  425.   (defun math-shift-binary (a &optional n w)   ; [I I] [Public]
  426. !   (if (not (Math-negp n))
  427.         (math-lshift-binary a n w)
  428.       (setq a (math-trunc a)
  429.         n (if n (math-trunc n) 1))
  430. --- 10602,10609 ----
  431.   (fset 'calcFunc-rsh (symbol-function 'math-rshift-binary))
  432.   
  433.   (defun math-shift-binary (a &optional n w)   ; [I I] [Public]
  434. !   (if (or (null n)
  435. !       (not (Math-negp n)))
  436.         (math-lshift-binary a n w)
  437.       (setq a (math-trunc a)
  438.         n (if n (math-trunc n) 1))
  439. *** calc.texinfo    Tue Jun 26 16:34:50 1990
  440. --- ../dist/calc.texinfo    Tue Jun 26 17:02:30 1990
  441. ***************
  442. *** 1,7 ****
  443.   \input texinfo                  @c -*-texinfo-*-
  444.   @comment %**start of header (This is for running Texinfo on a region.)
  445.   @setfilename calc-info
  446. ! @settitle GNU Emacs Calc 1.02 Manual
  447.   @setchapternewpage odd
  448.   @comment %**end of header (This is for running Texinfo on a region.)
  449.   
  450. --- 1,7 ----
  451.   \input texinfo                  @c -*-texinfo-*-
  452.   @comment %**start of header (This is for running Texinfo on a region.)
  453.   @setfilename calc-info
  454. ! @settitle GNU Emacs Calc 1.03 Manual
  455.   @setchapternewpage odd
  456.   @comment %**end of header (This is for running Texinfo on a region.)
  457.   
  458. ***************
  459. *** 38,44 ****
  460.   @sp 6
  461.   @center @titlefont{Calc Manual}
  462.   @sp 4
  463. ! @center GNU Emacs Calc Version 1.02
  464.   @sp 1
  465.   @center June 1990
  466.   @sp 5
  467. --- 38,44 ----
  468.   @sp 6
  469.   @center @titlefont{Calc Manual}
  470.   @sp 4
  471. ! @center GNU Emacs Calc Version 1.03
  472.   @sp 1
  473.   @center June 1990
  474.   @sp 5
  475. ***************
  476. *** 1450,1456 ****
  477.       .          1:  10000.         .
  478.                      .
  479.   
  480. !   2. RET           1e4 RET        ^
  481.   @end example
  482.   @end group
  483.   
  484. --- 1450,1456 ----
  485.       .          1:  10000.         .
  486.                      .
  487.   
  488. !   2.0 RET          1e4 RET        ^
  489.   @end example
  490.   @end group
  491.   
  492. ***************
  493. *** 1497,1504 ****
  494.   notation}.  You get them by pressing @kbd{d n}, @kbd{d f},
  495.   @kbd{d s}, and @kbd{d e}, respectively.  In each case, you can
  496.   supply a numeric prefix argument which says how many digits
  497. ! should be displayed.  As an example, put the following numbers
  498. ! onto the stack, then try some different display modes.  First,
  499.   use @kbd{M-0 DEL} to clear the stack, then enter the four
  500.   numbers shown here:
  501.   
  502. --- 1497,1504 ----
  503.   notation}.  You get them by pressing @kbd{d n}, @kbd{d f},
  504.   @kbd{d s}, and @kbd{d e}, respectively.  In each case, you can
  505.   supply a numeric prefix argument which says how many digits
  506. ! should be displayed.  As an example, let's put a few numbers
  507. ! onto the stack and try some different display modes.  First,
  508.   use @kbd{M-0 DEL} to clear the stack, then enter the four
  509.   numbers shown here:
  510.   
  511. ***************
  512. *** 2767,2773 ****
  513.   
  514.   @group
  515.   @example
  516. ! 1:  8 +/- 0.2    2:  8 +/- 0.2    1:  0.266 +/- 0.011   1:  14.9 +/- 0.594
  517.       .            1:  30 +/- 1         .                     .
  518.                        .
  519.   
  520. --- 2767,2773 ----
  521.   
  522.   @group
  523.   @example
  524. ! 1:  8 +/- 0.2    2:  8 +/- 0.2    1:  0.266 +/- 0.011   1:  14.93 +/- 0.594
  525.       .            1:  30 +/- 1         .                     .
  526.                        .
  527.   
  528. ***************
  529. *** 8086,8109 ****
  530.   The @kbd{M-#} key with a negative prefix argument (@kbd{M-- M-#}) is
  531.   equivalent to @code{calc-grab-region}.
  532.   
  533. ! Each line of the grabbed area must contain one or more numbers,
  534. ! separated by spaces and/or commas.  Leading and trailing square
  535. ! brackets, curly braces and commas on the line are ignored.  Leading
  536. ! line numbers (as found in the Calc stack) are also ignored.  Thus, this
  537. ! command can generally read anything from a column of numbers in a
  538. ! spreadsheet to a matrix in one of Calc's own display formats.  The
  539. ! grabbed values may actually be any Calc formulas, except that spaces
  540. ! not enclosed in parentheses will be interpreted as separating two
  541. ! separate formulas.@refill
  542.   
  543.   If a different language has been specified (@pxref{Language Modes}),
  544.   the grabbed text will be interpreted according to the that language.
  545.   
  546. ! Each line becomes a row of the matrix.  The result will actually be a
  547. ! vector of vectors, which Calc will treat as a matrix only if every row
  548. ! contains the same number of values.  @xref{Matrix Functions}, to see how
  549. ! to pull the matrix apart into its constituent rows and columns.  (If it
  550. ! is a 1x1 matrix, just hit @kbd{v u} (@code{calc-unpack}) twice.)
  551.   
  552.   For example, suppose we have a column of numbers in a file which we
  553.   wish to sum.  Go to one corner of the column and press @kbd{C-@@} to
  554. --- 8086,8127 ----
  555.   The @kbd{M-#} key with a negative prefix argument (@kbd{M-- M-#}) is
  556.   equivalent to @code{calc-grab-region}.
  557.   
  558. ! Each line of the grabbed area becomes a row of the matrix.  The result
  559. ! will actually be a vector of vectors, which Calc will treat as a matrix
  560. ! only if every row contains the same number of values.
  561.   
  562. + If a line contains a portion surrounded by square brackets (or curly
  563. + braces), that portion is interpreted as a vector which becomes a row
  564. + of the matrix.  Any text surrounding the bracketed portion on the line
  565. + is ignored.
  566. + Otherwise, the entire line is interpreted as a row vector as if it
  567. + were surrounded by square brackets.  Leading line numbers (in the
  568. + format used in the Calc stack buffer) are ignored.  If you wish to
  569. + force this interpretation (even if the line contains bracketed
  570. + portions), give a negative numeric prefix argument to the
  571. + @code{calc-grab-region} command.
  572. + If you give a numeric prefix argument of zero, each line is instead
  573. + interpreted as a single formula which is converted into a one-element
  574. + vector.  Thus the result of @code{calc-grab-region} will be a one-column
  575. + matrix.  For example, suppose one line of the data is the expression
  576. + @samp{2 a}.  A plain @code{calc-grab-region} will interpret this as
  577. + @samp{[2 a]}, which in turn is read as a two-element vector.  But
  578. + with a zero prefix argument, it will be interpreted as @samp{[2*a]}.
  579. + If you give a positive numeric prefix argument @var{n}, then each line
  580. + will be split up into columns of width @var{n}; each column is parsed
  581. + separately as a matrix element.  If a line contained @samp{2 +/- 3 4 +/- 5},
  582. + then grabbing with a prefix argument of 8 would correctly split the
  583. + line into two error forms.
  584.   If a different language has been specified (@pxref{Language Modes}),
  585.   the grabbed text will be interpreted according to the that language.
  586.   
  587. ! @xref{Matrix Functions}, to see how to pull the matrix apart into its
  588. ! constituent rows and columns.  (If it is a 1x1 matrix, just hit @kbd{v u}
  589. ! (@code{calc-unpack}) twice.)
  590.   
  591.   For example, suppose we have a column of numbers in a file which we
  592.   wish to sum.  Go to one corner of the column and press @kbd{C-@@} to
  593. ***************
  594. *** 10739,10744 ****
  595. --- 10757,10779 ----
  596.   The functions described here are responsible for parsing and formatting
  597.   Calc numbers and formulas.
  598.   
  599. + @defun calc-eval str sep arg1 arg2 @dots{}
  600. + This is the simplest interface to the Calculator from another Lisp program.
  601. + The algebraic expression(s) in @var{str} are parsed and evaluated; the
  602. + results are formatted as a string and returned.  If @var{str} contains
  603. + several expressions the results are separated by string @var{sep}, or
  604. + by the string @samp{", "} if @var{sep} is omitted.  If any additional
  605. + arguments are given, they are values (in Calc's internal format) to be
  606. + used for @kbd{$}, @kbd{$$}, and so on in the string.
  607. + If the string @var{str} contains an error, the return value is instead
  608. + a list of two items:  An integer index into @var{str} to show the
  609. + approximate position of the error, and an explanatory message string.
  610. + This function uses the mode settings in the @code{*Calculator*} buffer.
  611. + If no such buffer exists, it will be created as a side-effect.
  612. + @end defun
  613.   @defun read-number str
  614.   If string @var{str} contains a valid Calc number, either integer,
  615.   fraction, float, or HMS form, this function parses and returns that
  616. ***************
  617. *** 10895,10900 ****
  618. --- 10930,10937 ----
  619.   (autoload 'calc             ".../calc.elc"     "Calculator Mode" t nil)
  620.   (autoload 'calc-extensions  ".../calc-ext.elc" nil nil nil)
  621.   (autoload 'quick-calc       ".../calc.elc"     "Quick Calculator" t nil)
  622. + (autoload 'full-calc        ".../calc.elc"     "Full-screen Calculator" t nil)
  623. + (autoload 'calc-eval        ".../calc.elc"     "Call Calculator" nil nil)
  624.   (autoload 'calc-grab-region ".../calc-ext.elc" nil t nil)
  625.   (autoload 'defmath          ".../calc-ext.elc" nil t t)
  626.   @end example
  627. ***************
  628. *** 10909,10915 ****
  629.   brings in the extensions module; Calc takes care to call the
  630.   @code{calc-extensions} function (which doesn't actually do anything)
  631.   before any operation that requires the extensions to be present.
  632. ! The other three @code{autoload} commands are for functions which might
  633.   reasonably be used before the user has typed @kbd{M-x calc} for the
  634.   first time.
  635.   
  636. --- 10946,10952 ----
  637.   brings in the extensions module; Calc takes care to call the
  638.   @code{calc-extensions} function (which doesn't actually do anything)
  639.   before any operation that requires the extensions to be present.
  640. ! The other five @code{autoload} commands are for functions which might
  641.   reasonably be used before the user has typed @kbd{M-x calc} for the
  642.   first time.
  643.   
  644. ***************
  645. *** 10978,10987 ****
  646.   To test your installation of Calc, start a fresh Emacs and type @kbd{M-#}
  647.   to make sure the autoload commands and key bindings work.  Now, type
  648.   @kbd{i} to make sure Calc can find its Info documentation.  Press @kbd{q}
  649. ! to exit the Info system.  Type @kbd{20 S} to compute the sine of
  650. ! 20 degrees; this will test the autoloading of the extensions module.
  651. ! The result should be 0.342020143326.  Finally, press @kbd{M-#} again to
  652. ! make sure the Calculator can exit.
  653.   
  654.   (The above text is included in both the Calc documentation and the
  655.   file INSTALL in the Calc distribution directory.)
  656. --- 11015,11024 ----
  657.   To test your installation of Calc, start a fresh Emacs and type @kbd{M-#}
  658.   to make sure the autoload commands and key bindings work.  Now, type
  659.   @kbd{i} to make sure Calc can find its Info documentation.  Press @kbd{q}
  660. ! to exit the Info system and @kbd{M-#} to re-enter the Calculator.
  661. ! Type @kbd{20 S} to compute the sine of 20 degrees; this will test the
  662. ! autoloading of the extensions module.  The result should be 0.342020143326.
  663. ! Finally, press @kbd{M-#} again to make sure the Calculator can exit.
  664.   
  665.   (The above text is included in both the Calc documentation and the
  666.   file INSTALL in the Calc distribution directory.)
  667.  
  668.