|
From: Roland S. <ma...@ro...> - 2016-01-24 21:33:58
|
Here's how far I've come:
First, a minor issue:
(setq default-directory "C:/Users/Roland/Documents/Meine Programme/Lisp/") or
(cd "C:/.../")
don't have any effect when inserted in the .emacs, although they should. That I don't understand, but I resolved the
problem by changing the start-in directory of the windows shortcut for the emacs.exe, which has the same effect.
Emacs is installed with clisp, quicklisp and slime. I can call M-x slime and it runs. My .emacs content so far is:
(setq inferior-lisp-program "clisp.exe")
(load "C:/quicklisp/slime-helper.el")
Now coming to maxima: if I use Andrej's setting:
(add-to-list 'load-path "C:/Program Files
(x86)/Maxima-sbcl-5.37.2/share/maxima/5.37.2/emacs/")
(require 'maxima)
(setq maxima-command "C:/Program Files (x86)/Maxima-sbcl-5.37.2/bin/maxima.bat")
(add-to-list 'auto-mode-alist '("\\.mac\\'" . maxima-mode))
maxima connects. Fine. If I use your setting (of course with the path adapted), which is exactly the setting described
in emacswiki and similar to the one described on the imaxima homepage:
(add-to-list 'load-path "/usr/local/share/maxima/5.35.1/emacs/")
(autoload 'maxima-mode "maxima" "Maxima mode" t)
(autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t)
(autoload 'maxima "maxima" "Maxima interaction" t)
(autoload 'imath-mode "imath" "Imath mode for math formula input" t)
(setq imaxima-use-maxima-mode-flag t)
(add-to-list 'auto-mode-alist '("\\.ma[cx]" . maxima-mode))
M-x maxima gives "Searching for program, no such file or directory, maxima."
M-x imaxima creates a *maxima* buffer, but with: "Comint: no process".
Of course I would like to see imaxima also in emacs, so it would be great if I could get your settings to work, too. I
can't find out where these maxima specific variables are described, so I could not resolve that.
Your slime-maxima connection sounds so interesting, I would be happy to get that going, too:
> ... is to type at the first prompt of maxima load(startswank) where startswank.lisp is a file i have put in my .maxima
> (initialization file) so maxima finds it, containing
>
> (pushnew "/home/michel/Documents/pro/dists/quicklisp/software/slime-2.14/" asdf:*central-registry*)
> (require :swank)
> (swank:create-server :port 4005 :dont-close t)
>
> The first line describes the place where you install slime, the second then can work and load slime, finally the third
> Instructs lisp to open a socket on port 4005 waiting for a connection (this is what swank does).
What is the .maxima initialization file? Is this identical to the maxima-init.mac or the maxima-init.lisp under
wxmaxima? Probably not. Is it the equivalent for console maxima? Where does it have to be placed, in the same directory
as the .emacs? What is the relevant documentation for such issues?
What do you mean by putting a file (startswank.lisp) into a file (.maxima)?
Will the port number be the same for windows? (I'm no hardware expert either.) How do I find it out?
Will swank be already installed in my setup?
Best regards,
Roland
> -----Original Message-----
> From: Michel Talon [ <mailto:ta...@lp...> mailto:ta...@lp...]
> Sent: Saturday, January 23, 2016 12:52 AM
> To: Roland Salz
> Subject: Re: About engineering-format.lisp
>
> I am at the moment working with this setup in Ubuntu, but as far as i
> know there is no difference in Windows. So i
have
> emacs with the .emacs shown after my signature. Of course paths have
> to be adapted. On Ubuntu i have a printer called PDF which prints to
> PDF files, which is very convenient to print nicely formatted stuff by
> emacs. There is a command
to
> increase the initial size of the emacs window, another to get a nice
> antialised font, and finally the stuff to get the
slime
> mode and the maxima mode. The maxima mode comes with the maxima
> distribution. For slime i have used something which is very convenient
> to get lisp software, called quicklisp. See
> <https://www.quicklisp.org/beta/> https://www.quicklisp.org/beta/ This got me a
working
> slime (the one coming wit Ubuntu did not work correctly), installed
> under my home. It also provided a simple script
slime-
> helper.el which setups things. Note i had a little bug solved by
> (byte-compile-disable-warning 'cl-functions) that i
found on
> the web.
> Assuming you have this setup working OK you have maxima mode and slime.
>
> Now the way to make them work together.
> You open emacs and type M-x maxima (this is Meta-X you have to find
> the Meta key, on my keyboard it is the left Alt
key).
> This launches maxima in the background so you can type commands and
> get the result inside emacs. Of course maxima is in fact a lisp
> program running a maxima core, so can interact with slime. The way to
> do that (at least the way i am
> using) is to type at the first prompt of maxima
> load(startswank)
> where startswank.lisp is a file i have put in my .maxima
> (initialisation
> file) so maxima finds it, containing
>
> (pushnew
> "/home/michel/Documents/pro/dists/quicklisp/software/slime-2.14/"
> asdf:*central-registry*)
> (require :swank)
> (swank:create-server :port 4005 :dont-close t)
>
> The first line describes the place where you install slime, the second
> then can work and load slime, finally the third
instructs
> lisp to open a socket on port 4005 waiting for a connection (this is what swank does).
>
> After that you type in emacs
> M-x slime-connect
> emacs asks 2 questions to which you type Ret to accept the defaults
> (connection on localhost, port 4005). Here it is
slime,
> that is emacs, which opens a socket and interacts with swank on the lisp side.
>
> Then the screen splits and you get two windows, one for maxima, the
> other for lisp with the prompt MAXIMA>
>
> Suppose you want to see how a*b is represented in lisp. In maxima type
> e:a*b; Then in lisp type $e, you get the representation ((MTIMES SIMP) $A $B) this is the beginning of hacking!!!!
> As soon as you produce a lisp error, you will see a slime popup with
> the appropriate backtraces and restarts. This is
a
> fantastic tool.
>
>
> Finally if you want to work with specific lisp files or maxima files.
> I recommend to open them in a new frame. They will appear colorized in
> maxima mode or slime mode. Suppose you have some defun in a lisp file
> and you edit it. Then you type C-M-x on the function which
> automatically recompiles it and overwrites the previous definition.
> Immediately you can test it in the lisp interaction window. This is an
> incredibly fast way to progress by trial and error. You will promptly
> discover that this setup (with 3 or 4 windows) is light years ahead to
> anything built on stupid windowing frameworks (particularly when they
> are ultra buggy like wxwidgets). When you have something of interest
> in one window you can Postscript Print Buffer (perhaps on a PDF
> printer) and thus keep a nice colorized output.
>
>
> If you have a TeX installation on your machine and want to run maxima
> computations with messy output, you can also run M-x imaxima which
> filters the maxima output through TeX and thus gives beautiful results
> in emacs. Unfortunately too long lines produce errors, this is one
> case where wxmaxima has an advantage (although too long lines also
> cause problems here). The notebook stuff in wxmaxima has in my opinion
> exactly zero interest (as in Mathematica or Maple) since you get
> exactly the same effect under maxima mode of emacs, where you can type
> all the comments you want afterwards in the emacs buffer and then
> print it if you like.
>
> Hope this long mail may be useful
>
>
> --
> Michel Talon
>
>
> (custom-set-variables
> ;; custom-set-variables was added by Custom.
> ;; If you edit it by hand, you could mess it up, so be careful.
> ;; Your init file should contain only one such instance.
> ;; If there is more than one, they won't work right.
> '(column-number-mode t)
> '(display-time-mode t)
> '(font-use-system-font nil)
> '(inhibit-startup-screen t)
> '(package-archives (quote (("gnu" . " <http://elpa.gnu.org/packages/> http://elpa.gnu.org/packages/")
> ("melpa" . " <http://melpa.org/packages/> http://melpa.org/packages/"))))
> '(printer-name "PDF")
> '(show-paren-mode t)
> '(tool-bar-mode nil))
> (custom-set-faces
> ;; custom-set-faces was added by Custom.
> ;; If you edit it by hand, you could mess it up, so be careful.
> ;; Your init file should contain only one such instance.
> ;; If there is more than one, they won't work right.
> '(default ((t (:family "Ubuntu Mono" :foundry "unknown" :slant
> normal :weight normal :height 120 :width normal)))))
>
>
>
> (setq initial-frame-alist
> '((top . 1) (left . 1) (width . 100) (height . 50)))
>
>
>
> (setenv "SBCL_HOME" "/usr/lib/sbcl")
> (byte-compile-disable-warning 'cl-functions) (load (expand-file-name
> "~/Documents/pro/slime-helper.el"))
> (setq inferior-lisp-program "sbcl")
>
> (add-to-list 'load-path "/usr/local/share/maxima/5.35.1/emacs/")
> (autoload 'maxima-mode "maxima" "Maxima mode" t)
> (autoload 'imaxima "imaxima" "Frontend for maxima with Image support" t)
> (autoload 'maxima "maxima" "Maxima interaction" t)
> (autoload 'imath-mode "imath" "Imath mode for math formula input" t)
> (setq imaxima-use-maxima-mode-flag t)
> (add-to-list 'auto-mode-alist '(" <file:///\\.ma[cx]> \\.ma[cx]" . maxima-mode))
|