unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Rupert Swarbrick <rswarbrick@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Customization maxima mode
Date: Thu, 19 Jun 2008 20:59:13 +0100	[thread overview]
Message-ID: <g3edqh$c06$1@news.albasani.net> (raw)
In-Reply-To: mailman.13565.1213869210.18990.help-gnu-emacs@gnu.org

"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


       reply	other threads:[~2008-06-19 19:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.13565.1213869210.18990.help-gnu-emacs@gnu.org>
2008-06-19 19:59 ` Rupert Swarbrick [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='g3edqh$c06$1@news.albasani.net' \
    --to=rswarbrick@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).