From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rupert Swarbrick Newsgroups: gmane.emacs.help Subject: Re: Customization maxima mode Date: Thu, 19 Jun 2008 20:59:13 +0100 Organization: albasani.net Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1213908070 14643 80.91.229.12 (19 Jun 2008 20:41:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 19 Jun 2008 20:41:10 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 19 22:41:54 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1K9Qwf-0000pY-Di for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Jun 2008 22:41:25 +0200 Original-Received: from localhost ([127.0.0.1]:34321 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1K9Qvq-00015w-JW for geh-help-gnu-emacs@m.gmane.org; Thu, 19 Jun 2008 16:40:34 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news.albasani.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 44 Original-X-Trace: news.albasani.net OjrUgSwEPDpijX2ekDoCVz5iynZRu5zwzw5ptDr+QDXRc+b3DcKtXuDM4OIu0pz+PtAlVQ6G+DiiPzfZJpJgIHKHBVudSUu7495cLugnvayGMuC1dhSBD0/H+/z9pnMv Original-X-Complaints-To: abuse@albasani.net Original-NNTP-Posting-Date: Thu, 19 Jun 2008 19:59:13 +0000 (UTC) X-User-ID: gqqs4vbdfE8tRrhGZr4xXBJvlCZzNurpM8VRWLW4yNA= Cancel-Lock: sha1:ns277jat1hVrBEQABWRlxLAVoYA= User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/22.2 (gnu/linux) X-NNTP-Posting-Host: KgstJV6gb47TTkSe+aIxMCk2U/M4xfdJL3u1pecZadY= Original-Xref: news.stanford.edu gnu.emacs.help:159624 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:54978 Archived-At: "Lorenzo Isella" 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