diff options
| author | Jay Belanger | 2005-05-30 21:03:51 +0000 |
|---|---|---|
| committer | Jay Belanger | 2005-05-30 21:03:51 +0000 |
| commit | ed65ed86e10f9a9a4112e510d46400069d44de19 (patch) | |
| tree | 8694f930708a294f5d40a7c9e13dcfd37e82adbf | |
| parent | 3c1ebc5af8b9fee8834a77ca6a37db6ccde6648f (diff) | |
| download | emacs-ed65ed86e10f9a9a4112e510d46400069d44de19.tar.gz emacs-ed65ed86e10f9a9a4112e510d46400069d44de19.zip | |
(calc-bug-address): Fix docstring.
(calc-window-hook, calc-trail-window-hook): New variables.
(calc-trail-display): Use calc-trail-window-hook if it is non-nil.
(calc): Use calc-window-hook if it is non-nil.
| -rw-r--r-- | lisp/calc/calc.el | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index dbc5e90b917..3a99291fdef 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -325,7 +325,7 @@ This is not required to be present for user-written mode annotations." | |||
| 325 | :type '(choice (string) (sexp))) | 325 | :type '(choice (string) (sexp))) |
| 326 | 326 | ||
| 327 | (defvar calc-bug-address "belanger@truman.edu" | 327 | (defvar calc-bug-address "belanger@truman.edu" |
| 328 | "Address of the author of Calc, for use by `report-calc-bug'.") | 328 | "Address of the maintainer of Calc, for use by `report-calc-bug'.") |
| 329 | 329 | ||
| 330 | (defvar calc-scan-for-dels t | 330 | (defvar calc-scan-for-dels t |
| 331 | "If t, scan keymaps to find all DEL-like keys. | 331 | "If t, scan keymaps to find all DEL-like keys. |
| @@ -720,6 +720,12 @@ If nil, selections displayed but ignored.") | |||
| 720 | (defvar calc-load-hook nil | 720 | (defvar calc-load-hook nil |
| 721 | "Hook run when calc.el is loaded.") | 721 | "Hook run when calc.el is loaded.") |
| 722 | 722 | ||
| 723 | (defvar calc-window-hook nil | ||
| 724 | "Hook called to create the Calc window.") | ||
| 725 | |||
| 726 | (defvar calc-trail-window-hook nil | ||
| 727 | "Hook called to create the Calc trail window.") | ||
| 728 | |||
| 723 | ;; Verify that Calc is running on the right kind of system. | 729 | ;; Verify that Calc is running on the right kind of system. |
| 724 | (defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version)))) | 730 | (defvar calc-emacs-type-lucid (not (not (string-match "Lucid" emacs-version)))) |
| 725 | 731 | ||
| @@ -1205,18 +1211,20 @@ commands given here will actually operate on the *Calculator* stack." | |||
| 1205 | (switch-to-buffer (current-buffer) t) | 1211 | (switch-to-buffer (current-buffer) t) |
| 1206 | (if (get-buffer-window (current-buffer)) | 1212 | (if (get-buffer-window (current-buffer)) |
| 1207 | (select-window (get-buffer-window (current-buffer))) | 1213 | (select-window (get-buffer-window (current-buffer))) |
| 1208 | (let ((w (get-largest-window))) | 1214 | (if calc-window-hook |
| 1209 | (if (and pop-up-windows | 1215 | (run-hooks 'calc-window-hook) |
| 1210 | (> (window-height w) | 1216 | (let ((w (get-largest-window))) |
| 1211 | (+ window-min-height calc-window-height 2))) | 1217 | (if (and pop-up-windows |
| 1212 | (progn | 1218 | (> (window-height w) |
| 1213 | (setq w (split-window w | 1219 | (+ window-min-height calc-window-height 2))) |
| 1214 | (- (window-height w) | 1220 | (progn |
| 1215 | calc-window-height 2) | 1221 | (setq w (split-window w |
| 1216 | nil)) | 1222 | (- (window-height w) |
| 1217 | (set-window-buffer w (current-buffer)) | 1223 | calc-window-height 2) |
| 1218 | (select-window w)) | 1224 | nil)) |
| 1219 | (pop-to-buffer (current-buffer)))))) | 1225 | (set-window-buffer w (current-buffer)) |
| 1226 | (select-window w)) | ||
| 1227 | (pop-to-buffer (current-buffer))))))) | ||
| 1220 | (save-excursion | 1228 | (save-excursion |
| 1221 | (set-buffer (calc-trail-buffer)) | 1229 | (set-buffer (calc-trail-buffer)) |
| 1222 | (and calc-display-trail | 1230 | (and calc-display-trail |
| @@ -1823,15 +1831,17 @@ See calc-keypad for details." | |||
| 1823 | (not (if flag (memq flag '(nil 0)) win))) | 1831 | (not (if flag (memq flag '(nil 0)) win))) |
| 1824 | (if (null win) | 1832 | (if (null win) |
| 1825 | (progn | 1833 | (progn |
| 1826 | (let ((w (split-window nil (/ (* (window-width) 2) 3) t))) | 1834 | (if calc-trail-window-hook |
| 1827 | (set-window-buffer w calc-trail-buffer)) | 1835 | (run-hooks 'calc-trail-window-hook) |
| 1828 | (calc-wrapper | 1836 | (let ((w (split-window nil (/ (* (window-width) 2) 3) t))) |
| 1829 | (setq overlay-arrow-string calc-trail-overlay | 1837 | (set-window-buffer w calc-trail-buffer))) |
| 1830 | overlay-arrow-position calc-trail-pointer) | 1838 | (calc-wrapper |
| 1831 | (or no-refresh | 1839 | (setq overlay-arrow-string calc-trail-overlay |
| 1832 | (if interactive | 1840 | overlay-arrow-position calc-trail-pointer) |
| 1833 | (calc-do-refresh) | 1841 | (or no-refresh |
| 1834 | (calc-refresh)))))) | 1842 | (if interactive |
| 1843 | (calc-do-refresh) | ||
| 1844 | (calc-refresh)))))) | ||
| 1835 | (if win | 1845 | (if win |
| 1836 | (progn | 1846 | (progn |
| 1837 | (delete-window win) | 1847 | (delete-window win) |