Change everything.
[emacs.d.git] / lisp / imaxima-rc.el
blob603b68835ec3f689118a907985686c8fadbf09dc
1 ;;; An rc to setup imaxima (and maxima).
3 ;;; On some systems, the Maxima Emacs contribs aren't installed in any
4 ;;; of the usual load path directories. So, attempt to add wherever
5 ;;; they are to the load path.
6 (defvar yard-maxima-paths '("~/share/maxima"
7 "/usr/local/share/maxima"
8 "/usr/share/maxima")
9 "List of directories to search for a distribution of Maxima.")
11 (defun yard-find-latest-maxima (paths)
12 (car (sort (apply #'append
13 (mapcar (lambda (path)
14 (file-expand-wildcards
15 (concat (file-name-as-directory path)
16 "*")))
17 paths))
18 #'string<)))
20 (defun yard-find-maxima-emacs-contrib (paths)
21 (let ((path (concat (file-name-as-directory (yard-find-latest-maxima paths))
22 "emacs/")))
23 (when (file-exists-p path) path)))
25 (let ((maxima-emacs-contrib
26 (yard-find-maxima-emacs-contrib yard-maxima-paths)))
27 (when maxima-emacs-contrib (add-to-list 'load-path maxima-emacs-contrib)))
29 ;;; Then try to load them.
30 (when (yard-optimistically-locate-feature 'maxima)
31 (autoload 'maxima-mode "maxima" "Major mode for editing Maxima mode." t)
32 (autoload 'maxima "maxima" "Run Maxima interactively." t)
33 (add-to-list 'auto-mode-alist '("\\.ma?[cx]$" . maxima-mode)))
35 (when (yard-optimistically-locate-feature 'imaxima)
36 (autoload 'imaxima "imaxima" "Image support for Maxima" t)
37 (setq imaxima-fnt-size "Large"
38 imaxima-use-maxima-mode-flag t))