[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [Axiom In Emacs]

From: kai Kaminski
Subject: [Axiom-developer] [Axiom In Emacs]
Date: Thu, 18 Aug 2005 08:34:26 -0500


-On July 18, 2005 11:50 AM Kai Kaminski wrote:
-This is a tiny Emacs major mode for BOOT code. It supports very
-rudimentary syntax highlighting and (un)comment-region. To use it,
-put the file <tt>boot-mode.el</tt> somewhere in your <tt>load-path</tt>
-and add <tt>(require &apos;boot-mode)</tt> to your <tt>.emacs</tt>.
-You can activate the mode through <tt>M-x boot-mode RET</tt>.
-<a href="boot-mode.el">boot-mode.el</a>

<h3>Editing Axiom's Source Code</h3>

Emacs can be configured to make editing Axiom's source code much easier. First 
of all you have to put <a href="boot-mode.el"><tt>boot-mode.el</tt></a> and 
<tt>noweb-mode.el</tt> (included in the noweb distribution, which in turn is 
included in the Axiom distribution) into your <tt>load-path</tt>. Then you add 
the following to your <tt>.emacs</tt>:

(require 'noweb-mode)

(defun kai:set-code-mode ()
  (let* ((filename (buffer-file-name)))
    (let ((end (string-match "\\.pamphlet" filename)))
       (assoc-default (substring filename 0 end)

(add-hook 'noweb-mode-hook 'kai:set-code-mode)

(require 'boot-mode)


(setq auto-mode-alist
       '(".*\\.pamphlet" . noweb-mode)
       '(".*\\.boot" . boot-mode)
       '(".*\\.lisp" . lisp-mode)
       '(".*\\.c" . c-mode)

This code tries to automatically set the code mode in noweb, which only works 
for files with names of the form <tt>file.ext.pamphlet</tt>, where <tt>ext</tt> 
indicates the code mode. For example, <tt>sockio.lisp.pamphlet</tt> would have 
its code mode set to <tt>lisp-mode</tt> and <tt>nci.boot.pamphlet</tt> to 
<tt>boot-mode</tt>. If the auto-detection can't decide on a mode it uses 

forwarded from

reply via email to

[Prev in Thread] Current Thread [Next in Thread]