branch: externals/sql-indent
commit a0635812887ae0a5fc8cd96fa1c76200d1073fe4
Author: Pierre Téchoueyres <[email protected]>
Commit: Alex Harsányi <[email protected]>

    Various minor improvements on left align SQL statments. (#22)
    
    * Various minor improvements on left align SQL statments.
    
    * Update pr17-io-left after updating sql-indent-left setup.
---
 sql-indent-left.el         | 11 +++++++----
 test-data/pr17-io-left.eld |  2 +-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/sql-indent-left.el b/sql-indent-left.el
index 78392f4..f430b27 100644
--- a/sql-indent-left.el
+++ b/sql-indent-left.el
@@ -166,9 +166,13 @@ select aaa,
     (delete-clause 0)
     (update-clause 0)
     (case-clause-item-cont 0)
+    (begin-block 0)
+    (case-clause +)
     (package +)
     (package-body +)
-    (nested-statement-continuation  +)
+    (nested-statement-continuation 1)
+    (string-continuation 0) ;; or shoult it be a begining of line or aligned 
with the previous block ?
+                            ;; Anyway. It's really *BAD* to continue a string 
accross lines.
     (select-column-continuation sqlind-indent-select-column
                                 sqlind-adjust-operator
                                 sqlind-lone-semicolon)
@@ -180,7 +184,7 @@ select aaa,
                       sqlind-adjust-operator
                      sqlind-left-justify-logical-operator
                       sqlind-lone-semicolon)
-    (in-insert-clause sqlind-lineup-to-clause-end
+    (in-insert-clause +
                       sqlind-adjust-operator
                      sqlind-left-justify-logical-operator
                       sqlind-lone-semicolon)
@@ -188,8 +192,7 @@ select aaa,
                       sqlind-adjust-operator
                      sqlind-left-justify-logical-operator
                       sqlind-lone-semicolon)
-    (select-table-continuation sqlind-indent-select-table +
-                               sqlind-lone-semicolon)
+    (select-table-continuation + sqlind-lone-semicolon)
     ;; rest picked up from the original indentation offsets
     ,@sqlind-default-indentation-offsets-alist)
   "Align sql code like this :
diff --git a/test-data/pr17-io-left.eld b/test-data/pr17-io-left.eld
index 75b166e..4942879 100644
--- a/test-data/pr17-io-left.eld
+++ b/test-data/pr17-io-left.eld
@@ -1 +1 @@
-(0 0 0 0 0 0 0 0 10 10 10 7 4 0 0 12 0 0 0 7 7 7 7 7 7 0 7 0 0 0 0 0 0 0 19 26 
19 19 19 19 19 19 0 0 0 0 0 8 0 0 0 0 0 7 0 0 7 0 0 0 0 12 14 14 0 7 7 7 7 7 7 
25 7 25 7 0 29 29 50 50 22 7 8 27 20 8 0 9 0 9 0 0 0 0 0)
+(0 0 0 0 0 0 0 0 10 10 10 7 4 0 0 12 0 0 0 7 7 7 7 7 7 0 7 0 0 0 0 0 0 0 19 26 
19 19 19 19 19 19 0 0 0 0 0 7 0 0 0 0 0 7 0 0 6 0 0 0 0 2 3 3 0 7 7 7 7 7 7 24 
7 24 7 0 29 29 49 49 22 7 2 21 14 2 0 9 0 9 0 0 0 0 0)

Reply via email to