diff options
| author | Glenn Morris | 2009-09-15 02:35:22 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-09-15 02:35:22 +0000 |
| commit | a9d46b583ef9b1a9bda2cc9b478eaf15f7e61b50 (patch) | |
| tree | 1c50b5666017e79203ec462e1b1ccfe5a62b2df5 | |
| parent | 2b8e87c4693dd1ffab7d9c4bd1adb7290fef1759 (diff) | |
| download | emacs-a9d46b583ef9b1a9bda2cc9b478eaf15f7e61b50.tar.gz emacs-a9d46b583ef9b1a9bda2cc9b478eaf15f7e61b50.zip | |
(arglist): Define for compiler.
Delete trailing whitespace.
| -rw-r--r-- | lisp/calc/calc-prog.el | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/lisp/calc/calc-prog.el b/lisp/calc/calc-prog.el index 6de8613e13b..87e143c6502 100644 --- a/lisp/calc/calc-prog.el +++ b/lisp/calc/calc-prog.el | |||
| @@ -199,7 +199,7 @@ | |||
| 199 | (while | 199 | (while |
| 200 | (progn | 200 | (progn |
| 201 | (setq cmd-base-default (concat "User-" keyname)) | 201 | (setq cmd-base-default (concat "User-" keyname)) |
| 202 | (setq cmd (completing-read | 202 | (setq cmd (completing-read |
| 203 | (concat "Define M-x command name (default calc-" | 203 | (concat "Define M-x command name (default calc-" |
| 204 | cmd-base-default | 204 | cmd-base-default |
| 205 | "): ") | 205 | "): ") |
| @@ -224,7 +224,7 @@ | |||
| 224 | "That name conflicts with a built-in Emacs function. Replace this function? ")))))) | 224 | "That name conflicts with a built-in Emacs function. Replace this function? ")))))) |
| 225 | (while | 225 | (while |
| 226 | (progn | 226 | (progn |
| 227 | (setq cmd-base-default | 227 | (setq cmd-base-default |
| 228 | (if cmd-base | 228 | (if cmd-base |
| 229 | (if (string-match | 229 | (if (string-match |
| 230 | "\\`User-.+" cmd-base) | 230 | "\\`User-.+" cmd-base) |
| @@ -233,16 +233,16 @@ | |||
| 233 | (substring cmd-base 5)) | 233 | (substring cmd-base 5)) |
| 234 | cmd-base) | 234 | cmd-base) |
| 235 | (concat "User" keyname))) | 235 | (concat "User" keyname))) |
| 236 | (setq func | 236 | (setq func |
| 237 | (concat "calcFunc-" | 237 | (concat "calcFunc-" |
| 238 | (completing-read | 238 | (completing-read |
| 239 | (concat "Define algebraic function name (default " | 239 | (concat "Define algebraic function name (default " |
| 240 | cmd-base-default "): ") | 240 | cmd-base-default "): ") |
| 241 | (mapcar (lambda (x) (substring x 9)) | 241 | (mapcar (lambda (x) (substring x 9)) |
| 242 | (all-completions "calcFunc-" | 242 | (all-completions "calcFunc-" |
| 243 | obarray)) | 243 | obarray)) |
| 244 | (lambda (x) | 244 | (lambda (x) |
| 245 | (fboundp | 245 | (fboundp |
| 246 | (intern (concat "calcFunc-" x)))) | 246 | (intern (concat "calcFunc-" x)))) |
| 247 | nil))) | 247 | nil))) |
| 248 | (setq func | 248 | (setq func |
| @@ -270,7 +270,7 @@ | |||
| 270 | (setq calc-user-formula-alist arglist) | 270 | (setq calc-user-formula-alist arglist) |
| 271 | (while | 271 | (while |
| 272 | (progn | 272 | (progn |
| 273 | (setq calc-user-formula-alist | 273 | (setq calc-user-formula-alist |
| 274 | (read-from-minibuffer "Function argument list: " | 274 | (read-from-minibuffer "Function argument list: " |
| 275 | (if arglist | 275 | (if arglist |
| 276 | (prin1-to-string arglist) | 276 | (prin1-to-string arglist) |
| @@ -284,7 +284,7 @@ | |||
| 284 | func | 284 | func |
| 285 | (y-or-n-p | 285 | (y-or-n-p |
| 286 | "Leave it symbolic for non-constant arguments? "))) | 286 | "Leave it symbolic for non-constant arguments? "))) |
| 287 | (setq calc-user-formula-alist | 287 | (setq calc-user-formula-alist |
| 288 | (mapcar (function (lambda (x) | 288 | (mapcar (function (lambda (x) |
| 289 | (or (cdr (assq x '((nil . arg-nil) | 289 | (or (cdr (assq x '((nil . arg-nil) |
| 290 | (t . arg-t)))) | 290 | (t . arg-t)))) |
| @@ -328,6 +328,7 @@ | |||
| 328 | (setcdr kmap (cons (cons key cmd) (cdr kmap))))))) | 328 | (setcdr kmap (cons (cons key cmd) (cdr kmap))))))) |
| 329 | (message ""))) | 329 | (message ""))) |
| 330 | 330 | ||
| 331 | (defvar arglist) ; dynamically bound in all callers | ||
| 331 | (defun calc-default-formula-arglist (form) | 332 | (defun calc-default-formula-arglist (form) |
| 332 | (if (consp form) | 333 | (if (consp form) |
| 333 | (if (eq (car form) 'var) | 334 | (if (eq (car form) 'var) |
| @@ -382,14 +383,14 @@ | |||
| 382 | (if (eq calc-language 'unform) | 383 | (if (eq calc-language 'unform) |
| 383 | (error "Can't define formats for unformatted mode")) | 384 | (error "Can't define formats for unformatted mode")) |
| 384 | (let* ((comp (calc-top 1)) | 385 | (let* ((comp (calc-top 1)) |
| 385 | (func (intern | 386 | (func (intern |
| 386 | (concat "calcFunc-" | 387 | (concat "calcFunc-" |
| 387 | (completing-read "Define format for which function: " | 388 | (completing-read "Define format for which function: " |
| 388 | (mapcar (lambda (x) (substring x 9)) | 389 | (mapcar (lambda (x) (substring x 9)) |
| 389 | (all-completions "calcFunc-" | 390 | (all-completions "calcFunc-" |
| 390 | obarray)) | 391 | obarray)) |
| 391 | (lambda (x) | 392 | (lambda (x) |
| 392 | (fboundp | 393 | (fboundp |
| 393 | (intern (concat "calcFunc-" x)))))))) | 394 | (intern (concat "calcFunc-" x)))))))) |
| 394 | (comps (get func 'math-compose-forms)) | 395 | (comps (get func 'math-compose-forms)) |
| 395 | entry entry2 | 396 | entry entry2 |
| @@ -402,7 +403,7 @@ | |||
| 402 | (setq arglist (sort arglist 'string-lessp)) | 403 | (setq arglist (sort arglist 'string-lessp)) |
| 403 | (while | 404 | (while |
| 404 | (progn | 405 | (progn |
| 405 | (setq calc-user-formula-alist | 406 | (setq calc-user-formula-alist |
| 406 | (read-from-minibuffer "Composition argument list: " | 407 | (read-from-minibuffer "Composition argument list: " |
| 407 | (if arglist | 408 | (if arglist |
| 408 | (prin1-to-string arglist) | 409 | (prin1-to-string arglist) |
| @@ -417,9 +418,9 @@ | |||
| 417 | (cons (setq entry (list calc-language)) comps))) | 418 | (cons (setq entry (list calc-language)) comps))) |
| 418 | (or (setq entry2 (assq (length calc-user-formula-alist) (cdr entry))) | 419 | (or (setq entry2 (assq (length calc-user-formula-alist) (cdr entry))) |
| 419 | (setcdr entry | 420 | (setcdr entry |
| 420 | (cons (setq entry2 | 421 | (cons (setq entry2 |
| 421 | (list (length calc-user-formula-alist))) (cdr entry)))) | 422 | (list (length calc-user-formula-alist))) (cdr entry)))) |
| 422 | (setcdr entry2 | 423 | (setcdr entry2 |
| 423 | (list 'lambda calc-user-formula-alist (calc-fix-user-formula comp)))) | 424 | (list 'lambda calc-user-formula-alist (calc-fix-user-formula comp)))) |
| 424 | (calc-pop-stack 1) | 425 | (calc-pop-stack 1) |
| 425 | (calc-do-refresh)))) | 426 | (calc-do-refresh)))) |
| @@ -503,8 +504,8 @@ | |||
| 503 | (switch-to-buffer calc-original-buffer)) | 504 | (switch-to-buffer calc-original-buffer)) |
| 504 | 505 | ||
| 505 | ;; The variable calc-lang is local to calc-write-parse-table, but is | 506 | ;; The variable calc-lang is local to calc-write-parse-table, but is |
| 506 | ;; used by calc-write-parse-table-part which is called by | 507 | ;; used by calc-write-parse-table-part which is called by |
| 507 | ;; calc-write-parse-table. The variable is also local to | 508 | ;; calc-write-parse-table. The variable is also local to |
| 508 | ;; calc-read-parse-table, but is used by calc-fix-token-name which | 509 | ;; calc-read-parse-table, but is used by calc-fix-token-name which |
| 509 | ;; is called (indirectly) by calc-read-parse-table. | 510 | ;; is called (indirectly) by calc-read-parse-table. |
| 510 | (defvar calc-lang) | 511 | (defvar calc-lang) |
| @@ -691,10 +692,10 @@ | |||
| 691 | (let* ((mac (elt (nth 1 (nth 3 cmd)) 1)) | 692 | (let* ((mac (elt (nth 1 (nth 3 cmd)) 1)) |
| 692 | (str (edmacro-format-keys mac t)) | 693 | (str (edmacro-format-keys mac t)) |
| 693 | (kys (nth 3 (nth 3 cmd)))) | 694 | (kys (nth 3 (nth 3 cmd)))) |
| 694 | (calc-edit-mode | 695 | (calc-edit-mode |
| 695 | (list 'calc-edit-macro-finish-edit cmdname kys) | 696 | (list 'calc-edit-macro-finish-edit cmdname kys) |
| 696 | t (format (concat | 697 | t (format (concat |
| 697 | "Editing keyboard macro (%s, bound to %s).\n" | 698 | "Editing keyboard macro (%s, bound to %s).\n" |
| 698 | "Original keys: %s \n") | 699 | "Original keys: %s \n") |
| 699 | cmdname kys (elt (nth 1 (nth 3 cmd)) 0))) | 700 | cmdname kys (elt (nth 1 (nth 3 cmd)) 0))) |
| 700 | (insert str "\n") | 701 | (insert str "\n") |
| @@ -710,7 +711,7 @@ | |||
| 710 | (if (and defn (calc-valid-formula-func func)) | 711 | (if (and defn (calc-valid-formula-func func)) |
| 711 | (let ((niceexpr (math-format-nice-expr defn (frame-width)))) | 712 | (let ((niceexpr (math-format-nice-expr defn (frame-width)))) |
| 712 | (calc-wrapper | 713 | (calc-wrapper |
| 713 | (calc-edit-mode | 714 | (calc-edit-mode |
| 714 | (list 'calc-finish-formula-edit (list 'quote func)) | 715 | (list 'calc-finish-formula-edit (list 'quote func)) |
| 715 | nil | 716 | nil |
| 716 | (format (concat | 717 | (format (concat |
| @@ -792,7 +793,7 @@ | |||
| 792 | (when match | 793 | (when match |
| 793 | (kill-line 1) | 794 | (kill-line 1) |
| 794 | (setq line (concat line (substring curline 0 match)))) | 795 | (setq line (concat line (substring curline 0 match)))) |
| 795 | (setq line (replace-regexp-in-string "SPC" " SPC " | 796 | (setq line (replace-regexp-in-string "SPC" " SPC " |
| 796 | (replace-regexp-in-string " " "" line))) | 797 | (replace-regexp-in-string " " "" line))) |
| 797 | (insert line "\t\t\t") | 798 | (insert line "\t\t\t") |
| 798 | (if (> (current-column) 24) | 799 | (if (> (current-column) 24) |
| @@ -817,7 +818,7 @@ | |||
| 817 | (setq line (concat line curline)) | 818 | (setq line (concat line curline)) |
| 818 | (kill-line 1) | 819 | (kill-line 1) |
| 819 | (setq curline (calc-edit-macro-command))) | 820 | (setq curline (calc-edit-macro-command))) |
| 820 | (when match | 821 | (when match |
| 821 | (kill-line 1) | 822 | (kill-line 1) |
| 822 | (setq line (concat line (substring curline 0 match)))) | 823 | (setq line (concat line (substring curline 0 match)))) |
| 823 | (setq line (replace-regexp-in-string " " "" line)) | 824 | (setq line (replace-regexp-in-string " " "" line)) |
| @@ -844,7 +845,7 @@ | |||
| 844 | (setq line (concat line curline)) | 845 | (setq line (concat line curline)) |
| 845 | (kill-line 1) | 846 | (kill-line 1) |
| 846 | (setq curline (calc-edit-macro-command))) | 847 | (setq curline (calc-edit-macro-command))) |
| 847 | (when match | 848 | (when match |
| 848 | (kill-line 1) | 849 | (kill-line 1) |
| 849 | (setq line (concat line (substring curline 0 match)))) | 850 | (setq line (concat line (substring curline 0 match)))) |
| 850 | (setq line (replace-regexp-in-string " " "" line)) | 851 | (setq line (replace-regexp-in-string " " "" line)) |
| @@ -1019,8 +1020,8 @@ Redefine the corresponding command." | |||
| 1019 | (mapcar (lambda (x) (substring x 9)) | 1020 | (mapcar (lambda (x) (substring x 9)) |
| 1020 | (all-completions "calcFunc-" | 1021 | (all-completions "calcFunc-" |
| 1021 | obarray)) | 1022 | obarray)) |
| 1022 | (lambda (x) | 1023 | (lambda (x) |
| 1023 | (fboundp | 1024 | (fboundp |
| 1024 | (intern (concat "calcFunc-" x)))) | 1025 | (intern (concat "calcFunc-" x)))) |
| 1025 | t))))) | 1026 | t))))) |
| 1026 | (and (eq key ?\M-x) | 1027 | (and (eq key ?\M-x) |