On Mon, 17 Mar 2003, [EMAIL PROTECTED] wrote:

> Jeremy Cowgar writes:
>> > XEmacs with MMM for Multiple Major Modes support works very nicely.
>> > It's a huge improvement over the stock Tcl mode in Gnu Emacs and
>> > XEmacs as well.  I didn't configure the one I'm using at work, so I
>> > can't really tell you how to do so, but googling for "mmm-mode" gets a
>> > lot of useful hits, e.g.:

There's some attribution lossage here, as well as some confusion over
the ATP's 'work' comment.  Anyway, since I did the xemacs
configuration, I guess I'll pipe in here...

mmm is available as an Xemacs package, or can be downloaded from 
mmm-mode.sourceforge.net

>> When you arrive at home (if/when) you have time, I would love to see your
>> configs. I have tried a few things out to make this work and so far am
>> failing.

Once you have mmm installed, you need to setup so that adp pages are handled.

adp files should have html-mode as their primary mode.
  (add-to-list 'auto-mode-alist '("\\.adp\\'" . html-mode))

Then you need mmm-mode setup so that mmm looks for all of the other stuff
that could be in adp pages.

  (setq mmm-global-mode 'maybe)
  (setq mmm-submode-decoration-level 2)

  (mmm-add-mode-ext-class 'html-mode "\\.adp\\'" 'html-tcl)
  (mmm-add-mode-ext-class 'html-mode "\\.adp\\'" 'html-js)
  (mmm-add-mode-ext-class 'html-mode "\\.adp\\'" 'embedded-css)


Then you need to make sure that html-tcl, html-js, and embedded-css
have been defined as mmm groups or classes.

Stuff between <style> ... </style> is css, and is available with mmm,
and is repeated here.

   (mmm-add-classes
    '((embedded-css
       :submode css
       :face mmm-declaration-submode-face
       :front "<style[^>]*>"
       :back "</style>")))

Stuff inside of <% .... >% is tcl.

   (mmm-add-group
    'html-tcl
    '((tcl-code
       :submode tcl
       :face mmm-code-submode-face
       :front "<%[!=]?"
       :back "%>")))

The standard html-js version looks for <script> ... </script> and handles javascript.

My html-js version looks for other languages, but probably requires
modifications that I've made to mmm-mode.


tcl mode is then setup so that anybody using the db_* functions
get sql-mode when writing the queries by doing the following:

  (mmm-add-mode-ext-class 'tcl-mode "www/.*\\.tcl\\'" 'ad-tcl-sql)

(mmm-add-group
 'ad-tcl-sql
 `((db-multirow
    :submode sql
    :face mmm-code-submode-face
    :front
       ,(concat "\\("
               (regexp-opt '("db_0or1row" "db_1row" "db_clob_get_file" 
"db_blob_get_file" "db_dml" "db_exec" "db_exec_plsql" "db_foreach" "db_list" 
"db_list_of_lists" "db_multirow" "db_string" "db_write_blob" "db_write_clob" "ns_ora" 
"orasql"))
             "\\)" ".*{")
    :back "}")
   (ad-page-contract
    :submode html
    :face mmm-code-submode-face
    :front "^\\(ad_page_contract\\).*{"
    :back "^}")
))

The above requires that db_foreach sql queries be written using {} and
not "".

-jeff


--
AOLserver - http://www.aolserver.com/
To Remove yourself from this list: http://www.aolserver.com/listserv.html
List information and options: http://listserv.aol.com/

Reply via email to