aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2010-04-16 21:47:25 -0500
committerJay Belanger2010-04-16 21:47:25 -0500
commitd8b01fef6303a142dc9b6e26638d07f74e3e2ccd (patch)
tree9a3ca4f57f36ff18be63d11f73f037e2ae280e8e
parent0f4442efb1a1ec17448a8750e4c49defb5479982 (diff)
downloademacs-d8b01fef6303a142dc9b6e26638d07f74e3e2ccd.tar.gz
emacs-d8b01fef6303a142dc9b6e26638d07f74e3e2ccd.zip
* calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'.
Add `calc-option-prefix-help' to calc-help autoloads. (calc-inverse): Add "Option" to message, as appropriate. (calc-hyperbolic): Add "Option" to message, as appropriate. (calc-option, calc-is-option): New functions. * calc-help.el (calc-full-help): Add `calc-option-help'. (calc-option-prefix-help): New function. * calc-misc.el (calc-help): Add "Option" entry. * calc.el (calc-local-var-list): Add `calc-option-flag'. (calc-option-flag): New variable. (calc-do): Set `calc-option-flag to nil. (calc-set-mode-line): Add "Opt " as appropriate.
-rw-r--r--lisp/ChangeLog18
-rw-r--r--lisp/calc/calc-ext.el58
-rw-r--r--lisp/calc/calc-help.el6
-rw-r--r--lisp/calc/calc-misc.el33
-rw-r--r--lisp/calc/calc.el5
5 files changed, 98 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 52a5867d1d1..2edd1522658 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,21 @@
12010-04-17 Jay Belanger <jay.p.belanger@gmail.com>
2
3 * calc-ext.el (calc-init-extensions): Add keybinding for 'calc-option'.
4 Add `calc-option-prefix-help' to calc-help autoloads.
5 (calc-inverse): Add "Option" to message, as appropriate.
6 (calc-hyperbolic): Add "Option" to message, as appropriate.
7 (calc-option, calc-is-option): New functions.
8
9 * calc-help.el (calc-full-help): Add `calc-option-help'.
10 (calc-option-prefix-help): New function.
11
12 * calc-misc.el (calc-help): Add "Option" entry.
13
14 * calc.el (calc-local-var-list): Add `calc-option-flag'.
15 (calc-option-flag): New variable.
16 (calc-do): Set `calc-option-flag to nil.
17 (calc-set-mode-line): Add "Opt " as appropriate.
18
12010-04-16 Juri Linkov <juri@jurta.org> 192010-04-16 Juri Linkov <juri@jurta.org>
2 20
3 Move scrolling commands from simple.el to window.el 21 Move scrolling commands from simple.el to window.el
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el
index 61ec3573282..f6f8e3d03d9 100644
--- a/lisp/calc/calc-ext.el
+++ b/lisp/calc/calc-ext.el
@@ -104,6 +104,7 @@
104 (define-key calc-mode-map "J" 'calc-conj) 104 (define-key calc-mode-map "J" 'calc-conj)
105 (define-key calc-mode-map "L" 'calc-ln) 105 (define-key calc-mode-map "L" 'calc-ln)
106 (define-key calc-mode-map "N" 'calc-eval-num) 106 (define-key calc-mode-map "N" 'calc-eval-num)
107 (define-key calc-mode-map "O" 'calc-option)
107 (define-key calc-mode-map "P" 'calc-pi) 108 (define-key calc-mode-map "P" 'calc-pi)
108 (define-key calc-mode-map "Q" 'calc-sqrt) 109 (define-key calc-mode-map "Q" 'calc-sqrt)
109 (define-key calc-mode-map "R" 'calc-round) 110 (define-key calc-mode-map "R" 'calc-round)
@@ -1045,7 +1046,7 @@ calc-graph-zero-x calc-graph-zero-y)
1045calc-d-prefix-help calc-describe-function calc-describe-key 1046calc-d-prefix-help calc-describe-function calc-describe-key
1046calc-describe-key-briefly calc-describe-variable calc-f-prefix-help 1047calc-describe-key-briefly calc-describe-variable calc-f-prefix-help
1047calc-full-help calc-g-prefix-help calc-help-prefix 1048calc-full-help calc-g-prefix-help calc-help-prefix
1048calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help 1049calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help calc-option-prefix-help
1049calc-inverse-prefix-help calc-j-prefix-help calc-k-prefix-help 1050calc-inverse-prefix-help calc-j-prefix-help calc-k-prefix-help
1050calc-m-prefix-help calc-r-prefix-help calc-s-prefix-help 1051calc-m-prefix-help calc-r-prefix-help calc-s-prefix-help
1051calc-t-prefix-help calc-u-prefix-help calc-v-prefix-help) 1052calc-t-prefix-help calc-u-prefix-help calc-v-prefix-help)
@@ -1408,9 +1409,18 @@ calc-kill calc-kill-region calc-yank))))
1408 (with-current-buffer calc-main-buffer 1409 (with-current-buffer calc-main-buffer
1409 calc-hyperbolic-flag) 1410 calc-hyperbolic-flag)
1410 calc-hyperbolic-flag)) 1411 calc-hyperbolic-flag))
1411 (msg (if hyp-flag 1412 (opt-flag (if (or
1412 "Inverse Hyperbolic..." 1413 (eq major-mode 'calc-keypad-mode)
1413 "Inverse..."))) 1414 (eq major-mode 'calc-trail-mode))
1415 (with-current-buffer calc-main-buffer
1416 calc-option-flag)
1417 calc-option-flag))
1418 (msg
1419 (cond
1420 ((and opt-flag hyp-flag) "Option Inverse Hyperbolic...")
1421 (hyp-flag "Inverse Hyperbolic...")
1422 (opt-flag "Option Inverse...")
1423 (t "Inverse..."))))
1414 (calc-fancy-prefix 'calc-inverse-flag msg n))) 1424 (calc-fancy-prefix 'calc-inverse-flag msg n)))
1415 1425
1416(defconst calc-fancy-prefix-map 1426(defconst calc-fancy-prefix-map
@@ -1489,9 +1499,18 @@ calc-kill calc-kill-region calc-yank))))
1489 (with-current-buffer calc-main-buffer 1499 (with-current-buffer calc-main-buffer
1490 calc-inverse-flag) 1500 calc-inverse-flag)
1491 calc-inverse-flag)) 1501 calc-inverse-flag))
1492 (msg (if inv-flag 1502 (opt-flag (if (or
1493 "Inverse Hyperbolic..." 1503 (eq major-mode 'calc-keypad-mode)
1494 "Hyperbolic..."))) 1504 (eq major-mode 'calc-trail-mode))
1505 (with-current-buffer calc-main-buffer
1506 calc-option-flag)
1507 calc-option-flag))
1508 (msg
1509 (cond
1510 ((and opt-flag inv-flag) "Option Inverse Hyperbolic...")
1511 (opt-flag "Option Hyperbolic...")
1512 (inv-flag "Inverse Hyperbolic...")
1513 (t "Hyperbolic..."))))
1495 (calc-fancy-prefix 'calc-hyperbolic-flag msg n))) 1514 (calc-fancy-prefix 'calc-hyperbolic-flag msg n)))
1496 1515
1497(defun calc-hyperbolic-func () 1516(defun calc-hyperbolic-func ()
@@ -1504,6 +1523,31 @@ calc-kill calc-kill-region calc-yank))))
1504(defun calc-is-hyperbolic () 1523(defun calc-is-hyperbolic ()
1505 calc-hyperbolic-flag) 1524 calc-hyperbolic-flag)
1506 1525
1526(defun calc-option (&optional n)
1527 (interactive "P")
1528 (let* ((inv-flag (if (or
1529 (eq major-mode 'calc-keypad-mode)
1530 (eq major-mode 'calc-trail-mode))
1531 (with-current-buffer calc-main-buffer
1532 calc-inverse-flag)
1533 calc-inverse-flag))
1534 (hyp-flag (if (or
1535 (eq major-mode 'calc-keypad-mode)
1536 (eq major-mode 'calc-trail-mode))
1537 (with-current-buffer calc-main-buffer
1538 calc-hyperbolic-flag)
1539 calc-hyperbolic-flag))
1540 (msg
1541 (cond
1542 ((and hyp-flag inv-flag) "Option Inverse Hyperbolic...")
1543 (hyp-flag "Option Hyperbolic...")
1544 (inv-flag "Option Inverse...")
1545 (t "Option..."))))
1546 (calc-fancy-prefix 'calc-option-flag msg n)))
1547
1548(defun calc-is-option ()
1549 calc-option-flag)
1550
1507(defun calc-keep-args (&optional n) 1551(defun calc-keep-args (&optional n)
1508 (interactive "P") 1552 (interactive "P")
1509 (calc-fancy-prefix 'calc-keep-args-flag "Keep args..." n)) 1553 (calc-fancy-prefix 'calc-keep-args-flag "Keep args..." n))
diff --git a/lisp/calc/calc-help.el b/lisp/calc/calc-help.el
index 0b2240f78c4..baae194561a 100644
--- a/lisp/calc/calc-help.el
+++ b/lisp/calc/calc-help.el
@@ -446,6 +446,7 @@ C-w Describe how there is no warranty for Calc."
446 '(calc-inverse-prefix-help 446 '(calc-inverse-prefix-help
447 calc-hyperbolic-prefix-help 447 calc-hyperbolic-prefix-help
448 calc-inv-hyp-prefix-help 448 calc-inv-hyp-prefix-help
449 calc-option-prefix-help
449 calc-a-prefix-help 450 calc-a-prefix-help
450 calc-b-prefix-help 451 calc-b-prefix-help
451 calc-c-prefix-help 452 calc-c-prefix-help
@@ -512,6 +513,11 @@ C-w Describe how there is no warranty for Calc."
512 "I H + a S (general invert func); v h (rtail)") 513 "I H + a S (general invert func); v h (rtail)")
513 "inverse-hyperbolic" nil)) 514 "inverse-hyperbolic" nil))
514 515
516(defun calc-option-prefix-help ()
517 (interactive)
518 (calc-do-prefix-help
519 '("")
520 "option" nil))
515 521
516(defun calc-f-prefix-help () 522(defun calc-f-prefix-help ()
517 (interactive) 523 (interactive)
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el
index b6b2917f0fe..890e624ecb4 100644
--- a/lisp/calc/calc-misc.el
+++ b/lisp/calc/calc-misc.el
@@ -35,6 +35,7 @@
35(declare-function calc-inv-hyp-prefix-help "calc-help" ()) 35(declare-function calc-inv-hyp-prefix-help "calc-help" ())
36(declare-function calc-inverse-prefix-help "calc-help" ()) 36(declare-function calc-inverse-prefix-help "calc-help" ())
37(declare-function calc-hyperbolic-prefix-help "calc-help" ()) 37(declare-function calc-hyperbolic-prefix-help "calc-help" ())
38(declare-function calc-option-prefix-help "calc-help" ())
38(declare-function calc-explain-why "calc-stuff" (why &optional more)) 39(declare-function calc-explain-why "calc-stuff" (why &optional more))
39(declare-function calc-clear-command-flag "calc-ext" (f)) 40(declare-function calc-clear-command-flag "calc-ext" (f))
40(declare-function calc-roll-down-with-selections "calc-sel" (n m)) 41(declare-function calc-roll-down-with-selections "calc-sel" (n m))
@@ -219,7 +220,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
219 (let ((msgs 220 (let ((msgs
220 '("Press `h' for complete help; press `?' repeatedly for a summary" 221 '("Press `h' for complete help; press `?' repeatedly for a summary"
221 "Letter keys: Negate; Precision; Yank; Why; Xtended cmd; Quit" 222 "Letter keys: Negate; Precision; Yank; Why; Xtended cmd; Quit"
222 "Letter keys: SHIFT + Undo, reDo; Keep-args; Inverse, Hyperbolic" 223 "Letter keys: SHIFT + Undo, reDo; Keep-args; Inverse, Hyperbolic, Option"
223 "Letter keys: SHIFT + sQrt; Sin, Cos, Tan; Exp, Ln, logB" 224 "Letter keys: SHIFT + sQrt; Sin, Cos, Tan; Exp, Ln, logB"
224 "Letter keys: SHIFT + Floor, Round; Abs, conJ, arG; Pi" 225 "Letter keys: SHIFT + Floor, Round; Abs, conJ, arG; Pi"
225 "Letter keys: SHIFT + Num-eval; More-recn; eXec-kbd-macro" 226 "Letter keys: SHIFT + Num-eval; More-recn; eXec-kbd-macro"
@@ -245,20 +246,22 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
245 (calc-inv-hyp-prefix-help) 246 (calc-inv-hyp-prefix-help)
246 (calc-inverse-prefix-help)) 247 (calc-inverse-prefix-help))
247 (calc-hyperbolic-prefix-help)) 248 (calc-hyperbolic-prefix-help))
248 (setq calc-help-phase 249 (if calc-option-flag
249 (if (eq this-command last-command) 250 (calc-option-prefix-help)
250 (% (1+ calc-help-phase) (1+ (length msgs))) 251 (setq calc-help-phase
251 0)) 252 (if (eq this-command last-command)
252 (let ((msg (nth calc-help-phase msgs))) 253 (% (1+ calc-help-phase) (1+ (length msgs)))
253 (message "%s" (if msg 254 0))
254 (concat msg ":" 255 (let ((msg (nth calc-help-phase msgs)))
255 (make-string (- (apply 'max 256 (message "%s" (if msg
256 (mapcar 'length 257 (concat msg ":"
257 msgs)) 258 (make-string (- (apply 'max
258 (length msg)) 32) 259 (mapcar 'length
259 " [?=MORE]") 260 msgs))
260 ""))))))) 261 (length msg)) 32)
261 262 " [?=MORE]")
263 ""))))))))
264
262 265
263 266
264 267
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index 2a6ec97ef5c..c5a5458fff8 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -797,6 +797,7 @@ Used by `calc-user-invocation'.")
797 calc-matrix-mode 797 calc-matrix-mode
798 calc-inverse-flag 798 calc-inverse-flag
799 calc-hyperbolic-flag 799 calc-hyperbolic-flag
800 calc-option-flag
800 calc-keep-args-flag 801 calc-keep-args-flag
801 calc-angle-mode 802 calc-angle-mode
802 calc-number-radix 803 calc-number-radix
@@ -926,6 +927,8 @@ Used by `calc-user-invocation'.")
926 "If non-nil, next operation is Inverse.") 927 "If non-nil, next operation is Inverse.")
927(defvar calc-hyperbolic-flag nil 928(defvar calc-hyperbolic-flag nil
928 "If non-nil, next operation is Hyperbolic.") 929 "If non-nil, next operation is Hyperbolic.")
930(defvar calc-option-flag nil
931 "If non-nil, next operation has Optional behavior.")
929(defvar calc-keep-args-flag nil 932(defvar calc-keep-args-flag nil
930 "If non-nil, next operation should not remove its arguments from stack.") 933 "If non-nil, next operation should not remove its arguments from stack.")
931(defvar calc-function-open "(" 934(defvar calc-function-open "("
@@ -1619,6 +1622,7 @@ See calc-keypad for details."
1619 (calc-select-buffer) 1622 (calc-select-buffer)
1620 (setq calc-inverse-flag nil 1623 (setq calc-inverse-flag nil
1621 calc-hyperbolic-flag nil 1624 calc-hyperbolic-flag nil
1625 calc-option-flag nil
1622 calc-keep-args-flag nil))) 1626 calc-keep-args-flag nil)))
1623 (when (memq 'do-edit calc-command-flags) 1627 (when (memq 'do-edit calc-command-flags)
1624 (switch-to-buffer (get-buffer-create "*Calc Edit*"))) 1628 (switch-to-buffer (get-buffer-create "*Calc Edit*")))
@@ -1757,6 +1761,7 @@ See calc-keypad for details."
1757 (> (calc-stack-size) 0) 1761 (> (calc-stack-size) 0)
1758 (calc-top 1 'sel)) "Sel " "") 1762 (calc-top 1 'sel)) "Sel " "")
1759 (if calc-display-dirty "Dirty " "") 1763 (if calc-display-dirty "Dirty " "")
1764 (if calc-option-flag "Opt " "")
1760 (if calc-inverse-flag "Inv " "") 1765 (if calc-inverse-flag "Inv " "")
1761 (if calc-hyperbolic-flag "Hyp " "") 1766 (if calc-hyperbolic-flag "Hyp " "")
1762 (if calc-keep-args-flag "Keep " "") 1767 (if calc-keep-args-flag "Keep " "")