Mercurial > emacs
comparison lisp/calc/calc.el @ 45578:73f6b3b88ae9
(calc-show-banner): New variable.
(calc-refresh): Only show banner if `calc-show-banner' is non-nil.
(calc-mode-var-list): Add `calc-show-banner'.
author | Miles Bader <miles@gnu.org> |
---|---|
date | Thu, 30 May 2002 01:04:15 +0000 |
parents | f9b633c7d323 |
children | 2030da0c85f2 |
comparison
equal
deleted
inserted
replaced
45577:30f1ddc50732 | 45578:73f6b3b88ae9 |
---|---|
247 | 247 |
248 ;; Calculator stack. | 248 ;; Calculator stack. |
249 ;; Entries are 3-lists: Formula, Height (in lines), Selection (or nil). | 249 ;; Entries are 3-lists: Formula, Height (in lines), Selection (or nil). |
250 (defvar calc-stack '((top-of-stack 1 nil))) | 250 (defvar calc-stack '((top-of-stack 1 nil))) |
251 | 251 |
252 (defvar calc-show-banner t | |
253 "*If non-nil, show a friendly greeting above the stack.") | |
254 | |
252 ;; Index into calc-stack of "top" of stack. | 255 ;; Index into calc-stack of "top" of stack. |
253 ;; This is 1 unless calc-truncate-stack has been used. | 256 ;; This is 1 unless calc-truncate-stack has been used. |
254 ;;(defvar calc-stack-top 1) | 257 ;;(defvar calc-stack-top 1) |
255 | 258 |
256 ;; If non-nil, load the calc-ext module automatically when calc is loaded. | 259 ;; If non-nil, load the calc-ext module automatically when calc is loaded. |
579 (calc-gnuplot-print-device "postscript") | 582 (calc-gnuplot-print-device "postscript") |
580 (calc-gnuplot-print-output "auto") | 583 (calc-gnuplot-print-output "auto") |
581 (calc-gnuplot-geometry nil) | 584 (calc-gnuplot-geometry nil) |
582 (calc-graph-default-resolution 15) | 585 (calc-graph-default-resolution 15) |
583 (calc-graph-default-resolution-3d 5) | 586 (calc-graph-default-resolution-3d 5) |
584 (calc-invocation-macro nil))) | 587 (calc-invocation-macro nil) |
588 (calc-show-banner t))) | |
585 | 589 |
586 (defconst calc-local-var-list '(calc-stack | 590 (defconst calc-local-var-list '(calc-stack |
587 calc-stack-top | 591 calc-stack-top |
588 calc-undo-list | 592 calc-undo-list |
589 calc-redo-list | 593 calc-redo-list |
1700 (save-aligned (looking-at "\\.$")) | 1704 (save-aligned (looking-at "\\.$")) |
1701 (thing calc-stack)) | 1705 (thing calc-stack)) |
1702 (setq calc-any-selections nil | 1706 (setq calc-any-selections nil |
1703 calc-any-evaltos nil) | 1707 calc-any-evaltos nil) |
1704 (erase-buffer) | 1708 (erase-buffer) |
1705 (insert "--- Emacs Calculator Mode ---\n") | 1709 (when calc-show-banner |
1710 (insert "--- Emacs Calculator Mode ---\n")) | |
1706 (while thing | 1711 (while thing |
1707 (goto-char (point-min)) | 1712 (goto-char (point-min)) |
1708 (forward-line 1) | 1713 (when calc-show-banner |
1714 (forward-line 1)) | |
1709 (insert (math-format-stack-value (car thing)) "\n") | 1715 (insert (math-format-stack-value (car thing)) "\n") |
1710 (setq thing (cdr thing))) | 1716 (setq thing (cdr thing))) |
1711 (calc-renumber-stack) | 1717 (calc-renumber-stack) |
1712 (if calc-display-dirty | 1718 (if calc-display-dirty |
1713 (calc-wrapper (setq calc-display-dirty nil))) | 1719 (calc-wrapper (setq calc-display-dirty nil))) |