branch: externals/sql-indent
commit 77af9f16f9f528c33a8c41054aee23f1e6fdfb9f
Author: Alex Harsanyi <[email protected]>
Commit: Alex Harsanyi <[email protected]>

    Renamed some indentation functions for consistency
    
    * `sqlind-adjust-and-or-left` renamed to
      `sqlind-left-justify-logical-operator`
    
    * `sqlind-adjust-and-or-right` renamed to
      `sqlind-right-justify-logical-operator`
---
 customize-indentation.md | 18 +++++++++---------
 sql-indent-left.el       | 16 ++++++++--------
 sql-indent.el            |  7 ++++---
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/customize-indentation.md b/customize-indentation.md
index 7b77b92..e19d1a6 100644
--- a/customize-indentation.md
+++ b/customize-indentation.md
@@ -128,17 +128,17 @@ The following functions are available as part of the 
package:
     and    cond2 = 2;
 ```
 
-* `sqlind-adjust-and-or-left` -- Align an AND, OR or NOT operator with
-the start of the WHERE clause.
-If this rule is added to the 'in-select-clause syntax after the
-`sqlind-lineup-to-clause-end' rule, it will adjust lines starting
-with AND, OR or NOT to be aligned so they sit left under the WHERE clause.
+* `sqlind-left-justify-logical-operator` -- Align an AND, OR or NOT operator
+  with the start of the WHERE clause.  If this rule is added to the
+  'in-select-clause syntax after the `sqlind-lineup-to-clause-end' rule, it
+  will adjust lines starting with AND, OR or NOT to be aligned so they sit
+  left under the WHERE clause.
 
-* `sqlind-adjust-and-or-right` -- Align an AND, OR or NOT operator
+* `sqlind-right-justify-logical-operator` -- Align an AND, OR or NOT operator
   with the end of the WHERE clause. If this rule is added to the
-  'in-select-clause syntax after the `sqlind-lineup-to-clause-end' rule,
-  it will adjust lines starting with AND, OR or NOT to be aligned so
-  they sit under the WHERE clause.
+  'in-select-clause syntax after the `sqlind-lineup-to-clause-end' rule, it
+  will adjust lines starting with AND, OR or NOT to be aligned so they sit
+  under the WHERE clause.
 
 * `sqlind-adjust-comma` -- if the line starts with a comma, adjust the current
   offset so that the line is indented to the first word character.  For
diff --git a/sql-indent-left.el b/sql-indent-left.el
index dccec7c..78392f4 100755
--- a/sql-indent-left.el
+++ b/sql-indent-left.el
@@ -59,19 +59,19 @@
                                 sqlind-lone-semicolon)
     (in-select-clause sqlind-lineup-to-clause-end
                       sqlind-adjust-operator
-                     sqlind-adjust-and-or-right
+                     sqlind-right-justify-logical-operator
                      sqlind-lone-semicolon)
     (in-delete-clause sqlind-lineup-to-clause-end
                       sqlind-adjust-operator
-                     sqlind-adjust-and-or-right
+                     sqlind-right-justify-logical-operator
                      sqlind-lone-semicolon)
     (in-insert-clause sqlind-lineup-to-clause-end
                       sqlind-adjust-operator
-                     sqlind-adjust-and-or-right
+                     sqlind-right-justify-logical-operator
                      sqlind-lone-semicolon)
     (in-update-clause sqlind-lineup-to-clause-end
                       sqlind-adjust-operator
-                     sqlind-adjust-and-or-right
+                     sqlind-right-justify-logical-operator
                      sqlind-lone-semicolon)
     ;; mandatory 
     (select-table-continuation sqlind-indent-select-table +
@@ -174,19 +174,19 @@ select aaa,
                                 sqlind-lone-semicolon)
     (in-select-clause sqlind-lineup-to-clause-end
                       sqlind-adjust-operator
-                     sqlind-adjust-and-or-left
+                     sqlind-left-justify-logical-operator
                       sqlind-lone-semicolon)
     (in-delete-clause sqlind-lineup-to-clause-end
                       sqlind-adjust-operator
-                     sqlind-adjust-and-or-left
+                     sqlind-left-justify-logical-operator
                       sqlind-lone-semicolon)
     (in-insert-clause sqlind-lineup-to-clause-end
                       sqlind-adjust-operator
-                     sqlind-adjust-and-or-left
+                     sqlind-left-justify-logical-operator
                       sqlind-lone-semicolon)
     (in-update-clause sqlind-lineup-to-clause-end
                       sqlind-adjust-operator
-                     sqlind-adjust-and-or-left
+                     sqlind-left-justify-logical-operator
                       sqlind-lone-semicolon)
     (select-table-continuation sqlind-indent-select-table +
                                sqlind-lone-semicolon)
diff --git a/sql-indent.el b/sql-indent.el
index 91b1f4a..b4ecf72 100644
--- a/sql-indent.el
+++ b/sql-indent.el
@@ -1443,7 +1443,8 @@ clause (select, from, where, etc) in which the current 
point is.
     (select-join-condition          ++)
     (select-table                   sqlind-indent-select-table)
     (select-table-continuation      sqlind-indent-select-table +)
-    (in-select-clause               sqlind-lineup-to-clause-end 
sqlind-adjust-and-or-right)
+    (in-select-clause               sqlind-lineup-to-clause-end
+                                    sqlind-right-justify-logical-operator)
     (insert-clause                  sqlind-right-justify-clause)
     (in-insert-clause               sqlind-lineup-to-clause-end)
     (delete-clause                  sqlind-right-justify-clause)
@@ -1702,7 +1703,7 @@ keyword ends."
         ;; otherwise, align to the end of the clause, with a few exceptions
         (current-column)))))
 
-(defun sqlind-adjust-and-or-right (syntax base-indentation)
+(defun sqlind-right-justify-logical-operator (syntax base-indentation)
   "Align an AND, OR or NOT operator with the end of the WHERE clause.
 If this rule is added to the 'in-select-clause syntax after the
 `sqlind-lineup-to-clause-end' rule, it will adjust lines starting
@@ -1715,7 +1716,7 @@ with AND, OR or NOT to be aligned so they sit under the 
WHERE clause."
           (- base-indentation (1+ (- (match-end 0) (match-beginning 0))))
         base-indentation))))
 
-(defun sqlind-adjust-and-or-left (syntax base-indentation)
+(defun sqlind-left-justify-logical-operator (syntax base-indentation)
   "Align an AND, OR or NOT operator with the start of the WHERE clause.
 If this rule is added to the 'in-select-clause syntax after the
 `sqlind-lineup-to-clause-end' rule, it will adjust lines starting

Reply via email to