SRRAT: use MRAT reader functions instead of CADDAR, etc.
[maxima.git] / archive / src / grabext.lisp
blob145427fdaa95cf358968d7af660e56becf1b507b
1 (in-package "MAXIMA")
2 ;(require "MAKE" "make.lisp")
3 ;;The following can be used to help building a list of auto declarations.
4 ;;They certainly add to many names for a translated file.
6 (defun grab-externals (file &aux tem ans (eof '(nil))
7 (file-name (intern (pathname-name
8 (pathname file)))))
9 (declare (special ans file-name))
10 (with-open-file (st file)
11 (sloop while (not (eq eof (setq tem (read st nil eof))))
12 when (consp tem)
13 do (grab-externals1 tem)))
14 ans)
16 (defun grab-externals1 (form )
17 (declare (special ans file-name))
18 (cond ((consp form)
19 (case (car form)
20 (defmfun
21 (push `(autof ',(second form)',file-name) ans))
22 (defmtrfun
23 (push `(autof ',(car(second form))',file-name) ans))
25 (defmspec (push `(auto-mspec ',(second form)',file-name)
26 ans))
27 (eval-when (dolist (v (cddr form))(grab-externals1 v)))
28 (progn (dolist (v (cdr form))(grab-externals1 v)))))))
30 (defun print-maxima-externals (file &optional
31 (files (make::system-files :maxima)))
32 (let ((decls
33 (sloop for v in appending
34 (grab-externals (format nil "~(~a~).lisp" v)))))
35 (with-open-file (st file :direction :output)
36 (format st ";;Autoloads for maxima~%(in-package \"MAXIMA\")~2%")
37 (sloop for w in decls
38 do (format st "~%~s" w)))))
40 ;An emacs-lisp function for figuring out which of the translated functions
41 ;are really important. Put in one window the doc file and all test files
42 ;and all manual concatted together. Then go through the forms in this
43 ;window and if you can't find the form in the documentation, then it
44 ;is not external. Comment it out.
46 (defun delete-some-autoloads ()
47 (interactive)
48 (while (re-search-forward " '" nil t)
49 (let ((tem (read (current-buffer))))
50 (other-window 1)
51 (goto-char (point-min))
52 (cond ((search-forward (substring (format "%s" tem) 1) nil t) (other-window 1))
53 (t (other-window 1) (beginning-of-line )
55 (insert ";")))
56 (beginning-of-line )
57 (forward-line 1))))