[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] EOF syntax as Emacs comment?
From: |
Graham Fawcett |
Subject: |
Re: [Chicken-users] EOF syntax as Emacs comment? |
Date: |
Thu, 9 Feb 2006 16:30:24 -0500 |
On 2/9/06, Reed Sheridan <address@hidden> wrote:
> This doesn't seem to "just work," as I had hoped, so I tried two-mode-mode
> as Dominique suggested. Unfortunately, it switches modes for the whole
> buffer as you move the point in and out of the embedded text, which doesn't
> help paredit (though I'll still use it if I can't find anything more
> suitable). Before I spend much time messing with mmm-mode, does it switch
> the mode for the whole buffer like two-mode-mode, or does it put different
> parts of the buffer in different modes?
Different parts in different modes. You can have an indefinite number
of sub-modes.
Sorry, I didn't post a working example, but rather another case of
mmm-mode at work. Let me see if I can give you something more
specific... try this in your .emacs:
(mmm-add-mode-ext-class nil "\\.scm" 'scheme-eof)
(mmm-add-classes
'((scheme-eof
:submode text-mode
:front "#..EOF"
:back "^EOF$")))
(add-to-list 'auto-mode-alist '("\\.scm" . mmm-mode))
This declares "scheme-eof" as an extension class, provides the regexes
to match the beginning and end of the EOF section, and specifies the
mode to use within that section (I chose text-mode). Finally, it adds
mmm-mode to the auto-mode-list for .SCM files.
Note too that I cheated on the first regex. ;-) Works here, hope it
works for you too.
Graham