diff options
| author | Eli Zaretskii | 2001-11-11 10:26:44 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2001-11-11 10:26:44 +0000 |
| commit | f20be8fee3805abd394fc03f97426a08f8be9646 (patch) | |
| tree | 3f91df1282c97ce79a0ffd9e0c96405a6e499c4e | |
| parent | 8391faa18f22c3726017f51f7f25ed410a5dbba1 (diff) | |
| download | emacs-f20be8fee3805abd394fc03f97426a08f8be9646.tar.gz emacs-f20be8fee3805abd394fc03f97426a08f8be9646.zip | |
(toplevel): Require calc-macs during compilation.
(calc-do-quick-calc): Use `frame-width' instead of `screen-width'.
(calcAlg-edit): Use `minibuffer-contents' instead of `buffer-string'.
(calcAlg-enter): Likewise.
(calcAlg-enter): Use `minibuffer-prompt-end' instead of `point-min'.
| -rw-r--r-- | lisp/calc/calc-aent.el | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index f9a135c6d76..4441989603f 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el | |||
| @@ -25,6 +25,7 @@ | |||
| 25 | (require 'calc) | 25 | (require 'calc) |
| 26 | 26 | ||
| 27 | (require 'calc-macs) | 27 | (require 'calc-macs) |
| 28 | (eval-when-compile '(require calc-macs)) | ||
| 28 | 29 | ||
| 29 | (defun calc-Need-calc-aent () nil) | 30 | (defun calc-Need-calc-aent () nil) |
| 30 | 31 | ||
| @@ -85,11 +86,11 @@ | |||
| 85 | (format ", \"%c\"" (car alg-exp)) | 86 | (format ", \"%c\"" (car alg-exp)) |
| 86 | "") | 87 | "") |
| 87 | ")"))) | 88 | ")"))) |
| 88 | (if (and (< (length buf) (screen-width)) (= (length entry) 1) | 89 | (if (and (< (length buf) (frame-width)) (= (length entry) 1) |
| 89 | calc-extensions-loaded) | 90 | calc-extensions-loaded) |
| 90 | (let ((long (concat (math-format-value (car entry) 1000) | 91 | (let ((long (concat (math-format-value (car entry) 1000) |
| 91 | " => " buf))) | 92 | " => " buf))) |
| 92 | (if (<= (length long) (- (screen-width) 8)) | 93 | (if (<= (length long) (- (frame-width) 8)) |
| 93 | (setq buf long)))) | 94 | (setq buf long)))) |
| 94 | (calc-handle-whys) | 95 | (calc-handle-whys) |
| 95 | (message "Result: %s" buf))) | 96 | (message "Result: %s" buf))) |
| @@ -385,7 +386,7 @@ | |||
| 385 | (calc-minibuffer-contains | 386 | (calc-minibuffer-contains |
| 386 | "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'")) | 387 | "\\`\\([^\"]*\"[^\"]*\"\\)*[^\"]*\"[^\"]*\\'")) |
| 387 | (insert "`") | 388 | (insert "`") |
| 388 | (setq alg-exp (buffer-string)) | 389 | (setq alg-exp (minibuffer-contents)) |
| 389 | (and (> (length alg-exp) 0) (setq calc-previous-alg-entry alg-exp)) | 390 | (and (> (length alg-exp) 0) (setq calc-previous-alg-entry alg-exp)) |
| 390 | (exit-minibuffer)) | 391 | (exit-minibuffer)) |
| 391 | ) | 392 | ) |
| @@ -393,14 +394,14 @@ | |||
| 393 | 394 | ||
| 394 | (defun calcAlg-enter () | 395 | (defun calcAlg-enter () |
| 395 | (interactive) | 396 | (interactive) |
| 396 | (let* ((str (buffer-string)) | 397 | (let* ((str (minibuffer-contents)) |
| 397 | (exp (and (> (length str) 0) | 398 | (exp (and (> (length str) 0) |
| 398 | (save-excursion | 399 | (save-excursion |
| 399 | (set-buffer calc-buffer) | 400 | (set-buffer calc-buffer) |
| 400 | (math-read-exprs str))))) | 401 | (math-read-exprs str))))) |
| 401 | (if (eq (car-safe exp) 'error) | 402 | (if (eq (car-safe exp) 'error) |
| 402 | (progn | 403 | (progn |
| 403 | (goto-char (point-min)) | 404 | (goto-char (minibuffer-prompt-end)) |
| 404 | (forward-char (nth 1 exp)) | 405 | (forward-char (nth 1 exp)) |
| 405 | (beep) | 406 | (beep) |
| 406 | (calc-temp-minibuffer-message | 407 | (calc-temp-minibuffer-message |
| @@ -455,14 +456,14 @@ | |||
| 455 | (interactive) | 456 | (interactive) |
| 456 | (if (calc-minibuffer-contains ".*[@oh] *[^'m ]+[^'m]*\\'") | 457 | (if (calc-minibuffer-contains ".*[@oh] *[^'m ]+[^'m]*\\'") |
| 457 | (calcDigit-key) | 458 | (calcDigit-key) |
| 458 | (setq calc-digit-value (buffer-string)) | 459 | (setq calc-digit-value (minibuffer-contents)) |
| 459 | (exit-minibuffer)) | 460 | (exit-minibuffer)) |
| 460 | ) | 461 | ) |
| 461 | 462 | ||
| 462 | (defun calcDigit-edit () | 463 | (defun calcDigit-edit () |
| 463 | (interactive) | 464 | (interactive) |
| 464 | (calc-unread-command) | 465 | (calc-unread-command) |
| 465 | (setq calc-digit-value (buffer-string)) | 466 | (setq calc-digit-value (minibuffer-contents)) |
| 466 | (exit-minibuffer) | 467 | (exit-minibuffer) |
| 467 | ) | 468 | ) |
| 468 | 469 | ||