| 1 |
|
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
|
|---|
| 56 |
|
|---|
| 57 |
|
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
|
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
|
|---|
| 66 |
|
|---|
| 67 |
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
|
|---|
| 73 |
|
|---|
| 74 |
|
|---|
| 75 |
|
|---|
| 76 |
|
|---|
| 77 |
|
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
|
|---|
| 81 |
|
|---|
| 82 |
|
|---|
| 83 |
|
|---|
| 84 |
|
|---|
| 85 |
|
|---|
| 86 |
|
|---|
| 87 |
|
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
|
|---|
| 91 |
|
|---|
| 92 |
|
|---|
| 93 |
|
|---|
| 94 |
|
|---|
| 95 |
|
|---|
| 96 |
|
|---|
| 97 |
|
|---|
| 98 |
|
|---|
| 99 |
|
|---|
| 100 |
|
|---|
| 101 |
|
|---|
| 102 |
|
|---|
| 103 |
|
|---|
| 104 |
|
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
|
|---|
| 109 |
|
|---|
| 110 |
|
|---|
| 111 |
|
|---|
| 112 |
|
|---|
| 113 |
|
|---|
| 114 |
|
|---|
| 115 |
|
|---|
| 116 |
|
|---|
| 117 |
|
|---|
| 118 |
|
|---|
| 119 |
|
|---|
| 120 |
|
|---|
| 121 |
|
|---|
| 122 |
|
|---|
| 123 |
|
|---|
| 124 |
|
|---|
| 125 |
|
|---|
| 126 |
|
|---|
| 127 |
|
|---|
| 128 |
|
|---|
| 129 |
|
|---|
| 130 |
|
|---|
| 131 |
|
|---|
| 132 |
|
|---|
| 133 |
|
|---|
| 134 |
|
|---|
| 135 |
|
|---|
| 136 |
|
|---|
| 137 |
|
|---|
| 138 |
|
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
|
|---|
| 143 |
|
|---|
| 144 |
|
|---|
| 145 |
|
|---|
| 146 |
|
|---|
| 147 |
|
|---|
| 148 |
|
|---|
| 149 |
|
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
|
|---|
| 153 |
|
|---|
| 154 |
|
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 |
|
|---|
| 158 |
|
|---|
| 159 |
|
|---|
| 160 |
|
|---|
| 161 |
|
|---|
| 162 |
|
|---|
| 163 |
|
|---|
| 164 |
|
|---|
| 165 |
|
|---|
| 166 |
|
|---|
| 167 |
|
|---|
| 168 |
|
|---|
| 169 |
|
|---|
| 170 |
|
|---|
| 171 |
|
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
|
|---|
| 176 |
|
|---|
| 177 |
|
|---|
| 178 |
|
|---|
| 179 |
|
|---|
| 180 |
|
|---|
| 181 |
|
|---|
| 182 |
|
|---|
| 183 |
|
|---|
| 184 |
|
|---|
| 185 |
|
|---|
| 186 |
|
|---|
| 187 |
|
|---|
| 188 |
|
|---|
| 189 |
|
|---|
| 190 |
|
|---|
| 191 |
|
|---|
| 192 |
|
|---|
| 193 |
|
|---|
| 194 |
|
|---|
| 195 |
|
|---|
| 196 |
|
|---|
| 197 |
|
|---|
| 198 |
|
|---|
| 199 |
|
|---|
| 200 |
|
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 |
|
|---|
| 206 |
|
|---|
| 207 |
(require 'calc-macs) |
|---|
| 208 |
|
|---|
| 209 |
(defgroup calc nil |
|---|
| 210 |
"GNU Calc." |
|---|
| 211 |
:prefix "calc-" |
|---|
| 212 |
:tag "Calc" |
|---|
| 213 |
:group 'applications) |
|---|
| 214 |
|
|---|
| 215 |
|
|---|
| 216 |
(defcustom calc-settings-file |
|---|
| 217 |
(convert-standard-filename "~/.calc.el") |
|---|
| 218 |
"*File in which to record permanent settings." |
|---|
| 219 |
:group 'calc |
|---|
| 220 |
:type '(file)) |
|---|
| 221 |
|
|---|
| 222 |
(defcustom calc-language-alist |
|---|
| 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)) |
|---|
| 233 |
"*Alist of major modes with appropriate Calc languages." |
|---|
| 234 |
:group 'calc |
|---|
| 235 |
:type '(alist :key-type (symbol :tag "Major mode") |
|---|
| 236 |
:value-type (symbol :tag "Calc language"))) |
|---|
| 237 |
|
|---|
| 238 |
(defcustom calc-embedded-announce-formula |
|---|
| 239 |
"%Embed\n\\(% .*\n\\)*" |
|---|
| 240 |
"*A regular expression which is sure to be followed by a calc-embedded formula." |
|---|
| 241 |
:group 'calc |
|---|
| 242 |
:type '(regexp)) |
|---|
| 243 |
|
|---|
| 244 |
(defcustom calc-embedded-announce-formula-alist |
|---|
| 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\\)*")) |
|---|
| 256 |
"*Alist of major modes with appropriate values for `calc-embedded-announce-formula'." |
|---|
| 257 |
:group 'calc |
|---|
| 258 |
:type '(alist :key-type (symbol :tag "Major mode") |
|---|
| 259 |
:value-type (regexp :tag "Regexp to announce formula"))) |
|---|
| 260 |
|
|---|
| 261 |
(defcustom calc-embedded-open-formula |
|---|
| 262 |
"\\`\\|^\n\\|\\$\\$?\\|\\\\\\[\\|^\\\\begin[^{].*\n\\|^\\\\begin{.*[^x]}.*\n\\|^@.*\n\\|^\\.EQ.*\n\\|\\\\(\\|^%\n\\|^\\.\\\\\"\n" |
|---|
| 263 |
"*A regular expression for the opening delimiter of a formula used by calc-embedded." |
|---|
| 264 |
:group 'calc |
|---|
| 265 |
:type '(regexp)) |
|---|
| 266 |
|
|---|
| 267 |
(defcustom calc-embedded-close-formula |
|---|
| 268 |
"\\'\\|\n$\\|\\$\\$?\\|\\\\]\\|^\\\\end[^{].*\n\\|^\\\\end{.*[^x]}.*\n\\|^@.*\n\\|^\\.EN.*\n\\|\\\\)\\|\n%\n\\|^\\.\\\\\"\n" |
|---|
| 269 |
"*A regular expression for the closing delimiter of a formula used by calc-embedded." |
|---|
| 270 |
:group 'calc |
|---|
| 271 |
:type '(regexp)) |
|---|
| 272 |
|
|---|
| 273 |
(defcustom calc-embedded-open-close-formula-alist |
|---|
| 274 |
nil |
|---|
| 275 |
"*Alist of major modes with pairs of formula delimiters used by calc-embedded." |
|---|
| 276 |
:group 'calc |
|---|
| 277 |
:type '(alist :key-type (symbol :tag "Major mode") |
|---|
| 278 |
:value-type (list (regexp :tag "Opening formula delimiter") |
|---|
| 279 |
(regexp :tag "Closing formula delimiter")))) |
|---|
| 280 |
|
|---|
| 281 |
(defcustom calc-embedded-open-word |
|---|
| 282 |
"^\\|[^-+0-9.eE]" |
|---|
| 283 |
"*A regular expression for the opening delimiter of a formula used by calc-embedded-word." |
|---|
| 284 |
:group 'calc |
|---|
| 285 |
:type '(regexp)) |
|---|
| 286 |
|
|---|
| 287 |
(defcustom calc-embedded-close-word |
|---|
| 288 |
"$\\|[^-+0-9.eE]" |
|---|
| 289 |
"*A regular expression for the closing delimiter of a formula used by calc-embedded-word." |
|---|
| 290 |
:group 'calc |
|---|
| 291 |
:type '(regexp)) |
|---|
| 292 |
|
|---|
| 293 |
(defcustom calc-embedded-open-close-word-alist |
|---|
| 294 |
nil |
|---|
| 295 |
"*Alist of major modes with pairs of word delimiters used by calc-embedded." |
|---|
| 296 |
:group 'calc |
|---|
| 297 |
:type '(alist :key-type (symbol :tag "Major mode") |
|---|
| 298 |
:value-type (list (regexp :tag "Opening word delimiter") |
|---|
| 299 |
(regexp :tag "Closing word delimiter")))) |
|---|
| 300 |
|
|---|
| 301 |
(defcustom calc-embedded-open-plain |
|---|
| 302 |
"%%% " |
|---|
| 303 |
"*A string which is the opening delimiter for a \"plain\" formula. |
|---|
| 304 |
If calc-show-plain mode is enabled, this is inserted at the front of |
|---|
| 305 |
each formula." |
|---|
| 306 |
:group 'calc |
|---|
| 307 |
:type '(string)) |
|---|
| 308 |
|
|---|
| 309 |
(defcustom calc-embedded-close-plain |
|---|
| 310 |
" %%%\n" |
|---|
| 311 |
"*A string which is the closing delimiter for a \"plain\" formula. |
|---|
| 312 |
See calc-embedded-open-plain." |
|---|
| 313 |
:group 'calc |
|---|
| 314 |
:type '(string)) |
|---|
| 315 |
|
|---|
| 316 |
(defcustom calc-embedded-open-close-plain-alist |
|---|
| 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")) |
|---|
| 328 |
"*Alist of major modes with pairs of delimiters for \"plain\" formulas." |
|---|
| 329 |
:group 'calc |
|---|
| 330 |
:type '(alist :key-type (symbol :tag "Major mode") |
|---|
| 331 |
:value-type (list (string :tag "Opening \"plain\" delimiter") |
|---|
| 332 |
(string :tag "Closing \"plain\" delimiter")))) |
|---|
| 333 |
|
|---|
| 334 |
(defcustom calc-embedded-open-new-formula |
|---|
| 335 |
"\n\n" |
|---|
| 336 |
"*A string which is inserted at front of formula by calc-embedded-new-formula." |
|---|
| 337 |
:group 'calc |
|---|
| 338 |
:type '(string)) |
|---|
| 339 |
|
|---|
| 340 |
(defcustom calc-embedded-close-new-formula |
|---|
| 341 |
"\n\n" |
|---|
| 342 |
"*A string which is inserted at end of formula by calc-embedded-new-formula." |
|---|
| 343 |
:group 'calc |
|---|
| 344 |
:type '(string)) |
|---|
| 345 |
|
|---|
| 346 |
(defcustom calc-embedded-open-close-new-formula-alist |
|---|
| 347 |
nil |
|---|
| 348 |
"*Alist of major modes with pairs of new formula delimiters used by calc-embedded." |
|---|
| 349 |
:group 'calc |
|---|
| 350 |
:type '(alist :key-type (symbol :tag "Major mode") |
|---|
| 351 |
:value-type (list (string :tag "Opening new formula delimiter") |
|---|
| 352 |
(string :tag "Closing new formula delimiter")))) |
|---|
| 353 |
|
|---|
| 354 |
(defcustom calc-embedded-open-mode |
|---|
| 355 |
"% " |
|---|
| 356 |
"*A string which should precede calc-embedded mode annotations. |
|---|
| 357 |
This is not required to be present for user-written mode annotations." |
|---|
| 358 |
:group 'calc |
|---|
| 359 |
:type '(string)) |
|---|
| 360 |
|
|---|
| 361 |
(defcustom calc-embedded-close-mode |
|---|
| 362 |
"\n" |
|---|
| 363 |
"*A string which should follow calc-embedded mode annotations. |
|---|
| 364 |
This is not required to be present for user-written mode annotations." |
|---|
| 365 |
:group 'calc |
|---|
| 366 |
:type '(string)) |
|---|
| 367 |
|
|---|
| 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")) |
|---|
| 380 |
"*Alist of major modes with pairs of strings to delimit annotations." |
|---|
| 381 |
:group 'calc |
|---|
| 382 |
:type '(alist :key-type (symbol :tag "Major mode") |
|---|
| 383 |
:value-type (list (string :tag "Opening annotation delimiter") |
|---|
| 384 |
(string :tag "Closing annotation delimiter")))) |
|---|
| 385 |
|
|---|
| 386 |
(defcustom calc-gnuplot-name |
|---|
| 387 |
"gnuplot" |
|---|
| 388 |
"*Name of GNUPLOT program, for calc-graph features." |
|---|
| 389 |
:group 'calc |
|---|
| 390 |
:type '(string)) |
|---|
| 391 |
|
|---|
| 392 |
(defcustom calc-gnuplot-plot-command |
|---|
| 393 |
nil |
|---|
| 394 |
"*Name of command for displaying GNUPLOT output; %s = file name to print." |
|---|
| 395 |
:group 'calc |
|---|
| 396 |
:type '(choice (string) (sexp))) |
|---|
| 397 |
|
|---|
| 398 |
(defcustom calc-gnuplot-print-command |
|---|
| 399 |
"lp %s" |
|---|
| 400 |
"*Name of command for printing GNUPLOT output; %s = file name to print." |
|---|
| 401 |
:group 'calc |
|---|
| 402 |
:type '(choice (string) (sexp))) |
|---|
| 403 |
|
|---|
| 404 |
(defvar calc-bug-address "jay.p.belanger@gmail.com" |
|---|
| 405 |
"Address of the maintainer of Calc, for use by `report-calc-bug'.") |
|---|
| 406 |
|
|---|
| 407 |
(defvar calc-scan-for-dels t |
|---|
| 408 |
"If t, scan keymaps to find all DEL-like keys. |
|---|
| 409 |
if nil, only DEL itself is mapped to calc-pop.") |
|---|
| 410 |
|
|---|
| 411 |
(defvar calc-stack '((top-of-stack 1 nil)) |
|---|
| 412 |
"Calculator stack. |
|---|
| 413 |
Entries are 3-lists: Formula, Height (in lines), Selection (or nil).") |
|---|
| 414 |
|
|---|
| 415 |
(defvar calc-stack-top 1 |
|---|
| 416 |
"Index into `calc-stack' of \"top\" of stack. |
|---|
| 417 |
This is 1 unless `calc-truncate-stack' has been used.") |
|---|
| 418 |
|
|---|
| 419 |
(defvar calc-display-sci-high 0 |
|---|
| 420 |
"Floating-point numbers with this positive exponent or higher above the |
|---|
| 421 |
current precision are displayed in scientific notation in calc-mode.") |
|---|
| 422 |
|
|---|
| 423 |
(defvar calc-display-sci-low -3 |
|---|
| 424 |
"Floating-point numbers with this negative exponent or lower are displayed |
|---|
| 425 |
scientific notation in calc-mode.") |
|---|
| 426 |
|
|---|
| 427 |
(defvar calc-other-modes nil |
|---|
| 428 |
"List of used-defined strings to append to Calculator mode line.") |
|---|
| 429 |
|
|---|
| 430 |
(defvar calc-Y-help-msgs nil |
|---|
| 431 |
"List of strings for Y prefix help.") |
|---|
| 432 |
|
|---|
| 433 |
(defvar calc-loaded-settings-file nil |
|---|
| 434 |
"t if `calc-settings-file' has been loaded yet.") |
|---|
| 435 |
|
|---|
| 436 |
|
|---|
| 437 |
(defvar calc-mode-var-list '() |
|---|
| 438 |
"List of variables used in customizing GNU Calc.") |
|---|
| 439 |
|
|---|
| 440 |
(defmacro defcalcmodevar (var defval &optional doc) |
|---|
| 441 |
`(progn |
|---|
| 442 |
(defvar ,var ,defval ,doc) |
|---|
| 443 |
(add-to-list 'calc-mode-var-list (list (quote ,var) ,defval)))) |
|---|
| 444 |
|
|---|
| 445 |
(defun calc-mode-var-list-restore-default-values () |
|---|
| 446 |
(mapcar (function (lambda (v) (set (car v) (nth 1 v)))) |
|---|
| 447 |
calc-mode-var-list)) |
|---|
| 448 |
|
|---|
| 449 |
(defun calc-mode-var-list-restore-saved-values () |
|---|
| 450 |
(let ((newvarlist '())) |
|---|
| 451 |
(save-excursion |
|---|
| 452 |
(let (pos |
|---|
| 453 |
(file (substitute-in-file-name calc-settings-file))) |
|---|
| 454 |
(when (and |
|---|
| 455 |
(file-regular-p file) |
|---|
| 456 |
(set-buffer (find-file-noselect file)) |
|---|
| 457 |
(goto-char (point-min)) |
|---|
| 458 |
(search-forward ";;; Mode settings stored by Calc" nil t) |
|---|
| 459 |
(progn |
|---|
| 460 |
(forward-line 1) |
|---|
| 461 |
(setq pos (point)) |
|---|
| 462 |
(search-forward "\n;;; End of mode settings" nil t))) |
|---|
| 463 |
(beginning-of-line) |
|---|
| 464 |
(calc-mode-var-list-restore-default-values) |
|---|
| 465 |
(eval-region pos (point)) |
|---|
| 466 |
(let ((varlist calc-mode-var-list)) |
|---|
| 467 |
(while varlist |
|---|
| 468 |
(let ((var (car varlist))) |
|---|
| 469 |
(setq newvarlist |
|---|
| 470 |
(cons (list (car var) (symbol-value (car var))) |
|---|
| 471 |
newvarlist))) |
|---|
| 472 |
(setq varlist (cdr varlist))))))) |
|---|
| 473 |
(if newvarlist |
|---|
| 474 |
(mapcar (function (lambda (v) (set (car v) (nth 1 v)))) |
|---|
| 475 |
newvarlist) |
|---|
| 476 |
(calc-mode-var-list-restore-default-values)))) |
|---|
| 477 |
|
|---|
| 478 |
(defcalcmodevar calc-always-load-extensions nil |
|---|
| 479 |
"If non-nil, load the calc-ext module automatically when calc is loaded.") |
|---|
| 480 |
|
|---|
| 481 |
(defcalcmodevar calc-line-numbering t |
|---|
| 482 |
"If non-nil, display line numbers in Calculator stack.") |
|---|
| 483 |
|
|---|
| 484 |
(defcalcmodevar calc-line-breaking t |
|---|
| 485 |
"If non-nil, break long values across multiple lines in Calculator stack.") |
|---|
| 486 |
|
|---|
| 487 |
(defcalcmodevar calc-display-just nil |
|---|
| 488 |
"If nil, stack display is left-justified. |
|---|
| 489 |
If `right', stack display is right-justified. |
|---|
| 490 |
If `center', stack display is centered.") |
|---|
| 491 |
|
|---|
| 492 |
(defcalcmodevar calc-display-origin nil |
|---|
| 493 |
"Horizontal origin of displayed stack entries. |
|---|
| 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.") |
|---|
| 497 |
|
|---|
| 498 |
(defcalcmodevar calc-number-radix 10 |
|---|
| 499 |
"Radix for entry and display of numbers in calc-mode, 2-36.") |
|---|
| 500 |
|
|---|
| 501 |
(defcalcmodevar calc-leading-zeros nil |
|---|
| 502 |
"If non-nil, leading zeros are provided to pad integers to calc-word-size.") |
|---|
| 503 |
|
|---|
| 504 |
(defcalcmodevar calc-group-digits nil |
|---|
| 505 |
"If non-nil, group digits in large displayed integers by inserting spaces. |
|---|
| 506 |
If an integer, group that many digits at a time. |
|---|
| 507 |
If t, use 4 for binary and hex, 3 otherwise.") |
|---|
| 508 |
|
|---|
| 509 |
(defcalcmodevar calc-group-char "," |
|---|
| 510 |
"The character (in the form of a string) to be used for grouping digits. |
|---|
| 511 |
This is used only when calc-group-digits mode is on.") |
|---|
| 512 |
|
|---|
| 513 |
(defcalcmodevar calc-point-char "." |
|---|
| 514 |
"The character (in the form of a string) to be used as a decimal point.") |
|---|
| 515 |
|
|---|
| 516 |
(defcalcmodevar calc-frac-format '(":" nil) |
|---|
| 517 |
"Format of displayed fractions; a string of one or two of \":\" or \"/\".") |
|---|
| 518 |
|
|---|
| 519 |
(defcalcmodevar calc-prefer-frac nil |
|---|
| 520 |
"If non-nil, prefer fractional over floating-point results.") |
|---|
| 521 |
|
|---|
| 522 |
(defcalcmodevar calc-hms-format "%s@ %s' %s\"" |
|---|
| 523 |
"Format of displayed hours-minutes-seconds angles, a format string. |
|---|
| 524 |
String must contain three %s marks for hours, minutes, seconds respectively.") |
|---|
| 525 |
|
|---|
| 526 |
(defcalcmodevar calc-date-format '((H ":" mm C SS pp " ") |
|---|
| 527 |
Www " " Mmm " " D ", " YYYY) |
|---|
| 528 |
"Format of displayed date forms.") |
|---|
| 529 |
|
|---|
| 530 |
(defcalcmodevar calc-float-format '(float 0) |
|---|
| 531 |
"Format to use for display of floating-point numbers in calc-mode. |
|---|
| 532 |
Must be a list of one of the following forms: |
|---|
| 533 |
(float 0) Floating point format, display full precision. |
|---|
| 534 |
(float N) N > 0: Floating point format, at most N significant figures. |
|---|
| 535 |
(float -N) -N < 0: Floating point format, calc-internal-prec - N figs. |
|---|
| 536 |
(fix N) N >= 0: Fixed point format, N places after decimal point. |
|---|
| 537 |
(sci 0) Scientific notation, full precision. |
|---|
| 538 |
(sci N) N > 0: Scientific notation, N significant figures. |
|---|
| 539 |
(sci -N) -N < 0: Scientific notation, calc-internal-prec - N figs. |
|---|
| 540 |
(eng 0) Engineering notation, full precision. |
|---|
| 541 |
(eng N) N > 0: Engineering notation, N significant figures. |
|---|
| 542 |
(eng -N) -N < 0: Engineering notation, calc-internal-prec - N figs.") |
|---|
| 543 |
|
|---|
| 544 |
(defcalcmodevar calc-full-float-format '(float 0) |
|---|
| 545 |
"Format to use when full precision must be displayed.") |
|---|
| 546 |
|
|---|
| 547 |
(defcalcmodevar calc-complex-format nil |
|---|
| 548 |
"Format to use for display of complex numbers in calc-mode. Must be one of: |
|---|
| 549 |
nil Use (x, y) form. |
|---|
| 550 |
i Use x + yi form. |
|---|
| 551 |
j Use x + yj form.") |
|---|
| 552 |
|
|---|
| 553 |
(defcalcmodevar calc-complex-mode 'cplx |
|---|
| 554 |
"Preferred form, either `cplx' or `polar', for complex numbers.") |
|---|
| 555 |
|
|---|
| 556 |
(defcalcmodevar calc-infinite-mode nil |
|---|
| 557 |
"If nil, 1 / 0 is left unsimplified. |
|---|
| 558 |
If 0, 1 / 0 is changed to inf (zeros are considered positive). |
|---|
| 559 |
Otherwise, 1 / 0 is changed to uinf (undirected infinity).") |
|---|
| 560 |
|
|---|
| 561 |
(defcalcmodevar calc-display-strings nil |
|---|
| 562 |
"If non-nil, display vectors of byte-sized integers as strings.") |
|---|
| 563 |
|
|---|
| 564 |
(defcalcmodevar calc-matrix-just 'center |
|---|
| 565 |
"If nil, vector elements are left-justified. |
|---|
| 566 |
If `right', vector elements are right-justified. |
|---|
| 567 |
If `center', vector elements are centered.") |
|---|
| 568 |
|
|---|
| 569 |
(defcalcmodevar calc-break-vectors nil |
|---|
| 570 |
"If non-nil, display vectors one element per line.") |
|---|
| 571 |
|
|---|
| 572 |
(defcalcmodevar calc-full-vectors t |
|---|
| 573 |
"If non-nil, display long vectors in full. If nil, use abbreviated form.") |
|---|
| 574 |
|
|---|
| 575 |
(defcalcmodevar calc-full-trail-vectors t |
|---|
| 576 |
"If non-nil, display long vectors in full in the trail.") |
|---|
| 577 |
|
|---|
| 578 |
(defcalcmodevar calc-vector-commas "," |
|---|
| 579 |
"If non-nil, separate elements of displayed vectors with this string.") |
|---|
| 580 |
|
|---|
| 581 |
(defcalcmodevar calc-vector-brackets "[]" |
|---|
| 582 |
"If non-nil, surround displayed vectors with these characters.") |
|---|
| 583 |
|
|---|
| 584 |
(defcalcmodevar calc-matrix-brackets '(R O) |
|---|
| 585 |
"A list of code-letter symbols that control \"big\" matrix display. |
|---|
| 586 |
If `R' is present, display inner brackets for matrices. |
|---|
| 587 |
If `O' is present, display outer brackets for matrices (above/below). |
|---|
| 588 |
If `C' is present, display outer brackets for matrices (centered).") |
|---|
| 589 |
|
|---|
| 590 |
(defcalcmodevar calc-language nil |
|---|
| 591 |
"Language or format for entry and display of stack values. Must be one of: |
|---|
| 592 |
nil Use standard Calc notation. |
|---|
| 593 |
flat Use standard Calc notation, one-line format. |
|---|
| 594 |
big Display formulas in 2-d notation (enter w/std notation). |
|---|
| 595 |
unform Use unformatted display: add(a, mul(b,c)). |
|---|
| 596 |
c Use C language notation. |
|---|
| 597 |
pascal Use Pascal language notation. |
|---|
| 598 |
fortran Use Fortran language notation. |
|---|
| 599 |
tex Use TeX notation. |
|---|
| 600 |
latex Use LaTeX notation. |
|---|
| 601 |
eqn Use eqn notation. |
|---|
| 602 |
math Use Mathematica(tm) notation. |
|---|
| 603 |
maple Use Maple notation.") |
|---|
| 604 |
|
|---|
| 605 |
(defcalcmodevar calc-language-option nil |
|---|
| 606 |
"Numeric prefix argument for the command that set `calc-language'.") |
|---|
| 607 |
|
|---|
| 608 |
(defcalcmodevar calc-left-label "" |
|---|
| 609 |
"Label to display at left of formula.") |
|---|
| 610 |
|
|---|
| 611 |
(defcalcmodevar calc-right-label "" |
|---|
| 612 |
"Label to display at right of formula.") |
|---|
| 613 |
|
|---|
| 614 |
(defcalcmodevar calc-word-size 32 |
|---|
| 615 |
"Minimum number of bits per word, if any, for binary operations in calc-mode.") |
|---|
| 616 |
|
|---|
| 617 |
(defcalcmodevar calc-previous-modulo nil |
|---|
| 618 |
"Most recently used value of M in a modulo form.") |
|---|
| 619 |
|
|---|
| 620 |
(defcalcmodevar calc-simplify-mode nil |
|---|
| 621 |
"Type of simplification applied to results. |
|---|
| 622 |
If `none', results are not simplified when pushed on the stack. |
|---|
| 623 |
If `num', functions are simplified only when args are constant. |
|---|
| 624 |
If nil, only fast simplifications are applied. |
|---|
| 625 |
If `binary', `math-clip' is applied if appropriate. |
|---|
| 626 |
If `alg', `math-simplify' is applied. |
|---|
| 627 |
If `ext', `math-simplify-extended' is applied. |
|---|
| 628 |
If `units', `math-simplify-units' is applied.") |
|---|
| 629 |
|
|---|
| 630 |
(defcalcmodevar calc-auto-recompute t |
|---|
| 631 |
"If non-nil, recompute evalto's automatically when necessary.") |
|---|
| 632 |
|
|---|
| 633 |
(defcalcmodevar calc-display-raw nil |
|---|
| 634 |
"If non-nil, display shows unformatted Lisp exprs. (For debugging)") |
|---|
| 635 |
|
|---|
| 636 |
(defcalcmodevar calc-internal-prec 12 |
|---|
| 637 |
"Number of digits of internal precision for calc-mode calculations.") |
|---|
| 638 |
|
|---|
| 639 |
(defcalcmodevar calc-angle-mode 'deg |
|---|
| 640 |
"If deg, angles are in degrees; if rad, angles are in radians. |
|---|
| 641 |
If hms, angles are in degrees-minutes-seconds.") |
|---|
| 642 |
|
|---|
| 643 |
(defcalcmodevar calc-algebraic-mode nil |
|---|
| 644 |
"If non-nil, numeric entry accepts whole algebraic expressions. |
|---|
| 645 |
If nil, algebraic expressions must be preceded by \"'\".") |
|---|
| 646 |
|
|---|
| 647 |
(defcalcmodevar calc-incomplete-algebraic-mode nil |
|---|
| 648 |
"Like calc-algebraic-mode except only affects ( and [ keys.") |
|---|
| 649 |
|
|---|
| 650 |
(defcalcmodevar calc-symbolic-mode nil |
|---|
| 651 |
"If non-nil, inexact numeric computations like sqrt(2) are postponed. |
|---|
| 652 |
If nil, computations on numbers always yield numbers where possible.") |
|---|
| 653 |
|
|---|
| 654 |
(defcalcmodevar calc-matrix-mode nil |
|---|
| 655 |
"If `matrix', variables are assumed to be matrix-valued. |
|---|
| 656 |
If a number, variables are assumed to be NxN matrices. |
|---|
| 657 |
If `sqmatrix', variables are assumed to be square matrices of an unspecified size. |
|---|
| 658 |
If `scalar', variables are assumed to be scalar-valued. |
|---|
| 659 |
If nil, symbolic math routines make no assumptions about variables.") |
|---|
| 660 |
|
|---|
| 661 |
(defcalcmodevar calc-shift-prefix nil |
|---|
| 662 |
"If non-nil, shifted letter keys are prefix keys rather than normal meanings.") |
|---|
| 663 |
|
|---|
| 664 |
(defcalcmodevar calc-window-height 7 |
|---|
| 665 |
"Initial height of Calculator window.") |
|---|
| 666 |
|
|---|
| 667 |
(defcalcmodevar calc-display-trail t |
|---|
| 668 |
"If non-nil, M-x calc creates a window to display Calculator trail.") |
|---|
| 669 |
|
|---|
| 670 |
(defcalcmodevar calc-show-selections t |
|---|
| 671 |
"If non-nil, selected sub-formulas are shown by obscuring rest of formula. |
|---|
| 672 |
If nil, selected sub-formulas are highlighted by obscuring the sub-formulas.") |
|---|
| 673 |
|
|---|
| 674 |
(defcalcmodevar calc-use-selections t |
|---|
| 675 |
"If non-nil, commands operate only on selected portions of formulas. |
|---|
| 676 |
If nil, selections displayed but ignored.") |
|---|
| 677 |
|
|---|
| 678 |
(defcalcmodevar calc-assoc-selections t |
|---|
| 679 |
"If non-nil, selection hides deep structure of associative formulas.") |
|---|
| 680 |
|
|---|
| 681 |
(defcalcmodevar calc-display-working-message 'lots |
|---|
| 682 |
"If non-nil, display \"Working...\" for potentially slow Calculator commands.") |
|---|
| 683 |
|
|---|
| 684 |
(defcalcmodevar calc-auto-why 'maybe |
|---|
| 685 |
"If non-nil, automatically execute a \"why\" command to explain odd results.") |
|---|
| 686 |
|
|---|
| 687 |
(defcalcmodevar calc-timing nil |
|---|
| 688 |
"If non-nil, display timing information on each slow command.") |
|---|
| 689 |
|
|---|
| 690 |
(defcalcmodevar calc-mode-save-mode 'local) |
|---|
| 691 |
|
|---|
| 692 |
(defcalcmodevar calc-standard-date-formats |
|---|
| 693 |
'("N" |
|---|
| 694 |
"<H:mm:SSpp >Www Mmm D, YYYY" |
|---|
| 695 |
"D Mmm YYYY<, h:mm:SS>" |
|---|
| 696 |
"Www Mmm BD< hh:mm:ss> YYYY" |
|---|
| 697 |
"M/D/Y< H:mm:SSpp>" |
|---|
| 698 |
"D.M.Y< h:mm:SS>" |
|---|
| 699 |
"M-D-Y< H:mm:SSpp>" |
|---|
| 700 |
"D-M-Y< h:mm:SS>" |
|---|
| 701 |
"j<, h:mm:SS>" |
|---|
| 702 |
"YYddd< hh:mm:ss>")) |
|---|
| 703 |
|
|---|
| 704 |
(defcalcmodevar calc-autorange-units nil) |
|---|
| 705 |
|
|---|
| 706 |
(defcalcmodevar calc-was-keypad-mode nil) |
|---|
| 707 |
|
|---|
| 708 |
(defcalcmodevar calc-full-mode nil) |
|---|
| 709 |
|
|---|
| 710 |
(defcalcmodevar calc-user-parse-tables nil) |
|---|
| 711 |
|
|---|
| 712 |
(defcalcmodevar calc-gnuplot-default-device "default") |
|---|
| 713 |
|
|---|
| 714 |
(defcalcmodevar calc-gnuplot-default-output "STDOUT") |
|---|
| 715 |
|
|---|
| 716 |
(defcalcmodevar calc-gnuplot-print-device "postscript") |
|---|
| 717 |
|
|---|
| 718 |
(defcalcmodevar calc-gnuplot-print-output "auto") |
|---|
| 719 |
|
|---|
| 720 |
(defcalcmodevar calc-gnuplot-geometry nil) |
|---|
| 721 |
|
|---|
| 722 |
(defcalcmodevar calc-graph-default-resolution 15) |
|---|
| 723 |
|
|---|
| 724 |
(defcalcmodevar calc-graph-default-resolution-3d 5) |
|---|
| 725 |
|
|---|
| 726 |
(defcalcmodevar calc-invocation-macro nil) |
|---|
| 727 |
|
|---|
| 728 |
(defcalcmodevar calc-show-banner t |
|---|
| 729 |
"*If non-nil, show a friendly greeting above the stack.") |
|---|
| 730 |
|
|---|
| 731 |
(defconst calc-local-var-list '(calc-stack |
|---|
| 732 |
calc-stack-top |
|---|
| 733 |
calc-undo-list |
|---|
| 734 |
calc-redo-list |
|---|
| 735 |
calc-always-load-extensions |
|---|
| 736 |
calc-mode-save-mode |
|---|
| 737 |
calc-display-raw |
|---|
| 738 |
calc-line-numbering |
|---|
| 739 |
calc-line-breaking |
|---|
| 740 |
calc-display-just |
|---|
| 741 |
calc-display-origin |
|---|
| 742 |
calc-left-label |
|---|
| 743 |
calc-right-label |
|---|
| 744 |
calc-auto-why |
|---|
| 745 |
calc-algebraic-mode |
|---|
| 746 |
calc-incomplete-algebraic-mode |
|---|
| 747 |
calc-symbolic-mode |
|---|
| 748 |
calc-matrix-mode |
|---|
| 749 |
calc-inverse-flag |
|---|
| 750 |
calc-hyperbolic-flag |
|---|
| 751 |
calc-keep-args-flag |
|---|
| 752 |
calc-angle-mode |
|---|
| 753 |
calc-number-radix |
|---|
| 754 |
calc-leading-zeros |
|---|
| 755 |
calc-group-digits |
|---|
| 756 |
calc-group-char |
|---|
| 757 |
calc-point-char |
|---|
| 758 |
calc-frac-format |
|---|
| 759 |
calc-prefer-frac |
|---|
| 760 |
calc-hms-format |
|---|
| 761 |
calc-date-format |
|---|
| 762 |
calc-standard-date-formats |
|---|
| 763 |
calc-float-format |
|---|
| 764 |
calc-full-float-format |
|---|
| 765 |
calc-complex-format |
|---|
| 766 |
calc-matrix-just |
|---|
| 767 |
calc-full-vectors |
|---|
| 768 |
calc-full-trail-vectors |
|---|
| 769 |
calc-break-vectors |
|---|
| 770 |
calc-vector-commas |
|---|
| 771 |
calc-vector-brackets |
|---|
| 772 |
calc-matrix-brackets |
|---|
| 773 |
calc-complex-mode |
|---|
| 774 |
calc-infinite-mode |
|---|
| 775 |
calc-display-strings |
|---|
| 776 |
calc-simplify-mode |
|---|
| 777 |
calc-auto-recompute |
|---|
| 778 |
calc-autorange-units |
|---|
| 779 |
calc-show-plain |
|---|
| 780 |
calc-show-selections |
|---|
| 781 |
calc-use-selections |
|---|
| 782 |
calc-assoc-selections |
|---|
| 783 |
calc-word-size |
|---|
| 784 |
calc-internal-prec)) |
|---|
| 785 |
|
|---|
| 786 |
(defvar calc-mode-hook nil |
|---|
| 787 |
"Hook run when entering calc-mode.") |
|---|
| 788 |
|
|---|
| 789 |
(defvar calc-trail-mode-hook nil |
|---|
| 790 |
"Hook run when entering calc-trail-mode.") |
|---|
| 791 |
|
|---|
| 792 |
(defvar calc-start-hook nil |
|---|
| 793 |
"Hook run when calc is started.") |
|---|
| 794 |
|
|---|
| 795 |
(defvar calc-end-hook nil |
|---|
| 796 |
"Hook run when calc is quit.") |
|---|
| 797 |
|
|---|
| 798 |
(defvar calc-load-hook nil |
|---|
| 799 |
"Hook run when calc.el is loaded.") |
|---|
| 800 |
|
|---|
| 801 |
(defvar calc-window-hook nil |
|---|
| 802 |
"Hook called to create the Calc window.") |
|---|
| 803 |
|
|---|
| 804 |
(defvar calc-trail-window-hook nil |
|---|
| 805 |
"Hook called to create the Calc trail window.") |
|---|
| 806 |
|
|---|
| 807 |
(defvar calc-embedded-new-buffer-hook nil |
|---|
| 808 |
"Hook run when starting embedded mode in a new buffer.") |
|---|
| 809 |
|
|---|
| 810 |
(defvar calc-embedded-new-formula-hook nil |
|---|
|
|---|