diff options
| author | Michael Mauger | 2010-08-07 19:57:07 -0400 |
|---|---|---|
| committer | Michael Mauger | 2010-08-07 19:57:07 -0400 |
| commit | b93d4f22cbb28c4efbb65fa4927e8b42b41ba00f (patch) | |
| tree | 37192fadc264f2caeea633d117cdc305e131cccf /lisp/progmodes/sql.el | |
| parent | 746812d9da7e6e2437fcac311d18641748942213 (diff) | |
| download | emacs-b93d4f22cbb28c4efbb65fa4927e8b42b41ba00f.tar.gz emacs-b93d4f22cbb28c4efbb65fa4927e8b42b41ba00f.zip | |
* progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
SQLite 3 keywords, functions and datatypes.
(sql-interactive-mode): Removed `comint-process-echoes' set to t
(Bug#6686).
Diffstat (limited to 'lisp/progmodes/sql.el')
| -rw-r--r-- | lisp/progmodes/sql.el | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index afadcb973d0..ff75d46ff13 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el | |||
| @@ -1961,7 +1961,51 @@ regular expressions are created during compilation by calling the | |||
| 1961 | function `regexp-opt'. Therefore, take a look at the source before | 1961 | function `regexp-opt'. Therefore, take a look at the source before |
| 1962 | you define your own `sql-mode-mysql-font-lock-keywords'.") | 1962 | you define your own `sql-mode-mysql-font-lock-keywords'.") |
| 1963 | 1963 | ||
| 1964 | (defvar sql-mode-sqlite-font-lock-keywords nil | 1964 | (defvar sql-mode-sqlite-font-lock-keywords |
| 1965 | (eval-when-compile | ||
| 1966 | (list | ||
| 1967 | ;; SQLite Keyword | ||
| 1968 | (sql-font-lock-keywords-builder 'font-lock-keyword-face nil | ||
| 1969 | "abort" "action" "add" "after" "all" "alter" "analyze" "and" "as" | ||
| 1970 | "asc" "attach" "autoincrement" "before" "begin" "between" "by" | ||
| 1971 | "cascade" "case" "cast" "check" "collate" "column" "commit" "conflict" | ||
| 1972 | "constraint" "create" "cross" "current_date" "current_time" | ||
| 1973 | "current_timestamp" "database" "default" "deferrable" "deferred" | ||
| 1974 | "delete" "desc" "detach" "distinct" "drop" "each" "else" "end" | ||
| 1975 | "escape" "except" "exclusive" "exists" "explain" "fail" "for" | ||
| 1976 | "foreign" "from" "full" "glob" "group" "having" "if" "ignore" | ||
| 1977 | "immediate" "in" "index" "indexed" "initially" "inner" "insert" | ||
| 1978 | "instead" "intersect" "into" "is" "isnull" "join" "key" "left" "like" | ||
| 1979 | "limit" "match" "natural" "no" "not" "notnull" "null" "of" "offset" | ||
| 1980 | "on" "or" "order" "outer" "plan" "pragma" "primary" "query" "raise" | ||
| 1981 | "references" "regexp" "reindex" "release" "rename" "replace" | ||
| 1982 | "restrict" "right" "rollback" "row" "savepoint" "select" "set" "table" | ||
| 1983 | "temp" "temporary" "then" "to" "transaction" "trigger" "union" | ||
| 1984 | "unique" "update" "using" "vacuum" "values" "view" "virtual" "when" | ||
| 1985 | "where" | ||
| 1986 | ) | ||
| 1987 | ;; SQLite Data types | ||
| 1988 | (sql-font-lock-keywords-builder 'font-lock-type-face nil | ||
| 1989 | "int" "integer" "tinyint" "smallint" "mediumint" "bigint" "unsigned" | ||
| 1990 | "big" "int2" "int8" "character" "varchar" "varying" "nchar" "native " | ||
| 1991 | "nvarchar" "text" "clob" "blob" "real" "double" "precision" "float" | ||
| 1992 | "numeric" "decimal" "boolean" "date" "datetime" | ||
| 1993 | ) | ||
| 1994 | ;; SQLite Functions | ||
| 1995 | (sql-font-lock-keywords-builder 'font-lock-builtin-face nil | ||
| 1996 | ;; Core functions | ||
| 1997 | "abs" "changes" "coalesce" "glob" "ifnull" "hex" "last_insert_rowid" | ||
| 1998 | "length" "like" "load_extension" "lower" "ltrim" "max" "min" "nullif" | ||
| 1999 | "quote" "random" "randomblob" "replace" "round" "rtrim" "soundex" | ||
| 2000 | "sqlite_compileoption_get" "sqlite_compileoption_used" | ||
| 2001 | "sqlite_source_id" "sqlite_version" "substr" "total_changes" "trim" | ||
| 2002 | "typeof" "upper" "zeroblob" | ||
| 2003 | ;; Date/time functions | ||
| 2004 | "time" "julianday" "strftime" | ||
| 2005 | ;; Aggregate functions | ||
| 2006 | "avg" "count" "group_concat" "max" "min" "sum" "total" | ||
| 2007 | ))) | ||
| 2008 | |||
| 1965 | "SQLite SQL keywords used by font-lock. | 2009 | "SQLite SQL keywords used by font-lock. |
| 1966 | 2010 | ||
| 1967 | This variable is used by `sql-mode' and `sql-interactive-mode'. The | 2011 | This variable is used by `sql-mode' and `sql-interactive-mode'. The |
| @@ -2951,7 +2995,6 @@ you entered, right above the output it created. | |||
| 2951 | (sql-get-product-feature sql-product :prompt-length)) | 2995 | (sql-get-product-feature sql-product :prompt-length)) |
| 2952 | (make-local-variable 'sql-input-ring-separator) | 2996 | (make-local-variable 'sql-input-ring-separator) |
| 2953 | (make-local-variable 'sql-input-ring-file-name) | 2997 | (make-local-variable 'sql-input-ring-file-name) |
| 2954 | (setq comint-process-echoes t) | ||
| 2955 | ;; Run the mode hook (along with comint's hooks). | 2998 | ;; Run the mode hook (along with comint's hooks). |
| 2956 | (run-mode-hooks 'sql-interactive-mode-hook) | 2999 | (run-mode-hooks 'sql-interactive-mode-hook) |
| 2957 | ;; Set comint based on user overrides. | 3000 | ;; Set comint based on user overrides. |