help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mode for a region?


From: Tim Johnson
Subject: Re: mode for a region?
Date: Sun, 27 Nov 2005 22:17:24 -0000
User-agent: slrn/0.9.8.0 (Linux)

On 2005-11-27, Drew Adams <drew.adams@oracle.com> wrote:
> Some languages provide for using expressions of another language within
> them. Some syntactic method is used to identify the other-language
> expression.
>
> For example, you might have a SQL expression that uses SQL function
> XMLQuery, which takes a (quoted) XQuery expression as an argument. SQL and
> XQuery are different languages, with radically different syntaxes. Another
> example would be Prolog expressions within Lisp (or vice versa). There are
> many languages that let you pass an expression to another language.

  Vim does this quite well with Javascript in HTML documents. I can
  check up on this, since I am moderately familiar with vim. In fact
  the <script> </script> syntax provides a delimiters which the editor
  
  The same could go for an asm construct in C.

> I'm wondering how Emacs modes might have already tried to deal with this (if
> they have).
>
> What I'm thinking of is something like this: The major mode (e.g. SQL mode)
> recognizes the existence of an expression in the other language (e.g.
> XQuery), and somehow allows for use of a "regional" mode that acts on that
> (e.g. XQuery) expression. "Act on" could be anything - simple font-lock
> highlighting, indentation, syntax-checking, type-checking, or even
> evaluation.
>
> Anyone know of an attempt to deal with mixing two languages, perhaps by
> having a local (region) sub-mode?
>
>
>


-- 
Tim Johnson <tim@johnsons-web.com>
      http://www.alaska-internet-solutions.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]