aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2004-11-26 22:38:31 +0000
committerJay Belanger2004-11-26 22:38:31 +0000
commitadb0a6165d6d5d00f946f70416ca8499b4065dfd (patch)
tree8577d7fc1583bef377caef134240895093019d37
parentc478ee0ee2eb35bb1ed4eb9bdc3dd6f5f89e1ae3 (diff)
downloademacs-adb0a6165d6d5d00f946f70416ca8499b4065dfd.tar.gz
emacs-adb0a6165d6d5d00f946f70416ca8499b4065dfd.zip
(calc-original-buffer): Declare it.
(calc-embed-outer-top, calc-embed-outer-bot, calc-embed-top) (calc-embed-bot): New variables. (calc-do-embedded, calc-embedded-mark-formula) (calc-embedded-find-bounds, calc-embedded-duplicate) (calc-embedded-new-formula, calc-embedded-make-info): Replace variables outer-top, outer-bot, bot and top by declared variables. (calc-embed-prev-modes): New variable. (calc-embedded-set-modes, calc-embedded-update): Replace variable prev-modes with declared variable. (calc-embed-vars-used): New variable. (calc-embedded-make-info, calc-embedded-evaluate-expr) (calc-embedded-update, calc-embedded-find-vars): Replace variable vars-used by declared variable.
-rw-r--r--lisp/calc/calc-embed.el163
1 files changed, 93 insertions, 70 deletions
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index b3c5a4cff64..ee9c1466923 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -3,8 +3,7 @@
3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. 3;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc.
4 4
5;; Author: David Gillespie <daveg@synaptics.com> 5;; Author: David Gillespie <daveg@synaptics.com>
6;; Maintainers: D. Goel <deego@gnufans.org> 6;; Maintainer: Jay Belanger <belanger@truman.edu>
7;; Colin Walters <walters@debian.org>
8 7
9;; This file is part of GNU Emacs. 8;; This file is part of GNU Emacs.
10 9
@@ -152,6 +151,16 @@ This is not required to be present for user-written mode annotations.")
152;;; rather than using buffer-local variables because the latter are 151;;; rather than using buffer-local variables because the latter are
153;;; thrown away when a buffer changes major modes. 152;;; thrown away when a buffer changes major modes.
154 153
154;; The variables calc-embed-outer-top, calc-embed-outer-bot,
155;; calc-embed-top and calc-embed-bot are
156;; local to calc-do-embedded, calc-embedded-mark-formula,
157;; calc-embedded-duplicate, calc-embedded-new-formula and
158;; calc-embedded-make-info, but are used by calc-embedded-find-bounds,
159;; which is called (directly or indirectly) by the above functions.
160(defvar calc-embed-outer-top)
161(defvar calc-embed-outer-bot)
162(defvar calc-embed-top)
163(defvar calc-embed-bot)
155 164
156(defvar calc-embedded-quiet nil) 165(defvar calc-embedded-quiet nil)
157(defun calc-do-embedded (arg end obeg oend) 166(defun calc-do-embedded (arg end obeg oend)
@@ -204,7 +213,7 @@ This is not required to be present for user-written mode annotations.")
204 (let ((modes (list mode-line-buffer-identification 213 (let ((modes (list mode-line-buffer-identification
205 (current-local-map) 214 (current-local-map)
206 truncate-lines)) 215 truncate-lines))
207 top bot outer-top outer-bot 216 calc-embed-top calc-embed-bot calc-embed-outer-top calc-embed-outer-bot
208 info chg ident) 217 info chg ident)
209 (barf-if-buffer-read-only) 218 (barf-if-buffer-read-only)
210 (or calc-embedded-globals 219 (or calc-embedded-globals
@@ -300,6 +309,8 @@ This is not required to be present for user-written mode annotations.")
300 (insert str "\n"))) 309 (insert str "\n")))
301 (calc-show-edit-buffer)) 310 (calc-show-edit-buffer))
302 311
312(defvar calc-original-buffer)
313
303(defun calc-embedded-finish-edit (info) 314(defun calc-embedded-finish-edit (info)
304 (let ((buf (current-buffer)) 315 (let ((buf (current-buffer))
305 (str (buffer-substring (point) (point-max))) 316 (str (buffer-substring (point) (point-max)))
@@ -388,11 +399,11 @@ With any prefix argument, marks only the formula itself."
388 (interactive "P") 399 (interactive "P")
389 (and (eq major-mode 'calc-mode) 400 (and (eq major-mode 'calc-mode)
390 (error "This command should be used in a normal editing buffer")) 401 (error "This command should be used in a normal editing buffer"))
391 (let (top bot outer-top outer-bot) 402 (let (calc-embed-top calc-embed-bot calc-embed-outer-top calc-embed-outer-bot)
392 (save-excursion 403 (save-excursion
393 (calc-embedded-find-bounds body-only)) 404 (calc-embedded-find-bounds body-only))
394 (push-mark (if body-only bot outer-bot) t) 405 (push-mark (if body-only calc-embed-bot calc-embed-outer-bot) t)
395 (goto-char (if body-only top outer-top)))) 406 (goto-char (if body-only calc-embed-top calc-embed-outer-top))))
396 407
397(defun calc-embedded-find-bounds (&optional plain) 408(defun calc-embedded-find-bounds (&optional plain)
398 ;; (while (and (bolp) (eq (following-char) ?\n)) 409 ;; (while (and (bolp) (eq (following-char) ?\n))
@@ -407,7 +418,7 @@ With any prefix argument, marks only the formula itself."
407 (and (eq (preceding-char) ?\$) ; backward search for \$\$? won't back 418 (and (eq (preceding-char) ?\$) ; backward search for \$\$? won't back
408 (eq (following-char) ?\$) ; up over a second $, so do it by hand. 419 (eq (following-char) ?\$) ; up over a second $, so do it by hand.
409 (forward-char -1)) 420 (forward-char -1))
410 (setq outer-top (point)) 421 (setq calc-embed-outer-top (point))
411 (goto-char (match-end 0)) 422 (goto-char (match-end 0))
412 (if (eq (following-char) ?\n) 423 (if (eq (following-char) ?\n)
413 (forward-char 1)) 424 (forward-char 1))
@@ -419,21 +430,21 @@ With any prefix argument, marks only the formula itself."
419 (progn 430 (progn
420 (goto-char (match-end 0)) 431 (goto-char (match-end 0))
421 (search-forward calc-embedded-close-plain)))) 432 (search-forward calc-embedded-close-plain))))
422 (setq top (point)) 433 (setq calc-embed-top (point))
423 (or (re-search-forward calc-embedded-close-formula nil t) 434 (or (re-search-forward calc-embedded-close-formula nil t)
424 (error "Can't find end of formula")) 435 (error "Can't find end of formula"))
425 (if (< (point) home) 436 (if (< (point) home)
426 (error "Not inside a formula")) 437 (error "Not inside a formula"))
427 (and (eq (following-char) ?\n) (not (bolp)) 438 (and (eq (following-char) ?\n) (not (bolp))
428 (forward-char 1)) 439 (forward-char 1))
429 (setq outer-bot (point)) 440 (setq calc-embed-outer-bot (point))
430 (goto-char (match-beginning 0)) 441 (goto-char (match-beginning 0))
431 (if (eq (preceding-char) ?\n) 442 (if (eq (preceding-char) ?\n)
432 (backward-char 1)) 443 (backward-char 1))
433 (or (eolp) 444 (or (eolp)
434 (while (eq (preceding-char) ?\ ) 445 (while (eq (preceding-char) ?\ )
435 (backward-char 1))) 446 (backward-char 1)))
436 (setq bot (point)))) 447 (setq calc-embed-bot (point))))
437 448
438(defun calc-embedded-kill-formula () 449(defun calc-embedded-kill-formula ()
439 "Kill the formula surrounding point. 450 "Kill the formula surrounding point.
@@ -458,25 +469,26 @@ The command \\[yank] can retrieve it from there."
458(defun calc-embedded-duplicate () 469(defun calc-embedded-duplicate ()
459 (interactive) 470 (interactive)
460 (let ((already calc-embedded-info) 471 (let ((already calc-embedded-info)
461 top bot outer-top outer-bot new-top) 472 calc-embed-top calc-embed-bot calc-embed-outer-top calc-embed-outer-bot new-top)
462 (if calc-embedded-info 473 (if calc-embedded-info
463 (progn 474 (progn
464 (setq top (+ (aref calc-embedded-info 2)) 475 (setq calc-embed-top (+ (aref calc-embedded-info 2))
465 bot (+ (aref calc-embedded-info 3)) 476 calc-embed-bot (+ (aref calc-embedded-info 3))
466 outer-top (+ (aref calc-embedded-info 4)) 477 calc-embed-outer-top (+ (aref calc-embedded-info 4))
467 outer-bot (+ (aref calc-embedded-info 5))) 478 calc-embed-outer-bot (+ (aref calc-embedded-info 5)))
468 (calc-embedded nil)) 479 (calc-embedded nil))
469 (calc-embedded-find-bounds)) 480 (calc-embedded-find-bounds))
470 (goto-char outer-bot) 481 (goto-char calc-embed-outer-bot)
471 (insert "\n") 482 (insert "\n")
472 (setq new-top (point)) 483 (setq new-top (point))
473 (insert-buffer-substring (current-buffer) outer-top outer-bot) 484 (insert-buffer-substring (current-buffer)
474 (goto-char (+ new-top (- top outer-top))) 485 calc-embed-outer-top calc-embed-outer-bot)
486 (goto-char (+ new-top (- calc-embed-top calc-embed-outer-top)))
475 (let ((calc-embedded-quiet (if already t 'x))) 487 (let ((calc-embedded-quiet (if already t 'x)))
476 (calc-embedded (+ new-top (- top outer-top)) 488 (calc-embedded (+ new-top (- calc-embed-top calc-embed-outer-top))
477 (+ new-top (- bot outer-top)) 489 (+ new-top (- calc-embed-bot calc-embed-outer-top))
478 new-top 490 new-top
479 (+ new-top (- outer-bot outer-top)))))) 491 (+ new-top (- calc-embed-outer-bot calc-embed-outer-top))))))
480 492
481(defun calc-embedded-next (arg) 493(defun calc-embedded-next (arg)
482 (interactive "P") 494 (interactive "P")
@@ -515,26 +527,26 @@ The command \\[yank] can retrieve it from there."
515 (error "This command should be used in a normal editing buffer")) 527 (error "This command should be used in a normal editing buffer"))
516 (if calc-embedded-info 528 (if calc-embedded-info
517 (calc-embedded nil)) 529 (calc-embedded nil))
518 (let (top bot outer-top outer-bot) 530 (let (calc-embed-top calc-embed-bot calc-embed-outer-top calc-embed-outer-bot)
519 (if (and (eq (preceding-char) ?\n) 531 (if (and (eq (preceding-char) ?\n)
520 (string-match "\\`\n" calc-embedded-open-new-formula)) 532 (string-match "\\`\n" calc-embedded-open-new-formula))
521 (progn 533 (progn
522 (setq outer-top (1- (point))) 534 (setq calc-embed-outer-top (1- (point)))
523 (forward-char -1) 535 (forward-char -1)
524 (insert (substring calc-embedded-open-new-formula 1))) 536 (insert (substring calc-embedded-open-new-formula 1)))
525 (setq outer-top (point)) 537 (setq calc-embed-outer-top (point))
526 (insert calc-embedded-open-new-formula)) 538 (insert calc-embedded-open-new-formula))
527 (setq top (point)) 539 (setq calc-embed-top (point))
528 (insert " ") 540 (insert " ")
529 (setq bot (point)) 541 (setq calc-embed-bot (point))
530 (insert calc-embedded-close-new-formula) 542 (insert calc-embedded-close-new-formula)
531 (if (and (eq (following-char) ?\n) 543 (if (and (eq (following-char) ?\n)
532 (string-match "\n\\'" calc-embedded-close-new-formula)) 544 (string-match "\n\\'" calc-embedded-close-new-formula))
533 (delete-char 1)) 545 (delete-char 1))
534 (setq outer-bot (point)) 546 (setq calc-embed-outer-bot (point))
535 (goto-char top) 547 (goto-char calc-embed-top)
536 (let ((calc-embedded-quiet 'x)) 548 (let ((calc-embedded-quiet 'x))
537 (calc-embedded top bot outer-top outer-bot)))) 549 (calc-embedded calc-embed-top calc-embed-bot calc-embed-outer-top calc-embed-outer-bot))))
538 550
539(defun calc-embedded-forget () 551(defun calc-embedded-forget ()
540 (interactive) 552 (interactive)
@@ -542,6 +554,9 @@ The command \\[yank] can retrieve it from there."
542 calc-embedded-active)) 554 calc-embedded-active))
543 (calc-embedded-active-state nil)) 555 (calc-embedded-active-state nil))
544 556
557;; The variables calc-embed-prev-modes is local to calc-embedded-update,
558;; but is used by calc-embedded-set-modes.
559(defvar calc-embed-prev-modes)
545 560
546(defun calc-embedded-set-modes (gmodes modes local-modes &optional temp) 561(defun calc-embedded-set-modes (gmodes modes local-modes &optional temp)
547 (let ((the-language (calc-embedded-language)) 562 (let ((the-language (calc-embedded-language))
@@ -561,9 +576,10 @@ The command \\[yank] can retrieve it from there."
561 (equal (symbol-value (car (car v))) value)) 576 (equal (symbol-value (car (car v))) value))
562 (progn 577 (progn
563 (setq changed t) 578 (setq changed t)
564 (if temp (setq prev-modes (cons (cons (car (car v)) 579 (if temp (setq calc-embed-prev-modes
565 (symbol-value (car (car v)))) 580 (cons (cons (car (car v))
566 prev-modes))) 581 (symbol-value (car (car v))))
582 calc-embed-prev-modes)))
567 (set (car (car v)) value))) 583 (set (car (car v)) value)))
568 (setq v (cdr v))) 584 (setq v (cdr v)))
569 (setq v modes) 585 (setq v modes)
@@ -574,9 +590,9 @@ The command \\[yank] can retrieve it from there."
574 (equal (symbol-value (car (car v))) value) 590 (equal (symbol-value (car (car v))) value)
575 (progn 591 (progn
576 (setq changed t) 592 (setq changed t)
577 (if temp (setq prev-modes (cons (cons (car (car v)) 593 (if temp (setq calc-embed-prev-modes (cons (cons (car (car v))
578 (symbol-value (car (car v)))) 594 (symbol-value (car (car v))))
579 prev-modes))) 595 calc-embed-prev-modes)))
580 (set (car (car v)) value))) 596 (set (car (car v)) value)))
581 (setq v (cdr v))) 597 (setq v (cdr v)))
582 (setq v local-modes) 598 (setq v local-modes)
@@ -585,9 +601,9 @@ The command \\[yank] can retrieve it from there."
585 (equal (symbol-value (car (car v))) value) 601 (equal (symbol-value (car (car v))) value)
586 (progn 602 (progn
587 (setq changed t) 603 (setq changed t)
588 (if temp (setq prev-modes (cons (cons (car (car v)) 604 (if temp (setq calc-embed-prev-modes (cons (cons (car (car v))
589 (symbol-value (car (car v)))) 605 (symbol-value (car (car v))))
590 prev-modes))) 606 calc-embed-prev-modes)))
591 (set (car (car v)) value))) 607 (set (car (car v)) value)))
592 (setq v (cdr v))) 608 (setq v (cdr v)))
593 (and changed (not (eq temp t)) 609 (and changed (not (eq temp t))
@@ -704,13 +720,18 @@ The command \\[yank] can retrieve it from there."
704 (goto-char save-pt) 720 (goto-char save-pt)
705 (list modes emodes pmodes))) 721 (list modes emodes pmodes)))
706 722
723;; The variable calc-embed-vars-used is local to calc-embedded-make-info,
724;; calc-embedded-evaluate-expr and calc-embedded-update, but is
725;; used by calc-embedded-find-vars, which is called by the above functions.
726(defvar calc-embed-vars-used)
707 727
708(defun calc-embedded-make-info (point cbuf fresh &optional 728(defun calc-embedded-make-info (point cbuf fresh &optional
709 top bot outer-top outer-bot) 729 calc-embed-top calc-embed-bot
730 calc-embed-outer-top calc-embed-outer-bot)
710 (let* ((bufentry (assq (current-buffer) calc-embedded-active)) 731 (let* ((bufentry (assq (current-buffer) calc-embedded-active))
711 (found bufentry) 732 (found bufentry)
712 (force (and fresh top)) 733 (force (and fresh calc-embed-top))
713 (fixed top) 734 (fixed calc-embed-top)
714 (new-info nil) 735 (new-info nil)
715 info str) 736 info str)
716 (or found 737 (or found
@@ -729,7 +750,8 @@ The command \\[yank] can retrieve it from there."
729 (aset info 1 (or cbuf (save-excursion 750 (aset info 1 (or cbuf (save-excursion
730 (calc-create-buffer) 751 (calc-create-buffer)
731 (current-buffer))))) 752 (current-buffer)))))
732 (if (and (integerp top) (not bot)) ; started with a user-supplied argument 753 (if (and (integerp calc-embed-top) (not calc-embed-bot))
754 ; started with a user-supplied argument
733 (progn 755 (progn
734 (if (= (setq arg (prefix-numeric-value arg)) 0) 756 (if (= (setq arg (prefix-numeric-value arg)) 0)
735 (progn 757 (progn
@@ -741,18 +763,18 @@ The command \\[yank] can retrieve it from there."
741 (aset info 4 (copy-marker (aref info 2))) 763 (aset info 4 (copy-marker (aref info 2)))
742 (aset info 5 (copy-marker (aref info 3)))) 764 (aset info 5 (copy-marker (aref info 3))))
743 (if (aref info 4) 765 (if (aref info 4)
744 (setq top (aref info 2) 766 (setq calc-embed-top (aref info 2)
745 fixed top) 767 fixed calc-embed-top)
746 (if (consp top) 768 (if (consp calc-embed-top)
747 (let ((calc-embedded-open-formula calc-embedded-open-word) 769 (let ((calc-embedded-open-formula calc-embedded-open-word)
748 (calc-embedded-close-formula calc-embedded-close-word)) 770 (calc-embedded-close-formula calc-embedded-close-word))
749 (calc-embedded-find-bounds 'plain)) 771 (calc-embedded-find-bounds 'plain))
750 (or top 772 (or calc-embed-top
751 (calc-embedded-find-bounds 'plain))) 773 (calc-embedded-find-bounds 'plain)))
752 (aset info 2 (copy-marker (min top bot))) 774 (aset info 2 (copy-marker (min calc-embed-top calc-embed-bot)))
753 (aset info 3 (copy-marker (max top bot))) 775 (aset info 3 (copy-marker (max calc-embed-top calc-embed-bot)))
754 (aset info 4 (copy-marker (or outer-top (aref info 2)))) 776 (aset info 4 (copy-marker (or calc-embed-outer-top (aref info 2))))
755 (aset info 5 (copy-marker (or outer-bot (aref info 3)))))) 777 (aset info 5 (copy-marker (or calc-embed-outer-bot (aref info 3))))))
756 (goto-char (aref info 2)) 778 (goto-char (aref info 2))
757 (if new-info 779 (if new-info
758 (progn 780 (progn
@@ -776,7 +798,7 @@ The command \\[yank] can retrieve it from there."
776 (let* ((open-plain calc-embedded-open-plain) 798 (let* ((open-plain calc-embedded-open-plain)
777 (close-plain calc-embedded-close-plain) 799 (close-plain calc-embedded-close-plain)
778 (pref-len (length open-plain)) 800 (pref-len (length open-plain))
779 (vars-used nil) 801 (calc-embed-vars-used nil)
780 suff-pos val temp) 802 suff-pos val temp)
781 (save-excursion 803 (save-excursion
782 (set-buffer (aref info 1)) 804 (set-buffer (aref info 1))
@@ -810,7 +832,7 @@ The command \\[yank] can retrieve it from there."
810 (nth 1 temp))) 832 (nth 1 temp)))
811 (if (memq (car-safe val) '(calcFunc-evalto calcFunc-assign)) 833 (if (memq (car-safe val) '(calcFunc-evalto calcFunc-assign))
812 (calc-embedded-find-vars val)) 834 (calc-embedded-find-vars val))
813 (aset info 10 vars-used) 835 (aset info 10 calc-embed-vars-used)
814 (aset info 11 nil)))) 836 (aset info 11 nil))))
815 (if new-info 837 (if new-info
816 (progn 838 (progn
@@ -821,8 +843,8 @@ The command \\[yank] can retrieve it from there."
821(defun calc-embedded-find-vars (x) 843(defun calc-embedded-find-vars (x)
822 (cond ((Math-primp x) 844 (cond ((Math-primp x)
823 (and (eq (car-safe x) 'var) 845 (and (eq (car-safe x) 'var)
824 (not (assoc x vars-used)) 846 (not (assoc x calc-embed-vars-used))
825 (setq vars-used (cons (list x) vars-used)))) 847 (setq calc-embed-vars-used (cons (list x) calc-embed-vars-used))))
826 ((eq (car x) 'calcFunc-evalto) 848 ((eq (car x) 'calcFunc-evalto)
827 (calc-embedded-find-vars (nth 1 x))) 849 (calc-embedded-find-vars (nth 1 x)))
828 ((eq (car x) 'calcFunc-assign) 850 ((eq (car x) 'calcFunc-assign)
@@ -831,16 +853,16 @@ The command \\[yank] can retrieve it from there."
831 (and (eq (car x) 'calcFunc-subscr) 853 (and (eq (car x) 'calcFunc-subscr)
832 (eq (car-safe (nth 1 x)) 'var) 854 (eq (car-safe (nth 1 x)) 'var)
833 (Math-primp (nth 2 x)) 855 (Math-primp (nth 2 x))
834 (not (assoc x vars-used)) 856 (not (assoc x calc-embed-vars-used))
835 (setq vars-used (cons (list x) vars-used))) 857 (setq calc-embed-vars-used (cons (list x) calc-embed-vars-used)))
836 (while (setq x (cdr x)) 858 (while (setq x (cdr x))
837 (calc-embedded-find-vars (car x)))))) 859 (calc-embedded-find-vars (car x))))))
838 860
839 861
840(defun calc-embedded-evaluate-expr (x) 862(defun calc-embedded-evaluate-expr (x)
841 (let ((vars-used (aref calc-embedded-info 10))) 863 (let ((calc-embed-vars-used (aref calc-embedded-info 10)))
842 (or vars-used (calc-embedded-find-vars x)) 864 (or calc-embed-vars-used (calc-embedded-find-vars x))
843 (if vars-used 865 (if calc-embed-vars-used
844 (let ((active (assq (aref calc-embedded-info 0) calc-embedded-active)) 866 (let ((active (assq (aref calc-embedded-info 0) calc-embedded-active))
845 (args nil)) 867 (args nil))
846 (save-excursion 868 (save-excursion
@@ -850,9 +872,9 @@ The command \\[yank] can retrieve it from there."
850 (calc-embedded-activate) 872 (calc-embedded-activate)
851 (setq active (assq (aref calc-embedded-info 0) 873 (setq active (assq (aref calc-embedded-info 0)
852 calc-embedded-active)))) 874 calc-embedded-active))))
853 (while vars-used 875 (while calc-embed-vars-used
854 (calc-embedded-eval-get-var (car (car vars-used)) active) 876 (calc-embedded-eval-get-var (car (car calc-embed-vars-used)) active)
855 (setq vars-used (cdr vars-used)))) 877 (setq calc-embed-vars-used (cdr calc-embed-vars-used))))
856 (calc-embedded-subst x)) 878 (calc-embedded-subst x))
857 (calc-normalize (math-evaluate-expr-rec x))))) 879 (calc-normalize (math-evaluate-expr-rec x)))))
858 880
@@ -900,10 +922,10 @@ The command \\[yank] can retrieve it from there."
900 922
901(defun calc-embedded-update (info which need-eval need-display 923(defun calc-embedded-update (info which need-eval need-display
902 &optional str entry old-val) 924 &optional str entry old-val)
903 (let* ((prev-modes nil) 925 (let* ((calc-embed-prev-modes nil)
904 (open-plain calc-embedded-open-plain) 926 (open-plain calc-embedded-open-plain)
905 (close-plain calc-embedded-close-plain) 927 (close-plain calc-embedded-close-plain)
906 (vars-used nil) 928 (calc-embed-vars-used nil)
907 (evalled nil) 929 (evalled nil)
908 (val (aref info 8)) 930 (val (aref info 8))
909 (old-eval (aref info 11))) 931 (old-eval (aref info 11)))
@@ -926,7 +948,7 @@ The command \\[yank] can retrieve it from there."
926 (if (or (eq need-eval 'eval) (eq (car-safe val) 'calcFunc-evalto)) 948 (if (or (eq need-eval 'eval) (eq (car-safe val) 'calcFunc-evalto))
927 (aset info 8 val)) 949 (aset info 8 val))
928 (aset info 9 nil) 950 (aset info 9 nil)
929 (aset info 10 vars-used) 951 (aset info 10 calc-embed-vars-used)
930 (aset info 11 nil) 952 (aset info 11 nil)
931 (if (or need-display (eq (car-safe val) 'calcFunc-evalto)) 953 (if (or need-display (eq (car-safe val) 'calcFunc-evalto))
932 (let ((extra (if (eq calc-language 'big) 1 0))) 954 (let ((extra (if (eq calc-language 'big) 1 0)))
@@ -978,16 +1000,17 @@ The command \\[yank] can retrieve it from there."
978 (if (eq (car-safe old-val) 'calcFunc-assign) 1000 (if (eq (car-safe old-val) 'calcFunc-assign)
979 (calc-embedded-var-change (nth 1 old-val) (aref info 0))))) 1001 (calc-embedded-var-change (nth 1 old-val) (aref info 0)))))
980 (set-buffer (aref info 1)) 1002 (set-buffer (aref info 1))
981 (while prev-modes 1003 (while calc-embed-prev-modes
982 (cond ((eq (car (car prev-modes)) 'the-language) 1004 (cond ((eq (car (car calc-embed-prev-modes)) 'the-language)
983 (if need-display 1005 (if need-display
984 (calc-embedded-set-language (cdr (car prev-modes))))) 1006 (calc-embedded-set-language (cdr (car calc-embed-prev-modes)))))
985 ((eq (car (car prev-modes)) 'the-display-just) 1007 ((eq (car (car calc-embed-prev-modes)) 'the-display-just)
986 (if need-display 1008 (if need-display
987 (calc-embedded-set-justify (cdr (car prev-modes))))) 1009 (calc-embedded-set-justify (cdr (car calc-embed-prev-modes)))))
988 (t 1010 (t
989 (set (car (car prev-modes)) (cdr (car prev-modes))))) 1011 (set (car (car calc-embed-prev-modes))
990 (setq prev-modes (cdr prev-modes)))))) 1012 (cdr (car calc-embed-prev-modes)))))
1013 (setq calc-embed-prev-modes (cdr prev-modes))))))
991 1014
992 1015
993 1016