2002-05-29 Miles Bader * calc/calc.el (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'. * calc/calc-ext.el (calc-init-extensions): Add binding for `d@'. (calc-toggle-banner): New function. Index: lisp/calc/calc.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/calc/calc.el,v retrieving revision 1.12 diff -u -r1.12 calc.el --- lisp/calc/calc.el 14 Apr 2002 05:50:05 -0000 1.12 +++ lisp/calc/calc.el 29 May 2002 05:58:16 -0000 @@ -249,6 +249,9 @@ ;; Entries are 3-lists: Formula, Height (in lines), Selection (or nil). (defvar calc-stack '((top-of-stack 1 nil))) +(defvar calc-show-banner t + "*If non-nil, show a friendly greeting above the stack.") + ;; Index into calc-stack of "top" of stack. ;; This is 1 unless calc-truncate-stack has been used. ;;(defvar calc-stack-top 1) @@ -581,7 +584,8 @@ (calc-gnuplot-geometry nil) (calc-graph-default-resolution 15) (calc-graph-default-resolution-3d 5) - (calc-invocation-macro nil))) + (calc-invocation-macro nil) + (calc-show-banner t))) (defconst calc-local-var-list '(calc-stack calc-stack-top @@ -1702,10 +1706,12 @@ (setq calc-any-selections nil calc-any-evaltos nil) (erase-buffer) - (insert "--- Emacs Calculator Mode ---\n") + (when calc-show-banner + (insert "--- Emacs Calculator Mode ---\n")) (while thing (goto-char (point-min)) - (forward-line 1) + (when calc-show-banner + (forward-line 1)) (insert (math-format-stack-value (car thing)) "\n") (setq thing (cdr thing))) (calc-renumber-stack) Index: lisp/calc/calc-ext.el =================================================================== RCS file: /cvsroot/emacs/emacs/lisp/calc/calc-ext.el,v retrieving revision 1.9 diff -u -r1.9 calc-ext.el --- lisp/calc/calc-ext.el 26 Feb 2002 19:54:21 -0000 1.9 +++ lisp/calc/calc-ext.el 29 May 2002 05:58:13 -0000 @@ -1,6 +1,6 @@ ;;; calc-ext.el --- various extension functions for Calc -;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. +;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002 Free Software Foundation, Inc. ;; Author: David Gillespie ;; Maintainer: Colin Walters @@ -250,6 +250,7 @@ (define-key calc-mode-map "d'" 'calc-display-raw) (define-key calc-mode-map "d " 'calc-refresh) (define-key calc-mode-map "d\r" 'calc-refresh-top) + (define-key calc-mode-map "d@" 'calc-toggle-banner) (define-key calc-mode-map "f" nil) (define-key calc-mode-map "f?" 'calc-f-prefix-help) @@ -1489,6 +1490,11 @@ (if calc-embedded-info (calc-embedded-modes-change var)) (symbol-value (car var))))) +(defun calc-toggle-banner () + (interactive) + (setq calc-show-banner (not calc-show-banner)) + (calc-refresh)) + (defun calc-refresh-top (n) (interactive "p") (calc-wrapper @@ -1533,7 +1539,6 @@ (setq num (1- num))))) (and calc-embedded-active which-var (calc-embedded-var-change which-var))) - (defun calc-push (&rest vals) (calc-push-list vals))