I recently added mmm-mode support (written by Dan Drake [1]) to sage-mode:

;;; provide MMM (multiple major mode) support
(eval-after-load 'mmm-auto
 '(progn
    (mmm-add-classes
     '((sagetex
 :submode sage-mode
 :delimiter-mode nil
 :front
"\\\\begin{sage\\(block\\|silent\\|verbatim\\|example\\|commandline\\)}"
 :back "\\\\end{sage~1}"
 :save-matches 1)))
    (mmm-add-mode-ext-class nil "\\.tex\\'" 'sagetex)
    (unless mmm-global-mode
      (message "Multiple modes not enabled, please customize
`mmm-global-mode' to enable."))))

It seems to work fairly well, and it was pretty easy to setup.

-Ivan

[1]
https://bitbucket.org/gvol/sage-mode/commits/ff0feeb2daf60ac0eac31ee7a65e046037129120?at=default

On Aug 14, 2014, at 6:23 AM, Vincent Belaïche <[email protected]>
wrote:

As far as I can understand you are sort of embedding Maxima code into LaTeX
code and you would like the Maxima edit mode for the pieces of Maxima codes
only.

I think that the same sort of thing is needed for Asymptote
(http://asymptote.sourceforge.net/), not sure how/whether they handle it.
Maybe you should investigate whether people with similar problems have found
any standard solution to do it.

 Vincent.

From: [email protected]
To: [email protected]
Date: Thu, 13 Mar 2014 09:59:03 +0100
Subject: [AUCTeX] AUCTEX with multiple modes

Hi,

After playing around with emaxima-mode (a mode that extends AUCTeX to
mix in Maxima code that can be evaluated, it has not been mainteined for
a while) I came to the conclusion that getting a comfy environment out
of it would involve a lot of hacking. For example, to support M-;, I
need to implement my own comment function that checks if I am in a
maxima environment, and dispatch to comment-dwim accordingly (either
LaTeX-style % comments or Maxima-style /* */ comments). I would need to
do this for other functionality (font locking, indentation, etc) and it
would involve a lot of boilerplate code. So I am exploring other
solutions, and I came across Multiple Modes [1].

I notice that there are several implementations. Is there one which is
preferred for AUCTeX? Can someone please direct me to an example of
multiple modes in AUCTeX?

Best,

Tamas

[1] http://www.emacswiki.org/emacs/MultipleModes

_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex


_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex
_______________________________________________
auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/auctex

Reply via email to