1 |
;; Calculator for GNU Emacs, part I |
;; Calculator for GNU Emacs, part I |
2 |
;; Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. |
;; Copyright (C) 1990, 1991, 1992, 1993, 2001 Free Software Foundation, Inc. |
3 |
;; Written by Dave Gillespie, daveg@synaptics.com. |
;; Written by Dave Gillespie, daveg@synaptics.com. |
4 |
|
|
5 |
;; This file is part of GNU Emacs. |
;; This file is part of GNU Emacs. |
1178 |
(save-excursion |
(save-excursion |
1179 |
(set-buffer (calc-trail-buffer)) |
(set-buffer (calc-trail-buffer)) |
1180 |
(and calc-display-trail |
(and calc-display-trail |
1181 |
(= (window-width) (screen-width)) |
(= (window-width) (frame-width)) |
1182 |
(calc-trail-display 1 t))) |
(calc-trail-display 1 t))) |
1183 |
(message "Welcome to the GNU Emacs Calculator! Press `?' or `h' for help, `q' to quit.") |
(message "Welcome to the GNU Emacs Calculator! Press `?' or `h' for help, `q' to quit.") |
1184 |
(run-hooks 'calc-start-hook) |
(run-hooks 'calc-start-hook) |
1243 |
(kbuf (get-buffer "*Calc Keypad*"))) |
(kbuf (get-buffer "*Calc Keypad*"))) |
1244 |
(delete-windows-on (calc-trail-buffer)) |
(delete-windows-on (calc-trail-buffer)) |
1245 |
(if (and win |
(if (and win |
1246 |
(< (window-height win) (1- (screen-height))) |
(< (window-height win) (1- (frame-height))) |
1247 |
(= (window-width win) (screen-width)) ; avoid calc-keypad |
(= (window-width win) (frame-width)) ; avoid calc-keypad |
1248 |
(not (get-buffer-window "*Calc Keypad*"))) |
(not (get-buffer-window "*Calc Keypad*"))) |
1249 |
(setq calc-window-height (- (window-height win) 2))) |
(setq calc-window-height (- (window-height win) 2))) |
1250 |
(if calc-was-split |
(if calc-was-split |
3139 |
(defun calc-window-width () |
(defun calc-window-width () |
3140 |
(if calc-embedded-info |
(if calc-embedded-info |
3141 |
(let ((win (get-buffer-window (aref calc-embedded-info 0)))) |
(let ((win (get-buffer-window (aref calc-embedded-info 0)))) |
3142 |
(1- (if win (window-width win) (screen-width)))) |
(1- (if win (window-width win) (frame-width)))) |
3143 |
(- (window-width (get-buffer-window (current-buffer))) |
(- (window-width (get-buffer-window (current-buffer))) |
3144 |
(if calc-line-numbering 5 1))) |
(if calc-line-numbering 5 1))) |
3145 |
) |
) |
3528 |
) |
) |
3529 |
|
|
3530 |
(defun calc-unread-command (&optional input) |
(defun calc-unread-command (&optional input) |
3531 |
(cond (calc-emacs-type-gnu19 |
(if (featurep 'xemacs) |
3532 |
(setq unread-command-events (cons (or input last-command-event) |
(setq unread-command-event |
3533 |
unread-command-events))) |
(if (integerp input) (character-to-event input) |
3534 |
(calc-emacs-type-lucid |
(or input last-command-event))) |
3535 |
(setq unread-command-event |
(push (or input last-command-event) unread-command-events))) |
|
(if (integerp input) (character-to-event input) |
|
|
(or input last-command-event)))) |
|
|
(t |
|
|
(setq unread-command-char (or input last-command-char)))) |
|
|
) |
|
3536 |
|
|
3537 |
(defun calc-clear-unread-commands () |
(defun calc-clear-unread-commands () |
3538 |
(cond (calc-emacs-type-gnu19 (setq unread-command-events nil)) |
(if (featurep 'xemacs) |
3539 |
(calc-emacs-type-lucid (setq unread-command-event nil)) |
(calc-emacs-type-lucid (setq unread-command-event nil)) |
3540 |
(t (setq unread-command-char -1))) |
(setq unread-command-events nil))) |
|
) |
|
3541 |
|
|
3542 |
(if calc-always-load-extensions |
(if calc-always-load-extensions |
3543 |
(progn |
(progn |