* Customization maxima mode
@ 2008-06-19 9:53 Lorenzo Isella
2008-06-19 21:11 ` Nikolaj Schumacher
2008-06-19 22:21 ` David Hansen
0 siblings, 2 replies; 5+ messages in thread
From: Lorenzo Isella @ 2008-06-19 9:53 UTC (permalink / raw)
To: help-gnu-emacs
Dear All,
I use emacs, among other things, also to edit some simple batch files
for the computer-algebra system maxima
(http://maxima.sourceforge.net/). Thanks to this mailing list, I
managed to add some simple customization to other modules (python,
aucted, R etc...), but for some reason this fails for maxima-mode.
An example from my .emacs file:
(defun insert-round () "custom redefined insert-round" (interactive)
(insert "()") ; typing "(" automatically insert "()"
(backward-char 1)) ;and go between them: no more matching problems!
(local-set-key "(" 'insert-round)
(add-hook 'Maxima-mode-hook
(lambda () (local-set-key "(" 'insert-round)))
(setq auto-mode-alist (cons '("\\.max" . maxima-mode) auto-mode-alist))
;(setq load-path (cons "/usr/share/maxima/5.9.0/emacs" load-path ))
(autoload 'maxima "maxima" "Running Maxima interactively" t)
(autoload 'maxima-mode "maxima" "Maxima editing mode" t)
So, how comes that when editing e.g. file calculations.max, typing (
does not autocomplete to () and cursor in between the brackets?
I suppose I must be making a trivial mistake; a similar procedure
gives no trouble with a .py file for instance.
I should add that the maxima mode seems to be recognized (I have
syntax highlighting and so on).
Many thanks for your help
Lorenzo
^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <mailman.13565.1213869210.18990.help-gnu-emacs@gnu.org>]
* Re: Customization maxima mode
[not found] <mailman.13565.1213869210.18990.help-gnu-emacs@gnu.org>
@ 2008-06-19 19:59 ` Rupert Swarbrick
0 siblings, 0 replies; 5+ messages in thread
From: Rupert Swarbrick @ 2008-06-19 19:59 UTC (permalink / raw)
To: help-gnu-emacs
"Lorenzo Isella" <lorenzo.isella@gmail.com> writes:
> An example from my .emacs file:
>
> (defun insert-round () "custom redefined insert-round" (interactive)
> (insert "()") ; typing "(" automatically insert "()"
> (backward-char 1)) ;and go between them: no more matching problems!
>
> (local-set-key "(" 'insert-round)
>
> (add-hook 'Maxima-mode-hook
> (lambda () (local-set-key "(" 'insert-round)))
>
>
> (setq auto-mode-alist (cons '("\\.max" . maxima-mode) auto-mode-alist))
> ;(setq load-path (cons "/usr/share/maxima/5.9.0/emacs" load-path ))
> (autoload 'maxima "maxima" "Running Maxima interactively" t)
> (autoload 'maxima-mode "maxima" "Maxima editing mode" t)
>
> So, how comes that when editing e.g. file calculations.max, typing (
> does not autocomplete to () and cursor in between the brackets?
> I suppose I must be making a trivial mistake; a similar procedure
> gives no trouble with a .py file for instance.
Yep :) It's capitalization: you want maxima-mode-hook.
Note that
C-h a "Maxima.*mode-hook"
(without the quotes) comes up with it uncapitalized.
Also, (quick + dirty check) something that I do to check what's bound to
a hook is put a space after the quote temporarily:
(add-hook ' Maxima-mode-hook
and C-x C-e after the variable name. With maxima-mode-hook, you should
see nil or possibly maxima-font-setup. With the capital, you get an
error.
Rupert
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-06-19 22:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-19 9:53 Customization maxima mode Lorenzo Isella
2008-06-19 21:11 ` Nikolaj Schumacher
2008-06-19 22:15 ` Lorenzo Isella
2008-06-19 22:21 ` David Hansen
[not found] <mailman.13565.1213869210.18990.help-gnu-emacs@gnu.org>
2008-06-19 19:59 ` Rupert Swarbrick
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).