From dac694b8bb1e5a31a50215ceee6b064ae7c5001f Mon Sep 17 00:00:00 2001 From: Ingo Lohmar Date: Wed, 19 May 2021 15:02:33 +0200 Subject: [PATCH] * lisp/progmodes/sql.el: `sql-postgres-statement-starters' defcustom Recognize common table expression as statement start in Postgres. --- lisp/progmodes/sql.el | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 83cb77ef782..2bfb222182d 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -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" -- 2.39.5