(define-key calc-mode-map "J" 'calc-conj)
(define-key calc-mode-map "L" 'calc-ln)
(define-key calc-mode-map "N" 'calc-eval-num)
+ (define-key calc-mode-map "O" 'calc-option)
(define-key calc-mode-map "P" 'calc-pi)
(define-key calc-mode-map "Q" 'calc-sqrt)
(define-key calc-mode-map "R" 'calc-round)
("calc-yank" calc-alg-edit calc-clean-newlines
calc-do-grab-rectangle calc-do-grab-region calc-finish-stack-edit
-calc-copy-to-register calc-insert-register
+calc-copy-to-register calc-insert-register
calc-append-to-register calc-prepend-to-register
calc-force-refresh calc-locate-cursor-element calc-show-edit-buffer)
calc-round calc-scale-float calc-sign calc-trunc calc-xpon-part)
("calc-bin" calc-and calc-binary-radix calc-clip calc-twos-complement-mode
-calc-decimal-radix calc-diff calc-hex-radix calc-leading-zeros
+calc-decimal-radix calc-diff calc-hex-radix calc-leading-zeros
calc-lshift-arith calc-lshift-binary calc-not calc-octal-radix calc-or calc-radix
calc-rotate-binary calc-rshift-arith calc-rshift-binary calc-word-size
calc-xor)
calc-d-prefix-help calc-describe-function calc-describe-key
calc-describe-key-briefly calc-describe-variable calc-f-prefix-help
calc-full-help calc-g-prefix-help calc-help-prefix
-calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help
+calc-hyperbolic-prefix-help calc-inv-hyp-prefix-help calc-option-prefix-help
calc-inverse-prefix-help calc-j-prefix-help calc-k-prefix-help
calc-m-prefix-help calc-r-prefix-help calc-s-prefix-help
calc-t-prefix-help calc-u-prefix-help calc-v-prefix-help)
(with-current-buffer calc-main-buffer
calc-hyperbolic-flag)
calc-hyperbolic-flag))
- (msg (if hyp-flag
- "Inverse Hyperbolic..."
- "Inverse...")))
+ (opt-flag (if (or
+ (eq major-mode 'calc-keypad-mode)
+ (eq major-mode 'calc-trail-mode))
+ (with-current-buffer calc-main-buffer
+ calc-option-flag)
+ calc-option-flag))
+ (msg
+ (cond
+ ((and opt-flag hyp-flag) "Option Inverse Hyperbolic...")
+ (hyp-flag "Inverse Hyperbolic...")
+ (opt-flag "Option Inverse...")
+ (t "Inverse..."))))
(calc-fancy-prefix 'calc-inverse-flag msg n)))
(defconst calc-fancy-prefix-map
(with-current-buffer calc-main-buffer
calc-inverse-flag)
calc-inverse-flag))
- (msg (if inv-flag
- "Inverse Hyperbolic..."
- "Hyperbolic...")))
+ (opt-flag (if (or
+ (eq major-mode 'calc-keypad-mode)
+ (eq major-mode 'calc-trail-mode))
+ (with-current-buffer calc-main-buffer
+ calc-option-flag)
+ calc-option-flag))
+ (msg
+ (cond
+ ((and opt-flag inv-flag) "Option Inverse Hyperbolic...")
+ (opt-flag "Option Hyperbolic...")
+ (inv-flag "Inverse Hyperbolic...")
+ (t "Hyperbolic..."))))
(calc-fancy-prefix 'calc-hyperbolic-flag msg n)))
(defun calc-hyperbolic-func ()
(defun calc-is-hyperbolic ()
calc-hyperbolic-flag)
+(defun calc-option (&optional n)
+ (interactive "P")
+ (let* ((inv-flag (if (or
+ (eq major-mode 'calc-keypad-mode)
+ (eq major-mode 'calc-trail-mode))
+ (with-current-buffer calc-main-buffer
+ calc-inverse-flag)
+ calc-inverse-flag))
+ (hyp-flag (if (or
+ (eq major-mode 'calc-keypad-mode)
+ (eq major-mode 'calc-trail-mode))
+ (with-current-buffer calc-main-buffer
+ calc-hyperbolic-flag)
+ calc-hyperbolic-flag))
+ (msg
+ (cond
+ ((and hyp-flag inv-flag) "Option Inverse Hyperbolic...")
+ (hyp-flag "Option Hyperbolic...")
+ (inv-flag "Option Inverse...")
+ (t "Option..."))))
+ (calc-fancy-prefix 'calc-option-flag msg n)))
+
+(defun calc-is-option ()
+ calc-option-flag)
+
(defun calc-keep-args (&optional n)
(interactive "P")
(calc-fancy-prefix 'calc-keep-args-flag "Keep args..." n))
(defun calc-execute-extended-command (n)
(interactive "P")
(let* ((prompt (concat (calc-num-prefix-name n) "M-x "))
- (cmd (intern
- (completing-read prompt obarray 'commandp t "calc-"
+ (cmd (intern
+ (completing-read prompt obarray 'commandp t "calc-"
'calc-extended-command-history))))
(setq prefix-arg n)
(command-execute cmd)))
(concat "-" (math-format-flat-expr (nth 1 a) 1000)))
(t
(concat (math-remove-dashes
- (if (string-match "\\`calcFunc-\\([a-zA-Z0-9']+\\)\\'"
+ (if (string-match "\\`calcFunc-\\([a-zA-Zα-ωΑ-Ω0-9']+\\)\\'"
(symbol-name (car a)))
(math-match-substring (symbol-name (car a)) 1)
(symbol-name (car a))))
(defun math-group-float (str) ; [X X]
(let* ((pt (or (string-match "[^0-9a-zA-Z]" str) (length str)))
- (g (if (integerp calc-group-digits) (math-abs calc-group-digits) 3))
+ (g (if (integerp calc-group-digits) (math-abs calc-group-digits)
+ (if (memq calc-number-radix '(2 16)) 4 3)))
(i pt))
(if (and (integerp calc-group-digits) (< calc-group-digits 0))
(while (< (setq i (+ (1+ i) g)) (length str))
(provide 'calc-ext)
+;; Local variables:
+;; coding: utf-8
+;; End:
+
;; arch-tag: 1814ba7f-a390-49dc-9e25-a5adc205e97e
;;; calc-ext.el ends here