Template:Emacs and ctl

From AbInitio

(Difference between revisions)
Jump to: navigation, search
Revision as of 18:10, 23 October 2005 (edit)
Stevenj (Talk | contribs)

← Previous diff
Current revision (22:05, 14 February 2017) (edit)
AlexCerjan (Talk | contribs)
(Previous code snippet would throw errors with emacs 24.5 in ubuntu 16.04)
 
Line 1: Line 1:
It is useful to have <code>[[w:emacs|emacs]]</code> use its <code>scheme-mode</code> for editing ctl files, so that hitting tab indents nicely, and so on. <code>emacs</code> does this automatically for files ending with "<code>.scm</code>"; to do it for files ending with "<code>.ctl</code>" as well, add the following lines to your <code>~/.emacs</code> file: It is useful to have <code>[[w:emacs|emacs]]</code> use its <code>scheme-mode</code> for editing ctl files, so that hitting tab indents nicely, and so on. <code>emacs</code> does this automatically for files ending with "<code>.scm</code>"; to do it for files ending with "<code>.ctl</code>" as well, add the following lines to your <code>~/.emacs</code> file:
 +
 + (push '("\\.ctl\\'" . scheme-mode) auto-mode-alist)
 +
 +or if your <code>[[w:emacs|emacs]]</code> version is 24.3 or earlier and you have other "<code>.ctl</code>" files which are not Scheme:
(if (assoc "\\.ctl" auto-mode-alist) (if (assoc "\\.ctl" auto-mode-alist)
nil nil
- (nconc auto-mode-alist '(("\\.ctl" . scheme-mode))))+ (add-to-list 'auto-mode-alist '("\\.ctl\\'" . scheme-mode))))
(Incidentally, <code>emacs</code> scripts are written in "elisp," a language closely related to Scheme.) (Incidentally, <code>emacs</code> scripts are written in "elisp," a language closely related to Scheme.)
 +
 +If you don't use emacs (or derivatives such as [[w:Aquamacs|Aquamacs]]), it would be good to find another editor that supports a Scheme mode. For example, [http://www.jedit.org/ jEdit] is a free/open-source cross-platform editor with Scheme-syntax support. Another option is [http://projects.gnome.org/gedit/ GNU gedit] (for GNU/Linux and Unix); in fact, S. Hessam Moosavi Mehr has donated a [http://github.com/hessammehr/meepmpb-highlight hilighting mode for Meep/MPB] that specially highlights the Meep/MPB keywords.

Current revision

It is useful to have emacs use its scheme-mode for editing ctl files, so that hitting tab indents nicely, and so on. emacs does this automatically for files ending with ".scm"; to do it for files ending with ".ctl" as well, add the following lines to your ~/.emacs file:

(push '("\\.ctl\\'" . scheme-mode) auto-mode-alist)

or if your emacs version is 24.3 or earlier and you have other ".ctl" files which are not Scheme:

(if (assoc "\\.ctl" auto-mode-alist)
    nil
  (add-to-list 'auto-mode-alist '("\\.ctl\\'" . scheme-mode))))

(Incidentally, emacs scripts are written in "elisp," a language closely related to Scheme.)

If you don't use emacs (or derivatives such as Aquamacs), it would be good to find another editor that supports a Scheme mode. For example, jEdit is a free/open-source cross-platform editor with Scheme-syntax support. Another option is GNU gedit (for GNU/Linux and Unix); in fact, S. Hessam Moosavi Mehr has donated a hilighting mode for Meep/MPB that specially highlights the Meep/MPB keywords.

Personal tools