1 |
;; Calculator for GNU Emacs, part II [calc-store.el] |
;;; calc-store.el --- value storage functions for Calc |
2 |
|
|
3 |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
4 |
;; Written by Dave Gillespie, daveg@synaptics.com. |
|
5 |
|
;; Author: David Gillespie <daveg@synaptics.com> |
6 |
|
;; Maintainer: Colin Walters <walters@debian.org> |
7 |
|
|
8 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
9 |
|
|
22 |
;; file named COPYING. Among other things, the copyright notice |
;; file named COPYING. Among other things, the copyright notice |
23 |
;; and this notice must be preserved on all copies. |
;; and this notice must be preserved on all copies. |
24 |
|
|
25 |
|
;;; Commentary: |
26 |
|
|
27 |
|
;;; Code: |
28 |
|
|
29 |
;; This file is autoloaded from calc-ext.el. |
;; This file is autoloaded from calc-ext.el. |
30 |
(require 'calc-ext) |
(require 'calc-ext) |
36 |
|
|
37 |
;;; Memory commands. |
;;; Memory commands. |
38 |
|
|
39 |
|
(defvar calc-store-keep nil) |
40 |
(defun calc-store (&optional var) |
(defun calc-store (&optional var) |
41 |
(interactive) |
(interactive) |
42 |
(let ((calc-store-keep t)) |
(let ((calc-store-keep t)) |
43 |
(calc-store-into var))) |
(calc-store-into var))) |
|
(setq calc-store-keep nil) |
|
44 |
|
|
45 |
|
(defvar calc-given-value-flag nil) |
46 |
(defun calc-store-into (&optional var) |
(defun calc-store-into (&optional var) |
47 |
(interactive) |
(interactive) |
48 |
(calc-wrapper |
(calc-wrapper |
176 |
(setq calc-given-value (math-evaluate-expr calc-given-value)) |
(setq calc-given-value (math-evaluate-expr calc-given-value)) |
177 |
svar)) |
svar)) |
178 |
(intern var))))) |
(intern var))))) |
|
(setq calc-given-value-flag nil) |
|
179 |
|
|
180 |
(defvar calc-var-name-map nil "Keymap for reading Calc variable names.") |
(defvar calc-var-name-map nil "Keymap for reading Calc variable names.") |
181 |
(if calc-var-name-map |
(if calc-var-name-map |
374 |
(if var2 |
(if var2 |
375 |
(calc-store-value var2 value "")))))) |
(calc-store-value var2 value "")))))) |
376 |
|
|
377 |
|
(defvar calc-last-edited-variable nil) |
378 |
(defun calc-edit-variable (&optional var) |
(defun calc-edit-variable (&optional var) |
379 |
(interactive) |
(interactive) |
380 |
(calc-wrapper |
(calc-wrapper |
395 |
(and value |
(and value |
396 |
(insert (math-format-nice-expr value (frame-width)) "\n"))))) |
(insert (math-format-nice-expr value (frame-width)) "\n"))))) |
397 |
(calc-show-edit-buffer)) |
(calc-show-edit-buffer)) |
|
(setq calc-last-edited-variable nil) |
|
398 |
|
|
399 |
(defun calc-edit-Decls () |
(defun calc-edit-Decls () |
400 |
(interactive) |
(interactive) |
518 |
decl))))))) |
decl))))))) |
519 |
(calc-refresh-evaltos 'var-Decls)))) |
(calc-refresh-evaltos 'var-Decls)))) |
520 |
|
|
521 |
|
(defvar calc-dont-insert-variables '(var-FitRules var-FactorRules |
522 |
|
var-CommuteRules var-JumpRules |
523 |
|
var-DistribRules var-MergeRules |
524 |
|
var-NegateRules var-InvertRules |
525 |
|
var-IntegAfterRules |
526 |
|
var-TimeZone var-PlotRejects |
527 |
|
var-PlotData1 var-PlotData2 |
528 |
|
var-PlotData3 var-PlotData4 |
529 |
|
var-PlotData5 var-PlotData6 |
530 |
|
var-DUMMY)) |
531 |
|
|
532 |
(defun calc-permanent-variable (&optional var) |
(defun calc-permanent-variable (&optional var) |
533 |
(interactive) |
(interactive) |
534 |
(calc-wrapper |
(calc-wrapper |
548 |
(not (eq (car-safe (symbol-value x)) 'special-const)) |
(not (eq (car-safe (symbol-value x)) 'special-const)) |
549 |
(calc-insert-permanent-variable x)))))) |
(calc-insert-permanent-variable x)))))) |
550 |
(save-buffer)))) |
(save-buffer)))) |
551 |
(defvar calc-dont-insert-variables '(var-FitRules var-FactorRules |
|
552 |
var-CommuteRules var-JumpRules |
|
|
var-DistribRules var-MergeRules |
|
|
var-NegateRules var-InvertRules |
|
|
var-IntegAfterRules |
|
|
var-TimeZone var-PlotRejects |
|
|
var-PlotData1 var-PlotData2 |
|
|
var-PlotData3 var-PlotData4 |
|
|
var-PlotData5 var-PlotData6 |
|
|
var-DUMMY |
|
|
)) |
|
553 |
|
|
554 |
(defun calc-insert-permanent-variable (var) |
(defun calc-insert-permanent-variable (var) |
555 |
(goto-char (point-min)) |
(goto-char (point-min)) |