• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.10/emacs-93/emacs/lisp/calc/

Lines Matching +defs:line +defs:number +defs:mode

63 ;;   Implement line-breaking in non-flat compositions (is this desirable?).
64 ;; Implement matrix formatting with multi-line components.
84 ;; Handle TeX-mode parsing of \matrix{ ... } where ... contains braces.
197 ;; (wood, coal, oil, natural gas, etc.) or the number of scientific
198 ;; papers a person publishes, or the number of movies made.
223 '((latex-mode . latex)
224 (tex-mode . tex)
225 (plain-tex-mode . tex)
226 (context-mode . tex)
227 (nroff-mode . eqn)
228 (pascal-mode . pascal)
229 (c-mode . c)
230 (c++-mode . c)
231 (fortran-mode . fortran)
232 (f90-mode . fortran))
235 :type '(alist :key-type (symbol :tag "Major mode")
245 '((c++-mode . "//Embed\n\\(// .*\n\\)*")
246 (c-mode . "/\\*Embed\\*/\n\\(/\\* .*\\*/\n\\)*")
247 (f90-mode . "!Embed\n\\(! .*\n\\)*")
248 (fortran-mode . "C Embed\n\\(C .*\n\\)*")
249 (html-helper-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
250 (html-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
251 (nroff-mode . "\\\\\"Embed\n\\(\\\\\" .*\n\\)*")
252 (pascal-mode . "{Embed}\n\\({.*}\n\\)*")
253 (sgml-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
254 (xml-mode . "<!-- Embed -->\n\\(<!-- .* -->\n\\)*")
255 (texinfo-mode . "@c Embed\n\\(@c .*\n\\)*"))
258 :type '(alist :key-type (symbol :tag "Major mode")
277 :type '(alist :key-type (symbol :tag "Major mode")
297 :type '(alist :key-type (symbol :tag "Major mode")
304 If calc-show-plain mode is enabled, this is inserted at the front of
317 '((c++-mode "// %% " " %%\n")
318 (c-mode "/* %% " " %% */\n")
319 (f90-mode "! %% " " %%\n")
320 (fortran-mode "C %% " " %%\n")
321 (html-helper-mode "<!-- %% " " %% -->\n")
322 (html-mode "<!-- %% " " %% -->\n")
323 (nroff-mode "\\\" %% " " %%\n")
324 (pascal-mode "{%% " " %%}\n")
325 (sgml-mode "<!-- %% " " %% -->\n")
326 (xml-mode "<!-- %% " " %% -->\n")
327 (texinfo-mode "@c %% " " %%\n"))
330 :type '(alist :key-type (symbol :tag "Major mode")
350 :type '(alist :key-type (symbol :tag "Major mode")
354 (defcustom calc-embedded-open-mode
356 "*A string which should precede calc-embedded mode annotations.
357 This is not required to be present for user-written mode annotations."
361 (defcustom calc-embedded-close-mode
363 "*A string which should follow calc-embedded mode annotations.
364 This is not required to be present for user-written mode annotations."
368 (defcustom calc-embedded-open-close-mode-alist
369 '((c++-mode "// " "\n")
370 (c-mode "/* " " */\n")
371 (f90-mode "! " "\n")
372 (fortran-mode "C " "\n")
373 (html-helper-mode "<!-- " " -->\n")
374 (html-mode "<!-- " " -->\n")
375 (nroff-mode "\\\" " "\n")
376 (pascal-mode "{ " " }\n")
377 (sgml-mode "<!-- " " -->\n")
378 (xml-mode "<!-- " " -->\n")
379 (texinfo-mode "@c " "\n"))
382 :type '(alist :key-type (symbol :tag "Major mode")
421 current precision are displayed in scientific notation in calc-mode.")
425 scientific notation in calc-mode.")
428 "List of used-defined strings to append to Calculator mode line.")
437 (defvar calc-mode-var-list '()
443 (add-to-list 'calc-mode-var-list (list (quote ,var) ,defval))))
445 (defun calc-mode-var-list-restore-default-values ()
447 calc-mode-var-list))
449 (defun calc-mode-var-list-restore-saved-values ()
460 (forward-line 1)
462 (search-forward "\n;;; End of mode settings" nil t)))
463 (beginning-of-line)
464 (calc-mode-var-list-restore-default-values)
466 (let ((varlist calc-mode-var-list))
476 (calc-mode-var-list-restore-default-values))))
481 (defcalcmodevar calc-line-numbering t
482 "If non-nil, display line numbers in Calculator stack.")
484 (defcalcmodevar calc-line-breaking t
494 In left-justified mode, this is effectively indentation. (Default 0).
495 In right-justified mode, this is effectively window width.
496 In centered mode, center of stack entry is placed here.")
498 (defcalcmodevar calc-number-radix 10
499 "Radix for entry and display of numbers in calc-mode, 2-36.")
511 This is used only when calc-group-digits mode is on.")
531 "Format to use for display of floating-point numbers in calc-mode.
548 "Format to use for display of complex numbers in calc-mode. Must be one of:
553 (defcalcmodevar calc-complex-mode 'cplx
556 (defcalcmodevar calc-infinite-mode nil
570 "If non-nil, display vectors one element per line.")
593 flat Use standard Calc notation, one-line format.
615 "Minimum number of bits per word, if any, for binary operations in calc-mode.")
620 (defcalcmodevar calc-simplify-mode nil
637 "Number of digits of internal precision for calc-mode calculations.")
639 (defcalcmodevar calc-angle-mode 'deg
643 (defcalcmodevar calc-algebraic-mode nil
647 (defcalcmodevar calc-incomplete-algebraic-mode nil
648 "Like calc-algebraic-mode except only affects ( and [ keys.")
650 (defcalcmodevar calc-symbolic-mode nil
654 (defcalcmodevar calc-matrix-mode nil
656 If a number, variables are assumed to be NxN matrices.
690 (defcalcmodevar calc-mode-save-mode 'local)
706 (defcalcmodevar calc-was-keypad-mode nil)
708 (defcalcmodevar calc-full-mode nil)
736 calc-mode-save-mode
738 calc-line-numbering
739 calc-line-breaking
745 calc-algebraic-mode
746 calc-incomplete-algebraic-mode
747 calc-symbolic-mode
748 calc-matrix-mode
752 calc-angle-mode
753 calc-number-radix
773 calc-complex-mode
774 calc-infinite-mode
776 calc-simplify-mode
786 (defvar calc-mode-hook nil
787 "Hook run when entering calc-mode.")
789 (defvar calc-trail-mode-hook nil
790 "Hook run when entering calc-trail-mode.")
808 "Hook run when starting embedded mode in a new buffer.")
811 "Hook run when starting embedded mode in a new formula.")
813 (defvar calc-embedded-mode-hook nil
814 "Hook run when starting embedded mode.")
849 (put 'calc-mode 'mode-class 'special)
850 (put 'calc-trail-mode 'mode-class 'special)
888 (defvar calc-last-kill nil) ; Last number killed in calc-mode.
924 (defvar calc-mode-map
969 calc-mode-map)
970 (let ((cmap (nth 1 calc-mode-map))
991 (define-key calc-mode-map x 'calc-pop)
992 (define-key calc-mode-map
1156 (defun calc-mode ()
1157 "Calculator major mode.
1168 Calc manual on-line, `h s' to read the summary, or `h t' for the tutorial.
1171 _23 negative number -23 (or type `23 n')
1176 (2, 4) complex number 2 + 4i
1177 (2; 4) polar complex number (r; theta)
1180 2 +/- 3 (p key) number with mean 2, standard deviation 3
1181 2 mod 3 (M key) number 2 computed modulo 3
1185 \\{calc-mode-map}
1191 (use-local-map (if (eq calc-algebraic-mode 'total)
1192 (progn (require 'calc-ext) calc-alg-map) calc-mode-map))
1196 (add-hook 'change-major-mode-hook 'font-lock-defontify nil t)
1199 (setq major-mode 'calc-mode)
1200 (setq mode-name "Calculator")
1212 (let ((p command-line-args))
1219 (run-mode-hooks 'calc-mode-hook)
1221 (calc-set-mode-line)
1243 (defun calc-trail-mode (&optional buf)
1244 "Calc Trail mode.
1245 This mode is used by the *Calc Trail* buffer, which records all results
1254 (fundamental-mode)
1255 (use-local-map calc-mode-map)
1256 (setq major-mode 'calc-trail-mode)
1257 (setq mode-name "Calc Trail")
1268 (run-mode-hooks 'calc-trail-mode-hook))
1272 (or (eq major-mode 'calc-mode)
1273 (calc-mode))
1283 "The Emacs Calculator. Full documentation is listed under \"calc-mode\"."
1295 (if (eq major-mode 'calc-mode)
1299 (setq calc-was-keypad-mode nil)
1301 (and (null full-display) calc-full-mode))
1347 (if (eq major-mode 'calc-edit-mode)
1349 (if calc-was-keypad-mode
1351 (calc arg calc-full-mode t)))))
1360 (if (eq major-mode 'calc-edit-mode)
1366 (unless (eq major-mode 'calc-mode)
1403 "Invoke the Calculator in \"visual keypad\" mode.
1405 In this mode, click on the Calc \"buttons\" using the left mouse button.
1409 (calc-do-keypad calc-full-mode interactive))
1413 "Invoke the Calculator in full-screen \"visual keypad\" mode.
1423 (defvar calc-final-point-line)
1434 calc-final-point-line calc-final-point-column)
1442 (and (eq calc-algebraic-mode 'total)
1477 (eq major-mode 'calc-trail-mode)
1480 (if (eq major-mode 'calc-mode)
1482 (goto-line calc-final-point-line)
1486 (goto-line calc-final-point-line)
1496 (calc-set-mode-line)
1507 (or (eq major-mode 'calc-mode)
1517 (forward-line (- (calc-substack-height (or index 1)))))
1532 (defun calc-set-mode-line ()
1537 (new-mode-string
1546 (capitalize (symbol-name calc-angle-mode))
1550 (if (eq calc-algebraic-mode 'total) "Alg* "
1551 (if calc-algebraic-mode "Alg "
1552 (if calc-incomplete-algebraic-mode "Alg[( " "")))
1555 (if calc-symbolic-mode "Symb " "")
1556 (cond ((eq calc-matrix-mode 'matrix) "Matrix ")
1557 ((integerp calc-matrix-mode)
1558 (format "Matrix%d " calc-matrix-mode))
1559 ((eq calc-matrix-mode 'sqmatrix) "SqMatrix ")
1560 ((eq calc-matrix-mode 'scalar) "Scalar ")
1562 (if (eq calc-complex-mode 'polar) "Polar " "")
1564 (cond ((null calc-infinite-mode) "")
1565 ((eq calc-infinite-mode 1) "+Inf ")
1567 (cond ((eq calc-simplify-mode 'none) "NoSimp ")
1568 ((eq calc-simplify-mode 'num) "NumSimp ")
1569 ((eq calc-simplify-mode 'binary)
1571 ((eq calc-simplify-mode 'alg) "AlgSimp ")
1572 ((eq calc-simplify-mode 'ext) "ExtSimp ")
1573 ((eq calc-simplify-mode 'units) "UnitSimp ")
1577 (cond ((= calc-number-radix 10) "")
1578 ((= calc-number-radix 2) "Bin ")
1579 ((= calc-number-radix 8) "Oct ")
1580 ((= calc-number-radix 16) "Hex ")
1581 (t (format "Radix%d " calc-number-radix)))
1607 (cond ((integerp calc-line-breaking)
1608 (format "Wid%d " calc-line-breaking))
1609 (calc-line-breaking "")
1614 (cond ((eq calc-mode-save-mode 'save) "Save ")
1616 ((eq calc-mode-save-mode 'local) "Local ")
1617 ((eq calc-mode-save-mode 'edit) "LocEdit ")
1618 ((eq calc-mode-save-mode 'perm) "LocPerm ")
1619 ((eq calc-mode-save-mode 'global) "Global ")
1633 (if (equal new-mode-string mode-line-buffer-identification)
1635 (setq mode-line-buffer-identification new-mode-string)
1637 (and calc-embedded-info (calc-embedded-mode-line-change))))))
1640 (if (eq major-mode 'calc-mode)
1718 (if (memq calc-simplify-mode '(nil none num))
1755 (defvar sel-mode)
1757 (cond ((eq sel-mode 'entry)
1759 ((eq sel-mode 'sel)
1762 (eq sel-mode 'full)
1765 (sel-mode
1770 (defun calc-top (&optional n sel-mode)
1775 (defun calc-top-n (&optional n sel-mode) ; in case precision has changed
1776 (math-check-complete (calc-normalize (calc-top n sel-mode))))
1778 (defun calc-top-list (&optional n m sel-mode)
1788 (defun calc-top-list-n (&optional n m sel-mode)
1790 (mapcar 'calc-normalize (calc-top-list n m sel-mode))))
1794 (if calc-line-numbering
1802 (beginning-of-line)
1805 (beginning-of-line)
1819 (beginning-of-line)
1827 (and (eq major-mode 'calc-mode)
1843 (forward-line 1))
1855 (and calc-embedded-info (not (eq major-mode 'calc-mode))
1874 (let ((buf (or (and (not (eq major-mode 'calc-mode))
1878 (or (eq major-mode 'calc-trail-mode)
1879 (calc-trail-mode buf)))))
1884 (goto-line 2)
1949 (if (eq major-mode 'calc-trail-mode)
1951 (beginning-of-line)
1953 (forward-line 1)
1955 (forward-line -1)))
1968 (forward-line (/ (window-height win) 2))
1969 (forward-line (- 1 (window-height win)))
2087 ;;;; Reading a number using the minibuffer.
2095 (if (or calc-algebraic-mode
2096 (and (> calc-number-radix 14) (eq last-command-char ?e)))
2118 (or calc-digit-value (setq calc-digit-value (math-read-number buf)))
2140 (math-read-number str))))
2175 (insert (int-to-string calc-number-radix)))))
2232 (let ((radix (string-to-number
2299 ;;; (float NUM EXP) A floating-point number, NUM * 10^EXP;
2305 ;;; (cplx REAL IMAG) A complex number; REAL and IMAG are any of above.
2308 ;;; (polar R THETA) Polar complex number. Normalized, R > 0 and THETA
2324 ;;; SIGMA > 0. X is any complex number and SIGMA
2350 ;;; O Normalized object (vector or number)
2352 ;;; N Normalized number of any type
2353 ;;; N Normalized complex number
2354 ;;; R Normalized real number (float or rational)
2355 ;;; F Normalized floating-point number
2356 ;;; T Normalized rational number
2428 (or (and calc-simplify-mode
2463 (wrong-number-of-arguments
2464 (calc-record-why "*Wrong number of arguments"
2500 ;;; True if A is a floating-point real or complex number. [P x] [Public]
2534 ;;; Build a normalized floating-point number. [F I S]
2591 ;;; Compute the number of decimal digits in integer A. [S I]
3102 ;;; Format the number A as a string. [X N; X Z] [Public]
3116 (math-format-number a))
3131 (when calc-line-numbering
3155 (when calc-line-numbering
3165 (let* ((num (if calc-line-numbering 4 0))
3173 (when (integerp calc-line-breaking)
3174 (setq math-svo-wid calc-line-breaking)))
3189 (math-format-number a)
3191 (let ((calc-line-breaking nil))
3199 (if calc-line-numbering 5 1))))
3208 ;;; Format an expression as a one-line string suitable for re-reading.
3224 (math-format-number a)))
3231 ;;; Format a number as a string.
3232 (defun math-format-number (a &optional prec) ; [X N] [Public]
3237 (math-format-number (math-adjust-fraction a)))
3240 (if (= calc-number-radix 10)
3243 (concat "-" (math-format-number (- a)))
3248 calc-number-radix
3249 (if (= calc-number-radix 2)
3252 (format "%d#%s" calc-number-radix
3253 (if (= calc-number-radix 2)
3257 (math-format-number (math-bignum a))))
3262 ((and (eq (car a) 'float) (= calc-number-radix 10))
3264 (concat "-" (math-format-number (math-neg a)))
3340 (math-format-number-fancy a prec))))
3343 (if (and (= calc-number-radix 10)
3361 ;;; Parse a simple number in string form. [N X] [Public]
3362 (defun math-read-number (s)
3372 (math-read-number (concat "8#" digs))
3374 (string-to-number digs)
3379 (math-read-number (concat (math-match-substring s 1)
3384 (let ((val (math-read-number (math-match-substring s 1))))
3390 (math-read-number-fancy s))
3398 (let ((int (if (> ilen 0) (math-read-number int) 0))
3399 (frac (if (> flen 0) (math-read-number frac) 0)))
3409 (let ((mant (if (> (length mant) 0) (math-read-number mant) 1))
3411 (string-to-number exp))))
3426 (cons (string-to-number (substring s -3))
3428 (list (string-to-number s))))
3526 "Start Calc Embedded mode on the formula surrounding point."