diff options
author | Miles Bader <miles@gnu.org> | 2005-01-16 03:40:12 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 2005-01-16 03:40:12 +0000 |
commit | 54c4c5465ff6dcf158fc47b5894a688ec356f900 (patch) | |
tree | 7fd504f98080bd7c498874d3662ef67086a09b66 /lisp/calc | |
parent | d570d39f949427c4a5041375529c3748d72c6e3c (diff) | |
parent | 42187e99f8adc31d93d027b9017160731aab8972 (diff) | |
download | emacs-54c4c5465ff6dcf158fc47b5894a688ec356f900.tar.gz emacs-54c4c5465ff6dcf158fc47b5894a688ec356f900.tar.bz2 emacs-54c4c5465ff6dcf158fc47b5894a688ec356f900.zip |
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-2
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-83
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-84
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-3
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-4
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-5
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-6
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-11
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-12
Remove "-face" suffix from lazy-highlight face name
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-13
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-16
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-17
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-18
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-21
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-22
<no summary provided>
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-23
- miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-39
Update from CVS
* miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-40
Fix regressions from latest reftex update
* miles@gnu.org--gnu-2005/gnus--rel--5.10--base-0
tag of miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-82
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-1
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-2
Merge from miles@gnu.org--gnu-2004
* miles@gnu.org--gnu-2005/gnus--rel--5.10--patch-3
Merge from emacs--cvs-trunk--0
Diffstat (limited to 'lisp/calc')
-rw-r--r-- | lisp/calc/calc-embed.el | 6 | ||||
-rw-r--r-- | lisp/calc/calc-ext.el | 78 | ||||
-rw-r--r-- | lisp/calc/calc-help.el | 18 | ||||
-rw-r--r-- | lisp/calc/calc-mode.el | 11 | ||||
-rw-r--r-- | lisp/calc/calc-prog.el | 51 | ||||
-rw-r--r-- | lisp/calc/calc-sel.el | 3 | ||||
-rw-r--r-- | lisp/calc/calc-units.el | 2 | ||||
-rw-r--r-- | lisp/calc/calc-yank.el | 23 | ||||
-rw-r--r-- | lisp/calc/calc.el | 370 |
9 files changed, 267 insertions, 295 deletions
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el index 067d233bf4a..db1acfcb145 100644 --- a/lisp/calc/calc-embed.el +++ b/lisp/calc/calc-embed.el @@ -308,10 +308,10 @@ This is not required to be present for user-written mode annotations.") (calc-show-edit-buffer)) (defvar calc-original-buffer) - +(defvar calc-edit-top) (defun calc-embedded-finish-edit (info) (let ((buf (current-buffer)) - (str (buffer-substring (point) (point-max))) + (str (buffer-substring calc-edit-top (point-max))) (start (point)) pos) (switch-to-buffer calc-original-buffer) @@ -885,7 +885,7 @@ The command \\[yank] can retrieve it from there." (list 'calcFunc-assign (nth 1 x) (calc-embedded-subst (nth 2 x))) - (calc-normalize (math-evaluate-expr-rec (math-multi-subst-rec x)))))) + (calc-normalize (math-evaluate-expr-rec (math-multi-subst x nil nil)))))) (defun calc-embedded-eval-get-var (var base) (let ((entry base) diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index 89588b4ea74..280c3ca634b 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el @@ -1240,36 +1240,54 @@ calc-kill calc-kill-region calc-yank)))) (defun calc-reset (arg) (interactive "P") - (save-excursion - (or (eq major-mode 'calc-mode) - (calc-create-buffer)) - (if calc-embedded-info - (calc-embedded nil)) - (or arg - (setq calc-stack nil)) - (setq calc-undo-list nil - calc-redo-list nil) - (let (calc-stack calc-user-parse-tables calc-standard-date-formats - calc-invocation-macro) - (mapcar (function (lambda (v) (set v nil))) calc-local-var-list) - (mapcar (function (lambda (v) (set (car v) (nth 1 v)))) - calc-mode-var-list)) - (calc-set-language nil nil t) - (calc-mode) - (calc-flush-caches t) - (run-hooks 'calc-reset-hook)) - (calc-wrapper - (let ((win (get-buffer-window (current-buffer)))) - (calc-realign 0) - (if win - (let ((height (- (window-height win) 2))) - (set-window-point win (point)) - (or (= height calc-window-height) - (let ((swin (selected-window))) - (select-window win) - (enlarge-window (- calc-window-height height)) - (select-window swin))))))) - (message "(Calculator reset)")) + (setq arg (if arg (prefix-numeric-value arg) nil)) + (cond + ((and + calc-embedded-info + (equal (aref calc-embedded-info 0) (current-buffer)) + (<= (point) (aref calc-embedded-info 5)) + (>= (point) (aref calc-embedded-info 4))) + (let ((cbuf (aref calc-embedded-info 1)) + (calc-embedded-quiet t)) + (save-window-excursion + (calc-embedded nil) + (set-buffer cbuf) + (calc-reset arg)) + (calc-embedded nil))) + ((eq major-mode 'calc-mode) + (save-excursion + (unless (and arg (> (abs arg) 0)) + (setq calc-stack nil)) + (setq calc-undo-list nil + calc-redo-list nil) + (let (calc-stack calc-user-parse-tables calc-standard-date-formats + calc-invocation-macro) + (mapcar (function (lambda (v) (set v nil))) calc-local-var-list) + (if (and arg (<= arg 0)) + (calc-mode-var-list-restore-default-values) + (calc-mode-var-list-restore-saved-values))) + (calc-set-language nil nil t) + (calc-mode) + (calc-flush-caches t) + (run-hooks 'calc-reset-hook)) + (calc-wrapper + (let ((win (get-buffer-window (current-buffer)))) + (calc-realign 0) + ;; Adjust the window height if the window is visible, but doesn't + ;; take up the whole height of the frame. + (if (and + win + (< (window-height win) (1- (frame-height)))) + (let ((height (- (window-height win) 2))) + (set-window-point win (point)) + (or (= height calc-window-height) + (let ((swin (selected-window))) + (select-window win) + (enlarge-window (- calc-window-height height)) + (select-window swin))))))) + (message "(Calculator reset)")) + (t + (message "(Not inside a Calc buffer)")))) ;; What a pain; scroll-left behaves differently when called non-interactively. (defun calc-scroll-left (n) diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el index 087c42d295c..eb0cba79cd8 100644 --- a/lisp/calc/calc-help.el +++ b/lisp/calc/calc-help.el @@ -178,15 +178,15 @@ C-w Describe how there is no warranty for Calc." (if (= (buffer-size) 0) (progn (message "Reading Calc summary from manual...") - (save-window-excursion - (save-excursion - (calc-info-goto-node "Summary") - (goto-char (point-min)) - (forward-line 1) - (copy-to-buffer "*Calc Summary*" - (point) (point-max)) - (if Info-history - (Info-last)))))) + (require 'info nil t) + (with-temp-buffer + (Info-mode) + (Info-goto-node "(Calc)Summary") + (goto-char (point-min)) + (forward-line 1) + (copy-to-buffer "*Calc Summary*" + (point) (point-max))) + (setq buffer-read-only t))) (goto-char (point-min)) (setq case-fold-search nil) (re-search-forward "^\\(.*\\)\\[\\.\\. a b") diff --git a/lisp/calc/calc-mode.el b/lisp/calc/calc-mode.el index dfc488d49dd..389b52385b6 100644 --- a/lisp/calc/calc-mode.el +++ b/lisp/calc/calc-mode.el @@ -309,25 +309,22 @@ (defun calc-settings-file-name (name &optional arg) (interactive (list (read-file-name (format "Settings file name (normally %s): " - (abbreviate-file-name (or user-init-file - "~/.emacs")))) + (abbreviate-file-name calc-settings-file))) current-prefix-arg)) (calc-wrapper (setq arg (if arg (prefix-numeric-value arg) 0)) - (if (equal name "") + (if (string-equal (file-name-nondirectory name) "") (message "Calc settings file is \"%s\"" calc-settings-file) (if (< (math-abs arg) 2) (let ((list calc-mode-var-list)) (while list (set (car (car list)) (nth 1 (car list))) (setq list (cdr list))))) - ;; FIXME: we should use ~/.calc or so in order to avoid - ;; reexecuting ~/.emacs (it's not always idempotent) -cgw 2001.11.12 (setq calc-settings-file name) (or (and calc-settings-file - (string-match "\\.emacs" calc-settings-file) - (> arg 0)) + (equal user-init-file calc-settings-file) + (> arg 0)) (< arg 0) (load name t) (message "New file"))))) diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index b171010e220..b4901b5f8a0 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el @@ -684,21 +684,16 @@ (eq (car-safe (nth 3 cmd)) 'calc-execute-kbd-macro))) (let* ((mac (elt (nth 1 (nth 3 cmd)) 1)) (str (edmacro-format-keys mac t)) - (macbeg) (kys (nth 3 (nth 3 cmd)))) (calc-edit-mode (list 'calc-edit-macro-finish-edit cmdname kys) - t (format "Editing keyboard macro (%s, bound to %s).\n" - cmdname kys)) - (goto-char (point-max)) - (insert "Original keys: " (elt (nth 1 (nth 3 cmd)) 0) "\n" ) - (setq macbeg (point)) + t (format (concat + "Editing keyboard macro (%s, bound to %s).\n" + "Original keys: %s \n") + cmdname kys (elt (nth 1 (nth 3 cmd)) 0))) (insert str "\n") (calc-edit-format-macro-buffer) - (calc-show-edit-buffer) - (goto-char (point-min)) - (search-forward "Original") - (forward-line 2))) + (calc-show-edit-buffer))) (t (let* ((func (calc-stack-command-p cmd)) (defn (and func (symbolp func) @@ -714,18 +709,16 @@ nil (format "Editing formula (%s, %s, bound to %s).\n" intcmd algcmd kys)) - (insert (math-showing-full-precision - (math-format-nice-expr defn (frame-width))) - "\n")) - (calc-show-edit-buffer) - (goto-char (point-min)) - (forward-line 2)) + (insert (math-showing-full-precision + (math-format-nice-expr defn (frame-width))) + "\n")) + (calc-show-edit-buffer)) (error "That command's definition cannot be edited"))))))) ;; Formatting the macro buffer (defun calc-edit-macro-repeats () - (goto-char (point-min)) + (goto-char calc-edit-top) (while (re-search-forward "^\\([0-9]+\\)\\*" nil t) (setq num (string-to-int (match-string 1))) @@ -738,10 +731,10 @@ (defun calc-edit-macro-adjust-buffer () (calc-edit-macro-repeats) - (goto-char (point-min)) + (goto-char calc-edit-top) (while (re-search-forward "^RET$" nil t) (delete-char 1)) - (goto-char (point-min)) + (goto-char calc-edit-top) (while (and (re-search-forward "^$" nil t) (not (= (point) (point-max)))) (delete-char 1))) @@ -869,11 +862,7 @@ (defun calc-edit-format-macro-buffer () "Rewrite the Calc macro editing buffer." (calc-edit-macro-adjust-buffer) - (goto-char (point-min)) - (search-forward "Original keys:") - (forward-line 1) - (insert "\n") - (skip-chars-forward " \t\n") + (goto-char calc-edit-top) (let ((type (calc-edit-macro-command-type))) (while (not (string-equal type "")) (cond @@ -913,27 +902,25 @@ (calc-edit-macro-combine-var-name)) (t (forward-line 1))) (setq type (calc-edit-macro-command-type)))) - (goto-char (point-min))) + (goto-char calc-edit-top)) ;; Finish editing the macro (defun calc-edit-macro-pre-finish-edit () - (goto-char (point-min)) + (goto-char calc-edit-top) (while (re-search-forward "\\(^\\| \\)RET\\($\\|\t\\| \\)" nil t) (search-backward "RET") (delete-char 3) (insert "<return>"))) +(defvar calc-edit-top) (defun calc-edit-macro-finish-edit (cmdname key) "Finish editing a Calc macro. Redefine the corresponding command." (interactive) (let ((cmd (intern cmdname))) (calc-edit-macro-pre-finish-edit) - (goto-char (point-max)) - (re-search-backward "^Original keys:") - (forward-line 1) - (let* ((str (buffer-substring (point) (point-max))) + (let* ((str (buffer-substring calc-edit-top (point-max))) (mac (edmacro-parse-keys str t))) (if (= (length mac) 0) (fmakunbound cmd) @@ -946,10 +933,8 @@ Redefine the corresponding command." 'arg key))))))) (defun calc-finish-formula-edit (func) - (goto-char (point-min)) - (forward-line 2) (let ((buf (current-buffer)) - (str (buffer-substring (point) (point-max))) + (str (buffer-substring calc-edit-top (point-max))) (start (point)) (body (calc-valid-formula-func func))) (set-buffer calc-original-buffer) diff --git a/lisp/calc/calc-sel.el b/lisp/calc/calc-sel.el index 7b45814f1e7..4ae0df5d3ba 100644 --- a/lisp/calc/calc-sel.el +++ b/lisp/calc/calc-sel.el @@ -677,10 +677,11 @@ ;; The variable calc-edit-disp-trail is local to calc-edit-finish, ;; in calc-yank.el. (defvar calc-edit-disp-trail) +(defvar calc-edit-top) (defun calc-finish-selection-edit (num sel reselect) (let ((buf (current-buffer)) - (str (buffer-substring (point) (point-max))) + (str (buffer-substring calc-edit-top (point-max))) (start (point))) (switch-to-buffer calc-original-buffer) (let ((val (math-read-expr str))) diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index d473b02c0a6..e8a3abfe958 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el @@ -30,6 +30,8 @@ (require 'calc-ext) (require 'calc-macs) +(eval-when-compile + (require 'calc-alg)) ;;; Units operations. diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el index 4c7d41e0f76..53d5946e073 100644 --- a/lisp/calc/calc-yank.el +++ b/lisp/calc/calc-yank.el @@ -430,6 +430,7 @@ (defvar calc-edit-handler) (defvar calc-restore-trail) (defvar calc-allow-ret) +(defvar calc-edit-top) (defun calc-edit-mode (&optional handler allow-ret title) "Calculator editing mode. Press RET, LFD, or C-c C-c to finish. @@ -464,10 +465,15 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (let ((calc-edit-handler nil)) (calc-edit-finish t)) (message "(Cancelled)")) t t) - (insert (or title title "Calc Edit Mode. ") - "Press `C-c C-c'" - (if allow-ret "" " or RET") - " to finish, `C-x k RET' to cancel.\n"))) + (insert (propertize + (concat + (or title title "Calc Edit Mode. ") + "Press `C-c C-c'" + (if allow-ret "" " or RET") + " to finish, `C-x k RET' to cancel.\n\n") + 'font-lock-face 'italic 'read-only t 'rear-nonsticky t 'front-sticky t)) + (make-local-variable 'calc-edit-top) + (setq calc-edit-top (point)))) (put 'calc-edit-mode 'mode-class 'special) (defun calc-show-edit-buffer () @@ -484,8 +490,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (if win (delete-window win)))) (set-buffer-modified-p nil) - (goto-char (point-min)) - (forward-line 1))) + (goto-char calc-edit-top))) (defun calc-edit-return () (interactive) @@ -519,9 +524,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (set-buffer original) (not (eq major-mode 'calc-mode)))) (error "Original calculator buffer has been corrupted"))) - (goto-char (point-min)) - (when (looking-at "Calc Edit\\|Editing ") - (forward-line 1)) + (goto-char calc-edit-top) (if (buffer-modified-p) (eval calc-edit-handler)) (if one-window @@ -546,7 +549,7 @@ To cancel the edit, simply kill the *Calc Edit* buffer." (defun calc-finish-stack-edit (num) (let ((buf (current-buffer)) - (str (buffer-substring (point) (point-max))) + (str (buffer-substring calc-edit-top (point-max))) (start (point)) pos) (if (and (integerp num) (> num 1)) diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index f93c2e899b5..a578a8666b8 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el @@ -206,8 +206,8 @@ (require 'calc-macs) ;;;###autoload -(defvar calc-settings-file user-init-file - "*File in which to record permanent settings; default is `user-init-file'.") +(defvar calc-settings-file (convert-standard-filename "~/.calc.el") + "*File in which to record permanent settings.") (defvar calc-bug-address "belanger@truman.edu" "Address of the author of Calc, for use by `report-calc-bug'.") @@ -241,128 +241,102 @@ scientific notation in calc-mode.") (defvar calc-loaded-settings-file nil "t if `calc-settings-file' has been loaded yet.") -(defvar calc-always-load-extensions) -(defvar calc-line-numbering) -(defvar calc-line-breaking) -(defvar calc-display-just) -(defvar calc-display-origin) -(defvar calc-number-radix) -(defvar calc-leading-zeros) -(defvar calc-group-digits) -(defvar calc-group-char) -(defvar calc-point-char) -(defvar calc-frac-format) -(defvar calc-prefer-frac) -(defvar calc-hms-format) -(defvar calc-date-format) -(defvar calc-float-format) -(defvar calc-full-float-format) -(defvar calc-complex-format) -(defvar calc-complex-mode) -(defvar calc-infinite-mode) -(defvar calc-display-strings) -(defvar calc-matrix-just) -(defvar calc-break-vectors) -(defvar calc-full-vectors) -(defvar calc-full-trail-vectors) -(defvar calc-vector-commas) -(defvar calc-vector-brackets) -(defvar calc-matrix-brackets) -(defvar calc-language) -(defvar calc-language-option) -(defvar calc-left-label) -(defvar calc-right-label) -(defvar calc-word-size) -(defvar calc-previous-modulo) -(defvar calc-simplify-mode) -(defvar calc-auto-recompute) -(defvar calc-display-raw) -(defvar calc-internal-prec) -(defvar calc-angle-mode) -(defvar calc-algebraic-mode) -(defvar calc-incomplete-algebraic-mode) -(defvar calc-symbolic-mode) -(defvar calc-matrix-mode) -(defvar calc-shift-prefix) -(defvar calc-window-height) -(defvar calc-display-trail) -(defvar calc-show-selections) -(defvar calc-use-selections) -(defvar calc-assoc-selections) -(defvar calc-display-working-message) -(defvar calc-auto-why) -(defvar calc-timing) -(defvar calc-mode-save-mode) -(defvar calc-standard-date-formats) -(defvar calc-autorange-units) -(defvar calc-was-keypad-mode) -(defvar calc-full-mode) -(defvar calc-user-parse-tables) -(defvar calc-gnuplot-default-device) -(defvar calc-gnuplot-default-output) -(defvar calc-gnuplot-print-device) -(defvar calc-gnuplot-print-output) -(defvar calc-gnuplot-geometry) -(defvar calc-graph-default-resolution) -(defvar calc-graph-default-resolution-3d) -(defvar calc-invocation-macro) -(defvar calc-show-banner) - -(defconst calc-mode-var-list '( - (calc-always-load-extensions nil - "If non-nil, load the calc-ext module automatically when calc is loaded.") - - (calc-line-numbering t - "If non-nil, display line numbers in Calculator stack.") - - (calc-line-breaking t - "If non-nil, break long values across multiple lines in Calculator stack.") - - (calc-display-just nil - "If nil, stack display is left-justified. + +(defvar calc-mode-var-list '() + "List of variables used in customizing GNU Calc.") + +(defmacro defcalcmodevar (var defval &optional doc) + `(progn + (defvar ,var ,defval ,doc) + (add-to-list 'calc-mode-var-list (list (quote ,var) ,defval)))) + +(defun calc-mode-var-list-restore-default-values () + (mapcar (function (lambda (v) (set (car v) (nth 1 v)))) + calc-mode-var-list)) + +(defun calc-mode-var-list-restore-saved-values () + (let ((newvarlist '())) + (save-excursion + (let (pos + (file (substitute-in-file-name calc-settings-file))) + (when (and + (file-regular-p file) + (set-buffer (find-file-noselect file)) + (goto-char (point-min)) + (search-forward ";;; Mode settings stored by Calc" nil t) + (progn + (forward-line 1) + (setq pos (point)) + (search-forward "\n;;; End of mode settings" nil t))) + (beginning-of-line) + (calc-mode-var-list-restore-default-values) + (eval-region pos (point)) + (let ((varlist calc-mode-var-list)) + (while varlist + (let ((var (car varlist))) + (setq newvarlist + (cons (list (car var) (symbol-value (car var))) + newvarlist))) + (setq varlist (cdr varlist))))))) + (if newvarlist + (mapcar (function (lambda (v) (set (car v) (nth 1 v)))) + newvarlist) + (calc-mode-var-list-restore-default-values)))) + +(defcalcmodevar calc-always-load-extensions nil + "If non-nil, load the calc-ext module automatically when calc is loaded.") + +(defcalcmodevar calc-line-numbering t + "If non-nil, display line numbers in Calculator stack.") + +(defcalcmodevar calc-line-breaking t + "If non-nil, break long values across multiple lines in Calculator stack.") + +(defcalcmodevar calc-display-just nil + "If nil, stack display is left-justified. If `right', stack display is right-justified. If `center', stack display is centered.") - (calc-display-origin nil - "Horizontal origin of displayed stack entries. +(defcalcmodevar calc-display-origin nil + "Horizontal origin of displayed stack entries. In left-justified mode, this is effectively indentation. (Default 0). In right-justified mode, this is effectively window width. In centered mode, center of stack entry is placed here.") - (calc-number-radix 10 - "Radix for entry and display of numbers in calc-mode, 2-36.") +(defcalcmodevar calc-number-radix 10 + "Radix for entry and display of numbers in calc-mode, 2-36.") - (calc-leading-zeros nil - "If non-nil, leading zeros are provided to pad integers to calc-word-size.") +(defcalcmodevar calc-leading-zeros nil + "If non-nil, leading zeros are provided to pad integers to calc-word-size.") - (calc-group-digits nil - "If non-nil, group digits in large displayed integers by inserting spaces. +(defcalcmodevar calc-group-digits nil + "If non-nil, group digits in large displayed integers by inserting spaces. If an integer, group that many digits at a time. If t, use 4 for binary and hex, 3 otherwise.") - (calc-group-char "," - "The character (in the form of a string) to be used for grouping digits. +(defcalcmodevar calc-group-char "," + "The character (in the form of a string) to be used for grouping digits. This is used only when calc-group-digits mode is on.") - (calc-point-char "." - "The character (in the form of a string) to be used as a decimal point.") +(defcalcmodevar calc-point-char "." + "The character (in the form of a string) to be used as a decimal point.") - (calc-frac-format (":" nil) - "Format of displayed fractions; a string of one or two of \":\" or \"/\".") +(defcalcmodevar calc-frac-format '(":" nil) + "Format of displayed fractions; a string of one or two of \":\" or \"/\".") - (calc-prefer-frac nil - "If non-nil, prefer fractional over floating-point results.") +(defcalcmodevar calc-prefer-frac nil + "If non-nil, prefer fractional over floating-point results.") - (calc-hms-format "%s@ %s' %s\"" - "Format of displayed hours-minutes-seconds angles, a format string. +(defcalcmodevar calc-hms-format "%s@ %s' %s\"" + "Format of displayed hours-minutes-seconds angles, a format string. String must contain three %s marks for hours, minutes, seconds respectively.") - (calc-date-format ((H ":" mm C SS pp " ") - Www " " Mmm " " D ", " YYYY) - "Format of displayed date forms.") +(defcalcmodevar calc-date-format '((H ":" mm C SS pp " ") + Www " " Mmm " " D ", " YYYY) + "Format of displayed date forms.") - (calc-float-format (float 0) - "Format to use for display of floating-point numbers in calc-mode. +(defcalcmodevar calc-float-format '(float 0) + "Format to use for display of floating-point numbers in calc-mode. Must be a list of one of the following forms: (float 0) Floating point format, display full precision. (float N) N > 0: Floating point format, at most N significant figures. @@ -375,54 +349,54 @@ Must be a list of one of the following forms: (eng N) N > 0: Engineering notation, N significant figures. (eng -N) -N < 0: Engineering notation, calc-internal-prec - N figs.") - (calc-full-float-format (float 0) - "Format to use when full precision must be displayed.") +(defcalcmodevar calc-full-float-format '(float 0) + "Format to use when full precision must be displayed.") - (calc-complex-format nil - "Format to use for display of complex numbers in calc-mode. Must be one of: +(defcalcmodevar calc-complex-format nil + "Format to use for display of complex numbers in calc-mode. Must be one of: nil Use (x, y) form. i Use x + yi form. j Use x + yj form.") - (calc-complex-mode cplx - "Preferred form, either `cplx' or `polar', for complex numbers.") +(defcalcmodevar calc-complex-mode 'cplx + "Preferred form, either `cplx' or `polar', for complex numbers.") - (calc-infinite-mode nil - "If nil, 1 / 0 is left unsimplified. +(defcalcmodevar calc-infinite-mode nil + "If nil, 1 / 0 is left unsimplified. If 0, 1 / 0 is changed to inf (zeros are considered positive). Otherwise, 1 / 0 is changed to uinf (undirected infinity).") - (calc-display-strings nil - "If non-nil, display vectors of byte-sized integers as strings.") +(defcalcmodevar calc-display-strings nil + "If non-nil, display vectors of byte-sized integers as strings.") - (calc-matrix-just center - "If nil, vector elements are left-justified. +(defcalcmodevar calc-matrix-just 'center + "If nil, vector elements are left-justified. If `right', vector elements are right-justified. If `center', vector elements are centered.") - (calc-break-vectors nil - "If non-nil, display vectors one element per line.") +(defcalcmodevar calc-break-vectors nil + "If non-nil, display vectors one element per line.") - (calc-full-vectors t - "If non-nil, display long vectors in full. If nil, use abbreviated form.") +(defcalcmodevar calc-full-vectors t + "If non-nil, display long vectors in full. If nil, use abbreviated form.") - (calc-full-trail-vectors t - "If non-nil, display long vectors in full in the trail.") +(defcalcmodevar calc-full-trail-vectors t + "If non-nil, display long vectors in full in the trail.") - (calc-vector-commas "," - "If non-nil, separate elements of displayed vectors with this string.") +(defcalcmodevar calc-vector-commas "," + "If non-nil, separate elements of displayed vectors with this string.") - (calc-vector-brackets "[]" - "If non-nil, surround displayed vectors with these characters.") +(defcalcmodevar calc-vector-brackets "[]" + "If non-nil, surround displayed vectors with these characters.") - (calc-matrix-brackets (R O) - "A list of code-letter symbols that control \"big\" matrix display. +(defcalcmodevar calc-matrix-brackets '(R O) + "A list of code-letter symbols that control \"big\" matrix display. If `R' is present, display inner brackets for matrices. If `O' is present, display outer brackets for matrices (above/below). If `C' is present, display outer brackets for matrices (centered).") - (calc-language nil - "Language or format for entry and display of stack values. Must be one of: +(defcalcmodevar calc-language nil + "Language or format for entry and display of stack values. Must be one of: nil Use standard Calc notation. flat Use standard Calc notation, one-line format. big Display formulas in 2-d notation (enter w/std notation). @@ -435,23 +409,23 @@ If `C' is present, display outer brackets for matrices (centered).") math Use Mathematica(tm) notation. maple Use Maple notation.") - (calc-language-option nil - "Numeric prefix argument for the command that set `calc-language'.") +(defcalcmodevar calc-language-option nil + "Numeric prefix argument for the command that set `calc-language'.") - (calc-left-label "" - "Label to display at left of formula.") +(defcalcmodevar calc-left-label "" + "Label to display at left of formula.") - (calc-right-label "" - "Label to display at right of formula.") +(defcalcmodevar calc-right-label "" + "Label to display at right of formula.") - (calc-word-size 32 - "Minimum number of bits per word, if any, for binary operations in calc-mode.") +(defcalcmodevar calc-word-size 32 + "Minimum number of bits per word, if any, for binary operations in calc-mode.") - (calc-previous-modulo nil - "Most recently used value of M in a modulo form.") +(defcalcmodevar calc-previous-modulo nil + "Most recently used value of M in a modulo form.") - (calc-simplify-mode nil - "Type of simplification applied to results. +(defcalcmodevar calc-simplify-mode nil + "Type of simplification applied to results. If `none', results are not simplified when pushed on the stack. If `num', functions are simplified only when args are constant. If nil, only fast simplifications are applied. @@ -460,69 +434,69 @@ If `alg', `math-simplify' is applied. If `ext', `math-simplify-extended' is applied. If `units', `math-simplify-units' is applied.") - (calc-auto-recompute t - "If non-nil, recompute evalto's automatically when necessary.") +(defcalcmodevar calc-auto-recompute t + "If non-nil, recompute evalto's automatically when necessary.") - (calc-display-raw nil - "If non-nil, display shows unformatted Lisp exprs. (For debugging)") +(defcalcmodevar calc-display-raw nil + "If non-nil, display shows unformatted Lisp exprs.(defcalcmodevar For debugging)") - (calc-internal-prec 12 - "Number of digits of internal precision for calc-mode calculations.") +(defcalcmodevar calc-internal-prec 12 + "Number of digits of internal precision for calc-mode calculations.") - (calc-angle-mode deg - "If deg, angles are in degrees; if rad, angles are in radians. +(defcalcmodevar calc-angle-mode 'deg + "If deg, angles are in degrees; if rad, angles are in radians. If hms, angles are in degrees-minutes-seconds.") - (calc-algebraic-mode nil - "If non-nil, numeric entry accepts whole algebraic expressions. +(defcalcmodevar calc-algebraic-mode nil + "If non-nil, numeric entry accepts whole algebraic expressions. If nil, algebraic expressions must be preceded by \"'\".") - (calc-incomplete-algebraic-mode nil - "Like calc-algebraic-mode except only affects ( and [ keys.") +(defcalcmodevar calc-incomplete-algebraic-mode nil + "Like calc-algebraic-mode except only affects ( and [ keys.") - (calc-symbolic-mode nil - "If non-nil, inexact numeric computations like sqrt(2) are postponed. +(defcalcmodevar calc-symbolic-mode nil + "If non-nil, inexact numeric computations like sqrt(2) are postponed. If nil, computations on numbers always yield numbers where possible.") - (calc-matrix-mode nil - "If `matrix', variables are assumed to be matrix-valued. +(defcalcmodevar calc-matrix-mode nil + "If `matrix', variables are assumed to be matrix-valued. If a number, variables are assumed to be NxN matrices. If `scalar', variables are assumed to be scalar-valued. If nil, symbolic math routines make no assumptions about variables.") - (calc-shift-prefix nil - "If non-nil, shifted letter keys are prefix keys rather than normal meanings.") +(defcalcmodevar calc-shift-prefix nil + "If non-nil, shifted letter keys are prefix keys rather than normal meanings.") - (calc-window-height 7 - "Initial height of Calculator window.") +(defcalcmodevar calc-window-height 7 + "Initial height of Calculator window.") - (calc-display-trail t - "If non-nil, M-x calc creates a window to display Calculator trail.") +(defcalcmodevar calc-display-trail t + "If non-nil, M-x calc creates a window to display Calculator trail.") - (calc-show-selections t - "If non-nil, selected sub-formulas are shown by obscuring rest of formula. +(defcalcmodevar calc-show-selections t + "If non-nil, selected sub-formulas are shown by obscuring rest of formula. If nil, selected sub-formulas are highlighted by obscuring the sub-formulas.") - (calc-use-selections t - "If non-nil, commands operate only on selected portions of formulas. +(defcalcmodevar calc-use-selections t + "If non-nil, commands operate only on selected portions of formulas. If nil, selections displayed but ignored.") - (calc-assoc-selections t - "If non-nil, selection hides deep structure of associative formulas.") +(defcalcmodevar calc-assoc-selections t + "If non-nil, selection hides deep structure of associative formulas.") - (calc-display-working-message lots - "If non-nil, display \"Working...\" for potentially slow Calculator commands.") +(defcalcmodevar calc-display-working-message 'lots + "If non-nil, display \"Working...\" for potentially slow Calculator commands.") - (calc-auto-why maybe - "If non-nil, automatically execute a \"why\" command to explain odd results.") +(defcalcmodevar calc-auto-why 'maybe + "If non-nil, automatically execute a \"why\" command to explain odd results.") - (calc-timing nil - "If non-nil, display timing information on each slow command.") +(defcalcmodevar calc-timing nil + "If non-nil, display timing information on each slow command.") - (calc-mode-save-mode local) +(defcalcmodevar calc-mode-save-mode 'local) - (calc-standard-date-formats - ("N" +(defcalcmodevar calc-standard-date-formats + '("N" "<H:mm:SSpp >Www Mmm D, YYYY" "D Mmm YYYY<, h:mm:SS>" "Www Mmm BD< hh:mm:ss> YYYY" @@ -533,40 +507,32 @@ If nil, selections displayed but ignored.") "j<, h:mm:SS>" "YYddd< hh:mm:ss>")) - (calc-autorange-units nil) +(defcalcmodevar calc-autorange-units nil) - (calc-was-keypad-mode nil) +(defcalcmodevar calc-was-keypad-mode nil) - (calc-full-mode nil) +(defcalcmodevar calc-full-mode nil) - (calc-user-parse-tables nil) +(defcalcmodevar calc-user-parse-tables nil) - (calc-gnuplot-default-device "default") +(defcalcmodevar calc-gnuplot-default-device "default") - (calc-gnuplot-default-output "STDOUT") +(defcalcmodevar calc-gnuplot-default-output "STDOUT") - (calc-gnuplot-print-device "postscript") +(defcalcmodevar calc-gnuplot-print-device "postscript") - (calc-gnuplot-print-output "auto") +(defcalcmodevar calc-gnuplot-print-output "auto") - (calc-gnuplot-geometry nil) +(defcalcmodevar calc-gnuplot-geometry nil) - (calc-graph-default-resolution 15) +(defcalcmodevar calc-graph-default-resolution 15) - (calc-graph-default-resolution-3d 5) +(defcalcmodevar calc-graph-default-resolution-3d 5) - (calc-invocation-macro nil) - - (calc-show-banner t - "*If non-nil, show a friendly greeting above the stack.")) - "List of variables (and default values) used in customizing GNU Calc.") +(defcalcmodevar calc-invocation-macro nil) -(mapcar (function (lambda (v) - (or (boundp (car v)) - (set (car v) (nth 1 v))) - (if (nth 2 v) - (put (car v) 'variable-documentation (nth 2 v))))) - calc-mode-var-list) +(defcalcmodevar calc-show-banner t + "*If non-nil, show a friendly greeting above the stack.") (defconst calc-local-var-list '(calc-stack calc-stack-top @@ -1028,7 +994,7 @@ Notations: 3.14e6 3.14 * 10^6 (equal calc-settings-file user-init-file) (progn (setq calc-loaded-settings-file t) - (load calc-settings-file t))) ; t = missing-ok + (load (file-name-sans-extension calc-settings-file) t))) ; t = missing-ok (let ((p command-line-args)) (while p (and (equal (car p) "-f") |