aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorStefan Monnier2008-04-08 22:07:55 +0000
committerStefan Monnier2008-04-08 22:07:55 +0000
commit2378f0443a0a2b43c1045f2741401ed2f299d120 (patch)
treeeee350c3e9f0ed39aabcfd26c645044aa6b9f694 /lisp
parenta152877d30b453c1a1ad9de3a2c054d0c22ac528 (diff)
downloademacs-2378f0443a0a2b43c1045f2741401ed2f299d120.tar.gz
emacs-2378f0443a0a2b43c1045f2741401ed2f299d120.zip
* calc/calc.el: Load "cal-loaddefs" rather than set up autoloads manually.
(calc-mode-map, calc-digit-map, calc-dispatch-map): Move initialization into declaration. * calc/calc-yank.el: * calc/calc-misc.el: * calc/calc-embed.el: * calc/calc-aent.el: Add autoload cookies and set generated-autoload-file.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/calc/calc-aent.el25
-rw-r--r--lisp/calc/calc-embed.el51
-rw-r--r--lisp/calc/calc-misc.el86
-rw-r--r--lisp/calc/calc-yank.el31
-rw-r--r--lisp/calc/calc.el321
6 files changed, 292 insertions, 232 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b87ec1179f6..0448099f63c 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12008-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * calc/calc.el: Load "cal-loaddefs" rather than set up autoloads manually.
4 (calc-mode-map, calc-digit-map, calc-dispatch-map):
5 Move initialization into declaration.
6 * calc/calc-yank.el:
7 * calc/calc-misc.el:
8 * calc/calc-embed.el:
9 * calc/calc-aent.el: Add autoload cookies and set generated-autoload-file.
10
12008-04-08 Michael Albinus <michael.albinus@gmx.de> 112008-04-08 Michael Albinus <michael.albinus@gmx.de>
2 12
3 * ps-samp.el (ps-add-printer, ps-remove-printer) 13 * ps-samp.el (ps-add-printer, ps-remove-printer)
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el
index fefe99c987b..935ec4d601e 100644
--- a/lisp/calc/calc-aent.el
+++ b/lisp/calc/calc-aent.el
@@ -54,6 +54,7 @@
54(defvar calc-quick-calc-history nil 54(defvar calc-quick-calc-history nil
55 "The history list for quick-calc.") 55 "The history list for quick-calc.")
56 56
57;;;###autoload
57(defun calc-do-quick-calc () 58(defun calc-do-quick-calc ()
58 (require 'calc-ext) 59 (require 'calc-ext)
59 (calc-check-defines) 60 (calc-check-defines)
@@ -114,6 +115,7 @@
114 (insert shortbuf) 115 (insert shortbuf)
115 (kill-new shortbuf))))) 116 (kill-new shortbuf)))))
116 117
118;;;###autoload
117(defun calc-do-calc-eval (str separator args) 119(defun calc-do-calc-eval (str separator args)
118 (calc-check-defines) 120 (calc-check-defines)
119 (catch 'calc-error 121 (catch 'calc-error
@@ -268,10 +270,12 @@ The value t means abort and give an error message.")
268 270
269;;;; Reading an expression in algebraic form. 271;;;; Reading an expression in algebraic form.
270 272
273;;;###autoload
271(defun calc-auto-algebraic-entry (&optional prefix) 274(defun calc-auto-algebraic-entry (&optional prefix)
272 (interactive "P") 275 (interactive "P")
273 (calc-algebraic-entry prefix t)) 276 (calc-algebraic-entry prefix t))
274 277
278;;;###autoload
275(defun calc-algebraic-entry (&optional prefix auto) 279(defun calc-algebraic-entry (&optional prefix auto)
276 (interactive "P") 280 (interactive "P")
277 (calc-wrapper 281 (calc-wrapper
@@ -282,6 +286,7 @@ The value t means abort and give an error message.")
282(defvar calc-alg-entry-history nil 286(defvar calc-alg-entry-history nil
283 "History for algebraic entry.") 287 "History for algebraic entry.")
284 288
289;;;###autoload
285(defun calc-alg-entry (&optional initial prompt) 290(defun calc-alg-entry (&optional initial prompt)
286 (let* ((sel-mode nil) 291 (let* ((sel-mode nil)
287 (calc-dollar-values (mapcar 'calc-get-stack-element 292 (calc-dollar-values (mapcar 'calc-get-stack-element
@@ -319,6 +324,7 @@ The value t means abort and give an error message.")
319 324
320(defvar calc-alg-exp) 325(defvar calc-alg-exp)
321 326
327;;;###autoload
322(defun calc-do-alg-entry (&optional initial prompt no-normalize history) 328(defun calc-do-alg-entry (&optional initial prompt no-normalize history)
323 (let* ((calc-buffer (current-buffer)) 329 (let* ((calc-buffer (current-buffer))
324 (blink-paren-function 'calcAlg-blink-matching-open) 330 (blink-paren-function 'calcAlg-blink-matching-open)
@@ -461,6 +467,7 @@ The value t means abort and give an error message.")
461 (aset (syntax-table) rightchar rightsaved))) 467 (aset (syntax-table) rightchar rightsaved)))
462 (blink-matching-open)))) 468 (blink-matching-open))))
463 469
470;;;###autoload
464(defun calc-alg-digit-entry () 471(defun calc-alg-digit-entry ()
465 (calc-alg-entry 472 (calc-alg-entry
466 (cond ((eq last-command-char ?e) 473 (cond ((eq last-command-char ?e)
@@ -474,6 +481,7 @@ The value t means abort and give an error message.")
474;; but can be set by calcDigit-algebraic and calcDigit-edit. 481;; but can be set by calcDigit-algebraic and calcDigit-edit.
475(defvar calc-digit-value) 482(defvar calc-digit-value)
476 483
484;;;###autoload
477(defun calcDigit-algebraic () 485(defun calcDigit-algebraic ()
478 (interactive) 486 (interactive)
479 (if (calc-minibuffer-contains ".*[@oh] *[^'m ]+[^'m]*\\'") 487 (if (calc-minibuffer-contains ".*[@oh] *[^'m ]+[^'m]*\\'")
@@ -481,6 +489,7 @@ The value t means abort and give an error message.")
481 (setq calc-digit-value (minibuffer-contents)) 489 (setq calc-digit-value (minibuffer-contents))
482 (exit-minibuffer))) 490 (exit-minibuffer)))
483 491
492;;;###autoload
484(defun calcDigit-edit () 493(defun calcDigit-edit ()
485 (interactive) 494 (interactive)
486 (calc-unread-command) 495 (calc-unread-command)
@@ -563,6 +572,7 @@ in Calc algebraic input.")
563 "₀₁₂₃₄₅₆₇₈₉₊₋₍₎" ; 0123456789+-() 572 "₀₁₂₃₄₅₆₇₈₉₊₋₍₎" ; 0123456789+-()
564 "A string consisting of the subscripts allowed by Calc.") 573 "A string consisting of the subscripts allowed by Calc.")
565 574
575;;;###autoload
566(defun math-read-preprocess-string (str) 576(defun math-read-preprocess-string (str)
567 "Replace some substrings of STR by Calc equivalents." 577 "Replace some substrings of STR by Calc equivalents."
568 (setq str 578 (setq str
@@ -589,6 +599,7 @@ in Calc algebraic input.")
589(defvar math-exp-keep-spaces) 599(defvar math-exp-keep-spaces)
590(defvar math-expr-data) 600(defvar math-expr-data)
591 601
602;;;###autoload
592(defun math-read-exprs (math-exp-str) 603(defun math-read-exprs (math-exp-str)
593 (let ((math-exp-pos 0) 604 (let ((math-exp-pos 0)
594 (math-exp-old-pos 0) 605 (math-exp-old-pos 0)
@@ -613,6 +624,7 @@ in Calc algebraic input.")
613 val 624 val
614 (list 'error math-exp-old-pos "Syntax error")))))) 625 (list 'error math-exp-old-pos "Syntax error"))))))
615 626
627;;;###autoload
616(defun math-read-expr-list () 628(defun math-read-expr-list ()
617 (let* ((math-exp-keep-spaces nil) 629 (let* ((math-exp-keep-spaces nil)
618 (val (list (math-read-expr-level 0))) 630 (val (list (math-read-expr-level 0)))
@@ -634,6 +646,7 @@ in Calc algebraic input.")
634(defvar math-toks nil 646(defvar math-toks nil
635 "Tokens to pass between math-build-parse-table and math-find-user-tokens.") 647 "Tokens to pass between math-build-parse-table and math-find-user-tokens.")
636 648
649;;;###autoload
637(defun math-build-parse-table () 650(defun math-build-parse-table ()
638 (let ((mtab (cdr (assq nil calc-user-parse-tables))) 651 (let ((mtab (cdr (assq nil calc-user-parse-tables)))
639 (ltab (cdr (assq calc-language calc-user-parse-tables))) 652 (ltab (cdr (assq calc-language calc-user-parse-tables)))
@@ -658,6 +671,7 @@ in Calc algebraic input.")
658 calc-last-user-lang-parse-table ltab 671 calc-last-user-lang-parse-table ltab
659 calc-last-lang-parse-table lltab))))) 672 calc-last-lang-parse-table lltab)))))
660 673
674;;;###autoload
661(defun math-find-user-tokens (p) 675(defun math-find-user-tokens (p)
662 (while p 676 (while p
663 (cond ((and (stringp (car p)) 677 (cond ((and (stringp (car p))
@@ -682,6 +696,7 @@ in Calc algebraic input.")
682 (math-find-user-tokens (nth 2 (car p)))))) 696 (math-find-user-tokens (nth 2 (car p))))))
683 (setq p (cdr p)))) 697 (setq p (cdr p))))
684 698
699;;;###autoload
685(defun math-read-token () 700(defun math-read-token ()
686 (if (>= math-exp-pos (length math-exp-str)) 701 (if (>= math-exp-pos (length math-exp-str))
687 (setq math-exp-old-pos math-exp-pos 702 (setq math-exp-old-pos math-exp-pos
@@ -867,6 +882,7 @@ in Calc algebraic input.")
867;; calc-arg-values is defined in calc-ext.el, but is used here. 882;; calc-arg-values is defined in calc-ext.el, but is used here.
868(defvar calc-arg-values) 883(defvar calc-arg-values)
869 884
885;;;###autoload
870(defun calc-check-user-syntax (&optional x prec) 886(defun calc-check-user-syntax (&optional x prec)
871 (let ((p calc-user-parse-table) 887 (let ((p calc-user-parse-table)
872 (matches nil) 888 (matches nil)
@@ -953,6 +969,7 @@ in Calc algebraic input.")
953 (setq p (cdr p))) 969 (setq p (cdr p)))
954 (and p match))) 970 (and p match)))
955 971
972;;;###autoload
956(defun calc-match-user-syntax (p &optional term) 973(defun calc-match-user-syntax (p &optional term)
957 (let ((matches nil) 974 (let ((matches nil)
958 (save-exp-pos math-exp-pos) 975 (save-exp-pos math-exp-pos)
@@ -1013,6 +1030,7 @@ in Calc algebraic input.")
1013 matches "Failed")) 1030 matches "Failed"))
1014 matches)) 1031 matches))
1015 1032
1033;;;###autoload
1016(defun math-remove-dashes (x) 1034(defun math-remove-dashes (x)
1017 (if (string-match "\\`\\(.*\\)-\\(.*\\)\\'" x) 1035 (if (string-match "\\`\\(.*\\)-\\(.*\\)\\'" x)
1018 (math-remove-dashes 1036 (math-remove-dashes
@@ -1052,6 +1070,7 @@ If the current Calc language does not use placeholders, return nil."
1052 (concat (math-match-substring x 1) "_" (math-match-substring x 2))) 1070 (concat (math-match-substring x 1) "_" (math-match-substring x 2)))
1053 x)) 1071 x))
1054 1072
1073;;;###autoload
1055(defun math-read-if (cond op) 1074(defun math-read-if (cond op)
1056 (let ((then (math-read-expr-level 0))) 1075 (let ((then (math-read-expr-level 0)))
1057 (or (equal math-expr-data ":") 1076 (or (equal math-expr-data ":")
@@ -1263,5 +1282,9 @@ If the current Calc language does not use placeholders, return nil."
1263 1282
1264(provide 'calc-aent) 1283(provide 'calc-aent)
1265 1284
1266;;; arch-tag: 5599e45d-e51e-44bb-9a20-9f4ed8c96c32 1285;; Local variables:
1286;; generated-autoload-file: "calc-loaddefs.el"
1287;; End:
1288
1289;; arch-tag: 5599e45d-e51e-44bb-9a20-9f4ed8c96c32
1267;;; calc-aent.el ends here 1290;;; calc-aent.el ends here
diff --git a/lisp/calc/calc-embed.el b/lisp/calc/calc-embed.el
index 51cdd3f9174..31996c0d553 100644
--- a/lisp/calc/calc-embed.el
+++ b/lisp/calc/calc-embed.el
@@ -96,29 +96,29 @@
96)) 96))
97 97
98 98
99;;; Format of calc-embedded-info vector: 99;; Format of calc-embedded-info vector:
100;;; 0 Editing buffer. 100;; 0 Editing buffer.
101;;; 1 Calculator buffer. 101;; 1 Calculator buffer.
102;;; 2 Top of current formula (marker). 102;; 2 Top of current formula (marker).
103;;; 3 Bottom of current formula (marker). 103;; 3 Bottom of current formula (marker).
104;;; 4 Top of current formula's delimiters (marker). 104;; 4 Top of current formula's delimiters (marker).
105;;; 5 Bottom of current formula's delimiters (marker). 105;; 5 Bottom of current formula's delimiters (marker).
106;;; 6 String representation of current formula. 106;; 6 String representation of current formula.
107;;; 7 Non-nil if formula is embedded within a single line. 107;; 7 Non-nil if formula is embedded within a single line.
108;;; 8 Internal representation of current formula. 108;; 8 Internal representation of current formula.
109;;; 9 Variable assigned by this formula, or nil. 109;; 9 Variable assigned by this formula, or nil.
110;;; 10 List of variables upon which this formula depends. 110;; 10 List of variables upon which this formula depends.
111;;; 11 Evaluated value of the formula, or nil. 111;; 11 Evaluated value of the formula, or nil.
112;;; 12 Mode settings for current formula. 112;; 12 Mode settings for current formula.
113;;; 13 Local mode settings for current formula. 113;; 13 Local mode settings for current formula.
114;;; 14 Permanent mode settings for current formula. 114;; 14 Permanent mode settings for current formula.
115;;; 15 Global mode settings for editing buffer. 115;; 15 Global mode settings for editing buffer.
116 116
117 117
118;;; calc-embedded-active is an a-list keyed on buffers; each cdr is a 118;; calc-embedded-active is an a-list keyed on buffers; each cdr is a
119;;; sorted list of calc-embedded-infos in that buffer. We do this 119;; sorted list of calc-embedded-infos in that buffer. We do this
120;;; rather than using buffer-local variables because the latter are 120;; rather than using buffer-local variables because the latter are
121;;; thrown away when a buffer changes major modes. 121;; thrown away when a buffer changes major modes.
122 122
123(defvar calc-embedded-original-modes nil 123(defvar calc-embedded-original-modes nil
124 "The mode settings for Calc buffer when put in embedded mode.") 124 "The mode settings for Calc buffer when put in embedded mode.")
@@ -414,6 +414,7 @@
414 (aset info 8 val) 414 (aset info 8 val)
415 (calc-embedded-update info 14 t t)))) 415 (calc-embedded-update info 14 t t))))
416 416
417;;;###autoload
417(defun calc-do-embedded-activate (calc-embed-arg cbuf) 418(defun calc-do-embedded-activate (calc-embed-arg cbuf)
418 (calc-plain-buffer-only) 419 (calc-plain-buffer-only)
419 (if calc-embed-arg 420 (if calc-embed-arg
@@ -1374,5 +1375,9 @@ The command \\[yank] can retrieve it from there."
1374 1375
1375(provide 'calc-embed) 1376(provide 'calc-embed)
1376 1377
1378;; Local variables:
1379;; generated-autoload-file: "calc-loaddefs.el"
1380;; End:
1381
1377;; arch-tag: 1b8f311e-fba1-40d3-b8c3-1d6f68fd26fc 1382;; arch-tag: 1b8f311e-fba1-40d3-b8c3-1d6f68fd26fc
1378;;; calc-embed.el ends here 1383;;; calc-embed.el ends here
diff --git a/lisp/calc/calc-misc.el b/lisp/calc/calc-misc.el
index 036850e3a25..10d06519d07 100644
--- a/lisp/calc/calc-misc.el
+++ b/lisp/calc/calc-misc.el
@@ -61,6 +61,7 @@
61(declare-function math-pow-fancy "calc-arith" (a b)) 61(declare-function math-pow-fancy "calc-arith" (a b))
62 62
63 63
64;;;###autoload
64(defun calc-dispatch-help (arg) 65(defun calc-dispatch-help (arg)
65 "C-x* is a prefix key sequence; follow it with one of these letters: 66 "C-x* is a prefix key sequence; follow it with one of these letters:
66 67
@@ -131,6 +132,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
131 (calc-do-dispatch arg)))) 132 (calc-do-dispatch arg))))
132 133
133 134
135;;;###autoload
134(defun calc-big-or-small (arg) 136(defun calc-big-or-small (arg)
135 "Toggle Calc between full-screen and regular mode." 137 "Toggle Calc between full-screen and regular mode."
136 (interactive "P") 138 (interactive "P")
@@ -157,6 +159,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
157 "Now using full screen for Calc" 159 "Now using full screen for Calc"
158 "Now using partial screen for Calc")))) 160 "Now using partial screen for Calc"))))
159 161
162;;;###autoload
160(defun calc-other-window (&optional interactive) 163(defun calc-other-window (&optional interactive)
161 "Invoke the Calculator in another window." 164 "Invoke the Calculator in another window."
162 (interactive "p") 165 (interactive "p")
@@ -170,6 +173,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
170 (let ((win (selected-window))) 173 (let ((win (selected-window)))
171 (calc nil win interactive))))) 174 (calc nil win interactive)))))
172 175
176;;;###autoload
173(defun another-calc () 177(defun another-calc ()
174 "Create another, independent Calculator buffer." 178 "Create another, independent Calculator buffer."
175 (interactive) 179 (interactive)
@@ -181,18 +185,21 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
181 (pop-to-buffer (current-buffer)) 185 (pop-to-buffer (current-buffer))
182 (calc-mode)) 186 (calc-mode))
183 187
188;;;###autoload
184(defun calc-info () 189(defun calc-info ()
185 "Run the Emacs Info system on the Calculator documentation." 190 "Run the Emacs Info system on the Calculator documentation."
186 (interactive) 191 (interactive)
187 (select-window (get-largest-window)) 192 (select-window (get-largest-window))
188 (info "Calc")) 193 (info "Calc"))
189 194
195;;;###autoload
190(defun calc-info-goto-node (node) 196(defun calc-info-goto-node (node)
191 "Go to a node in the Calculator info documentation." 197 "Go to a node in the Calculator info documentation."
192 (interactive) 198 (interactive)
193 (select-window (get-largest-window)) 199 (select-window (get-largest-window))
194 (info (concat "(Calc)" node))) 200 (info (concat "(Calc)" node)))
195 201
202;;;###autoload
196(defun calc-tutorial () 203(defun calc-tutorial ()
197 "Run the Emacs Info system on the Calculator Tutorial." 204 "Run the Emacs Info system on the Calculator Tutorial."
198 (interactive) 205 (interactive)
@@ -202,11 +209,13 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
202 (calc-other-window) 209 (calc-other-window)
203 (message "Welcome to the Calc Tutorial!")) 210 (message "Welcome to the Calc Tutorial!"))
204 211
212;;;###autoload
205(defun calc-info-summary () 213(defun calc-info-summary ()
206 "Run the Emacs Info system on the Calculator Summary." 214 "Run the Emacs Info system on the Calculator Summary."
207 (interactive) 215 (interactive)
208 (calc-info-goto-node "Summary")) 216 (calc-info-goto-node "Summary"))
209 217
218;;;###autoload
210(defun calc-help () 219(defun calc-help ()
211 (interactive) 220 (interactive)
212 (let ((msgs (append 221 (let ((msgs (append
@@ -263,6 +272,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
263;; and used in calc-why (in calc-stuff.el). 272;; and used in calc-why (in calc-stuff.el).
264(defvar calc-last-why-command) 273(defvar calc-last-why-command)
265 274
275;;;###autoload
266(defun calc-do-handle-whys () 276(defun calc-do-handle-whys ()
267 (setq calc-why (sort calc-next-why 277 (setq calc-why (sort calc-next-why
268 (function 278 (function
@@ -282,6 +292,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
282 (setq calc-last-why-command this-command) 292 (setq calc-last-why-command this-command)
283 (calc-clear-command-flag 'clear-message)))) 293 (calc-clear-command-flag 'clear-message))))
284 294
295;;;###autoload
285(defun calc-record-why (&rest stuff) 296(defun calc-record-why (&rest stuff)
286 (if (eq (car stuff) 'quiet) 297 (if (eq (car stuff) 'quiet)
287 (setq stuff (cdr stuff)) 298 (setq stuff (cdr stuff))
@@ -299,7 +310,8 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
299 (setq calc-next-why (cons stuff calc-next-why)) 310 (setq calc-next-why (cons stuff calc-next-why))
300 nil) 311 nil)
301 312
302;;; True if A is a constant or vector of constants. [P x] [Public] 313;; True if A is a constant or vector of constants. [P x] [Public]
314;;;###autoload
303(defun math-constp (a) 315(defun math-constp (a)
304 (or (Math-scalarp a) 316 (or (Math-scalarp a)
305 (and (memq (car a) '(sdev intv mod vec)) 317 (and (memq (car a) '(sdev intv mod vec))
@@ -310,6 +322,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
310 (null a))))) 322 (null a)))))
311 323
312 324
325;;;###autoload
313(defun calc-roll-down-stack (n &optional m) 326(defun calc-roll-down-stack (n &optional m)
314 (if (< n 0) 327 (if (< n 0)
315 (calc-roll-up-stack (- n) m) 328 (calc-roll-up-stack (- n) m)
@@ -324,6 +337,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
324 (append (calc-top-list m 1) 337 (append (calc-top-list m 1)
325 (calc-top-list (- n m) (1+ m)))))))) 338 (calc-top-list (- n m) (1+ m))))))))
326 339
340;;;###autoload
327(defun calc-roll-up-stack (n &optional m) 341(defun calc-roll-up-stack (n &optional m)
328 (if (< n 0) 342 (if (< n 0)
329 (calc-roll-down-stack (- n) m) 343 (calc-roll-down-stack (- n) m)
@@ -339,6 +353,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
339 (calc-top-list m (- n m -1)))))))) 353 (calc-top-list m (- n m -1))))))))
340 354
341 355
356;;;###autoload
342(defun calc-do-refresh () 357(defun calc-do-refresh ()
343 (if calc-hyperbolic-flag 358 (if calc-hyperbolic-flag
344 (progn 359 (progn
@@ -348,6 +363,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
348 t)) 363 t))
349 364
350 365
366;;;###autoload
351(defun calc-record-list (vals &optional prefix) 367(defun calc-record-list (vals &optional prefix)
352 (while vals 368 (while vals
353 (or (eq (car vals) 'top-of-stack) 369 (or (eq (car vals) 'top-of-stack)
@@ -357,12 +373,14 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
357 (setq vals (cdr vals)))) 373 (setq vals (cdr vals))))
358 374
359 375
376;;;###autoload
360(defun calc-last-args-stub (arg) 377(defun calc-last-args-stub (arg)
361 (interactive "p") 378 (interactive "p")
362 (require 'calc-ext) 379 (require 'calc-ext)
363 (calc-last-args arg)) 380 (calc-last-args arg))
364 381
365 382
383;;;###autoload
366(defun calc-power (arg) 384(defun calc-power (arg)
367 (interactive "P") 385 (interactive "P")
368 (calc-slow-wrapper 386 (calc-slow-wrapper
@@ -371,16 +389,19 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
371 (calc-binary-op "root" 'calcFunc-nroot arg nil nil) 389 (calc-binary-op "root" 'calcFunc-nroot arg nil nil)
372 (calc-binary-op "^" 'calcFunc-pow arg nil nil '^)))) 390 (calc-binary-op "^" 'calcFunc-pow arg nil nil '^))))
373 391
392;;;###autoload
374(defun calc-mod (arg) 393(defun calc-mod (arg)
375 (interactive "P") 394 (interactive "P")
376 (calc-slow-wrapper 395 (calc-slow-wrapper
377 (calc-binary-op "%" 'calcFunc-mod arg nil nil '%))) 396 (calc-binary-op "%" 'calcFunc-mod arg nil nil '%)))
378 397
398;;;###autoload
379(defun calc-inv (arg) 399(defun calc-inv (arg)
380 (interactive "P") 400 (interactive "P")
381 (calc-slow-wrapper 401 (calc-slow-wrapper
382 (calc-unary-op "inv" 'calcFunc-inv arg))) 402 (calc-unary-op "inv" 'calcFunc-inv arg)))
383 403
404;;;###autoload
384(defun calc-percent () 405(defun calc-percent ()
385 (interactive) 406 (interactive)
386 (calc-slow-wrapper 407 (calc-slow-wrapper
@@ -388,6 +409,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
388 1 "%" (list (list 'calcFunc-percent (calc-top-n 1)))))) 409 1 "%" (list (list 'calcFunc-percent (calc-top-n 1))))))
389 410
390 411
412;;;###autoload
391(defun calc-over (n) 413(defun calc-over (n)
392 (interactive "P") 414 (interactive "P")
393 (if n 415 (if n
@@ -395,12 +417,14 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
395 (calc-enter -2))) 417 (calc-enter -2)))
396 418
397 419
420;;;###autoload
398(defun calc-pop-above (n) 421(defun calc-pop-above (n)
399 (interactive "P") 422 (interactive "P")
400 (if n 423 (if n
401 (calc-pop (- (prefix-numeric-value n))) 424 (calc-pop (- (prefix-numeric-value n)))
402 (calc-pop -2))) 425 (calc-pop -2)))
403 426
427;;;###autoload
404(defun calc-roll-down (n) 428(defun calc-roll-down (n)
405 (interactive "P") 429 (interactive "P")
406 (calc-wrapper 430 (calc-wrapper
@@ -416,6 +440,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
416 (t 440 (t
417 (calc-roll-down-stack (calc-stack-size) (- nn))))))) 441 (calc-roll-down-stack (calc-stack-size) (- nn)))))))
418 442
443;;;###autoload
419(defun calc-roll-up (n) 444(defun calc-roll-up (n)
420 (interactive "P") 445 (interactive "P")
421 (calc-wrapper 446 (calc-wrapper
@@ -436,6 +461,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
436 461
437;;; Other commands. 462;;; Other commands.
438 463
464;;;###autoload
439(defun calc-num-prefix-name (n) 465(defun calc-num-prefix-name (n)
440 (cond ((eq n '-) "- ") 466 (cond ((eq n '-) "- ")
441 ((equal n '(4)) "C-u ") 467 ((equal n '(4)) "C-u ")
@@ -443,6 +469,7 @@ Calc user interface as before (either C-x * C or C-x * K; initially C-x * C).
443 ((integerp n) (format "%d " n)) 469 ((integerp n) (format "%d " n))
444 (t ""))) 470 (t "")))
445 471
472;;;###autoload
446(defun calc-missing-key (n) 473(defun calc-missing-key (n)
447 "This is a placeholder for a command which needs to be loaded from calc-ext. 474 "This is a placeholder for a command which needs to be loaded from calc-ext.
448When this key is used, calc-ext (the Calculator extensions module) will be 475When this key is used, calc-ext (the Calculator extensions module) will be
@@ -454,6 +481,7 @@ loaded and the keystroke automatically re-typed."
454 (calc-unread-command) 481 (calc-unread-command)
455 (setq prefix-arg n)) 482 (setq prefix-arg n))
456 483
484;;;###autoload
457(defun calc-shift-Y-prefix-help () 485(defun calc-shift-Y-prefix-help ()
458 (interactive) 486 (interactive)
459 (require 'calc-ext) 487 (require 'calc-ext)
@@ -462,6 +490,7 @@ loaded and the keystroke automatically re-typed."
462 490
463 491
464 492
493;;;###autoload
465(defun calcDigit-letter () 494(defun calcDigit-letter ()
466 (interactive) 495 (interactive)
467 (if (calc-minibuffer-contains "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*") 496 (if (calc-minibuffer-contains "[-+]?\\(1[1-9]\\|[2-9][0-9]\\)#.*")
@@ -472,6 +501,7 @@ loaded and the keystroke automatically re-typed."
472 501
473 502
474;; A Lisp version of temp_minibuffer_message from minibuf.c. 503;; A Lisp version of temp_minibuffer_message from minibuf.c.
504;;;###autoload
475(defun calc-temp-minibuffer-message (m) 505(defun calc-temp-minibuffer-message (m)
476 (let ((savemax (point-max))) 506 (let ((savemax (point-max)))
477 (save-excursion 507 (save-excursion
@@ -491,7 +521,8 @@ loaded and the keystroke automatically re-typed."
491(put 'math-with-extra-prec 'lisp-indent-hook 1) 521(put 'math-with-extra-prec 'lisp-indent-hook 1)
492 522
493 523
494;;; Concatenate two vectors, or a vector and an object. [V O O] [Public] 524;; Concatenate two vectors, or a vector and an object. [V O O] [Public]
525;;;###autoload
495(defun math-concat (v1 v2) 526(defun math-concat (v1 v2)
496 (if (stringp v1) 527 (if (stringp v1)
497 (concat v1 v2) 528 (concat v1 v2)
@@ -511,7 +542,8 @@ loaded and the keystroke automatically re-typed."
511 (list '| v1 v2)))) 542 (list '| v1 v2))))
512 543
513 544
514;;; True if A is zero. Works for un-normalized values. [P n] [Public] 545;; True if A is zero. Works for un-normalized values. [P n] [Public]
546;;;###autoload
515(defun math-zerop (a) 547(defun math-zerop (a)
516 (if (consp a) 548 (if (consp a)
517 (cond ((memq (car a) '(bigpos bigneg)) 549 (cond ((memq (car a) '(bigpos bigneg))
@@ -528,8 +560,9 @@ loaded and the keystroke automatically re-typed."
528 (eq a 0))) 560 (eq a 0)))
529 561
530 562
531;;; True if A is real and negative. [P n] [Public] 563;; True if A is real and negative. [P n] [Public]
532 564
565;;;###autoload
533(defun math-negp (a) 566(defun math-negp (a)
534 (if (consp a) 567 (if (consp a)
535 (cond ((eq (car a) 'bigpos) nil) 568 (cond ((eq (car a) 'bigpos) nil)
@@ -551,7 +584,8 @@ loaded and the keystroke automatically re-typed."
551 ((equal a '(neg (var inf var-inf))) t)) 584 ((equal a '(neg (var inf var-inf))) t))
552 (< a 0))) 585 (< a 0)))
553 586
554;;; True if A is a negative number or an expression the starts with '-'. 587;; True if A is a negative number or an expression the starts with '-'.
588;;;###autoload
555(defun math-looks-negp (a) ; [P x] [Public] 589(defun math-looks-negp (a) ; [P x] [Public]
556 (or (Math-negp a) 590 (or (Math-negp a)
557 (eq (car-safe a) 'neg) 591 (eq (car-safe a) 'neg)
@@ -562,7 +596,8 @@ loaded and the keystroke automatically re-typed."
562 (math-looks-negp (nth 1 a))))) 596 (math-looks-negp (nth 1 a)))))
563 597
564 598
565;;; True if A is real and positive. [P n] [Public] 599;; True if A is real and positive. [P n] [Public]
600;;;###autoload
566(defun math-posp (a) 601(defun math-posp (a)
567 (if (consp a) 602 (if (consp a)
568 (cond ((eq (car a) 'bigpos) (cdr a)) 603 (cond ((eq (car a) 'bigpos) (cdr a))
@@ -586,19 +621,23 @@ loaded and the keystroke automatically re-typed."
586 ((equal a '(var inf var-inf)) t)) 621 ((equal a '(var inf var-inf)) t))
587 (> a 0))) 622 (> a 0)))
588 623
624;;;###autoload
589(defalias 'math-fixnump 'integerp) 625(defalias 'math-fixnump 'integerp)
626;;;###autoload
590(defalias 'math-fixnatnump 'natnump) 627(defalias 'math-fixnatnump 'natnump)
591 628
592 629
593;;; True if A is an even integer. [P R R] [Public] 630;; True if A is an even integer. [P R R] [Public]
631;;;###autoload
594(defun math-evenp (a) 632(defun math-evenp (a)
595 (if (consp a) 633 (if (consp a)
596 (and (memq (car a) '(bigpos bigneg)) 634 (and (memq (car a) '(bigpos bigneg))
597 (= (% (nth 1 a) 2) 0)) 635 (= (% (nth 1 a) 2) 0))
598 (= (% a 2) 0))) 636 (= (% a 2) 0)))
599 637
600;;; Compute A / 2, for small or big integer A. [I i] 638;; Compute A / 2, for small or big integer A. [I i]
601;;; If A is negative, type of truncation is undefined. 639;; If A is negative, type of truncation is undefined.
640;;;###autoload
602(defun math-div2 (a) 641(defun math-div2 (a)
603 (if (consp a) 642 (if (consp a)
604 (if (cdr a) 643 (if (cdr a)
@@ -606,6 +645,7 @@ loaded and the keystroke automatically re-typed."
606 0) 645 0)
607 (/ a 2))) 646 (/ a 2)))
608 647
648;;;###autoload
609(defun math-div2-bignum (a) ; [l l] 649(defun math-div2-bignum (a) ; [l l]
610 (if (cdr a) 650 (if (cdr a)
611 (cons (+ (/ (car a) 2) (* (% (nth 1 a) 2) (/ math-bignum-digit-size 2))) 651 (cons (+ (/ (car a) 2) (* (% (nth 1 a) 2) (/ math-bignum-digit-size 2)))
@@ -613,7 +653,8 @@ loaded and the keystroke automatically re-typed."
613 (list (/ (car a) 2)))) 653 (list (/ (car a) 2))))
614 654
615 655
616;;; Reject an argument to a calculator function. [Public] 656;; Reject an argument to a calculator function. [Public]
657;;;###autoload
617(defun math-reject-arg (&optional a p option) 658(defun math-reject-arg (&optional a p option)
618 (if option 659 (if option
619 (calc-record-why option p a) 660 (calc-record-why option p a)
@@ -622,11 +663,12 @@ loaded and the keystroke automatically re-typed."
622 (signal 'wrong-type-argument (and a (if p (list p a) (list a))))) 663 (signal 'wrong-type-argument (and a (if p (list p a) (list a)))))
623 664
624 665
625;;; Coerce A to be an integer (by truncation toward zero). [I N] [Public] 666;; Coerce A to be an integer (by truncation toward zero). [I N] [Public]
626 667
627;; The variable math-trunc-prec is local to math-trunc, but used by 668;; The variable math-trunc-prec is local to math-trunc, but used by
628;; math-trunc-fancy in calc-arith.el, which is called by math-trunc. 669;; math-trunc-fancy in calc-arith.el, which is called by math-trunc.
629 670
671;;;###autoload
630(defun math-trunc (a &optional math-trunc-prec) 672(defun math-trunc (a &optional math-trunc-prec)
631 (cond (math-trunc-prec 673 (cond (math-trunc-prec
632 (require 'calc-ext) 674 (require 'calc-ext)
@@ -638,13 +680,15 @@ loaded and the keystroke automatically re-typed."
638 (math-scale-int (nth 1 a) (nth 2 a))) 680 (math-scale-int (nth 1 a) (nth 2 a)))
639 (t (require 'calc-ext) 681 (t (require 'calc-ext)
640 (math-trunc-fancy a)))) 682 (math-trunc-fancy a))))
683;;;###autoload
641(defalias 'calcFunc-trunc 'math-trunc) 684(defalias 'calcFunc-trunc 'math-trunc)
642 685
643;;; Coerce A to be an integer (by truncation toward minus infinity). [I N] 686;; Coerce A to be an integer (by truncation toward minus infinity). [I N]
644 687
645;; The variable math-floor-prec is local to math-floor, but used by 688;; The variable math-floor-prec is local to math-floor, but used by
646;; math-floor-fancy in calc-arith.el, which is called by math-floor. 689;; math-floor-fancy in calc-arith.el, which is called by math-floor.
647 690
691;;;###autoload
648(defun math-floor (a &optional math-floor-prec) ; [Public] 692(defun math-floor (a &optional math-floor-prec) ; [Public]
649 (cond (math-floor-prec 693 (cond (math-floor-prec
650 (require 'calc-ext) 694 (require 'calc-ext)
@@ -657,9 +701,11 @@ loaded and the keystroke automatically re-typed."
657 (math-trunc a))) 701 (math-trunc a)))
658 (t (require 'calc-ext) 702 (t (require 'calc-ext)
659 (math-floor-fancy a)))) 703 (math-floor-fancy a))))
704;;;###autoload
660(defalias 'calcFunc-floor 'math-floor) 705(defalias 'calcFunc-floor 'math-floor)
661 706
662 707
708;;;###autoload
663(defun math-imod (a b) ; [I I I] [Public] 709(defun math-imod (a b) ; [I I I] [Public]
664 (if (and (not (consp a)) (not (consp b))) 710 (if (and (not (consp a)) (not (consp b)))
665 (if (= b 0) 711 (if (= b 0)
@@ -668,6 +714,7 @@ loaded and the keystroke automatically re-typed."
668 (cdr (math-idivmod a b)))) 714 (cdr (math-idivmod a b))))
669 715
670 716
717;;;###autoload
671(defun calcFunc-inv (m) 718(defun calcFunc-inv (m)
672 (if (Math-vectorp m) 719 (if (Math-vectorp m)
673 (progn 720 (progn
@@ -682,6 +729,7 @@ loaded and the keystroke automatically re-typed."
682 (math-pow m -1) 729 (math-pow m -1)
683 (math-div 1 m)))) 730 (math-div 1 m))))
684 731
732;;;###autoload
685(defun math-do-working (msg arg) 733(defun math-do-working (msg arg)
686 (or executing-kbd-macro 734 (or executing-kbd-macro
687 (progn 735 (progn
@@ -695,7 +743,8 @@ loaded and the keystroke automatically re-typed."
695 (math-showing-full-precision (math-format-number arg)))))) 743 (math-showing-full-precision (math-format-number arg))))))
696 744
697 745
698;;; Compute A modulo B, defined in terms of truncation toward minus infinity. 746;; Compute A modulo B, defined in terms of truncation toward minus infinity.
747;;;###autoload
699(defun math-mod (a b) ; [R R R] [Public] 748(defun math-mod (a b) ; [R R R] [Public]
700 (cond ((and (Math-zerop a) (not (eq (car-safe a) 'mod))) a) 749 (cond ((and (Math-zerop a) (not (eq (car-safe a) 'mod))) a)
701 ((Math-zerop b) 750 ((Math-zerop b)
@@ -711,6 +760,7 @@ loaded and the keystroke automatically re-typed."
711 760
712;;; General exponentiation. 761;;; General exponentiation.
713 762
763;;;###autoload
714(defun math-pow (a b) ; [O O N] [Public] 764(defun math-pow (a b) ; [O O N] [Public]
715 (cond ((equal b '(var nan var-nan)) 765 (cond ((equal b '(var nan var-nan))
716 b) 766 b)
@@ -736,6 +786,7 @@ loaded and the keystroke automatically re-typed."
736 (require 'calc-ext) 786 (require 'calc-ext)
737 (math-pow-fancy a b)))) 787 (math-pow-fancy a b))))
738 788
789;;;###autoload
739(defun math-ipow (a n) ; [O O I] [Public] 790(defun math-ipow (a n) ; [O O I] [Public]
740 (cond ((Math-integer-negp n) 791 (cond ((Math-integer-negp n)
741 (math-ipow (math-div 1 a) (Math-integer-neg n))) 792 (math-ipow (math-div 1 a) (Math-integer-neg n)))
@@ -766,6 +817,7 @@ loaded and the keystroke automatically re-typed."
766 val)) 817 val))
767 818
768 819
820;;;###autoload
769(defun math-read-radix-digit (dig) ; [D S; Z S] 821(defun math-read-radix-digit (dig) ; [D S; Z S]
770 (if (> dig ?9) 822 (if (> dig ?9)
771 (if (< dig ?A) 823 (if (< dig ?A)
@@ -778,6 +830,7 @@ loaded and the keystroke automatically re-typed."
778 830
779;;; Bug reporting 831;;; Bug reporting
780 832
833;;;###autoload
781(defun report-calc-bug () 834(defun report-calc-bug ()
782 "Report a bug in Calc, the GNU Emacs calculator. 835 "Report a bug in Calc, the GNU Emacs calculator.
783Prompts for bug subject. Leaves you in a mail buffer." 836Prompts for bug subject. Leaves you in a mail buffer."
@@ -789,9 +842,14 @@ Prompts for bug subject. Leaves you in a mail buffer."
789precise symptoms of the bug. If possible, include a backtrace by 842precise symptoms of the bug. If possible, include a backtrace by
790doing 'M-x toggle-debug-on-error', then reproducing the bug. 843doing 'M-x toggle-debug-on-error', then reproducing the bug.
791" ))) 844" )))
845;;;###autoload
792(defalias 'calc-report-bug 'report-calc-bug) 846(defalias 'calc-report-bug 'report-calc-bug)
793 847
794(provide 'calc-misc) 848(provide 'calc-misc)
795 849
796;;; arch-tag: 7984d9d0-62e5-41dc-afb8-e904b975f250 850;; Local variables:
851;; generated-autoload-file: "calc-loaddefs.el"
852;; End:
853
854;; arch-tag: 7984d9d0-62e5-41dc-afb8-e904b975f250
797;;; calc-misc.el ends here 855;;; calc-misc.el ends here
diff --git a/lisp/calc/calc-yank.el b/lisp/calc/calc-yank.el
index 41a8d4157c9..cd13076cd20 100644
--- a/lisp/calc/calc-yank.el
+++ b/lisp/calc/calc-yank.el
@@ -103,9 +103,10 @@
103 (interactive "r") 103 (interactive "r")
104 (calc-kill-region top bot t)) 104 (calc-kill-region top bot t))
105 105
106;;; This function uses calc-last-kill if possible to get an exact result, 106;; This function uses calc-last-kill if possible to get an exact result,
107;;; otherwise it just parses the yanked string. 107;; otherwise it just parses the yanked string.
108;;; Modified to use Emacs 19 extended concept of kill-ring. -- daveg 12/15/96 108;; Modified to use Emacs 19 extended concept of kill-ring. -- daveg 12/15/96
109;;;###autoload
109(defun calc-yank () 110(defun calc-yank ()
110 (interactive) 111 (interactive)
111 (calc-wrapper 112 (calc-wrapper
@@ -373,8 +374,8 @@
373 (self-insert-command 1)) 374 (self-insert-command 1))
374 (setq i (1+ i)))))) 375 (setq i (1+ i))))))
375 376
376;;; First, require that buffer is visible and does not begin with "*" 377;; First, require that buffer is visible and does not begin with "*"
377;;; Second, require only that it not begin with "*Calc" 378;; Second, require only that it not begin with "*Calc"
378(defun calc-find-writable-buffer (buf mode) 379(defun calc-find-writable-buffer (buf mode)
379 (and buf 380 (and buf
380 (if (or (string-match "\\`\\( .*\\|\\*Calc.*\\)" 381 (if (or (string-match "\\`\\( .*\\|\\*Calc.*\\)"
@@ -417,13 +418,13 @@
417 (backward-char 1) 418 (backward-char 1)
418 (calc-set-command-flag 'do-edit)) 419 (calc-set-command-flag 'do-edit))
419 420
420(defvar calc-edit-mode-map nil "Keymap for use by the calc-edit command.") 421(defvar calc-edit-mode-map
421(if calc-edit-mode-map 422 (let ((map (make-sparse-keymap)))
422 () 423 (define-key map "\n" 'calc-edit-finish)
423 (setq calc-edit-mode-map (make-sparse-keymap)) 424 (define-key map "\r" 'calc-edit-return)
424 (define-key calc-edit-mode-map "\n" 'calc-edit-finish) 425 (define-key map "\C-c\C-c" 'calc-edit-finish)
425 (define-key calc-edit-mode-map "\r" 'calc-edit-return) 426 map)
426 (define-key calc-edit-mode-map "\C-c\C-c" 'calc-edit-finish)) 427 "Keymap for use by the calc-edit command.")
427 428
428(defvar calc-original-buffer) 429(defvar calc-original-buffer)
429(defvar calc-return-buffer) 430(defvar calc-return-buffer)
@@ -583,5 +584,9 @@ To cancel the edit, simply kill the *Calc Edit* buffer."
583 584
584(provide 'calc-yank) 585(provide 'calc-yank)
585 586
586;;; arch-tag: ca61019e-caca-4daa-b32c-b6afe372d5b5 587;; Local variables:
588;; generated-autoload-file: "calc-loaddefs.el"
589;; End:
590
591;; arch-tag: ca61019e-caca-4daa-b32c-b6afe372d5b5
587;;; calc-yank.el ends here 592;;; calc-yank.el ends here
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el
index b9a64385f41..4aeda3cb4e2 100644
--- a/lisp/calc/calc.el
+++ b/lisp/calc/calc.el
@@ -862,32 +862,32 @@ Used by `calc-user-invocation'.")
862 862
863;; Set up the autoloading linkage. 863;; Set up the autoloading linkage.
864(let ((name (and (fboundp 'calc-dispatch) 864(let ((name (and (fboundp 'calc-dispatch)
865 (eq (car-safe (symbol-function 'calc-dispatch)) 'autoload) 865 (eq (car-safe (symbol-function 'calc-dispatch)) 'autoload)
866 (nth 1 (symbol-function 'calc-dispatch)))) 866 (nth 1 (symbol-function 'calc-dispatch))))
867 (p load-path)) 867 (p load-path))
868 868
869 ;; If Calc files exist on the load-path, we're all set. 869 ;; If Calc files exist on the load-path, we're all set.
870 (while (and p (not (file-exists-p 870 (while (and p (not (file-exists-p
871 (expand-file-name "calc-misc.elc" (car p))))) 871 (expand-file-name "calc-misc.elc" (car p)))))
872 (setq p (cdr p))) 872 (setq p (cdr p)))
873 (or p 873 (or p
874 874
875 ;; If Calc is autoloaded using a path name, look there for Calc files. 875 ;; If Calc is autoloaded using a path name, look there for Calc files.
876 ;; This works for both relative ("calc/calc.elc") and absolute paths. 876 ;; This works for both relative ("calc/calc.elc") and absolute paths.
877 (and name (file-name-directory name) 877 (and name (file-name-directory name)
878 (let ((p2 load-path) 878 (let ((p2 load-path)
879 (name2 (concat (file-name-directory name) 879 (name2 (concat (file-name-directory name)
880 "calc-misc.elc"))) 880 "calc-misc.elc")))
881 (while (and p2 (not (file-exists-p 881 (while (and p2 (not (file-exists-p
882 (expand-file-name name2 (car p2))))) 882 (expand-file-name name2 (car p2)))))
883 (setq p2 (cdr p2))) 883 (setq p2 (cdr p2)))
884 (when p2 884 (when p2
885 (setq load-path (nconc load-path 885 (setq load-path (nconc load-path
886 (list 886 (list
887 (directory-file-name 887 (directory-file-name
888 (file-name-directory 888 (file-name-directory
889 (expand-file-name 889 (expand-file-name
890 name (car p2)))))))))))) 890 name (car p2))))))))))))
891 891
892;; The following modes use specially-formatted data. 892;; The following modes use specially-formatted data.
893(put 'calc-mode 'mode-class 'special) 893(put 'calc-mode 'mode-class 'special)
@@ -1001,76 +1001,74 @@ Used by `calc-user-invocation'.")
1001(mapc (lambda (v) (or (boundp v) (set v nil))) 1001(mapc (lambda (v) (or (boundp v) (set v nil)))
1002 calc-local-var-list) 1002 calc-local-var-list)
1003 1003
1004(defvar calc-mode-map nil 1004(defvar calc-mode-map
1005 (let ((map (make-keymap)))
1006 (suppress-keymap map t)
1007 (define-key map "+" 'calc-plus)
1008 (define-key map "-" 'calc-minus)
1009 (define-key map "*" 'calc-times)
1010 (define-key map "/" 'calc-divide)
1011 (define-key map "%" 'calc-mod)
1012 (define-key map "&" 'calc-inv)
1013 (define-key map "^" 'calc-power)
1014 (define-key map "\M-%" 'calc-percent)
1015 (define-key map "e" 'calcDigit-start)
1016 (define-key map "i" 'calc-info)
1017 (define-key map "n" 'calc-change-sign)
1018 (define-key map "q" 'calc-quit)
1019 (define-key map "Y" 'nil)
1020 (define-key map "Y?" 'calc-shift-Y-prefix-help)
1021 (define-key map "?" 'calc-help)
1022 (define-key map " " 'calc-enter)
1023 (define-key map "'" 'calc-algebraic-entry)
1024 (define-key map "$" 'calc-auto-algebraic-entry)
1025 (define-key map "\"" 'calc-auto-algebraic-entry)
1026 (define-key map "\t" 'calc-roll-down)
1027 (define-key map "\M-\t" 'calc-roll-up)
1028 (define-key map "\C-m" 'calc-enter)
1029 (define-key map "\M-\C-m" 'calc-last-args-stub)
1030 (define-key map "\C-j" 'calc-over)
1031 (define-key map "\C-y" 'calc-yank)
1032 (define-key map [mouse-2] 'calc-yank)
1033
1034 (mapc (lambda (x) (define-key map (char-to-string x) 'undefined))
1035 "lOW")
1036 (mapc (lambda (x) (define-key map (char-to-string x) 'calc-missing-key))
1037 (concat "ABCDEFGHIJKLMNPQRSTUVXZabcdfghjkmoprstuvwxyz"
1038 ":\\|!()[]<>{},;=~`\C-k\M-k\C-w\M-w\C-y\C-_"))
1039 (mapc (lambda (x) (define-key map (char-to-string x) 'calcDigit-start))
1040 "_0123456789.#@")
1041 map)
1005 "The key map for Calc.") 1042 "The key map for Calc.")
1006 1043
1007(or calc-mode-map
1008 (let ((map (make-keymap)))
1009 (suppress-keymap map t)
1010 (define-key map "+" 'calc-plus)
1011 (define-key map "-" 'calc-minus)
1012 (define-key map "*" 'calc-times)
1013 (define-key map "/" 'calc-divide)
1014 (define-key map "%" 'calc-mod)
1015 (define-key map "&" 'calc-inv)
1016 (define-key map "^" 'calc-power)
1017 (define-key map "\M-%" 'calc-percent)
1018 (define-key map "e" 'calcDigit-start)
1019 (define-key map "i" 'calc-info)
1020 (define-key map "n" 'calc-change-sign)
1021 (define-key map "q" 'calc-quit)
1022 (define-key map "Y" 'nil)
1023 (define-key map "Y?" 'calc-shift-Y-prefix-help)
1024 (define-key map "?" 'calc-help)
1025 (define-key map " " 'calc-enter)
1026 (define-key map "'" 'calc-algebraic-entry)
1027 (define-key map "$" 'calc-auto-algebraic-entry)
1028 (define-key map "\"" 'calc-auto-algebraic-entry)
1029 (define-key map "\t" 'calc-roll-down)
1030 (define-key map "\M-\t" 'calc-roll-up)
1031 (define-key map "\C-m" 'calc-enter)
1032 (define-key map "\M-\C-m" 'calc-last-args-stub)
1033 (define-key map "\C-j" 'calc-over)
1034 (define-key map "\C-y" 'calc-yank)
1035 (define-key map [mouse-2] 'calc-yank)
1036
1037 (mapc (lambda (x) (define-key map (char-to-string x) 'undefined))
1038 "lOW")
1039 (mapc (lambda (x) (define-key map (char-to-string x) 'calc-missing-key))
1040 (concat "ABCDEFGHIJKLMNPQRSTUVXZabcdfghjkmoprstuvwxyz"
1041 ":\\|!()[]<>{},;=~`\C-k\M-k\C-w\M-w\C-y\C-_"))
1042 (mapc (lambda (x) (define-key map (char-to-string x) 'calcDigit-start))
1043 "_0123456789.#@")
1044 (setq calc-mode-map map)))
1045
1046(defvar calc-digit-map nil
1047 "The key map for entering Calc digits.")
1048 1044
1049(or calc-digit-map 1045
1050 (let ((map (make-keymap))) 1046(defvar calc-digit-map
1051 (if (featurep 'xemacs) 1047 (let ((map (make-keymap)))
1052 (map-keymap (function 1048 (if (featurep 'xemacs)
1053 (lambda (keys bind) 1049 (map-keymap (function
1054 (define-key map keys 1050 (lambda (keys bind)
1055 (if (eq bind 'undefined) 1051 (define-key map keys
1056 'undefined 'calcDigit-nondigit)))) 1052 (if (eq bind 'undefined)
1057 calc-mode-map) 1053 'undefined 'calcDigit-nondigit))))
1058 (let ((cmap (nth 1 calc-mode-map)) 1054 calc-mode-map)
1059 (dmap (nth 1 map)) 1055 (let ((cmap (nth 1 calc-mode-map))
1060 (i 0)) 1056 (dmap (nth 1 map))
1061 (while (< i 128) 1057 (i 0))
1062 (aset dmap i 1058 (while (< i 128)
1063 (if (eq (aref cmap i) 'undefined) 1059 (aset dmap i
1064 'undefined 'calcDigit-nondigit)) 1060 (if (eq (aref cmap i) 'undefined)
1065 (setq i (1+ i))))) 1061 'undefined 'calcDigit-nondigit))
1066 (mapc (lambda (x) (define-key map (char-to-string x) 'calcDigit-key)) 1062 (setq i (1+ i)))))
1067 "_0123456789.e+-:n#@oh'\"mspM") 1063 (mapc (lambda (x) (define-key map (char-to-string x) 'calcDigit-key))
1068 (mapc (lambda (x) (define-key map (char-to-string x) 'calcDigit-letter)) 1064 "_0123456789.e+-:n#@oh'\"mspM")
1069 "abcdfgijklqrtuvwxyzABCDEFGHIJKLNOPQRSTUVWXYZ") 1065 (mapc (lambda (x) (define-key map (char-to-string x) 'calcDigit-letter))
1070 (define-key map "'" 'calcDigit-algebraic) 1066 "abcdfgijklqrtuvwxyzABCDEFGHIJKLNOPQRSTUVWXYZ")
1071 (define-key map "`" 'calcDigit-edit) 1067 (define-key map "'" 'calcDigit-algebraic)
1072 (define-key map "\C-g" 'abort-recursive-edit) 1068 (define-key map "`" 'calcDigit-edit)
1073 (setq calc-digit-map map))) 1069 (define-key map "\C-g" 'abort-recursive-edit)
1070 map)
1071 "The key map for entering Calc digits.")
1074 1072
1075(mapc (lambda (x) 1073(mapc (lambda (x)
1076 (condition-case err 1074 (condition-case err
@@ -1096,98 +1094,59 @@ Used by `calc-user-invocation'.")
1096 '("\C-d")) 1094 '("\C-d"))
1097 '("\177" "\C-d"))) 1095 '("\177" "\C-d")))
1098 1096
1099(defvar calc-dispatch-map nil 1097(defvar calc-dispatch-map
1098 (let ((map (make-keymap)))
1099 (mapc (lambda (x)
1100 (define-key map (char-to-string (car x)) (cdr x))
1101 (when (string-match "abcdefhijklnopqrstuwxyz"
1102 (char-to-string (car x)))
1103 (define-key map (char-to-string (- (car x) ?a -1)) (cdr x)))
1104 (define-key map (format "\e%c" (car x)) (cdr x)))
1105 '( ( ?a . calc-embedded-activate )
1106 ( ?b . calc-big-or-small )
1107 ( ?c . calc )
1108 ( ?d . calc-embedded-duplicate )
1109 ( ?e . calc-embedded )
1110 ( ?f . calc-embedded-new-formula )
1111 ( ?g . calc-grab-region )
1112 ( ?h . calc-dispatch-help )
1113 ( ?i . calc-info )
1114 ( ?j . calc-embedded-select )
1115 ( ?k . calc-keypad )
1116 ( ?l . calc-load-everything )
1117 ( ?m . read-kbd-macro )
1118 ( ?n . calc-embedded-next )
1119 ( ?o . calc-other-window )
1120 ( ?p . calc-embedded-previous )
1121 ( ?q . quick-calc )
1122 ( ?r . calc-grab-rectangle )
1123 ( ?s . calc-info-summary )
1124 ( ?t . calc-tutorial )
1125 ( ?u . calc-embedded-update-formula )
1126 ( ?w . calc-embedded-word )
1127 ( ?x . calc-quit )
1128 ( ?y . calc-copy-to-buffer )
1129 ( ?z . calc-user-invocation )
1130 ( ?\' . calc-embedded-new-formula )
1131 ( ?\` . calc-embedded-edit )
1132 ( ?: . calc-grab-sum-down )
1133 ( ?_ . calc-grab-sum-across )
1134 ( ?0 . calc-reset )
1135 ( ?? . calc-dispatch-help )
1136 ( ?# . calc-same-interface )
1137 ( ?& . calc-same-interface )
1138 ( ?\\ . calc-same-interface )
1139 ( ?= . calc-same-interface )
1140 ( ?* . calc-same-interface )
1141 ( ?/ . calc-same-interface )
1142 ( ?+ . calc-same-interface )
1143 ( ?- . calc-same-interface ) ))
1144 map)
1100 "The key map for starting Calc.") 1145 "The key map for starting Calc.")
1101 1146
1102(or calc-dispatch-map
1103 (let ((map (make-keymap)))
1104 (mapc (lambda (x)
1105 (define-key map (char-to-string (car x)) (cdr x))
1106 (when (string-match "abcdefhijklnopqrstuwxyz"
1107 (char-to-string (car x)))
1108 (define-key map (char-to-string (- (car x) ?a -1)) (cdr x)))
1109 (define-key map (format "\e%c" (car x)) (cdr x)))
1110 '( ( ?a . calc-embedded-activate )
1111 ( ?b . calc-big-or-small )
1112 ( ?c . calc )
1113 ( ?d . calc-embedded-duplicate )
1114 ( ?e . calc-embedded )
1115 ( ?f . calc-embedded-new-formula )
1116 ( ?g . calc-grab-region )
1117 ( ?h . calc-dispatch-help )
1118 ( ?i . calc-info )
1119 ( ?j . calc-embedded-select )
1120 ( ?k . calc-keypad )
1121 ( ?l . calc-load-everything )
1122 ( ?m . read-kbd-macro )
1123 ( ?n . calc-embedded-next )
1124 ( ?o . calc-other-window )
1125 ( ?p . calc-embedded-previous )
1126 ( ?q . quick-calc )
1127 ( ?r . calc-grab-rectangle )
1128 ( ?s . calc-info-summary )
1129 ( ?t . calc-tutorial )
1130 ( ?u . calc-embedded-update-formula )
1131 ( ?w . calc-embedded-word )
1132 ( ?x . calc-quit )
1133 ( ?y . calc-copy-to-buffer )
1134 ( ?z . calc-user-invocation )
1135 ( ?\' . calc-embedded-new-formula )
1136 ( ?\` . calc-embedded-edit )
1137 ( ?: . calc-grab-sum-down )
1138 ( ?_ . calc-grab-sum-across )
1139 ( ?0 . calc-reset )
1140 ( ?? . calc-dispatch-help )
1141 ( ?# . calc-same-interface )
1142 ( ?& . calc-same-interface )
1143 ( ?\\ . calc-same-interface )
1144 ( ?= . calc-same-interface )
1145 ( ?* . calc-same-interface )
1146 ( ?/ . calc-same-interface )
1147 ( ?+ . calc-same-interface )
1148 ( ?- . calc-same-interface ) ))
1149 (setq calc-dispatch-map map)))
1150 1147
1151;;;; (Autoloads here) 1148;;;; (Autoloads here)
1152(mapc 1149(load "calc-loaddefs.el" nil t)
1153 (lambda (x) (dolist (func (cdr x)) (autoload func (car x))))
1154 '(
1155
1156 ("calc-aent" calc-alg-digit-entry calc-alg-entry
1157 calc-check-user-syntax calc-do-alg-entry calc-do-calc-eval
1158 calc-do-quick-calc calc-match-user-syntax math-build-parse-table
1159 math-find-user-tokens math-read-expr-list math-read-exprs math-read-if
1160 math-read-token math-remove-dashes math-read-preprocess-string)
1161
1162 ("calc-embed" calc-do-embedded-activate)
1163
1164 ("calc-misc"
1165 calc-do-handle-whys calc-do-refresh calc-num-prefix-name
1166 calc-record-list calc-record-why calc-report-bug calc-roll-down-stack
1167 calc-roll-up-stack calc-temp-minibuffer-message calcFunc-floor
1168 calcFunc-inv calcFunc-trunc math-concat math-constp math-div2
1169 math-div2-bignum math-do-working math-evenp math-fixnatnump
1170 math-fixnump math-floor math-imod math-ipow math-looks-negp math-mod
1171 math-negp math-posp math-pow math-read-radix-digit math-reject-arg
1172 math-trunc math-zerop)))
1173
1174(mapc
1175 (lambda (x) (dolist (cmd (cdr x)) (autoload cmd (car x) nil t)))
1176 '(
1177
1178 ("calc-aent" calc-algebraic-entry calc-auto-algebraic-entry
1179 calcDigit-algebraic calcDigit-edit)
1180
1181 ("calc-misc" another-calc calc-big-or-small calc-dispatch-help
1182 calc-help calc-info calc-info-goto-node calc-info-summary calc-inv
1183 calc-last-args-stub
1184 calc-missing-key calc-mod calc-other-window calc-over calc-percent
1185 calc-pop-above calc-power calc-roll-down calc-roll-up
1186 calc-shift-Y-prefix-help calc-tutorial calcDigit-letter
1187 report-calc-bug)
1188
1189 ("calc-yank" calc-yank)))
1190
1191 1150
1192;;;###autoload (define-key ctl-x-map "*" 'calc-dispatch) 1151;;;###autoload (define-key ctl-x-map "*" 'calc-dispatch)
1193 1152