From: Vladimir Zolotykh
Subject: *CommonSQL expression formatting
Date: 
Message-ID: <3C8B84D0.D6EF19C@eurocom.od.ua>
I'm learning (un)CommonSQL. Is it possible to have special SQL syntax expressions
formatted nicely in Emacs ? I mean instead of

(sql:select 'employee :where [and [= [slot-value 'employee 'companyid] 
            [slot-value 'company 'companyid]]
            [= [slot-value 'company 'name] 
            "Widgets Inc."]])

I'd like to have something like:

(sql:select 'employee :where [and [= [slot-value 'employee 'companyid] 
                                     [slot-value 'company 'companyid]]
                                  [= [slot-value 'company 'name] 
                                     "Widgets Inc."]])

Using ACL ELI.

-- 
Vladimir Zolotykh
From: Harald Hanche-Olsen
Subject: Re: *CommonSQL expression formatting
Date: 
Message-ID: <pcozo1gxbbh.fsf@thoth.math.ntnu.no>
+ Vladimir Zolotykh <······@eurocom.od.ua>:

| I'm learning (un)CommonSQL. Is it possible to have special SQL
| syntax expressions formatted nicely in Emacs ? I mean instead of
| 
| (sql:select 'employee :where [and [= [slot-value 'employee 'companyid] 
|             [slot-value 'company 'companyid]]
|             [= [slot-value 'company 'name] 
|             "Widgets Inc."]])
| 
| I'd like to have something like:
| 
| (sql:select 'employee :where [and [= [slot-value 'employee 'companyid] 
|                                      [slot-value 'company 'companyid]]
|                                   [= [slot-value 'company 'name] 
|                                      "Widgets Inc."]])

You could try something like this:

  (modify-syntax-entry ?\[ "(]")
  (modify-syntax-entry ?\] ")[")

| Using ACL ELI.

I have no idea if that makes a difference, but it works in emacs'
standard lisp mode, anyway.

-- 
* Harald Hanche-Olsen     <URL:http://www.math.ntnu.no/~hanche/>
- Yes it works in practice - but does it work in theory?