On Wednesday 24 March 2004 05:36 pm, Angus Lees wrote:
> At Tue, 23 Mar 2004 21:56:31 -1000, Beau E. Cox wrote:
> > I am up and running with Embperl, but want to set my emacs
> > (gnu-emacs 21.3) for proper editing.
> >
> > I downloaded and installed the 'mmm' package (0.4.7) as per
> > the directions on the Embperl site.
>
> The instructions there are for a much older version of mmm.  The
> embperl "class" is now included by default and configuration has
> changed completely.
>
> You're better off reading the (quite extensive) mmm-mode info
> documentation.
>
> > Does anyone have the 'mmm' perl/embperl systax system
> > in gnu emacs? If so, could you shre your setup with me?
>
> I use ".epl" and ".html" for my Embperl files, and I prefer using
> html-helper-mode rather than html-mode (a psgml derivative) but the
> following should work with both.  The following is copied from my
> ~/.xemacs/init.el and tweaking should be obvious from the relevant
> variable's documentation:
>
>  (require 'mmm-mode)
>
>  ;; make Embperl files load in html-helper-mode
>  (add-to-list 'auto-mode-alist '("\\.epl\\'" . html-helper-mode))
>
>  ;; enable mmm subclass if major mode and filename match
>  (mmm-add-mode-ext-class 'html-mode "\\.(epl\\|html)\\'" 'embperl)
>  (mmm-add-mode-ext-class 'html-helper-mode "\\.(epl\\|html)\\'" 'embperl)
>
>  (setq mmm-global-mode 'maybe)

Thank you, Gus.

With your info and some trial and error, I was successful.
Here is the result:

;; --------------- MMM FOR EMBPERL -------------------

;; I am using GNU emacs 21.3 on Sorcerer Linux (current) with
;; current GNU tools. This is the way I got mmm mode working:

;; 1) DOWNLOAD MMM

;; Download 'mmm-mode-0.4.7.tar.gz' from
;; http://prdownloads.sourceforge.net/mmm-mode/mmm-mode-0.4.7.tar.gz?download

;; 2) INSTALL MMM

;; Read the README and INSTALL files; ./configure, make, and
;; make install. Sheck to be sure the mmm-<whatever>.el/.elc files
;; end up in your site-lisp directory for your emacs installiation
;; (normally '<emacs-install-prefix>/share/emacs/site-lisp').
;; if not goto 2.

;; 3) INFO MMM

;; if you installed mmm correctly, you may 'info mmm' at this point
;; to read about mmm.

;; 4) STARTUP FILE(S)

;; Add the following (or some subset of it) to your '~/.emacs'
;; (for your login only) or the
;; '<emacs-install-prefix>/share/emacs/site-lisp/site-start.el' file
;; (for everyone).

;; needed for all mmm usage
(require 'mmm-vars)

;; needed for mmm automatic mode
(require 'mmm-auto)

;; needed for Embperl
(require 'mmm-sample)

;; needed for Mason
(require 'mmm-mason)

;; now we setup mmm to automatically appear - if it is called for
(setq mmm-global-mode 'maybe)

;; I don't like background colors in my perl sections, so '0' turns
;; off all background fiddling. Up to you. See 'info mmm'.
(setq mmm-submode-decoration-level 0)

;; mmm sets perl sections to use cperl-mode by default. I perfer
;; plain perl-mode, so I include the following. Up to you.
(mmm-add-to-major-mode-preferences 'perl 'perl-mode t)

;; Here force any oddball extensions used by Embperl to html
;; I use ".epl".
(setq auto-mode-alist
  (append 
   ;; File name ends in '.epl'.
   '(
     ("\\.epl\\'" . html-mode))
   auto-mode-alist))

;; If you want automatic Embperl mmm mode for certain files
;; (you can select with a regex on name/extension or directory -
;; see 'info mmm'), include lines similar to the following:

;;(mmm-add-mode-ext-class nil "\\.epl\\'" 'embperl)
;;(mmm-add-mode-ext-class nil "\\.html\\'" 'embperl)

;; if you use the above lines, no 'mode' line is required in the
;; source file.

;; 5) SOURCE FILE MODE LINE

;; Since I use both Embperl and Mason, I use a mode line in my
;; source files; it must be the first line of the file and be
;; a 'comment' for the using application.

;; For Embperl:

;; [# -*- mode: html; mmm-classes: embperl; -*- #]

;; For Mason:

;; %# -*- mode: html; mmm-classes: mason; -*-

;; 6) PROBLEMS

;; Single-line perl constructs, i.e.: [+ $some_var +] sometimes do not
;; colorize correctly. Maybe one of you can figure this
;; one out - I couldn't.
;;
;; It has been reported that the 21.3 'font-lock.el' breaks mmm. I
;; did not find that to be the case; all of the above works with the
;; 21.3 font-lock.el. (Is this the colorize problem?)

;; 7) AUTHOR

;; Beau E. Cox
;; March 2004
;; <[EMAIL PROTECTED]>



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to