]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/progmodes/sql.el: `sql-postgres-statement-starters' defcustom
authorIngo Lohmar <ingo.lohmar@posteo.net>
Wed, 19 May 2021 13:02:33 +0000 (15:02 +0200)
committerIngo Lohmar <ingo.lohmar@posteo.net>
Wed, 19 May 2021 13:07:52 +0000 (15:07 +0200)
Recognize common table expression as statement start in Postgres.

lisp/progmodes/sql.el

index 83cb77ef78249edbdc4e5898080d9ac6318d26b7..2bfb222182d1c6d1c68fc566b4600945fe34360e 100644 (file)
@@ -484,6 +484,7 @@ file.  Since that is a plaintext file, this could be dangerous."
      :prompt-regexp "^[[:alnum:]_]*=[#>] "
      :prompt-length 5
      :prompt-cont-regexp "^[[:alnum:]_]*[-(][#>] "
+     :statement sql-postgres-statement-starters
      :input-filter sql-remove-tabs-filter
      :terminator ("\\(^\\s-*\\\\g\\|;\\)" . "\\g"))
 
@@ -1239,6 +1240,13 @@ add your name with a \"-U\" prefix (such as \"-Umark\") to the list."
             (push (match-string 1 row) res))))
       (nreverse res))))
 
+(defcustom sql-postgres-statement-starters
+  (regexp-opt '("with"))
+  "Additional statement-starting keywords in Postgres."
+  :type 'string
+  :group 'SQL
+  :version "28.1")
+
 ;; Customization for Interbase
 
 (defcustom sql-interbase-program "isql"