annotate lisp/progmodes/sql.el @ 98004:cb25381fabcc

(dired-get-filename): Rewrite octal escape character processor (bug#885).
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 05 Sep 2008 21:16:19 +0000
parents c3309dba6542
children a9dc0e7c3f2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; sql.el --- specialized comint.el for SQL interpreters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2
79717
a1342e6e097a Add 2008 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 78234
diff changeset
3 ;; Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
64699
629afbe74e61 Update copyright for release of 22.1 for progmodes directory.
Nick Roberts <nickrob@snap.net.nz>
parents: 64085
diff changeset
4 ;; Free Software Foundation, Inc.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
5
25381
970b18c6803f (sql-sybase): use sql-server instead of sql-database.
Alex Schroeder <alex@gnu.org>
parents: 25183
diff changeset
6 ;; Author: Alex Schroeder <alex@gnu.org>
52482
702be51912a8 Change maintainer.
Richard M. Stallman <rms@gnu.org>
parents: 52401
diff changeset
7 ;; Maintainer: Michael Mauger <mmaug@yahoo.com>
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
8 ;; Version: 2.0.2
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
9 ;; Keywords: comm languages processes
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
10 ;; URL: http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el
38872
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
11 ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; This file is part of GNU Emacs.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14
94673
52b7a8c22af5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
15 ;; GNU Emacs is free software: you can redistribute it and/or modify
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; it under the terms of the GNU General Public License as published by
94673
52b7a8c22af5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
17 ;; the Free Software Foundation, either version 3 of the License, or
52b7a8c22af5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
18 ;; (at your option) any later version.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; GNU Emacs is distributed in the hope that it will be useful,
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; GNU General Public License for more details.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;; You should have received a copy of the GNU General Public License
94673
52b7a8c22af5 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
26 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
27
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
28 ;;; Commentary:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
29
24354
6a438ef0b573 Set version to 1.4.1. Changed mail address to
Richard M. Stallman <rms@gnu.org>
parents: 24353
diff changeset
30 ;; Please send bug reports and bug fixes to the mailing list at
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
31 ;; help-gnu-emacs@gnu.org. If you want to subscribe to the mailing
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
32 ;; list, see the web page at
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
33 ;; http://lists.gnu.org/mailman/listinfo/help-gnu-emacs for
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
34 ;; instructions. I monitor this list actively. If you send an e-mail
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
35 ;; to Alex Schroeder it usually makes it to me when Alex has a chance
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
36 ;; to forward them along (Thanks, Alex).
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
37
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
38 ;; This file provides a sql-mode and a sql-interactive-mode. The
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
39 ;; original goals were two simple modes providing syntactic
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
40 ;; highlighting. The interactive mode had to provide a command-line
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
41 ;; history; the other mode had to provide "send region/buffer to SQL
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
42 ;; interpreter" functions. "simple" in this context means easy to
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
43 ;; use, easy to maintain and little or no bells and whistles. This
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
44 ;; has changed somewhat as experience with the mode has accumulated.
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
45
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
46 ;; Support for different flavors of SQL and command interpreters was
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
47 ;; available in early versions of sql.el. This support has been
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
48 ;; extended and formalized in later versions. Part of the impetus for
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
49 ;; the improved support of SQL flavors was borne out of the current
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
50 ;; maintainer's consulting experience. In the past fifteen years, I
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
51 ;; have used Oracle, Sybase, Informix, MySQL, Postgres, and SQLServer.
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
52 ;; On some assignments, I have used two or more of these concurrently.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;; If anybody feels like extending this sql mode, take a look at the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 ;; above mentioned modes and write a sqlx-mode on top of this one. If
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 ;; this proves to be difficult, please suggest changes that will
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
57 ;; facilitate your plans. Facilities have been provided to add
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
58 ;; products and product-specific configuration.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 ;; sql-interactive-mode is used to interact with a SQL interpreter
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
61 ;; process in a SQLi buffer (usually called `*SQL*'). The SQLi buffer
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
62 ;; is created by calling a SQL interpreter-specific entry function or
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
63 ;; sql-product-interactive. Do *not* call sql-interactive-mode by
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
64 ;; itself.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 ;; The list of currently supported interpreters and the corresponding
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
67 ;; entry function used to create the SQLi buffers is shown with
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ;; `sql-help' (M-x sql-help).
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ;; Since sql-interactive-mode is built on top of the general
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 ;; command-interpreter-in-a-buffer mode (comint mode), it shares a
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 ;; common base functionality, and a common set of bindings, with all
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ;; modes derived from comint mode. This makes these modes easier to
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 ;; use.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75
31392
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
76 ;; sql-mode can be used to keep editing SQL statements. The SQL
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
77 ;; statements can be sent to the SQL process in the SQLi buffer.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 ;; For documentation on the functionality provided by comint mode, and
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
80 ;; the hooks available for customizing it, see the file `comint.el'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
82 ;; Hint for newbies: take a look at `dabbrev-expand', `abbrev-mode', and
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
83 ;; `imenu-add-menubar-index'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 ;;; Requirements for Emacs 19.34:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 ;; If you are using Emacs 19.34, you will have to get and install
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 ;; the file regexp-opt.el
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 ;; <URL:ftp://ftp.ifi.uio.no/pub/emacs/emacs-20.3/lisp/emacs-lisp/regexp-opt.el>
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 ;; and the custom package
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 ;; <URL:http://www.dina.kvl.dk/~abraham/custom/>.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 ;;; Bugs:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
95 ;; sql-ms now uses osql instead of isql. Osql flushes its error
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
96 ;; stream more frequently than isql so that error messages are
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
97 ;; available. There is no prompt and some output still is buffered.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
98 ;; This improves the interaction under Emacs but it still is somewhat
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
99 ;; awkward.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
100
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
101 ;; Quoted identifiers are not supported for hilighting. Most
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
102 ;; databases support the use of double quoted strings in place of
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
103 ;; identifiers; ms (Microsoft SQLServer) also supports identifiers
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
104 ;; enclosed within brackets [].
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
106 ;; ChangeLog available on request.
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
107
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
108 ;;; Product Support:
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
109
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
110 ;; To add support for additional SQL products the following steps
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
111 ;; must be followed ("xyz" is the name of the product in the examples
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
112 ;; below):
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
113
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
114 ;; 1) Add the product to `sql-product' choice list.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
115
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
116 ;; (const :tag "XyzDB" xyz)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
117
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
118 ;; 2) Add an entry to the `sql-product-alist' list.
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
119
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
120 ;; (xyz
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
121 ;; :font-lock sql-mode-xyz-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
122 ;; :sqli-login (user password server database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
123 ;; :sqli-connect sql-connect-xyz
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
124 ;; :sqli-prompt-regexp "^xyzdb> "
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
125 ;; :sqli-prompt-length 7
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
126 ;; :sqli-input-sender nil
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
127 ;; :syntax-alist ((?# . "w")))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
128
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
129 ;; 3) Add customizable values for the product interpreter and options.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
130
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
131 ;; ;; Customization for XyzDB
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
132 ;;
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
133 ;; (defcustom sql-xyz-program "ixyz"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
134 ;; "*Command to start ixyz by XyzDB."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
135 ;; :type 'file
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
136 ;; :group 'SQL)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
137 ;;
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
138 ;; (defcustom sql-xyz-options '("-X" "-Y" "-Z")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
139 ;; "*List of additional options for `sql-xyz-program'."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
140 ;; :type '(repeat string)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
141 ;; :group 'SQL)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
142
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
143 ;; 4) Add an entry to SQL->Product submenu.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
144
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
145 ;; ["XyzDB" sql-highlight-xyz-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
146 ;; :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
147 ;; :selected (eq sql-product 'xyz)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
148
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
149 ;; 5) Add the font-lock specifications. At a minimum, default to
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
150 ;; using ANSI keywords. See sql-mode-oracle-font-lock-keywords for
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
151 ;; a more complex example.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
152
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
153 ;; (defvar sql-mode-xyz-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
154 ;; "XyzDB SQL keywords used by font-lock.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
155
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
156 ;; 6) Add a product highlighting function.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
157
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
158 ;; (defun sql-highlight-xyz-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
159 ;; "Highlight XyzDB keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
160 ;; (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
161 ;; (sql-set-product 'xyz))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
162
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
163 ;; 7) Add an autoloaded SQLi function.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
164
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
165 ;; ;;;###autoload
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
166 ;; (defun sql-xyz ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
167 ;; "Run ixyz by XyzDB as an inferior process."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
168 ;; (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
169 ;; (sql-product-interactive 'xyz))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
170
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
171 ;; 8) Add a connect function which formats the command line arguments
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
172 ;; and starts the product interpreter in a comint buffer. See the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
173 ;; existing connect functions for examples of the types of
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
174 ;; processing available.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
175
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
176 ;; (defun sql-connect-xyz ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
177 ;; "Create comint buffer and connect to XyzDB using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
178 ;; parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
179 ;;
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
180 ;; ;; Do something with `sql-user', `sql-password',
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
181 ;; ;; `sql-database', and `sql-server'.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
182 ;; (let ((params sql-xyz-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
183 ;; (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
184 ;; (setq params (append (list "-S" sql-server) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
185 ;; (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
186 ;; (setq params (append (list "-D" sql-database) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
187 ;; (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
188 ;; (setq params (append (list "-P" sql-password) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
189 ;; (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
190 ;; (setq params (append (list "-U" sql-user) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
191 ;; (set-buffer (apply 'make-comint "SQL" sql-xyz-program
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
192 ;; nil params))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
193
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
194 ;; 9) Save and compile sql.el.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
195
51929
3da2cf447bf9 Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents: 51893
diff changeset
196 ;;; To Do:
51893
1a294cfb1636 Version 1.8.0 of sql-mode.
Juanma Barranquero <lekktu@gmail.com>
parents: 51607
diff changeset
197
51929
3da2cf447bf9 Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents: 51893
diff changeset
198 ;; Add better hilight support for other brands; there is a bias towards
3da2cf447bf9 Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents: 51893
diff changeset
199 ;; Oracle because that's what I use at work. Anybody else just send in
3da2cf447bf9 Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents: 51893
diff changeset
200 ;; your lists of reserved words, keywords and builtin functions! As
3da2cf447bf9 Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents: 51893
diff changeset
201 ;; long as I don't receive any feedback, everything is hilighted with
3da2cf447bf9 Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents: 51893
diff changeset
202 ;; ANSI keywords only. I received the list of ANSI keywords from a
3da2cf447bf9 Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents: 51893
diff changeset
203 ;; user; if you know of any changes, let me know.
51893
1a294cfb1636 Version 1.8.0 of sql-mode.
Juanma Barranquero <lekktu@gmail.com>
parents: 51607
diff changeset
204
51929
3da2cf447bf9 Revert last change.
Juanma Barranquero <lekktu@gmail.com>
parents: 51893
diff changeset
205 ;; Add different hilighting levels.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
206
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
207 ;;; Thanks to all the people who helped me out:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
208
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
209 ;; Alex Schroeder <alex@gnu.org>
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
210 ;; Kai Blauberg <kai.blauberg@metla.fi>
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
211 ;; <ibalaban@dalet.com>
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
212 ;; Yair Friedman <yfriedma@JohnBryce.Co.Il>
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 ;; Gregor Zych <zych@pool.informatik.rwth-aachen.de>
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
214 ;; nino <nino@inform.dk>
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
215 ;; Berend de Boer <berend@pobox.com>
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
216 ;; Adam Jenkins <adam@thejenkins.org>
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
217 ;; Michael Mauger <mmaug@yahoo.com> -- improved product support
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
218 ;; Drew Adams <drew.adams@oracle.com> -- Emacs 20 support
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
219 ;; Harald Maier <maierh@myself.com> -- sql-send-string
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
220 ;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
221
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
222
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
223
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
224 ;;; Code:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
225
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
226 (require 'comint)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
227 ;; Need the following to allow GNU Emacs 19 to compile the file.
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
228 (eval-when-compile
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
229 (require 'regexp-opt))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
230 (require 'custom)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
231 (eval-when-compile ;; needed in Emacs 19, 20
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
232 (setq max-specpdl-size 2000))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
233
65240
e3995ff46137 (font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Juanma Barranquero <lekktu@gmail.com>
parents: 65198
diff changeset
234 (defvar font-lock-keyword-face)
e3995ff46137 (font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Juanma Barranquero <lekktu@gmail.com>
parents: 65198
diff changeset
235 (defvar font-lock-set-defaults)
e3995ff46137 (font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Juanma Barranquero <lekktu@gmail.com>
parents: 65198
diff changeset
236 (defvar font-lock-string-face)
e3995ff46137 (font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Juanma Barranquero <lekktu@gmail.com>
parents: 65198
diff changeset
237
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
238 ;;; Allow customization
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
239
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
240 (defgroup SQL nil
64052
68f51d595f7f (SQL): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 63410
diff changeset
241 "Running a SQL interpreter from within Emacs buffers."
24556
cfdf441b1331 Add defgroup :version.
Dave Love <fx@gnu.org>
parents: 24354
diff changeset
242 :version "20.4"
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 :group 'processes)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
245 ;; These four variables will be used as defaults, if set.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
246
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
247 (defcustom sql-user ""
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
248 "*Default username."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
249 :type 'string
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 (defcustom sql-password ""
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
253 "*Default password.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 Storing your password in a textfile such as ~/.emacs could be dangerous.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
256 Customizing your password will store it in your ~/.emacs file."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
257 :type 'string
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
258 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
259
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
260 (defcustom sql-database ""
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
261 "*Default database."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
262 :type 'string
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
263 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
264
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
265 (defcustom sql-server ""
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
266 "*Default server or host."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
267 :type 'string
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
268 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
269
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
270 ;; SQL Product support
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
271 (defcustom sql-product 'ansi
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
272 "*Select the SQL database product used so that buffers can be
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
273 highlighted properly when you open them."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
274 :type '(choice (const :tag "ANSI" ansi)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
275 (const :tag "DB2" db2)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
276 (const :tag "Informix" informix)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
277 (const :tag "Ingres" ingres)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
278 (const :tag "Interbase" interbase)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
279 (const :tag "Linter" linter)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
280 (const :tag "Microsoft" ms)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
281 (const :tag "MySQL" mysql)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
282 (const :tag "Oracle" oracle)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
283 (const :tag "PostGres" postgres)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
284 (const :tag "Solid" solid)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
285 (const :tag "SQLite" sqlite)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
286 (const :tag "Sybase" sybase))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
287 :group 'SQL)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
288
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
289 (defvar sql-interactive-product nil
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
290 "Product under `sql-interactive-mode'.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
291
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
292 (defvar sql-product-alist
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
293 '((ansi
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
294 :font-lock sql-mode-ansi-font-lock-keywords)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
295 (db2
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
296 :font-lock sql-mode-db2-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
297 :sqli-login nil
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
298 :sqli-connect sql-connect-db2
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
299 :sqli-prompt-regexp "^db2 => "
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
300 :sqli-prompt-length 7)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
301 (informix
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
302 :font-lock sql-mode-informix-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
303 :sqli-login (database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
304 :sqli-connect sql-connect-informix
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
305 :sqli-prompt-regexp "^SQL> "
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
306 :sqli-prompt-length 5)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
307 (ingres
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
308 :font-lock sql-mode-ingres-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
309 :sqli-login (database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
310 :sqli-connect sql-connect-ingres
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
311 :sqli-prompt-regexp "^\* "
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
312 :sqli-prompt-length 2)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
313 (interbase
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
314 :font-lock sql-mode-interbase-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
315 :sqli-login (user password database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
316 :sqli-connect sql-connect-interbase
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
317 :sqli-prompt-regexp "^SQL> "
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
318 :sqli-prompt-length 5)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
319 (linter
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
320 :font-lock sql-mode-linter-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
321 :sqli-login (user password database server)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
322 :sqli-connect sql-connect-linter
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
323 :sqli-prompt-regexp "^SQL>"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
324 :sqli-prompt-length 4)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
325 (ms
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
326 :font-lock sql-mode-ms-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
327 :sqli-login (user password server database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
328 :sqli-connect sql-connect-ms
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
329 :sqli-prompt-regexp "^[0-9]*>"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
330 :sqli-prompt-length 5
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
331 :syntax-alist ((?@ . "w")))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
332 (mysql
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
333 :font-lock sql-mode-mysql-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
334 :sqli-login (user password database server)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
335 :sqli-connect sql-connect-mysql
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
336 :sqli-prompt-regexp "^mysql> "
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
337 :sqli-prompt-length 6)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
338 (oracle
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
339 :font-lock sql-mode-oracle-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
340 :sqli-login (user password database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
341 :sqli-connect sql-connect-oracle
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
342 :sqli-prompt-regexp "^SQL> "
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
343 :sqli-prompt-length 5
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
344 :syntax-alist ((?$ . "w") (?# . "w")))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
345 (postgres
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
346 :font-lock sql-mode-postgres-font-lock-keywords
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
347 :sqli-login (user database server)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
348 :sqli-connect sql-connect-postgres
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
349 :sqli-prompt-regexp "^.*[#>] *"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
350 :sqli-prompt-length 5)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
351 (solid
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
352 :font-lock sql-mode-solid-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
353 :sqli-login (user password server)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
354 :sqli-connect sql-connect-solid
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
355 :sqli-prompt-regexp "^"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
356 :sqli-prompt-length 0)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
357 (sqlite
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
358 :font-lock sql-mode-sqlite-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
359 :sqli-login (user password server database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
360 :sqli-connect sql-connect-sqlite
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
361 :sqli-prompt-regexp "^sqlite> "
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
362 :sqli-prompt-length 8)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
363 (sybase
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
364 :font-lock sql-mode-sybase-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
365 :sqli-login (server user password database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
366 :sqli-connect sql-connect-sybase
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
367 :sqli-prompt-regexp "^SQL> "
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
368 :sqli-prompt-length 5
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
369 :syntax-alist ((?@ . "w")))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
370 )
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
371 "This variable contains a list of product features for each of the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
372 SQL products handled by `sql-mode'. Without an entry in this list a
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
373 product will not be properly highlighted and will not support
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
374 `sql-interactive-mode'.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
375
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
376 Each element in the list is in the following format:
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
377
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
378 \(PRODUCT FEATURE VALUE ...)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
379
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
380 where PRODUCT is the appropriate value of `sql-product'. The product
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
381 name is then followed by FEATURE-VALUE pairs. If a FEATURE is not
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
382 specified, its VALUE is treated as nil. FEATURE must be one of the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
383 following:
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
384
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
385 :font-lock name of the variable containing the product
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
386 specific font lock highlighting patterns.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
387
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
388 :sqli-login a list of login parameters (i.e., user,
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
389 password, database and server) needed to
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
390 connect to the database.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
391
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
392 :sqli-connect the name of a function which accepts no
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
393 parameters that will use the values of
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
394 `sql-user', `sql-password',
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
395 `sql-database' and `sql-server' to open a
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
396 comint buffer and connect to the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
397 database. Do product specific
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
398 configuration of comint in this function.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
399
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
400 :sqli-prompt-regexp a regular expression string that matches
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
401 the prompt issued by the product
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
402 interpreter. (Not needed in 21.3+)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
403
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
404 :sqli-prompt-length the length of the prompt on the line.(Not
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
405 needed in 21.3+)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
406
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
407 :syntax-alist an alist of syntax table entries to enable
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
408 special character treatment by font-lock and
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
409 imenu. ")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
410
96376
c3309dba6542 American English spelling fix.
Glenn Morris <rgm@gnu.org>
parents: 94673
diff changeset
411 ;; misc customization of sql.el behavior
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
412
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
413 (defcustom sql-electric-stuff nil
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
414 "Treat some input as electric.
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
415 If set to the symbol `semicolon', then hitting `;' will send current
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
416 input in the SQLi buffer to the process.
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
417 If set to the symbol `go', then hitting `go' on a line by itself will
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
418 send current input in the SQLi buffer to the process.
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
419 If set to nil, then you must use \\[comint-send-input] in order to send
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
420 current input in the SQLi buffer to the process."
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
421 :type '(choice (const :tag "Nothing" nil)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
422 (const :tag "The semikolon `;'" semicolon)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
423 (const :tag "The string `go' by itself" go))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
424 :version "20.8"
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
425 :group 'SQL)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
426
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
427 (defcustom sql-pop-to-buffer-after-send-region nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
428 "*If t, pop to the buffer SQL statements are sent to.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
429
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
430 After a call to `sql-send-region' or `sql-send-buffer',
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
431 the window is split and the SQLi buffer is shown. If this
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
432 variable is not nil, that buffer's window will be selected
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
433 by calling `pop-to-buffer'. If this variable is nil, that
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
434 buffer is shown using `display-buffer'."
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
435 :type 'boolean
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
436 :group 'SQL)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
437
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
438 ;; imenu support for sql-mode.
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
439
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
440 (defvar sql-imenu-generic-expression
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
441 ;; Items are in reverse order because they are rendered in reverse.
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
442 '(("Rules/Defaults" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(rule\\|default\\)\\s-+\\(\\w+\\)" 3)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
443 ("Sequences" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*sequence\\s-+\\(\\w+\\)" 2)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
444 ("Triggers" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*trigger\\s-+\\(\\w+\\)" 2)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
445 ("Functions" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?function\\s-+\\(\\w+\\)" 3)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
446 ("Procedures" "^\\s-*\\(create\\s-+\\(\\w+\\s-+\\)*\\)?proc\\(edure\\)?\\s-+\\(\\w+\\)" 4)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
447 ("Packages" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*package\\s-+\\(body\\s-+\\)?\\(\\w+\\)" 3)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
448 ("Indexes" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*index\\s-+\\(\\w+\\)" 2)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
449 ("Tables/Views" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(table\\|view\\)\\s-+\\(\\w+\\)" 3))
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
450 "Define interesting points in the SQL buffer for `imenu'.
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
451
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
452 This is used to set `imenu-generic-expression' when SQL mode is
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
453 entered. Subsequent changes to sql-imenu-generic-expression will not
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
454 affect existing SQL buffers because imenu-generic-expression is a
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
455 local variable.")
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
456
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
457 ;; history file
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
458
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
459 (defcustom sql-input-ring-file-name nil
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
460 "*If non-nil, name of the file to read/write input history.
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
461
24861
0d593aa15c0f (sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents: 24591
diff changeset
462 You have to set this variable if you want the history of your commands
0d593aa15c0f (sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents: 24591
diff changeset
463 saved from one Emacs session to the next. If this variable is set,
0d593aa15c0f (sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents: 24591
diff changeset
464 exiting the SQL interpreter in an SQLi buffer will write the input
0d593aa15c0f (sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents: 24591
diff changeset
465 history to the specified file. Starting a new process in a SQLi buffer
0d593aa15c0f (sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents: 24591
diff changeset
466 will read the input history from the specified file.
0d593aa15c0f (sql-input-ring-file-name): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents: 24591
diff changeset
467
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
468 This is used to initialize `comint-input-ring-file-name'.
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
469
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
470 Note that the size of the input history is determined by the variable
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
471 `comint-input-ring-size'."
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
472 :type '(choice (const :tag "none" nil)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
473 (file))
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
474 :group 'SQL)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
475
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
476 (defcustom sql-input-ring-separator "\n--\n"
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
477 "*Separator between commands in the history file.
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
478
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
479 If set to \"\\n\", each line in the history file will be interpreted as
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
480 one command. Multi-line commands are split into several commands when
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
481 the input ring is initialized from a history file.
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
482
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
483 This variable used to initialize `comint-input-ring-separator'.
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
484 `comint-input-ring-separator' is part of Emacs 21; if your Emacs
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
485 does not have it, setting `sql-input-ring-separator' will have no
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
486 effect. In that case multiline commands will be split into several
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
487 commands when the input history is read, as if you had set
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
488 `sql-input-ring-separator' to \"\\n\"."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
489 :type 'string
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
490 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
491
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
492 ;; The usual hooks
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
493
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
494 (defcustom sql-interactive-mode-hook '()
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
495 "*Hook for customizing `sql-interactive-mode'."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
496 :type 'hook
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
497 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
498
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
499 (defcustom sql-mode-hook '()
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
500 "*Hook for customizing `sql-mode'."
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
501 :type 'hook
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
502 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
503
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
504 (defcustom sql-set-sqli-hook '()
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
505 "*Hook for reacting to changes of `sql-buffer'.
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
506
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
507 This is called by `sql-set-sqli-buffer' when the value of `sql-buffer'
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
508 is changed."
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
509 :type 'hook
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
510 :group 'SQL)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
511
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
512 ;; Customization for Oracle
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
513
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
514 (defcustom sql-oracle-program "sqlplus"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
515 "*Command to start sqlplus by Oracle.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
516
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
517 Starts `sql-interactive-mode' after doing some setup.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
518
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
519 Under NT, \"sqlplus\" usually starts the sqlplus \"GUI\". In order to
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
520 start the sqlplus console, use \"plus33\" or something similar. You
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
521 will find the file in your Orant\\bin directory.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
522
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
523 The program can also specify a TCP connection. See `make-comint'."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
524 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
525 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
526
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
527 (defcustom sql-oracle-options nil
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
528 "*List of additional options for `sql-oracle-program'."
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
529 :type '(repeat string)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
530 :version "20.8"
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
531 :group 'SQL)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
532
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
533 ;; Customization for SQLite
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
534
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
535 (defcustom sql-sqlite-program "sqlite"
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
536 "*Command to start SQLite.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
537
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
538 Starts `sql-interactive-mode' after doing some setup.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
539
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
540 The program can also specify a TCP connection. See `make-comint'."
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
541 :type 'file
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
542 :group 'SQL)
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
543
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
544 (defcustom sql-sqlite-options nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
545 "*List of additional options for `sql-sqlite-program'.
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
546 The following list of options is reported to make things work
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
547 on Windows: \"-C\" \"-t\" \"-f\" \"-n\"."
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
548 :type '(repeat string)
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
549 :version "20.8"
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
550 :group 'SQL)
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
551
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
552 ;; Customization for MySql
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
553
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
554 (defcustom sql-mysql-program "mysql"
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
555 "*Command to start mysql by TcX.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
556
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
557 Starts `sql-interactive-mode' after doing some setup.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
558
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
559 The program can also specify a TCP connection. See `make-comint'."
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
560 :type 'file
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
561 :group 'SQL)
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
562
32169
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
563 (defcustom sql-mysql-options nil
34704
7cb3b80e66b8 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32621
diff changeset
564 "*List of additional options for `sql-mysql-program'.
7cb3b80e66b8 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32621
diff changeset
565 The following list of options is reported to make things work
7cb3b80e66b8 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32621
diff changeset
566 on Windows: \"-C\" \"-t\" \"-f\" \"-n\"."
32169
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
567 :type '(repeat string)
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
568 :version "20.8"
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
569 :group 'SQL)
5aa8b2b669b7 (sql-mysql-options): New variable.
Gerd Moellmann <gerd@gnu.org>
parents: 31392
diff changeset
570
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
571 ;; Customization for Solid
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
572
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
573 (defcustom sql-solid-program "solsql"
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
574 "*Command to start SOLID SQL Editor.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
575
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
576 Starts `sql-interactive-mode' after doing some setup.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
577
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
578 The program can also specify a TCP connection. See `make-comint'."
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
579 :type 'file
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
580 :group 'SQL)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
581
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
582 ;; Customization for SyBase
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
583
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
584 (defcustom sql-sybase-program "isql"
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
585 "*Command to start isql by SyBase.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
586
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
587 Starts `sql-interactive-mode' after doing some setup.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
588
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
589 The program can also specify a TCP connection. See `make-comint'."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
590 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
591 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
592
32621
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
593 (defcustom sql-sybase-options nil
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
594 "*List of additional options for `sql-sybase-program'.
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
595 Some versions of isql might require the -n option in order to work."
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
596 :type '(repeat string)
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
597 :version "20.8"
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
598 :group 'SQL)
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
599
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
600 ;; Customization for Informix
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
601
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
602 (defcustom sql-informix-program "dbaccess"
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
603 "*Command to start dbaccess by Informix.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
604
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
605 Starts `sql-interactive-mode' after doing some setup.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
606
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
607 The program can also specify a TCP connection. See `make-comint'."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
608 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
609 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
610
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
611 ;; Customization for Ingres
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
612
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
613 (defcustom sql-ingres-program "sql"
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
614 "*Command to start sql by Ingres.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
615
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
616 Starts `sql-interactive-mode' after doing some setup.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
617
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
618 The program can also specify a TCP connection. See `make-comint'."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
619 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
620 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
621
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
622 ;; Customization for Microsoft
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
623
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
624 (defcustom sql-ms-program "osql"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
625 "*Command to start osql by Microsoft.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
626
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
627 Starts `sql-interactive-mode' after doing some setup.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
628
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
629 The program can also specify a TCP connection. See `make-comint'."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
630 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
631 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
632
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
633 (defcustom sql-ms-options '("-w" "300" "-n")
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
634 ;; -w is the linesize
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
635 "*List of additional options for `sql-ms-program'."
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
636 :type '(repeat string)
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 55370
diff changeset
637 :version "22.1"
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
638 :group 'SQL)
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
639
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
640 ;; Customization for Postgres
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
641
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
642 (defcustom sql-postgres-program "psql"
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
643 "Command to start psql by Postgres.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
644
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
645 Starts `sql-interactive-mode' after doing some setup.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
646
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
647 The program can also specify a TCP connection. See `make-comint'."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
648 :type 'file
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
649 :group 'SQL)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
650
34704
7cb3b80e66b8 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32621
diff changeset
651 (defcustom sql-postgres-options '("-P" "pager=off")
31392
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
652 "*List of additional options for `sql-postgres-program'.
38872
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
653 The default setting includes the -P option which breaks older versions
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
654 of the psql client (such as version 6.5.3). The -P option is equivalent
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
655 to the --pset option. If you want the psql to prompt you for a user
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
656 name, add the string \"-u\" to the list of options. If you want to
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
657 provide a user name on the command line (newer versions such as 7.1),
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
658 add your name with a \"-U\" prefix (such as \"-Umark\") to the list."
31392
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
659 :type '(repeat string)
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
660 :version "20.8"
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
661 :group 'SQL)
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
662
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
663 ;; Customization for Interbase
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
664
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
665 (defcustom sql-interbase-program "isql"
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
666 "*Command to start isql by Interbase.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
667
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
668 Starts `sql-interactive-mode' after doing some setup.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
669
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
670 The program can also specify a TCP connection. See `make-comint'."
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
671 :type 'file
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
672 :group 'SQL)
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
673
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
674 (defcustom sql-interbase-options nil
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
675 "*List of additional options for `sql-interbase-program'."
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
676 :type '(repeat string)
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
677 :version "20.8"
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
678 :group 'SQL)
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
679
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
680 ;; Customization for DB2
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
681
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
682 (defcustom sql-db2-program "db2"
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
683 "*Command to start db2 by IBM.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
684
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
685 Starts `sql-interactive-mode' after doing some setup.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
686
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
687 The program can also specify a TCP connection. See `make-comint'."
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
688 :type 'file
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
689 :group 'SQL)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
690
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
691 (defcustom sql-db2-options nil
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
692 "*List of additional options for `sql-db2-program'."
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
693 :type '(repeat string)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
694 :version "20.8"
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
695 :group 'SQL)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
696
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
697 ;; Customization for Linter
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
698
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
699 (defcustom sql-linter-program "inl"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
700 "*Command to start inl by RELEX.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
701
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
702 Starts `sql-interactive-mode' after doing some setup."
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
703 :type 'file
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
704 :group 'SQL)
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
705
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
706 (defcustom sql-linter-options nil
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
707 "*List of additional options for `sql-linter-program'."
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
708 :type '(repeat string)
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
709 :version "21.3"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
710 :group 'SQL)
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
711
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
712
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
713
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
714 ;;; Variables which do not need customization
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
715
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
716 (defvar sql-user-history nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
717 "History of usernames used.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
718
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
719 (defvar sql-database-history nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
720 "History of databases used.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
721
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
722 (defvar sql-server-history nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
723 "History of servers used.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
724
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
725 ;; Passwords are not kept in a history.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
726
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
727 (defvar sql-buffer nil
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
728 "Current SQLi buffer.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
729
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
730 The global value of sql-buffer is the name of the latest SQLi buffer
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
731 created. Any SQL buffer created will make a local copy of this value.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
732 See `sql-interactive-mode' for more on multiple sessions. If you want
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
733 to change the SQLi buffer a SQL mode sends its SQL strings to, change
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
734 the local value of `sql-buffer' using \\[sql-set-sqli-buffer].")
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
735
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
736 (defvar sql-prompt-regexp nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
737 "Prompt used to initialize `comint-prompt-regexp'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
738
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
739 You can change `sql-prompt-regexp' on `sql-interactive-mode-hook'.")
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
740
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
741 (defvar sql-prompt-length 0
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
742 "Prompt used to set `left-margin' in `sql-interactive-mode'.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
743
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
744 You can change `sql-prompt-length' on `sql-interactive-mode-hook'.")
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
745
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
746 (defvar sql-alternate-buffer-name nil
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
747 "Buffer-local string used to possibly rename the SQLi buffer.
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
748
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
749 Used by `sql-rename-buffer'.")
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
750
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
751 ;; Keymap for sql-interactive-mode.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
752
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
753 (defvar sql-interactive-mode-map
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
754 (let ((map (make-sparse-keymap)))
64837
f80fef683ab5 (sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents: 64699
diff changeset
755 (if (fboundp 'set-keymap-parent)
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
756 (set-keymap-parent map comint-mode-map); Emacs
64837
f80fef683ab5 (sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents: 64699
diff changeset
757 (if (fboundp 'set-keymap-parents)
f80fef683ab5 (sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents: 64699
diff changeset
758 (set-keymap-parents map (list comint-mode-map)))); XEmacs
f80fef683ab5 (sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents: 64699
diff changeset
759 (if (fboundp 'set-keymap-name)
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
760 (set-keymap-name map 'sql-interactive-mode-map)); XEmacs
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
761 (define-key map (kbd "C-j") 'sql-accumulate-and-indent)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
762 (define-key map (kbd "C-c C-w") 'sql-copy-column)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
763 (define-key map (kbd "O") 'sql-magic-go)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
764 (define-key map (kbd "o") 'sql-magic-go)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
765 (define-key map (kbd ";") 'sql-magic-semicolon)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
766 map)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
767 "Mode map used for `sql-interactive-mode'.
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
768 Based on `comint-mode-map'.")
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
769
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
770 ;; Keymap for sql-mode.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
771
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
772 (defvar sql-mode-map
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
773 (let ((map (make-sparse-keymap)))
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
774 (define-key map (kbd "C-c C-c") 'sql-send-paragraph)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
775 (define-key map (kbd "C-c C-r") 'sql-send-region)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
776 (define-key map (kbd "C-c C-s") 'sql-send-string)
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
777 (define-key map (kbd "C-c C-b") 'sql-send-buffer)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
778 map)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
779 "Mode map used for `sql-mode'.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
780
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
781 ;; easy menu for sql-mode.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
782
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
783 (easy-menu-define
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
784 sql-mode-menu sql-mode-map
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
785 "Menu for `sql-mode'."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
786 '("SQL"
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
787 ["Send Paragraph" sql-send-paragraph (and (buffer-live-p sql-buffer)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
788 (get-buffer-process sql-buffer))]
31392
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
789 ["Send Region" sql-send-region (and (or (and (boundp 'mark-active); Emacs
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
790 mark-active)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
791 (mark t)); XEmacs
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
792 (buffer-live-p sql-buffer)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
793 (get-buffer-process sql-buffer))]
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
794 ["Send Buffer" sql-send-buffer (and (buffer-live-p sql-buffer)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
795 (get-buffer-process sql-buffer))]
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
796 ["Send String" sql-send-string t]
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
797 ["--" nil nil]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
798 ["Start SQLi session" sql-product-interactive (sql-product-feature :sqli-connect)]
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
799 ["Show SQLi buffer" sql-show-sqli-buffer t]
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
800 ["Set SQLi buffer" sql-set-sqli-buffer t]
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
801 ["Pop to SQLi buffer after send"
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
802 sql-toggle-pop-to-buffer-after-send-region
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
803 :style toggle
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
804 :selected sql-pop-to-buffer-after-send-region]
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
805 ["--" nil nil]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
806 ("Product"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
807 ["ANSI" sql-highlight-ansi-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
808 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
809 :selected (eq sql-product 'ansi)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
810 ["DB2" sql-highlight-db2-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
811 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
812 :selected (eq sql-product 'db2)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
813 ["Informix" sql-highlight-informix-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
814 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
815 :selected (eq sql-product 'informix)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
816 ["Ingres" sql-highlight-ingres-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
817 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
818 :selected (eq sql-product 'ingres)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
819 ["Interbase" sql-highlight-interbase-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
820 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
821 :selected (eq sql-product 'interbase)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
822 ["Linter" sql-highlight-linter-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
823 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
824 :selected (eq sql-product 'linter)]
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
825 ["MS SQLServer" sql-highlight-ms-keywords
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
826 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
827 :selected (eq sql-product 'ms)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
828 ["MySQL" sql-highlight-mysql-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
829 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
830 :selected (eq sql-product 'mysql)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
831 ["Oracle" sql-highlight-oracle-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
832 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
833 :selected (eq sql-product 'oracle)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
834 ["Postgres" sql-highlight-postgres-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
835 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
836 :selected (eq sql-product 'postgres)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
837 ["Solid" sql-highlight-solid-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
838 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
839 :selected (eq sql-product 'solid)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
840 ["SQLite" sql-highlight-sqlite-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
841 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
842 :selected (eq sql-product 'sqlite)]
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
843 ["Sybase" sql-highlight-sybase-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
844 :style radio
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
845 :selected (eq sql-product 'sybase)]
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
846 )))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
847
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
848 ;; easy menu for sql-interactive-mode.
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
849
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
850 (easy-menu-define
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
851 sql-interactive-mode-menu sql-interactive-mode-map
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
852 "Menu for `sql-interactive-mode'."
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
853 '("SQL"
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
854 ["Rename Buffer" sql-rename-buffer t]))
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
855
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
856 ;; Abbreviations -- if you want more of them, define them in your
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
857 ;; ~/.emacs file. Abbrevs have to be enabled in your ~/.emacs, too.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
858
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
859 (defvar sql-mode-abbrev-table nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
860 "Abbrev table used in `sql-mode' and `sql-interactive-mode'.")
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
861 (unless sql-mode-abbrev-table
74433
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
862 (define-abbrev-table 'sql-mode-abbrev-table nil))
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
863
84922
1b6b77d0f75a (top): Use `mapc' rather than `mapcar'.
Juanma Barranquero <lekktu@gmail.com>
parents: 78234
diff changeset
864 (mapc
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
865 ;; In Emacs 22+, provide SYSTEM-FLAG to define-abbrev.
74433
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
866 '(lambda (abbrev)
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
867 (let ((name (car abbrev))
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
868 (expansion (cdr abbrev)))
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
869 (condition-case nil
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
870 (define-abbrev sql-mode-abbrev-table name expansion nil 0 t)
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
871 (error
89cf360cc26e (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
Glenn Morris <rgm@gnu.org>
parents: 68773
diff changeset
872 (define-abbrev sql-mode-abbrev-table name expansion)))))
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
873 '(("ins" . "insert")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
874 ("upd" . "update")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
875 ("del" . "delete")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
876 ("sel" . "select")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
877 ("proc" . "procedure")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
878 ("func" . "function")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
879 ("cr" . "create")))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
880
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
881 ;; Syntax Table
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
882
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
883 (defvar sql-mode-syntax-table
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
884 (let ((table (make-syntax-table)))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
885 ;; C-style comments /**/ (see elisp manual "Syntax Flags"))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
886 (modify-syntax-entry ?/ ". 14" table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
887 (modify-syntax-entry ?* ". 23" table)
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
888 ;; double-dash starts comments
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
889 (modify-syntax-entry ?- ". 12b" table)
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
890 ;; newline and formfeed end comments
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
891 (modify-syntax-entry ?\n "> b" table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
892 (modify-syntax-entry ?\f "> b" table)
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
893 ;; single quotes (') delimit strings
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
894 (modify-syntax-entry ?' "\"" table)
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
895 ;; double quotes (") don't delimit strings
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
896 (modify-syntax-entry ?\" "." table)
40971
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
897 ;; backslash is no escape character
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
898 (modify-syntax-entry ?\\ "." table)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
899 table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
900 "Syntax table used in `sql-mode' and `sql-interactive-mode'.")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
901
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
902 ;; Font lock support
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
903
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
904 (defvar sql-mode-font-lock-object-name
74898
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
905 (eval-when-compile
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
906 (list (concat "^\\s-*\\(?:create\\|drop\\|alter\\)\\s-+" ;; lead off with CREATE, DROP or ALTER
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
907 "\\(?:\\w+\\s-+\\)*" ;; optional intervening keywords
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
908 "\\(?:table\\|view\\|\\(?:package\\|type\\)\\(?:\\s-+body\\)?\\|proc\\(?:edure\\)?"
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
909 "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+"
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
910 "\\(\\w+\\)")
60595cfe604f (sql-mode-abbrev-table): Corrected initialization.
Richard M. Stallman <rms@gnu.org>
parents: 74433
diff changeset
911 1 'font-lock-function-name-face))
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
912
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
913 "Pattern to match the names of top-level objects.
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
914
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
915 The pattern matches the name in a CREATE, DROP or ALTER
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
916 statement. The format of variable should be a valid
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
917 `font-lock-keywords' entry.")
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
918
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
919 (defmacro sql-keywords-re (&rest keywords)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
920 "Compile-time generation of regexp matching any one of KEYWORDS."
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
921 `(eval-when-compile
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
922 (concat "\\b"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
923 (regexp-opt ',keywords t)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
924 "\\b")))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
925
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
926 (defvar sql-mode-ansi-font-lock-keywords
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
927 (let ((ansi-funcs (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
928 "abs" "avg" "bit_length" "cardinality" "cast" "char_length"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
929 "character_length" "coalesce" "convert" "count" "current_date"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
930 "current_path" "current_role" "current_time" "current_timestamp"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
931 "current_user" "extract" "localtime" "localtimestamp" "lower" "max"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
932 "min" "mod" "nullif" "octet_length" "overlay" "placing" "session_user"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
933 "substring" "sum" "system_user" "translate" "treat" "trim" "upper"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
934 "user"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
935 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
936
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
937 (ansi-non-reserved (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
938 "ada" "asensitive" "assignment" "asymmetric" "atomic" "between"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
939 "bitvar" "called" "catalog_name" "chain" "character_set_catalog"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
940 "character_set_name" "character_set_schema" "checked" "class_origin"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
941 "cobol" "collation_catalog" "collation_name" "collation_schema"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
942 "column_name" "command_function" "command_function_code" "committed"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
943 "condition_number" "connection_name" "constraint_catalog"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
944 "constraint_name" "constraint_schema" "contains" "cursor_name"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
945 "datetime_interval_code" "datetime_interval_precision" "defined"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
946 "definer" "dispatch" "dynamic_function" "dynamic_function_code"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
947 "existing" "exists" "final" "fortran" "generated" "granted"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
948 "hierarchy" "hold" "implementation" "infix" "insensitive" "instance"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
949 "instantiable" "invoker" "key_member" "key_type" "length" "m"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
950 "message_length" "message_octet_length" "message_text" "method" "more"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
951 "mumps" "name" "nullable" "number" "options" "overlaps" "overriding"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
952 "parameter_mode" "parameter_name" "parameter_ordinal_position"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
953 "parameter_specific_catalog" "parameter_specific_name"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
954 "parameter_specific_schema" "pascal" "pli" "position" "repeatable"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
955 "returned_length" "returned_octet_length" "returned_sqlstate"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
956 "routine_catalog" "routine_name" "routine_schema" "row_count" "scale"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
957 "schema_name" "security" "self" "sensitive" "serializable"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
958 "server_name" "similar" "simple" "source" "specific_name" "style"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
959 "subclass_origin" "sublist" "symmetric" "system" "table_name"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
960 "transaction_active" "transactions_committed"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
961 "transactions_rolled_back" "transform" "transforms" "trigger_catalog"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
962 "trigger_name" "trigger_schema" "type" "uncommitted" "unnamed"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
963 "user_defined_type_catalog" "user_defined_type_name"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
964 "user_defined_type_schema"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
965 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
966
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
967 (ansi-reserved (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
968 "absolute" "action" "add" "admin" "after" "aggregate" "alias" "all"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
969 "allocate" "alter" "and" "any" "are" "as" "asc" "assertion" "at"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
970 "authorization" "before" "begin" "both" "breadth" "by" "call"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
971 "cascade" "cascaded" "case" "catalog" "check" "class" "close"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
972 "collate" "collation" "column" "commit" "completion" "connect"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
973 "connection" "constraint" "constraints" "constructor" "continue"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
974 "corresponding" "create" "cross" "cube" "current" "cursor" "cycle"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
975 "data" "day" "deallocate" "declare" "default" "deferrable" "deferred"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
976 "delete" "depth" "deref" "desc" "describe" "descriptor" "destroy"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
977 "destructor" "deterministic" "diagnostics" "dictionary" "disconnect"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
978 "distinct" "domain" "drop" "dynamic" "each" "else" "end" "equals"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
979 "escape" "every" "except" "exception" "exec" "execute" "external"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
980 "false" "fetch" "first" "for" "foreign" "found" "free" "from" "full"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
981 "function" "general" "get" "global" "go" "goto" "grant" "group"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
982 "grouping" "having" "host" "hour" "identity" "ignore" "immediate" "in"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
983 "indicator" "initialize" "initially" "inner" "inout" "input" "insert"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
984 "intersect" "into" "is" "isolation" "iterate" "join" "key" "language"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
985 "last" "lateral" "leading" "left" "less" "level" "like" "limit"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
986 "local" "locator" "map" "match" "minute" "modifies" "modify" "module"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
987 "month" "names" "natural" "new" "next" "no" "none" "not" "null" "of"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
988 "off" "old" "on" "only" "open" "operation" "option" "or" "order"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
989 "ordinality" "out" "outer" "output" "pad" "parameter" "parameters"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
990 "partial" "path" "postfix" "prefix" "preorder" "prepare" "preserve"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
991 "primary" "prior" "privileges" "procedure" "public" "read" "reads"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
992 "recursive" "references" "referencing" "relative" "restrict" "result"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
993 "return" "returns" "revoke" "right" "role" "rollback" "rollup"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
994 "routine" "rows" "savepoint" "schema" "scroll" "search" "second"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
995 "section" "select" "sequence" "session" "set" "sets" "size" "some"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
996 "space" "specific" "specifictype" "sql" "sqlexception" "sqlstate"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
997 "sqlwarning" "start" "state" "statement" "static" "structure" "table"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
998 "temporary" "terminate" "than" "then" "timezone_hour"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
999 "timezone_minute" "to" "trailing" "transaction" "translation"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1000 "trigger" "true" "under" "union" "unique" "unknown" "unnest" "update"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1001 "usage" "using" "value" "values" "variable" "view" "when" "whenever"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1002 "where" "with" "without" "work" "write" "year"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1003 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1004
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1005 (ansi-types (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1006 "array" "binary" "bit" "blob" "boolean" "char" "character" "clob"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1007 "date" "dec" "decimal" "double" "float" "int" "integer" "interval"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1008 "large" "national" "nchar" "nclob" "numeric" "object" "precision"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1009 "real" "ref" "row" "scope" "smallint" "time" "timestamp" "varchar"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1010 "varying" "zone"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1011 )))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1012
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1013 `((,ansi-non-reserved . font-lock-keyword-face)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1014 (,ansi-reserved . font-lock-keyword-face)
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1015 (,ansi-funcs . font-lock-builtin-face)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1016 (,ansi-types . font-lock-type-face)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1017
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1018 "ANSI SQL keywords used by font-lock.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1019
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1020 This variable is used by `sql-mode' and `sql-interactive-mode'. The
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1021 regular expressions are created during compilation by calling the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1022 function `regexp-opt'. Therefore, take a look at the source before
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1023 you define your own sql-mode-ansi-font-lock-keywords. You may want to
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1024 add functions and PL/SQL keywords.")
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1025
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1026 (defvar sql-mode-oracle-font-lock-keywords
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1027 (let ((oracle-functions (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1028 "abs" "acos" "add_months" "ascii" "asciistr" "asin" "atan" "atan2"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1029 "avg" "bfilename" "bin_to_num" "bitand" "cast" "ceil" "chartorowid"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1030 "chr" "coalesce" "compose" "concat" "convert" "corr" "cos" "cosh"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1031 "count" "covar_pop" "covar_samp" "cume_dist" "current_date"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1032 "current_timestamp" "current_user" "dbtimezone" "decode" "decompose"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1033 "dense_rank" "depth" "deref" "dump" "empty_clob" "existsnode" "exp"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1034 "extract" "extractvalue" "first" "first_value" "floor" "following"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1035 "from_tz" "greatest" "group_id" "grouping_id" "hextoraw" "initcap"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1036 "instr" "lag" "last" "last_day" "last_value" "lead" "least" "length"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1037 "ln" "localtimestamp" "lower" "lpad" "ltrim" "make_ref" "max" "min"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1038 "mod" "months_between" "new_time" "next_day" "nls_charset_decl_len"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1039 "nls_charset_id" "nls_charset_name" "nls_initcap" "nls_lower"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1040 "nls_upper" "nlssort" "ntile" "nullif" "numtodsinterval"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1041 "numtoyminterval" "nvl" "nvl2" "over" "path" "percent_rank"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1042 "percentile_cont" "percentile_disc" "power" "preceding" "rank"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1043 "ratio_to_report" "rawtohex" "rawtonhex" "reftohex" "regr_"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1044 "regr_avgx" "regr_avgy" "regr_count" "regr_intercept" "regr_r2"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1045 "regr_slope" "regr_sxx" "regr_sxy" "regr_syy" "replace" "round"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1046 "row_number" "rowidtochar" "rowidtonchar" "rpad" "rtrim"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1047 "sessiontimezone" "sign" "sin" "sinh" "soundex" "sqrt" "stddev"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1048 "stddev_pop" "stddev_samp" "substr" "sum" "sys_connect_by_path"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1049 "sys_context" "sys_dburigen" "sys_extract_utc" "sys_guid" "sys_typeid"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1050 "sys_xmlagg" "sys_xmlgen" "sysdate" "systimestamp" "tan" "tanh"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1051 "to_char" "to_clob" "to_date" "to_dsinterval" "to_lob" "to_multi_byte"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1052 "to_nchar" "to_nclob" "to_number" "to_single_byte" "to_timestamp"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1053 "to_timestamp_tz" "to_yminterval" "translate" "treat" "trim" "trunc"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1054 "tz_offset" "uid" "unbounded" "unistr" "updatexml" "upper" "user"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1055 "userenv" "var_pop" "var_samp" "variance" "vsize" "width_bucket" "xml"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1056 "xmlagg" "xmlattribute" "xmlcolattval" "xmlconcat" "xmlelement"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1057 "xmlforest" "xmlsequence" "xmltransform"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1058 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1059
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1060 (oracle-keywords (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1061 "abort" "access" "accessed" "account" "activate" "add" "admin"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1062 "advise" "after" "agent" "aggregate" "all" "allocate" "allow" "alter"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1063 "always" "analyze" "ancillary" "and" "any" "apply" "archive"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1064 "archivelog" "array" "as" "asc" "associate" "at" "attribute"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1065 "attributes" "audit" "authenticated" "authid" "authorization" "auto"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1066 "autoallocate" "automatic" "availability" "backup" "before" "begin"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1067 "behalf" "between" "binding" "bitmap" "block" "blocksize" "body"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1068 "both" "buffer_pool" "build" "by" "cache" "call" "cancel"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1069 "cascade" "case" "category" "certificate" "chained" "change" "check"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1070 "checkpoint" "child" "chunk" "class" "clear" "clone" "close" "cluster"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1071 "column" "column_value" "columns" "comment" "commit" "committed"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1072 "compatibility" "compile" "complete" "composite_limit" "compress"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1073 "compute" "connect" "connect_time" "consider" "consistent"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1074 "constraint" "constraints" "constructor" "contents" "context"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1075 "continue" "controlfile" "corruption" "cost" "cpu_per_call"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1076 "cpu_per_session" "create" "cross" "cube" "current" "currval" "cycle"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1077 "dangling" "data" "database" "datafile" "datafiles" "day" "ddl"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1078 "deallocate" "debug" "default" "deferrable" "deferred" "definer"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1079 "delay" "delete" "demand" "desc" "determines" "deterministic"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1080 "dictionary" "dimension" "directory" "disable" "disassociate"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1081 "disconnect" "distinct" "distinguished" "distributed" "dml" "drop"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1082 "each" "element" "else" "enable" "end" "equals_path" "escape"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1083 "estimate" "except" "exceptions" "exchange" "excluding" "exists"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1084 "expire" "explain" "extent" "external" "externally"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1085 "failed_login_attempts" "fast" "file" "final" "finish" "flush" "for"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1086 "force" "foreign" "freelist" "freelists" "freepools" "fresh" "from"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1087 "full" "function" "functions" "generated" "global" "global_name"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1088 "globally" "grant" "group" "grouping" "groups" "guard" "hash"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1089 "hashkeys" "having" "heap" "hierarchy" "id" "identified" "identifier"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1090 "idle_time" "immediate" "in" "including" "increment" "index" "indexed"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1091 "indexes" "indextype" "indextypes" "indicator" "initial" "initialized"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1092 "initially" "initrans" "inner" "insert" "instance" "instantiable"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1093 "instead" "intersect" "into" "invalidate" "is" "isolation" "java"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1094 "join" "keep" "key" "kill" "language" "left" "less" "level"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1095 "levels" "library" "like" "like2" "like4" "likec" "limit" "link"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1096 "list" "lob" "local" "location" "locator" "lock" "log" "logfile"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1097 "logging" "logical" "logical_reads_per_call"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1098 "logical_reads_per_session" "managed" "management" "manual" "map"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1099 "mapping" "master" "matched" "materialized" "maxdatafiles"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1100 "maxextents" "maximize" "maxinstances" "maxlogfiles" "maxloghistory"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1101 "maxlogmembers" "maxsize" "maxtrans" "maxvalue" "member" "memory"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1102 "merge" "migrate" "minextents" "minimize" "minimum" "minus" "minvalue"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1103 "mode" "modify" "monitoring" "month" "mount" "move" "movement" "name"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1104 "named" "natural" "nested" "never" "new" "next" "nextval" "no"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1105 "noarchivelog" "noaudit" "nocache" "nocompress" "nocopy" "nocycle"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1106 "nodelay" "noforce" "nologging" "nomapping" "nomaxvalue" "nominimize"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1107 "nominvalue" "nomonitoring" "none" "noorder" "noparallel" "norely"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1108 "noresetlogs" "noreverse" "normal" "norowdependencies" "nosort"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1109 "noswitch" "not" "nothing" "notimeout" "novalidate" "nowait" "null"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1110 "nulls" "object" "of" "off" "offline" "oidindex" "old" "on" "online"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1111 "only" "open" "operator" "optimal" "option" "or" "order"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1112 "organization" "out" "outer" "outline" "overflow" "overriding"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1113 "package" "packages" "parallel" "parallel_enable" "parameters"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1114 "parent" "partition" "partitions" "password" "password_grace_time"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1115 "password_life_time" "password_lock_time" "password_reuse_max"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1116 "password_reuse_time" "password_verify_function" "pctfree"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1117 "pctincrease" "pctthreshold" "pctused" "pctversion" "percent"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1118 "performance" "permanent" "pfile" "physical" "pipelined" "plan"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1119 "post_transaction" "pragma" "prebuilt" "preserve" "primary" "private"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1120 "private_sga" "privileges" "procedure" "profile" "protection" "public"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1121 "purge" "query" "quiesce" "quota" "range" "read" "reads" "rebuild"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1122 "records_per_block" "recover" "recovery" "recycle" "reduced" "ref"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1123 "references" "referencing" "refresh" "register" "reject" "relational"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1124 "rely" "rename" "reset" "resetlogs" "resize" "resolve" "resolver"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1125 "resource" "restrict" "restrict_references" "restricted" "result"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1126 "resumable" "resume" "retention" "return" "returning" "reuse"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1127 "reverse" "revoke" "rewrite" "right" "rnds" "rnps" "role" "roles"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1128 "rollback" "rollup" "row" "rowdependencies" "rownum" "rows" "sample"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1129 "savepoint" "scan" "schema" "scn" "scope" "segment" "select"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1130 "selectivity" "self" "sequence" "serializable" "session"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1131 "sessions_per_user" "set" "sets" "settings" "shared" "shared_pool"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1132 "shrink" "shutdown" "siblings" "sid" "single" "size" "skip" "some"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1133 "sort" "source" "space" "specification" "spfile" "split" "standby"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1134 "start" "statement_id" "static" "statistics" "stop" "storage" "store"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1135 "structure" "subpartition" "subpartitions" "substitutable"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1136 "successful" "supplemental" "suspend" "switch" "switchover" "synonym"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1137 "sys" "system" "table" "tables" "tablespace" "tempfile" "template"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1138 "temporary" "test" "than" "then" "thread" "through" "time_zone"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1139 "timeout" "to" "trace" "transaction" "trigger" "triggers" "truncate"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1140 "trust" "type" "types" "unarchived" "under" "under_path" "undo"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1141 "uniform" "union" "unique" "unlimited" "unlock" "unquiesce"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1142 "unrecoverable" "until" "unusable" "unused" "update" "upgrade" "usage"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1143 "use" "using" "validate" "validation" "value" "values" "variable"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1144 "varray" "version" "view" "wait" "when" "whenever" "where" "with"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1145 "without" "wnds" "wnps" "work" "write" "xmldata" "xmlschema" "xmltype"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1146 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1147
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1148 (oracle-types (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1149 "bfile" "blob" "byte" "char" "character" "clob" "date" "dec" "decimal"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1150 "double" "float" "int" "integer" "interval" "long" "national" "nchar"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1151 "nclob" "number" "numeric" "nvarchar2" "precision" "raw" "real"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1152 "rowid" "second" "smallint" "time" "timestamp" "urowid" "varchar"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1153 "varchar2" "varying" "year" "zone"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1154 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1155
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1156 (plsql-functions (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1157 "%bulk_rowcount" "%found" "%isopen" "%notfound" "%rowcount" "%rowtype"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1158 "%type" "extend" "prior"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1159 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1160
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1161 (plsql-keywords (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1162 "autonomous_transaction" "bulk" "char_base" "collect" "constant"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1163 "cursor" "declare" "do" "elsif" "exception_init" "execute" "exit"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1164 "extends" "false" "fetch" "forall" "goto" "hour" "if" "interface"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1165 "loop" "minute" "number_base" "ocirowid" "opaque" "others" "rowtype"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1166 "separate" "serially_reusable" "sql" "sqlcode" "sqlerrm" "subtype"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1167 "the" "timezone_abbr" "timezone_hour" "timezone_minute"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1168 "timezone_region" "true" "varrying" "while"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1169 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1170
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1171 (plsql-type (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1172 "binary_integer" "boolean" "naturaln" "pls_integer" "positive"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1173 "positiven" "record" "signtype" "string"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1174 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1175
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1176 (plsql-warning (sql-keywords-re
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1177 "access_into_null" "case_not_found" "collection_is_null"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1178 "cursor_already_open" "dup_val_on_index" "invalid_cursor"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1179 "invalid_number" "login_denied" "no_data_found" "not_logged_on"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1180 "program_error" "rowtype_mismatch" "self_is_null" "storage_error"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1181 "subscript_beyond_count" "subscript_outside_limit" "sys_invalid_rowid"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1182 "timeout_on_resource" "too_many_rows" "value_error" "zero_divide"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1183 "exception" "notfound"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1184 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1185
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1186 (sqlplus-commands
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1187 (eval-when-compile (concat "^\\(\\("
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1188 (regexp-opt '(
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1189 "@" "@@" "accept" "append" "archive" "attribute" "break"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1190 "btitle" "change" "clear" "column" "connect" "copy" "define"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1191 "del" "describe" "disconnect" "edit" "execute" "exit" "get" "help"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1192 "host" "input" "list" "password" "pause" "print" "prompt" "recover"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1193 "remark" "repfooter" "repheader" "run" "save" "show" "shutdown"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1194 "spool" "start" "startup" "store" "timing" "ttitle" "undefine"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1195 "variable" "whenever"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1196
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1197 ) t)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1198
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1199 "\\)\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1200 "\\(compute\\s-+\\(avg\\|cou\\|min\\|max\\|num\\|sum\\|std\\|var\\)\\)\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1201 "\\(set\\s-+\\(appi\\(nfo\\)?\\|array\\(size\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1202 "auto\\(commit\\)?\\|autop\\(rint\\)?\\|autorecovery\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1203 "autot\\(race\\)?\\|blo\\(ckterminator\\)?\\|cmds\\(ep\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1204 "colsep\\|com\\(patibility\\)?\\|con\\(cat\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1205 "copyc\\(ommit\\)?\\|copytypecheck\\|def\\(ine\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1206 "describe\\|echo\\|editf\\(ile\\)?\\|emb\\(edded\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1207 "esc\\(ape\\)?\\|feed\\(back\\)?\\|flagger\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1208 "flu\\(sh\\)?\\|hea\\(ding\\)?\\|heads\\(ep\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1209 "instance\\|lin\\(esize\\)?\\|lobof\\(fset\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1210 "logsource\\|long\\|longc\\(hunksize\\)?\\|mark\\(up\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1211 "newp\\(age\\)?\\|null\\|numf\\(ormat\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1212 "num\\(width\\)?\\|pages\\(ize\\)?\\|pau\\(se\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1213 "recsep\\|recsepchar\\|serverout\\(put\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1214 "shift\\(inout\\)?\\|show\\(mode\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1215 "sqlbl\\(anklines\\)?\\|sqlc\\(ase\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1216 "sqlco\\(ntinue\\)?\\|sqln\\(umber\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1217 "sqlpluscompat\\(ibility\\)?\\|sqlpre\\(fix\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1218 "sqlp\\(rompt\\)?\\|sqlt\\(erminator\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1219 "suf\\(fix\\)?\\|tab\\|term\\(out\\)?\\|ti\\(me\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1220 "timi\\(ng\\)?\\|trim\\(out\\)?\\|trims\\(pool\\)?\\|"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1221 "und\\(erline\\)?\\|ver\\(ify\\)?\\|wra\\(p\\)?\\)\\)\\)"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1222 "\\b.*$"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1223 ))))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1224
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1225 `((,sqlplus-commands . font-lock-doc-face)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1226 (,oracle-functions . font-lock-builtin-face)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1227 (,oracle-keywords . font-lock-keyword-face)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1228 (,oracle-types . font-lock-type-face)
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1229 (,plsql-functions . font-lock-builtin-face)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1230 (,plsql-keywords . font-lock-keyword-face)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1231 (,plsql-type . font-lock-type-face)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1232 (,plsql-warning . font-lock-warning-face)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1233
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1234 "Oracle SQL keywords used by font-lock.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1235
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1236 This variable is used by `sql-mode' and `sql-interactive-mode'. The
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1237 regular expressions are created during compilation by calling the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1238 function `regexp-opt'. Therefore, take a look at the source before
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1239 you define your own sql-mode-oracle-font-lock-keywords. You may want
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1240 to add functions and PL/SQL keywords.")
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1241
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1242 (defvar sql-mode-postgres-font-lock-keywords
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1243 (let ((pg-funcs (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1244 "abbrev" "abs" "acos" "age" "area" "ascii" "asin" "atab2" "atan"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1245 "atan2" "avg" "bit_length" "both" "broadcast" "btrim" "cbrt" "ceil"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1246 "center" "char_length" "chr" "coalesce" "col_description" "convert"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1247 "cos" "cot" "count" "current_database" "current_date" "current_schema"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1248 "current_schemas" "current_setting" "current_time" "current_timestamp"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1249 "current_user" "currval" "date_part" "date_trunc" "decode" "degrees"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1250 "diameter" "encode" "exp" "extract" "floor" "get_bit" "get_byte"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1251 "has_database_privilege" "has_function_privilege"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1252 "has_language_privilege" "has_schema_privilege" "has_table_privilege"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1253 "height" "host" "initcap" "isclosed" "isfinite" "isopen" "leading"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1254 "length" "ln" "localtime" "localtimestamp" "log" "lower" "lpad"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1255 "ltrim" "masklen" "max" "min" "mod" "netmask" "network" "nextval"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1256 "now" "npoints" "nullif" "obj_description" "octet_length" "overlay"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1257 "pclose" "pg_client_encoding" "pg_function_is_visible"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1258 "pg_get_constraintdef" "pg_get_indexdef" "pg_get_ruledef"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1259 "pg_get_userbyid" "pg_get_viewdef" "pg_opclass_is_visible"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1260 "pg_operator_is_visible" "pg_table_is_visible" "pg_type_is_visible"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1261 "pi" "popen" "position" "pow" "quote_ident" "quote_literal" "radians"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1262 "radius" "random" "repeat" "replace" "round" "rpad" "rtrim"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1263 "session_user" "set_bit" "set_byte" "set_config" "set_masklen"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1264 "setval" "sign" "sin" "split_part" "sqrt" "stddev" "strpos" "substr"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1265 "substring" "sum" "tan" "timeofday" "to_ascii" "to_char" "to_date"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1266 "to_hex" "to_number" "to_timestamp" "trailing" "translate" "trim"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1267 "trunc" "upper" "variance" "version" "width"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1268 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1269
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1270 (pg-reserved (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1271 "abort" "access" "add" "after" "aggregate" "alignment" "all" "alter"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1272 "analyze" "and" "any" "as" "asc" "assignment" "authorization"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1273 "backward" "basetype" "before" "begin" "between" "binary" "by" "cache"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1274 "called" "cascade" "case" "cast" "characteristics" "check"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1275 "checkpoint" "class" "close" "cluster" "column" "comment" "commit"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1276 "committed" "commutator" "constraint" "constraints" "conversion"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1277 "copy" "create" "createdb" "createuser" "cursor" "cycle" "database"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1278 "deallocate" "declare" "default" "deferrable" "deferred" "definer"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1279 "delete" "delimiter" "desc" "distinct" "do" "domain" "drop" "each"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1280 "element" "else" "encoding" "encrypted" "end" "escape" "except"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1281 "exclusive" "execute" "exists" "explain" "extended" "external" "false"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1282 "fetch" "finalfunc" "for" "force" "foreign" "forward" "freeze" "from"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1283 "full" "function" "grant" "group" "gtcmp" "handler" "hashes" "having"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1284 "immediate" "immutable" "implicit" "in" "increment" "index" "inherits"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1285 "initcond" "initially" "input" "insensitive" "insert" "instead"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1286 "internallength" "intersect" "into" "invoker" "is" "isnull"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1287 "isolation" "join" "key" "language" "leftarg" "level" "like" "limit"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1288 "listen" "load" "local" "location" "lock" "ltcmp" "main" "match"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1289 "maxvalue" "merges" "minvalue" "mode" "move" "natural" "negator"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1290 "next" "nocreatedb" "nocreateuser" "none" "not" "nothing" "notify"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1291 "notnull" "null" "of" "offset" "oids" "on" "only" "operator" "or"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1292 "order" "output" "owner" "partial" "passedbyvalue" "password" "plain"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1293 "prepare" "primary" "prior" "privileges" "procedural" "procedure"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1294 "public" "read" "recheck" "references" "reindex" "relative" "rename"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1295 "reset" "restrict" "returns" "revoke" "rightarg" "rollback" "row"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1296 "rule" "schema" "scroll" "security" "select" "sequence" "serializable"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1297 "session" "set" "sfunc" "share" "show" "similar" "some" "sort1"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1298 "sort2" "stable" "start" "statement" "statistics" "storage" "strict"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1299 "stype" "sysid" "table" "temp" "template" "temporary" "then" "to"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1300 "transaction" "trigger" "true" "truncate" "trusted" "type"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1301 "unencrypted" "union" "unique" "unknown" "unlisten" "until" "update"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1302 "usage" "user" "using" "vacuum" "valid" "validator" "values"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1303 "variable" "verbose" "view" "volatile" "when" "where" "with" "without"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1304 "work"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1305 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1306
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1307 (pg-types (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1308 "anyarray" "bigint" "bigserial" "bit" "boolean" "box" "bytea" "char"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1309 "character" "cidr" "circle" "cstring" "date" "decimal" "double"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1310 "float4" "float8" "inet" "int2" "int4" "int8" "integer" "internal"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1311 "interval" "language_handler" "line" "lseg" "macaddr" "money"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1312 "numeric" "oid" "opaque" "path" "point" "polygon" "precision" "real"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1313 "record" "regclass" "regoper" "regoperator" "regproc" "regprocedure"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1314 "regtype" "serial" "serial4" "serial8" "smallint" "text" "time"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1315 "timestamp" "varchar" "varying" "void" "zone"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1316 )))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1317
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1318 `((,pg-funcs . font-lock-builtin-face)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1319 (,pg-reserved . font-lock-keyword-face)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1320 (,pg-types . font-lock-type-face)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1321
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1322 "Postgres SQL keywords used by font-lock.
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1323
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1324 This variable is used by `sql-mode' and `sql-interactive-mode'. The
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1325 regular expressions are created during compilation by calling the
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1326 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1327 you define your own sql-mode-postgres-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1328
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1329 (defvar sql-mode-linter-font-lock-keywords
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1330 (let ((linter-keywords (sql-keywords-re
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1331 "autocommit" "autoinc" "autorowid" "cancel" "cascade" "channel"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1332 "committed" "count" "countblob" "cross" "current" "data" "database"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1333 "datafile" "datafiles" "datesplit" "dba" "dbname" "default" "deferred"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1334 "denied" "description" "device" "difference" "directory" "error"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1335 "escape" "euc" "exclusive" "external" "extfile" "false" "file"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1336 "filename" "filesize" "filetime" "filter" "findblob" "first" "foreign"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1337 "full" "fuzzy" "global" "granted" "ignore" "immediate" "increment"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1338 "indexes" "indexfile" "indexfiles" "indextime" "initial" "integrity"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1339 "internal" "key" "last_autoinc" "last_rowid" "limit" "linter"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1340 "linter_file_device" "linter_file_size" "linter_name_length" "ln"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1341 "local" "login" "maxisn" "maxrow" "maxrowid" "maxvalue" "message"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1342 "minvalue" "module" "names" "national" "natural" "new" "new_table"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1343 "no" "node" "noneuc" "nulliferror" "numbers" "off" "old" "old_table"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1344 "only" "operation" "optimistic" "option" "page" "partially" "password"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1345 "phrase" "plan" "precision" "primary" "priority" "privileges"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1346 "proc_info_size" "proc_par_name_len" "protocol" "quant" "range" "raw"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1347 "read" "record" "records" "references" "remote" "rename" "replication"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1348 "restart" "rewrite" "root" "row" "rule" "savepoint" "security"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1349 "sensitive" "sequence" "serializable" "server" "since" "size" "some"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1350 "startup" "statement" "station" "success" "sys_guid" "tables" "test"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1351 "timeout" "trace" "transaction" "translation" "trigger"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1352 "trigger_info_size" "true" "trunc" "uncommitted" "unicode" "unknown"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1353 "unlimited" "unlisted" "user" "utf8" "value" "varying" "volumes"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1354 "wait" "windows_code" "workspace" "write" "xml"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1355 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1356
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1357 (linter-reserved (sql-keywords-re
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1358 "access" "action" "add" "address" "after" "all" "alter" "always" "and"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1359 "any" "append" "as" "asc" "ascic" "async" "at_begin" "at_end" "audit"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1360 "aud_obj_name_len" "backup" "base" "before" "between" "blobfile"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1361 "blobfiles" "blobpct" "brief" "browse" "by" "case" "cast" "check"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1362 "clear" "close" "column" "comment" "commit" "connect" "contains"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1363 "correct" "create" "delete" "desc" "disable" "disconnect" "distinct"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1364 "drop" "each" "ef" "else" "enable" "end" "event" "except" "exclude"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1365 "execute" "exists" "extract" "fetch" "finish" "for" "from" "get"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1366 "grant" "group" "having" "identified" "in" "index" "inner" "insert"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1367 "instead" "intersect" "into" "is" "isolation" "join" "left" "level"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1368 "like" "lock" "mode" "modify" "not" "nowait" "null" "of" "on" "open"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1369 "or" "order" "outer" "owner" "press" "prior" "procedure" "public"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1370 "purge" "rebuild" "resource" "restrict" "revoke" "right" "role"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1371 "rollback" "rownum" "select" "session" "set" "share" "shutdown"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1372 "start" "stop" "sync" "synchronize" "synonym" "sysdate" "table" "then"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1373 "to" "union" "unique" "unlock" "until" "update" "using" "values"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1374 "view" "when" "where" "with" "without"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1375 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1376
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1377 (linter-types (sql-keywords-re
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1378 "bigint" "bitmap" "blob" "boolean" "char" "character" "date"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1379 "datetime" "dec" "decimal" "double" "float" "int" "integer" "nchar"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1380 "number" "numeric" "real" "smallint" "varbyte" "varchar" "byte"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1381 "cursor" "long"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1382 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1383
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1384 (linter-functions (sql-keywords-re
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1385 "abs" "acos" "asin" "atan" "atan2" "avg" "ceil" "cos" "cosh" "divtime"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1386 "exp" "floor" "getbits" "getblob" "getbyte" "getlong" "getraw"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1387 "getstr" "gettext" "getword" "hextoraw" "lenblob" "length" "log"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1388 "lower" "lpad" "ltrim" "max" "min" "mod" "monthname" "nvl"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1389 "octet_length" "power" "rand" "rawtohex" "repeat_string"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1390 "right_substr" "round" "rpad" "rtrim" "sign" "sin" "sinh" "soundex"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1391 "sqrt" "sum" "tan" "tanh" "timeint_to_days" "to_char" "to_date"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1392 "to_gmtime" "to_localtime" "to_number" "trim" "upper" "decode"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1393 "substr" "substring" "chr" "dayname" "days" "greatest" "hex" "initcap"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1394 "instr" "least" "multime" "replace" "width"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1395 )))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1396
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1397 `((,linter-keywords . font-lock-keyword-face)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1398 (,linter-reserved . font-lock-keyword-face)
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1399 (,linter-functions . font-lock-builtin-face)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1400 (,linter-types . font-lock-type-face)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1401
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1402 "Linter SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1403
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1404 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1405 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1406 function `regexp-opt'.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1407
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1408 (defvar sql-mode-ms-font-lock-keywords
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1409 (let ((ms-reserved (sql-keywords-re
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1410 "absolute" "add" "all" "alter" "and" "any" "as" "asc" "authorization"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1411 "avg" "backup" "begin" "between" "break" "browse" "bulk" "by"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1412 "cascade" "case" "check" "checkpoint" "close" "clustered" "coalesce"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1413 "column" "commit" "committed" "compute" "confirm" "constraint"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1414 "contains" "containstable" "continue" "controlrow" "convert" "count"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1415 "create" "cross" "current" "current_date" "current_time"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1416 "current_timestamp" "current_user" "database" "deallocate" "declare"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1417 "default" "delete" "deny" "desc" "disk" "distinct" "distributed"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1418 "double" "drop" "dummy" "dump" "else" "end" "errlvl" "errorexit"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1419 "escape" "except" "exec" "execute" "exists" "exit" "fetch" "file"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1420 "fillfactor" "first" "floppy" "for" "foreign" "freetext"
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1421 "freetexttable" "from" "full" "goto" "grant" "group" "having"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1422 "holdlock" "identity" "identity_insert" "identitycol" "if" "in"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1423 "index" "inner" "insert" "intersect" "into" "is" "isolation" "join"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1424 "key" "kill" "last" "left" "level" "like" "lineno" "load" "max" "min"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1425 "mirrorexit" "national" "next" "nocheck" "nolock" "nonclustered" "not"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1426 "null" "nullif" "of" "off" "offsets" "on" "once" "only" "open"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1427 "opendatasource" "openquery" "openrowset" "option" "or" "order"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1428 "outer" "output" "over" "paglock" "percent" "perm" "permanent" "pipe"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1429 "plan" "precision" "prepare" "primary" "print" "prior" "privileges"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1430 "proc" "procedure" "processexit" "public" "raiserror" "read"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1431 "readcommitted" "readpast" "readtext" "readuncommitted" "reconfigure"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1432 "references" "relative" "repeatable" "repeatableread" "replication"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1433 "restore" "restrict" "return" "revoke" "right" "rollback" "rowcount"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1434 "rowguidcol" "rowlock" "rule" "save" "schema" "select" "serializable"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1435 "session_user" "set" "shutdown" "some" "statistics" "sum"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1436 "system_user" "table" "tablock" "tablockx" "tape" "temp" "temporary"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1437 "textsize" "then" "to" "top" "tran" "transaction" "trigger" "truncate"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1438 "tsequal" "uncommitted" "union" "unique" "update" "updatetext"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1439 "updlock" "use" "user" "values" "view" "waitfor" "when" "where"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1440 "while" "with" "work" "writetext" "collate" "function" "openxml"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1441 "returns"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1442 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1443
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1444 (ms-types (sql-keywords-re
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1445 "binary" "bit" "char" "character" "cursor" "datetime" "dec" "decimal"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1446 "double" "float" "image" "int" "integer" "money" "national" "nchar"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1447 "ntext" "numeric" "numeric" "nvarchar" "precision" "real"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1448 "smalldatetime" "smallint" "smallmoney" "text" "timestamp" "tinyint"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1449 "uniqueidentifier" "varbinary" "varchar" "varying"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1450 ))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1451
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1452 (ms-vars "\\b@[a-zA-Z0-9_]*\\b")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1453
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1454 (ms-functions (sql-keywords-re
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1455 "@@connections" "@@cpu_busy" "@@cursor_rows" "@@datefirst" "@@dbts"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1456 "@@error" "@@fetch_status" "@@identity" "@@idle" "@@io_busy"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1457 "@@langid" "@@language" "@@lock_timeout" "@@max_connections"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1458 "@@max_precision" "@@nestlevel" "@@options" "@@pack_received"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1459 "@@pack_sent" "@@packet_errors" "@@procid" "@@remserver" "@@rowcount"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1460 "@@servername" "@@servicename" "@@spid" "@@textsize" "@@timeticks"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1461 "@@total_errors" "@@total_read" "@@total_write" "@@trancount"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1462 "@@version" "abs" "acos" "and" "app_name" "ascii" "asin" "atan" "atn2"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1463 "avg" "case" "cast" "ceiling" "char" "charindex" "coalesce"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1464 "col_length" "col_name" "columnproperty" "containstable" "convert"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1465 "cos" "cot" "count" "current_timestamp" "current_user" "cursor_status"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1466 "databaseproperty" "datalength" "dateadd" "datediff" "datename"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1467 "datepart" "day" "db_id" "db_name" "degrees" "difference" "exp"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1468 "file_id" "file_name" "filegroup_id" "filegroup_name"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1469 "filegroupproperty" "fileproperty" "floor" "formatmessage"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1470 "freetexttable" "fulltextcatalogproperty" "fulltextserviceproperty"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1471 "getansinull" "getdate" "grouping" "host_id" "host_name" "ident_incr"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1472 "ident_seed" "identity" "index_col" "indexproperty" "is_member"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1473 "is_srvrolemember" "isdate" "isnull" "isnumeric" "left" "len" "log"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1474 "log10" "lower" "ltrim" "max" "min" "month" "nchar" "newid" "nullif"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1475 "object_id" "object_name" "objectproperty" "openquery" "openrowset"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1476 "parsename" "patindex" "patindex" "permissions" "pi" "power"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1477 "quotename" "radians" "rand" "replace" "replicate" "reverse" "right"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1478 "round" "rtrim" "session_user" "sign" "sin" "soundex" "space" "sqrt"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1479 "square" "stats_date" "stdev" "stdevp" "str" "stuff" "substring" "sum"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1480 "suser_id" "suser_name" "suser_sid" "suser_sname" "system_user" "tan"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1481 "textptr" "textvalid" "typeproperty" "unicode" "upper" "user"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1482 "user_id" "user_name" "var" "varp" "year"
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1483 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1484
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1485 (ms-commands
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1486 (eval-when-compile
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1487 (concat "^\\(\\(set\\s-+\\("
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1488 (regexp-opt '(
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1489 "datefirst" "dateformat" "deadlock_priority" "lock_timeout"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1490 "concat_null_yields_null" "cursor_close_on_commit"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1491 "disable_def_cnst_chk" "fips_flagger" "identity_insert" "language"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1492 "offsets" "quoted_identifier" "arithabort" "arithignore" "fmtonly"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1493 "nocount" "noexec" "numeric_roundabort" "parseonly"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1494 "query_governor_cost_limit" "rowcount" "textsize" "ansi_defaults"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1495 "ansi_null_dflt_off" "ansi_null_dflt_on" "ansi_nulls" "ansi_padding"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1496 "ansi_warnings" "forceplan" "showplan_all" "showplan_text"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1497 "statistics" "implicit_transactions" "remote_proc_transactions"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1498 "transaction" "xact_abort"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1499 ) t)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1500 "\\)\\)\\|go\\s-*\\|use\\s-+\\|setuser\\s-+\\|dbcc\\s-+\\).*$"))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1501
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1502 `((,ms-commands . font-lock-doc-face)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1503 (,ms-reserved . font-lock-keyword-face)
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1504 (,ms-functions . font-lock-builtin-face)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1505 (,ms-vars . font-lock-variable-name-face)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1506 (,ms-types . font-lock-type-face)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1507
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1508 "Microsoft SQLServer SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1509
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1510 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1511 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1512 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1513 you define your own sql-mode-ms-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1514
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1515 (defvar sql-mode-sybase-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1516 "Sybase SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1517
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1518 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1519 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1520 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1521 you define your own sql-mode-sybase-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1522
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1523 (defvar sql-mode-informix-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1524 "Informix SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1525
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1526 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1527 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1528 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1529 you define your own sql-mode-informix-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1530
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1531 (defvar sql-mode-interbase-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1532 "Interbase SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1533
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1534 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1535 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1536 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1537 you define your own sql-mode-interbase-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1538
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1539 (defvar sql-mode-ingres-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1540 "Ingres SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1541
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1542 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1543 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1544 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1545 you define your own sql-mode-interbase-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1546
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1547 (defvar sql-mode-solid-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1548 "Solid SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1549
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1550 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1551 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1552 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1553 you define your own sql-mode-solid-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1554
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1555 (defvar sql-mode-mysql-font-lock-keywords
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1556 (let ((mysql-funcs (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1557 "ascii" "avg" "bdmpolyfromtext" "bdmpolyfromwkb" "bdpolyfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1558 "bdpolyfromwkb" "benchmark" "bin" "bit_and" "bit_length" "bit_or"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1559 "bit_xor" "both" "cast" "char_length" "character_length" "coalesce"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1560 "concat" "concat_ws" "connection_id" "conv" "convert" "count"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1561 "curdate" "current_date" "current_time" "current_timestamp" "curtime"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1562 "elt" "encrypt" "export_set" "field" "find_in_set" "found_rows" "from"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1563 "geomcollfromtext" "geomcollfromwkb" "geometrycollectionfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1564 "geometrycollectionfromwkb" "geometryfromtext" "geometryfromwkb"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1565 "geomfromtext" "geomfromwkb" "get_lock" "group_concat" "hex" "ifnull"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1566 "instr" "interval" "isnull" "last_insert_id" "lcase" "leading"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1567 "length" "linefromtext" "linefromwkb" "linestringfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1568 "linestringfromwkb" "load_file" "locate" "lower" "lpad" "ltrim"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1569 "make_set" "master_pos_wait" "max" "mid" "min" "mlinefromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1570 "mlinefromwkb" "mpointfromtext" "mpointfromwkb" "mpolyfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1571 "mpolyfromwkb" "multilinestringfromtext" "multilinestringfromwkb"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1572 "multipointfromtext" "multipointfromwkb" "multipolygonfromtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1573 "multipolygonfromwkb" "now" "nullif" "oct" "octet_length" "ord"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1574 "pointfromtext" "pointfromwkb" "polyfromtext" "polyfromwkb"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1575 "polygonfromtext" "polygonfromwkb" "position" "quote" "rand"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1576 "release_lock" "repeat" "replace" "reverse" "rpad" "rtrim" "soundex"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1577 "space" "std" "stddev" "substring" "substring_index" "sum" "sysdate"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1578 "trailing" "trim" "ucase" "unix_timestamp" "upper" "user" "variance"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1579 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1580
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1581 (mysql-keywords (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1582 "action" "add" "after" "against" "all" "alter" "and" "as" "asc"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1583 "auto_increment" "avg_row_length" "bdb" "between" "by" "cascade"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1584 "case" "change" "character" "check" "checksum" "close" "collate"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1585 "collation" "column" "columns" "comment" "committed" "concurrent"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1586 "constraint" "create" "cross" "data" "database" "default"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1587 "delay_key_write" "delayed" "delete" "desc" "directory" "disable"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1588 "distinct" "distinctrow" "do" "drop" "dumpfile" "duplicate" "else"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1589 "enable" "enclosed" "end" "escaped" "exists" "fields" "first" "for"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1590 "force" "foreign" "from" "full" "fulltext" "global" "group" "handler"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1591 "having" "heap" "high_priority" "if" "ignore" "in" "index" "infile"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1592 "inner" "insert" "insert_method" "into" "is" "isam" "isolation" "join"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1593 "key" "keys" "last" "left" "level" "like" "limit" "lines" "load"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1594 "local" "lock" "low_priority" "match" "max_rows" "merge" "min_rows"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1595 "mode" "modify" "mrg_myisam" "myisam" "natural" "next" "no" "not"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1596 "null" "offset" "oj" "on" "open" "optionally" "or" "order" "outer"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1597 "outfile" "pack_keys" "partial" "password" "prev" "primary"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1598 "procedure" "quick" "raid0" "raid_type" "read" "references" "rename"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1599 "repeatable" "restrict" "right" "rollback" "rollup" "row_format"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1600 "savepoint" "select" "separator" "serializable" "session" "set"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1601 "share" "show" "sql_big_result" "sql_buffer_result" "sql_cache"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1602 "sql_calc_found_rows" "sql_no_cache" "sql_small_result" "starting"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1603 "straight_join" "striped" "table" "tables" "temporary" "terminated"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1604 "then" "to" "transaction" "truncate" "type" "uncommitted" "union"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1605 "unique" "unlock" "update" "use" "using" "values" "when" "where"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1606 "with" "write" "xor"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1607 ))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1608
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1609 (mysql-types (sql-keywords-re
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1610 "bigint" "binary" "bit" "blob" "bool" "boolean" "char" "curve" "date"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1611 "datetime" "dec" "decimal" "double" "enum" "fixed" "float" "geometry"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1612 "geometrycollection" "int" "integer" "line" "linearring" "linestring"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1613 "longblob" "longtext" "mediumblob" "mediumint" "mediumtext"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1614 "multicurve" "multilinestring" "multipoint" "multipolygon"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1615 "multisurface" "national" "numeric" "point" "polygon" "precision"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1616 "real" "smallint" "surface" "text" "time" "timestamp" "tinyblob"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1617 "tinyint" "tinytext" "unsigned" "varchar" "year" "year2" "year4"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1618 "zerofill"
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1619 )))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1620
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1621 `((,mysql-funcs . font-lock-builtin-face)
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1622 (,mysql-keywords . font-lock-keyword-face)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1623 (,mysql-types . font-lock-type-face)))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1624
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1625 "MySQL SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1626
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1627 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1628 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1629 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1630 you define your own sql-mode-mysql-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1631
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1632 (defvar sql-mode-sqlite-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1633 "SQLite SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1634
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1635 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1636 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1637 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1638 you define your own sql-mode-sqlite-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1639
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1640 (defvar sql-mode-db2-font-lock-keywords nil
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1641 "DB2 SQL keywords used by font-lock.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1642
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1643 This variable is used by `sql-mode' and `sql-interactive-mode'. The
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1644 regular expressions are created during compilation by calling the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1645 function `regexp-opt'. Therefore, take a look at the source before
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1646 you define your own sql-mode-db2-font-lock-keywords.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1647
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1648 (defvar sql-mode-font-lock-keywords nil
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1649 "SQL keywords used by font-lock.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1650
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1651 Setting this variable directly no longer has any affect. Use
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1652 `sql-product' and `sql-add-product-keywords' to control the
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1653 highlighting rules in sql-mode.")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1654
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1655
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1656
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1657 ;;; SQL Product support functions
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1658
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1659 (defun sql-product-feature (feature &optional product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1660 "Lookup `feature' needed to support the current SQL product.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1661
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1662 See \[sql-product-alist] for a list of products and supported features."
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1663 (plist-get
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1664 (cdr (assoc (or product sql-product)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1665 sql-product-alist))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1666 feature))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1667
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1668 (defun sql-product-font-lock (keywords-only imenu)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1669 "Sets `font-lock-defaults' and `font-lock-keywords' based on
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1670 the product-specific keywords and syntax-alists defined in
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1671 `sql-product-alist'."
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1672 (let
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1673 ;; Get the product-specific syntax-alist.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1674 ((syntax-alist
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1675 (append
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1676 (sql-product-feature :syntax-alist)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1677 '((?_ . "w") (?. . "w")))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1678
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1679 ;; Get the product-specific keywords.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1680 (setq sql-mode-font-lock-keywords
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1681 (append
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1682 (unless (eq sql-product 'ansi)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1683 (eval (sql-product-feature :font-lock)))
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1684 ;; Always highlight ANSI keywords
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1685 (eval (sql-product-feature :font-lock 'ansi))
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1686 ;; Fontify object names in CREATE, DROP and ALTER DDL
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1687 ;; statements
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1688 (list sql-mode-font-lock-object-name)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1689
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1690 ;; Setup font-lock. Force re-parsing of `font-lock-defaults'.
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1691 (set (make-local-variable 'font-lock-set-defaults) nil)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1692 (setq font-lock-defaults (list 'sql-mode-font-lock-keywords
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1693 keywords-only t syntax-alist))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1694
55370
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1695 ;; Force font lock to reinitialize if it is already on
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1696 ;; Otherwise, we can wait until it can be started.
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1697 (when (and (fboundp 'font-lock-mode)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1698 font-lock-mode)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1699 (font-lock-mode-internal nil)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1700 (font-lock-mode-internal t))
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1701
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1702 (add-hook 'font-lock-mode-hook
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1703 (lambda ()
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1704 ;; Provide defaults for new font-lock faces.
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1705 (defvar font-lock-builtin-face
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1706 (if (boundp 'font-lock-preprocessor-face)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1707 font-lock-preprocessor-face
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1708 font-lock-keyword-face))
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1709 (defvar font-lock-doc-face font-lock-string-face))
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1710 nil t)
f714f103b48a (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 55241
diff changeset
1711
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1712 ;; Setup imenu; it needs the same syntax-alist.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1713 (when imenu
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1714 (setq imenu-syntax-alist syntax-alist))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1715
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1716 ;;;###autoload
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1717 (defun sql-add-product-keywords (product keywords &optional append)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1718 "Add highlighting KEYWORDS for SQL PRODUCT.
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1719
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1720 PRODUCT should be a symbol, the name of a sql product, such as
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1721 `oracle'. KEYWORDS should be a list; see the variable
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1722 `font-lock-keywords'. By default they are added at the beginning
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1723 of the current highlighting list. If optional argument APPEND is
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1724 `set', they are used to replace the current highlighting list.
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1725 If APPEND is any other non-nil value, they are added at the end
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1726 of the current highlighting list.
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1727
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1728 For example:
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1729
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1730 (sql-add-product-keywords 'ms
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1731 '((\"\\\\b\\\\w+_t\\\\b\" . font-lock-type-face)))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1732
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1733 adds a fontification pattern to fontify identifiers ending in
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1734 `_t' as data types."
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1735
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1736 (let ((font-lock (sql-product-feature :font-lock product))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1737 old)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1738 (setq old (eval font-lock))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1739 (set font-lock
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1740 (if (eq append 'set)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1741 keywords
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1742 (if append
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1743 (append old keywords)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1744 (append keywords old))))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1745
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1746
30905
2069c10bf952 (sql-magic-go): Use comint-bol.
Gerd Moellmann <gerd@gnu.org>
parents: 30838
diff changeset
1747
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1748 ;;; Functions to switch highlighting
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1749
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1750 (defun sql-highlight-product ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1751 "Turns on the appropriate font highlighting for the SQL product
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1752 selected."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1753
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1754 (when (eq major-mode 'sql-mode)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1755 ;; Setup font-lock
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1756 (sql-product-font-lock nil t)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1757
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1758 ;; Set the mode name to include the product.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1759 (setq mode-name (concat "SQL[" (prin1-to-string sql-product) "]"))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1760
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1761 (defun sql-set-product (product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1762 "Set `sql-product' to product and enable appropriate
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1763 highlighting."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1764 (interactive "SEnter SQL product: ")
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
1765 (when (not (assoc product sql-product-alist))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1766 (error "SQL product %s is not supported; treated as ANSI" product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1767 (setq product 'ansi))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1768
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1769 ;; Save product setting and fontify.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1770 (setq sql-product product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1771 (sql-highlight-product))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1772
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1773 (defun sql-highlight-oracle-keywords ()
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1774 "Highlight Oracle keywords."
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1775 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1776 (sql-set-product 'oracle))
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1777
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1778 (defun sql-highlight-postgres-keywords ()
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1779 "Highlight Postgres keywords."
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1780 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1781 (sql-set-product 'postgres))
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1782
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1783 (defun sql-highlight-linter-keywords ()
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1784 "Highlight LINTER keywords."
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1785 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1786 (sql-set-product 'linter))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1787
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1788 (defun sql-highlight-ms-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1789 "Highlight Microsoft SQLServer keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1790 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1791 (sql-set-product 'ms))
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1792
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1793 (defun sql-highlight-ansi-keywords ()
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1794 "Highlight ANSI SQL keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1795 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1796 (sql-set-product 'ansi))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1797
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1798 (defun sql-highlight-sybase-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1799 "Highlight Sybase SQL keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1800 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1801 (sql-set-product 'sybase))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1802
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1803 (defun sql-highlight-informix-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1804 "Highlight Informix SQL keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1805 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1806 (sql-set-product 'informix))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1807
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1808 (defun sql-highlight-interbase-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1809 "Highlight Interbase SQL keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1810 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1811 (sql-set-product 'interbase))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1812
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1813 (defun sql-highlight-ingres-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1814 "Highlight Ingres SQL keywords."
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1815 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1816 (sql-set-product 'ingres))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1817
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1818 (defun sql-highlight-solid-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1819 "Highlight Solid SQL keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1820 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1821 (sql-set-product 'solid))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1822
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1823 (defun sql-highlight-mysql-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1824 "Highlight MySQL SQL keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1825 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1826 (sql-set-product 'mysql))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1827
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1828 (defun sql-highlight-sqlite-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1829 "Highlight SQLite SQL keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1830 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1831 (sql-set-product 'sqlite))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1832
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1833 (defun sql-highlight-db2-keywords ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1834 "Highlight DB2 SQL keywords."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1835 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1836 (sql-set-product 'db2))
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1837
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1838
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1839
30838
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1840 ;;; Compatibility functions
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1841
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1842 (if (not (fboundp 'comint-line-beginning-position))
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1843 ;; comint-line-beginning-position is defined in Emacs 21
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1844 (defun comint-line-beginning-position ()
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1845 "Returns the buffer position of the beginning of the line, after any prompt.
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1846 The prompt is assumed to be any text at the beginning of the line matching
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1847 the regular expression `comint-prompt-regexp', a buffer local variable."
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1848 (save-excursion (comint-bol nil) (point))))
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1849
c9f793802722 Add compatibility definition of comint-line-beginning-position.
Miles Bader <miles@gnu.org>
parents: 30642
diff changeset
1850
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1851
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1852 ;;; Small functions
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1853
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1854 (defun sql-magic-go (arg)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1855 "Insert \"o\" and call `comint-send-input'.
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1856 `sql-electric-stuff' must be the symbol `go'."
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1857 (interactive "P")
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1858 (self-insert-command (prefix-numeric-value arg))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1859 (if (and (equal sql-electric-stuff 'go)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1860 (save-excursion
30642
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
1861 (comint-bol nil)
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
1862 (looking-at "go\\b")))
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1863 (comint-send-input)))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1864
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1865 (defun sql-magic-semicolon (arg)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1866 "Insert semicolon and call `comint-send-input'.
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1867 `sql-electric-stuff' must be the symbol `semicolon'."
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1868 (interactive "P")
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1869 (self-insert-command (prefix-numeric-value arg))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1870 (if (equal sql-electric-stuff 'semicolon)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1871 (comint-send-input)))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1872
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1873 (defun sql-accumulate-and-indent ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1874 "Continue SQL statement on the next line."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1875 (interactive)
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1876 (if (fboundp 'comint-accumulate)
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1877 (comint-accumulate)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1878 (newline))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1879 (indent-according-to-mode))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1880
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1881 ;;;###autoload
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1882 (defun sql-help ()
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
1883 "Show short help for the SQL modes.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1884
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1885 Use an entry function to open an interactive SQL buffer. This buffer is
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1886 usually named `*SQL*'. The name of the major mode is SQLi.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1887
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1888 Use the following commands to start a specific SQL interpreter:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1889
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1890 PostGres: \\[sql-postgres]
40432
225bd38b0ce7 (sql-mysql): Doc change by RMS.
Gerd Moellmann <gerd@gnu.org>
parents: 38872
diff changeset
1891 MySQL: \\[sql-mysql]
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
1892 SQLite: \\[sql-sqlite]
24268
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
1893
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
1894 Other non-free SQL implementations are also supported:
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
1895
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1896 Solid: \\[sql-solid]
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1897 Oracle: \\[sql-oracle]
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1898 Informix: \\[sql-informix]
24268
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
1899 Sybase: \\[sql-sybase]
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
1900 Ingres: \\[sql-ingres]
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
1901 Microsoft: \\[sql-ms]
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1902 DB2: \\[sql-db2]
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
1903 Interbase: \\[sql-interbase]
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1904 Linter: \\[sql-linter]
24268
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
1905
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
1906 But we urge you to choose a free implementation instead of these.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1907
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1908 Once you have the SQLi buffer, you can enter SQL statements in the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1909 buffer. The output generated is appended to the buffer and a new prompt
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1910 is generated. See the In/Out menu in the SQLi buffer for some functions
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1911 that help you navigate through the buffer, the input history, etc.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1912
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1913 If you have a really complex SQL statement or if you are writing a
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1914 procedure, you can do this in a separate buffer. Put the new buffer in
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1915 `sql-mode' by calling \\[sql-mode]. The name of this buffer can be
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1916 anything. The name of the major mode is SQL.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1917
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1918 In this SQL buffer (SQL mode), you can send the region or the entire
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1919 buffer to the interactive SQL buffer (SQLi mode). The results are
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1920 appended to the SQLi buffer without disturbing your SQL buffer."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1921 (interactive)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1922 (describe-function 'sql-help))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1923
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1924 (defun sql-read-passwd (prompt &optional default)
64837
f80fef683ab5 (sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents: 64699
diff changeset
1925 "Read a password using PROMPT. Optional DEFAULT is password to start with."
f80fef683ab5 (sql-interactive-mode-map): Use fboundp.
Richard M. Stallman <rms@gnu.org>
parents: 64699
diff changeset
1926 (read-passwd prompt nil default))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1927
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1928 (defun sql-get-login (&rest what)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1929 "Get username, password and database from the user.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1930
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1931 The variables `sql-user', `sql-password', `sql-server', and
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
1932 `sql-database' can be customized. They are used as the default values.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1933 Usernames, servers and databases are stored in `sql-user-history',
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1934 `sql-server-history' and `database-history'. Passwords are not stored
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
1935 in a history.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1936
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1937 Parameter WHAT is a list of the arguments passed to this function.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1938 The function asks for the username if WHAT contains symbol `user', for
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1939 the password if it contains symbol `password', for the server if it
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1940 contains symbol `server', and for the database if it contains symbol
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1941 `database'. The members of WHAT are processed in the order in which
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1942 they are provided.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1943
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1944 In order to ask the user for username, password and database, call the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1945 function like this: (sql-get-login 'user 'password 'database)."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1946 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1947 (while what
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1948 (cond
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1949 ((eq (car what) 'user) ; user
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
1950 (setq sql-user
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1951 (read-from-minibuffer "User: " sql-user nil nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1952 sql-user-history)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1953 ((eq (car what) 'password) ; password
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
1954 (setq sql-password
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1955 (sql-read-passwd "Password: " sql-password)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1956 ((eq (car what) 'server) ; server
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
1957 (setq sql-server
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1958 (read-from-minibuffer "Server: " sql-server nil nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1959 sql-server-history)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1960 ((eq (car what) 'database) ; database
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
1961 (setq sql-database
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1962 (read-from-minibuffer "Database: " sql-database nil nil
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1963 sql-database-history))))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
1964 (setq what (cdr what))))
25381
970b18c6803f (sql-sybase): use sql-server instead of sql-database.
Alex Schroeder <alex@gnu.org>
parents: 25183
diff changeset
1965
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1966 (defun sql-find-sqli-buffer ()
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1967 "Return the current default SQLi buffer or nil.
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1968 In order to qualify, the SQLi buffer must be alive,
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1969 be in `sql-interactive-mode' and have a process."
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1970 (let ((default-buffer (default-value 'sql-buffer)))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1971 (if (and (buffer-live-p default-buffer)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1972 (get-buffer-process default-buffer))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1973 default-buffer
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1974 (save-excursion
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1975 (let ((buflist (buffer-list))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1976 (found))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1977 (while (not (or (null buflist)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1978 found))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1979 (let ((candidate (car buflist)))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1980 (set-buffer candidate)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1981 (if (and (equal major-mode 'sql-interactive-mode)
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1982 (get-buffer-process candidate))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1983 (setq found candidate))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1984 (setq buflist (cdr buflist))))
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
1985 found)))))
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1986
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1987 (defun sql-set-sqli-buffer-generally ()
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
1988 "Set SQLi buffer for all SQL buffers that have none.
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1989 This function checks all SQL buffers for their SQLi buffer. If their
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1990 SQLi buffer is nonexistent or has no process, it is set to the current
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1991 default SQLi buffer. The current default SQLi buffer is determined
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1992 using `sql-find-sqli-buffer'. If `sql-buffer' is set,
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1993 `sql-set-sqli-hook' is run."
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1994 (interactive)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1995 (save-excursion
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1996 (let ((buflist (buffer-list))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1997 (default-sqli-buffer (sql-find-sqli-buffer)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1998 (setq-default sql-buffer default-sqli-buffer)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
1999 (while (not (null buflist))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2000 (let ((candidate (car buflist)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2001 (set-buffer candidate)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2002 (if (and (equal major-mode 'sql-mode)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2003 (not (buffer-live-p sql-buffer)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2004 (progn
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2005 (setq sql-buffer default-sqli-buffer)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2006 (run-hooks 'sql-set-sqli-hook))))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2007 (setq buflist (cdr buflist))))))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2008
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2009 (defun sql-set-sqli-buffer ()
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2010 "Set the SQLi buffer SQL strings are sent to.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2011
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2012 Call this function in a SQL buffer in order to set the SQLi buffer SQL
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2013 strings are sent to. Calling this function sets `sql-buffer' and runs
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2014 `sql-set-sqli-hook'.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2015
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2016 If you call it from a SQL buffer, this sets the local copy of
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2017 `sql-buffer'.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2018
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2019 If you call it from anywhere else, it sets the global copy of
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2020 `sql-buffer'."
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2021 (interactive)
26576
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2022 (let ((default-buffer (sql-find-sqli-buffer)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2023 (if (null default-buffer)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2024 (error "There is no suitable SQLi buffer"))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2025 (let ((new-buffer
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2026 (get-buffer
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2027 (read-buffer "New SQLi buffer: " default-buffer t))))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2028 (if (null (get-buffer-process new-buffer))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2029 (error "Buffer %s has no process" (buffer-name new-buffer)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2030 (if (null (save-excursion
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2031 (set-buffer new-buffer)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2032 (equal major-mode 'sql-interactive-mode)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2033 (error "Buffer %s is no SQLi buffer" (buffer-name new-buffer)))
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2034 (if new-buffer
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2035 (progn
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2036 (setq sql-buffer new-buffer)
0894b3c8dfd6 (sql-find-sqli-buffer): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 25826
diff changeset
2037 (run-hooks 'sql-set-sqli-hook))))))
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2038
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2039 (defun sql-show-sqli-buffer ()
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2040 "Show the name of current SQLi buffer.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2041
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2042 This is the buffer SQL strings are sent to. It is stored in the
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2043 variable `sql-buffer'. See `sql-help' on how to create such a buffer."
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2044 (interactive)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2045 (if (null (buffer-live-p sql-buffer))
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2046 (message "%s has no SQLi buffer set." (buffer-name (current-buffer)))
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2047 (if (null (get-buffer-process sql-buffer))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2048 (message "Buffer %s has no process." (buffer-name sql-buffer))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2049 (message "Current SQLi buffer is %s." (buffer-name sql-buffer)))))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2050
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2051 (defun sql-make-alternate-buffer-name ()
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2052 "Return a string that can be used to rename a SQLi buffer.
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2053
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2054 This is used to set `sql-alternate-buffer-name' within
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2055 `sql-interactive-mode'."
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2056 (concat (if (string= "" sql-user)
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2057 (if (string= "" (user-login-name))
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2058 ()
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2059 (concat (user-login-name) "/"))
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2060 (concat sql-user "/"))
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2061 (if (string= "" sql-database)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2062 (if (string= "" sql-server)
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2063 (system-name)
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2064 sql-server)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2065 sql-database)))
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2066
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2067 (defun sql-rename-buffer ()
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2068 "Renames a SQLi buffer."
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2069 (interactive)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2070 (rename-buffer (format "*SQL: %s*" sql-alternate-buffer-name) t))
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2071
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2072 (defun sql-copy-column ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2073 "Copy current column to the end of buffer.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2074 Inserts SELECT or commas if appropriate."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2075 (interactive)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2076 (let ((column))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2077 (save-excursion
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2078 (setq column (buffer-substring
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2079 (progn (forward-char 1) (backward-sexp 1) (point))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2080 (progn (forward-sexp 1) (point))))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2081 (goto-char (point-max))
30642
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2082 (let ((bol (comint-line-beginning-position)))
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2083 (cond
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2084 ;; if empty command line, insert SELECT
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2085 ((= bol (point))
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2086 (insert "SELECT "))
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2087 ;; else if appending to INTO .* (, SELECT or ORDER BY, insert a comma
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2088 ((save-excursion
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2089 (re-search-backward "\\b\\(\\(into\\s-+\\S-+\\s-+(\\)\\|select\\|order by\\) .+"
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2090 bol t))
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2091 (insert ", "))
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2092 ;; else insert a space
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2093 (t
64052
68f51d595f7f (SQL): Finish `defgroup' description with period.
Juanma Barranquero <lekktu@gmail.com>
parents: 63410
diff changeset
2094 (if (eq (preceding-char) ?\s)
30642
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2095 nil
ae938744b6b1 (sql-magic-go): Use comint-bol instead of explicitly matching
Miles Bader <miles@gnu.org>
parents: 30513
diff changeset
2096 (insert " ")))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2097 ;; in any case, insert the column
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2098 (insert column)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2099 (message "%s" column))))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2100
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2101 ;; On NT, SQL*Plus for Oracle turns on full buffering for stdout if it
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2102 ;; is not attached to a character device; therefore placeholder
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2103 ;; replacement by SQL*Plus is fully buffered. The workaround lets
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2104 ;; Emacs query for the placeholders.
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2105
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2106 (defvar sql-placeholder-history nil
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2107 "History of placeholder values used.")
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2108
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2109 (defun sql-query-placeholders-and-send (proc string)
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2110 "Send to PROC input STRING, maybe replacing placeholders.
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2111 Placeholders are words starting with and ampersand like &this.
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2112 This function is used for `comint-input-sender' if using `sql-oracle' on NT."
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2113 (while (string-match "&\\(\\sw+\\)" string)
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2114 (setq string (replace-match
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2115 (read-from-minibuffer
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2116 (format "Enter value for %s: " (match-string 1 string))
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2117 nil nil nil sql-placeholder-history)
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2118 t t string)))
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2119 (comint-send-string proc string)
42694
4664fcfde396 (sql-query-placeholders-and-send): Handle
Richard M. Stallman <rms@gnu.org>
parents: 42440
diff changeset
2120 (if comint-input-sender-no-newline
42799
2f56e7fc793a (sql-escape-newlines-and-send)
Richard M. Stallman <rms@gnu.org>
parents: 42694
diff changeset
2121 (if (not (string-equal string ""))
42694
4664fcfde396 (sql-query-placeholders-and-send): Handle
Richard M. Stallman <rms@gnu.org>
parents: 42440
diff changeset
2122 (process-send-eof))
4664fcfde396 (sql-query-placeholders-and-send): Handle
Richard M. Stallman <rms@gnu.org>
parents: 42440
diff changeset
2123 (comint-send-string proc "\n")))
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2124
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2125 ;; Using DB2 interactively, newlines must be escaped with " \".
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2126 ;; The space before the backslash is relevant.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2127 (defun sql-escape-newlines-and-send (proc string)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2128 "Send to PROC input STRING, escaping newlines if necessary.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2129 Every newline in STRING will be preceded with a space and a backslash."
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2130 (let ((result "") (start 0) mb me)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2131 (while (string-match "\n" string start)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2132 (setq mb (match-beginning 0)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2133 me (match-end 0))
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2134 (if (and (> mb 1)
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2135 (string-equal " \\" (substring string (- mb 2) mb)))
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2136 (setq result (concat result (substring string start me)))
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2137 (setq result (concat result (substring string start mb) " \\\n")))
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2138 (setq start me))
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2139 (setq result (concat result (substring string start)))
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2140 (comint-send-string proc result)
42694
4664fcfde396 (sql-query-placeholders-and-send): Handle
Richard M. Stallman <rms@gnu.org>
parents: 42440
diff changeset
2141 (if comint-input-sender-no-newline
42799
2f56e7fc793a (sql-escape-newlines-and-send)
Richard M. Stallman <rms@gnu.org>
parents: 42694
diff changeset
2142 (if (not (string-equal string ""))
42694
4664fcfde396 (sql-query-placeholders-and-send): Handle
Richard M. Stallman <rms@gnu.org>
parents: 42440
diff changeset
2143 (process-send-eof))
4664fcfde396 (sql-query-placeholders-and-send): Handle
Richard M. Stallman <rms@gnu.org>
parents: 42440
diff changeset
2144 (comint-send-string proc "\n"))))
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2145
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2146
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2147
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2148 ;;; Sending the region to the SQLi buffer.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2149
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2150 (defun sql-send-region (start end)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2151 "Send a region to the SQL process."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2152 (interactive "r")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2153 (if (buffer-live-p sql-buffer)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2154 (save-excursion
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2155 (comint-send-region sql-buffer start end)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2156 (if (string-match "\n$" (buffer-substring start end))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2157 ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2158 (comint-send-string sql-buffer "\n"))
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2159 (message "Sent string to buffer %s." (buffer-name sql-buffer))
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2160 (if sql-pop-to-buffer-after-send-region
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2161 (pop-to-buffer sql-buffer)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2162 (display-buffer sql-buffer)))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2163 (message "No SQL process started.")))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2164
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2165 (defun sql-send-paragraph ()
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2166 "Send the current paragraph to the SQL process."
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2167 (interactive)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2168 (let ((start (save-excursion
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2169 (backward-paragraph)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2170 (point)))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2171 (end (save-excursion
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2172 (forward-paragraph)
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2173 (point))))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2174 (sql-send-region start end)))
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2175
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2176 (defun sql-send-buffer ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2177 "Send the buffer contents to the SQL process."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2178 (interactive)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2179 (sql-send-region (point-min) (point-max)))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2180
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2181 (defun sql-send-string (str)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2182 "Send a string to the SQL process."
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2183 (interactive "sSQL Text: ")
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2184 (if (buffer-live-p sql-buffer)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2185 (save-excursion
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2186 (comint-send-string sql-buffer str)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2187 (comint-send-string sql-buffer "\n")
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2188 (message "Sent string to buffer %s." (buffer-name sql-buffer))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2189 (if sql-pop-to-buffer-after-send-region
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2190 (pop-to-buffer sql-buffer)
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2191 (display-buffer sql-buffer)))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2192 (message "No SQL process started.")))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2193
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2194 (defun sql-toggle-pop-to-buffer-after-send-region (&optional value)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2195 "Toggle `sql-pop-to-buffer-after-send-region'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2196
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2197 If given the optional parameter VALUE, sets
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2198 sql-toggle-pop-to-buffer-after-send-region to VALUE."
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2199 (interactive "P")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2200 (if value
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2201 (setq sql-pop-to-buffer-after-send-region value)
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2202 (setq sql-pop-to-buffer-after-send-region
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2203 (null sql-pop-to-buffer-after-send-region ))))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2204
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2205
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2206
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2207 ;;; SQL mode -- uses SQL interactive mode
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2208
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2209 ;;;###autoload
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2210 (defun sql-mode ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2211 "Major mode to edit SQL.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2212
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2213 You can send SQL statements to the SQLi buffer using
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2214 \\[sql-send-region]. Such a buffer must exist before you can do this.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2215 See `sql-help' on how to create SQLi buffers.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2216
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2217 \\{sql-mode-map}
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2218 Customization: Entry to this mode runs the `sql-mode-hook'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2219
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2220 When you put a buffer in SQL mode, the buffer stores the last SQLi
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2221 buffer created as its destination in the variable `sql-buffer'. This
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2222 will be the buffer \\[sql-send-region] sends the region to. If this
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2223 SQLi buffer is killed, \\[sql-send-region] is no longer able to
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2224 determine where the strings should be sent to. You can set the
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2225 value of `sql-buffer' using \\[sql-set-sqli-buffer].
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2226
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2227 For information on how to create multiple SQLi buffers, see
40971
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2228 `sql-interactive-mode'.
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2229
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2230 Note that SQL doesn't have an escape character unless you specify
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2231 one. If you specify backslash as escape character in SQL,
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2232 you must tell Emacs. Here's how to do that in your `~/.emacs' file:
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2233
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2234 \(add-hook 'sql-mode-hook
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2235 (lambda ()
fa679d186a7d (sql-mode): Doc change.
Richard M. Stallman <rms@gnu.org>
parents: 40432
diff changeset
2236 (modify-syntax-entry ?\\\\ \".\" sql-mode-syntax-table)))"
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2237 (interactive)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2238 (kill-all-local-variables)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2239 (setq major-mode 'sql-mode)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2240 (setq mode-name "SQL")
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2241 (use-local-map sql-mode-map)
31392
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
2242 (if sql-mode-menu
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
2243 (easy-menu-add sql-mode-menu)); XEmacs
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2244 (set-syntax-table sql-mode-syntax-table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2245 (make-local-variable 'font-lock-defaults)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2246 (make-local-variable 'sql-mode-font-lock-keywords)
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2247 (make-local-variable 'comment-start)
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2248 (setq comment-start "--")
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2249 ;; Make each buffer in sql-mode remember the "current" SQLi buffer.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2250 (make-local-variable 'sql-buffer)
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2251 ;; Add imenu support for sql-mode. Note that imenu-generic-expression
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2252 ;; is buffer-local, so we don't need a local-variable for it. SQL is
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2253 ;; case-insensitive, that's why we have to set imenu-case-fold-search.
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2254 (setq imenu-generic-expression sql-imenu-generic-expression
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2255 imenu-case-fold-search t)
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2256 ;; Make `sql-send-paragraph' work on paragraphs that contain indented
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2257 ;; lines.
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2258 (make-local-variable 'paragraph-separate)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2259 (make-local-variable 'paragraph-start)
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2260 (setq paragraph-separate "[\f]*$"
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2261 paragraph-start "[\n\f]")
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2262 ;; Abbrevs
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2263 (setq local-abbrev-table sql-mode-abbrev-table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2264 (setq abbrev-all-caps 1)
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2265 ;; Run hook
62772
f2892faa87d4 * progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents: 59996
diff changeset
2266 (run-mode-hooks 'sql-mode-hook)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2267 ;; Catch changes to sql-product and highlight accordingly
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2268 (sql-highlight-product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2269 (add-hook 'hack-local-variables-hook 'sql-highlight-product t t))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2270
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2271
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2272
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2273 ;;; SQL interactive mode
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2274
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2275 (put 'sql-interactive-mode 'mode-class 'special)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2276
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2277 (defun sql-interactive-mode ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2278 "Major mode to use a SQL interpreter interactively.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2279
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2280 Do not call this function by yourself. The environment must be
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2281 initialized by an entry function specific for the SQL interpreter. See
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2282 `sql-help' for a list of available entry functions.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2283
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2284 \\[comint-send-input] after the end of the process' output sends the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2285 text from the end of process to the end of the current line.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2286 \\[comint-send-input] before end of process output copies the current
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2287 line minus the prompt to the end of the buffer and sends it.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2288 \\[comint-copy-old-input] just copies the current line.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2289 Use \\[sql-accumulate-and-indent] to enter multi-line statements.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2290
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2291 If you want to make multiple SQL buffers, rename the `*SQL*' buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2292 using \\[rename-buffer] or \\[rename-uniquely] and start a new process.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2293 See `sql-help' for a list of available entry functions. The last buffer
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2294 created by such an entry function is the current SQLi buffer. SQL
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2295 buffers will send strings to the SQLi buffer current at the time of
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2296 their creation. See `sql-mode' for details.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2297
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2298 Sample session using two connections:
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2299
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2300 1. Create first SQLi buffer by calling an entry function.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2301 2. Rename buffer \"*SQL*\" to \"*Connection 1*\".
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2302 3. Create a SQL buffer \"test1.sql\".
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2303 4. Create second SQLi buffer by calling an entry function.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2304 5. Rename buffer \"*SQL*\" to \"*Connection 2*\".
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2305 6. Create a SQL buffer \"test2.sql\".
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2306
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2307 Now \\[sql-send-region] in buffer \"test1.sql\" will send the region to
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2308 buffer \"*Connection 1*\", \\[sql-send-region] in buffer \"test2.sql\"
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2309 will send the region to buffer \"*Connection 2*\".
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2310
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2311 If you accidentally suspend your process, use \\[comint-continue-subjob]
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2312 to continue it. On some operating systems, this will not work because
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2313 the signals are not supported.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2314
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2315 \\{sql-interactive-mode-map}
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2316 Customization: Entry to this mode runs the hooks on `comint-mode-hook'
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2317 and `sql-interactive-mode-hook' (in that order). Before each input, the
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2318 hooks on `comint-input-filter-functions' are run. After each SQL
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2319 interpreter output, the hooks on `comint-output-filter-functions' are
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2320 run.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2321
65198
7fbb366ab47a (sql-interactive-mode): Fix typo in docstring.
Juanma Barranquero <lekktu@gmail.com>
parents: 64837
diff changeset
2322 Variable `sql-input-ring-file-name' controls the initialization of the
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2323 input ring history.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2324
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2325 Variables `comint-output-filter-functions', a hook, and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2326 `comint-scroll-to-bottom-on-input' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2327 `comint-scroll-to-bottom-on-output' control whether input and output
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2328 cause the window to scroll to the end of the buffer.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2329
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2330 If you want to make SQL buffers limited in length, add the function
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2331 `comint-truncate-buffer' to `comint-output-filter-functions'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2332
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2333 Here is an example for your .emacs file. It keeps the SQLi buffer a
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2334 certain length.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2335
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2336 \(add-hook 'sql-interactive-mode-hook
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2337 \(function (lambda ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2338 \(setq comint-output-filter-functions 'comint-truncate-buffer))))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2339
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2340 Here is another example. It will always put point back to the statement
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2341 you entered, right above the output it created.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2342
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2343 \(setq comint-output-filter-functions
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2344 \(function (lambda (STR) (comint-show-output))))"
63410
37dd5dc2f5ae (sql-interactive-mode): Use delay-mode-hooks.
Lute Kamstra <lute@gnu.org>
parents: 62772
diff changeset
2345 (delay-mode-hooks (comint-mode))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2346 ;; Get the `sql-product' for this interactive session.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2347 (set (make-local-variable 'sql-product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2348 (or sql-interactive-product
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2349 sql-product))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2350 ;; Setup the mode.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2351 (setq major-mode 'sql-interactive-mode)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2352 (setq mode-name (concat "SQLi[" (prin1-to-string sql-product) "]"))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2353 (use-local-map sql-interactive-mode-map)
31392
1f97a090ba6d (sql-postgres): Use sql-postgres-options.
Gerd Moellmann <gerd@gnu.org>
parents: 30905
diff changeset
2354 (if sql-interactive-mode-menu
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2355 (easy-menu-add sql-interactive-mode-menu)) ; XEmacs
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2356 (set-syntax-table sql-mode-syntax-table)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2357 (make-local-variable 'sql-mode-font-lock-keywords)
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2358 (make-local-variable 'font-lock-defaults)
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2359 ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2360 ;; SELECT 'x' FROM DUAL with SQL*Plus, because the title of the column
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2361 ;; will have just one quote. Therefore syntactic hilighting is
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2362 ;; disabled for interactive buffers. No imenu support.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2363 (sql-product-font-lock t nil)
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2364 ;; Enable commenting and uncommenting of the region.
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2365 (make-local-variable 'comment-start)
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2366 (setq comment-start "--")
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2367 ;; Abbreviation table init and case-insensitive. It is not activated
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2368 ;; by default.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2369 (setq local-abbrev-table sql-mode-abbrev-table)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2370 (setq abbrev-all-caps 1)
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2371 ;; Exiting the process will call sql-stop.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2372 (set-process-sentinel (get-buffer-process sql-buffer) 'sql-stop)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2373 ;; Create a usefull name for renaming this buffer later.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2374 (make-local-variable 'sql-alternate-buffer-name)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2375 (setq sql-alternate-buffer-name (sql-make-alternate-buffer-name))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2376 ;; User stuff. Initialize before the hook.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2377 (set (make-local-variable 'sql-prompt-regexp)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2378 (sql-product-feature :sqli-prompt-regexp))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2379 (set (make-local-variable 'sql-prompt-length)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2380 (sql-product-feature :sqli-prompt-length))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2381 (make-local-variable 'sql-input-ring-separator)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2382 (make-local-variable 'sql-input-ring-file-name)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2383 ;; Run hook.
62772
f2892faa87d4 * progmodes/ada-mode.el (ada-mode):
Lute Kamstra <lute@gnu.org>
parents: 59996
diff changeset
2384 (run-mode-hooks 'sql-interactive-mode-hook)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2385 ;; Set comint based on user overrides.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2386 (setq comint-prompt-regexp sql-prompt-regexp)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2387 (setq left-margin sql-prompt-length)
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2388 ;; People wanting a different history file for each
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2389 ;; buffer/process/client/whatever can change separator and file-name
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2390 ;; on the sql-interactive-mode-hook.
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2391 (setq comint-input-ring-separator sql-input-ring-separator
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2392 comint-input-ring-file-name sql-input-ring-file-name)
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2393 ;; Calling the hook before calling comint-read-input-ring allows users
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2394 ;; to set comint-input-ring-file-name in sql-interactive-mode-hook.
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2395 (comint-read-input-ring t))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2396
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2397 (defun sql-stop (process event)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2398 "Called when the SQL process is stopped.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2399
24353
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2400 Writes the input history to a history file using
1ae2a12a85ee (sql-set-sqli-hook): A hook run when sql-buffer is
Richard M. Stallman <rms@gnu.org>
parents: 24310
diff changeset
2401 `comint-write-input-ring' and inserts a short message in the SQL buffer.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2402
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2403 This function is a sentinel watching the SQL interpreter process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2404 Sentinels will always get the two parameters PROCESS and EVENT."
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2405 (comint-write-input-ring)
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2406 (if (and (eq (current-buffer) sql-buffer)
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2407 (not buffer-read-only))
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2408 (insert (format "\nProcess %s %s\n" process event))
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2409 (message "Process %s %s" process event)))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2410
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2411
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2412
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2413 ;;; Entry functions for different SQL interpreters.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2414
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2415 ;;;###autoload
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2416 (defun sql-product-interactive (&optional product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2417 "Run product interpreter as an inferior process.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2418
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2419 If buffer `*SQL*' exists but no process is running, make a new process.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2420 If buffer exists and a process is running, just switch to buffer
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2421 `*SQL*'.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2422
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2423 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2424 (interactive)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2425 (setq product (or product sql-product))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2426 (when (sql-product-feature :sqli-connect product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2427 (if (comint-check-proc "*SQL*")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2428 (pop-to-buffer "*SQL*")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2429 ;; Get credentials.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2430 (apply 'sql-get-login (sql-product-feature :sqli-login product))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2431 ;; Connect to database.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2432 (message "Login...")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2433 (funcall (sql-product-feature :sqli-connect product))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2434 ;; Set SQLi mode.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2435 (setq sql-interactive-product product)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2436 (setq sql-buffer (current-buffer))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2437 (sql-interactive-mode)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2438 ;; All done.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2439 (message "Login...done")
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2440 (pop-to-buffer sql-buffer))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2441
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2442 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2443 (defun sql-oracle ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2444 "Run sqlplus by Oracle as an inferior process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2445
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2446 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2447 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2448 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2449
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2450 Interpreter used comes from variable `sql-oracle-program'. Login uses
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2451 the variables `sql-user', `sql-password', and `sql-database' as
29937
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2452 defaults, if set. Additional command line parameters can be stored in
693c2c631d72 (sql-interactive-mode-map): Use `kbd' in calls to
Gerd Moellmann <gerd@gnu.org>
parents: 26576
diff changeset
2453 the list `sql-oracle-options'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2454
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2455 The buffer is put in sql-interactive-mode, giving commands for sending
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2456 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2457
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2458 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2459 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2460 before \\[sql-oracle]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2461 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2462 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2463 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2464
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2465 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2466 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2467 (sql-product-interactive 'oracle))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2468
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2469 (defun sql-connect-oracle ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2470 "Create comint buffer and connect to Oracle using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2471 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2472 ;; Produce user/password@database construct. Password without user
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2473 ;; is meaningless; database without user/password is meaningless,
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2474 ;; because "@param" will ask sqlplus to interpret the script
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2475 ;; "param".
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2476 (let ((parameter nil))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2477 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2478 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2479 (setq parameter (concat sql-user "/" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2480 (setq parameter sql-user)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2481 (if (and parameter (not (string= "" sql-database)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2482 (setq parameter (concat parameter "@" sql-database)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2483 (if parameter
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2484 (setq parameter (nconc (list parameter) sql-oracle-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2485 (setq parameter sql-oracle-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2486 (if parameter
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2487 (set-buffer (apply 'make-comint "SQL" sql-oracle-program nil
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2488 parameter))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2489 (set-buffer (make-comint "SQL" sql-oracle-program nil)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2490 ;; SQL*Plus is buffered on WindowsNT; this handles &placeholders.
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2491 (if (eq window-system 'w32)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2492 (setq comint-input-sender 'sql-query-placeholders-and-send))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2493
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2494
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2495
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2496 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2497 (defun sql-sybase ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2498 "Run isql by SyBase as an inferior process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2499
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2500 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2501 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2502 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2503
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2504 Interpreter used comes from variable `sql-sybase-program'. Login uses
32621
50c28d51e0f2 (sql-sybase-options): New option.
Gerd Moellmann <gerd@gnu.org>
parents: 32169
diff changeset
2505 the variables `sql-server', `sql-user', `sql-password', and
36523
e72a04113eac (sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents: 34704
diff changeset
2506 `sql-database' as defaults, if set. Additional command line parameters
e72a04113eac (sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents: 34704
diff changeset
2507 can be stored in the list `sql-sybase-options'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2508
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2509 The buffer is put in sql-interactive-mode, giving commands for sending
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2510 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2511
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2512 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2513 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2514 before \\[sql-sybase]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2515 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2516 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2517 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2518
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2519 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2520 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2521 (sql-product-interactive 'sybase))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2522
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2523 (defun sql-connect-sybase ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2524 "Create comint buffer and connect to Sybase using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2525 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2526 ;; Put all parameters to the program (if defined) in a list and call
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2527 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2528 (let ((params sql-sybase-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2529 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2530 (setq params (append (list "-S" sql-server) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2531 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2532 (setq params (append (list "-D" sql-database) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2533 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2534 (setq params (append (list "-P" sql-password) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2535 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2536 (setq params (append (list "-U" sql-user) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2537 (set-buffer (apply 'make-comint "SQL" sql-sybase-program
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2538 nil params))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2539
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2540
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2541
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2542 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2543 (defun sql-informix ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2544 "Run dbaccess by Informix as an inferior process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2545
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2546 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2547 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2548 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2549
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2550 Interpreter used comes from variable `sql-informix-program'. Login uses
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2551 the variable `sql-database' as default, if set.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2552
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2553 The buffer is put in sql-interactive-mode, giving commands for sending
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2554 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2555
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2556 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2557 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2558 before \\[sql-informix]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2559 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2560 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2561 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2562
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2563 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2564 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2565 (sql-product-interactive 'informix))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2566
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2567 (defun sql-connect-informix ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2568 "Create comint buffer and connect to Informix using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2569 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2570 ;; username and password are ignored.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2571 (if (string= "" sql-database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2572 (set-buffer (make-comint "SQL" sql-informix-program nil))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2573 (set-buffer (make-comint "SQL" sql-informix-program nil sql-database "-"))))
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2574
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2575
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2576
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2577 ;;;###autoload
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2578 (defun sql-sqlite ()
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2579 "Run sqlite as an inferior process.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2580
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2581 SQLite is free software.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2582
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2583 If buffer `*SQL*' exists but no process is running, make a new process.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2584 If buffer exists and a process is running, just switch to buffer
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2585 `*SQL*'.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2586
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2587 Interpreter used comes from variable `sql-sqlite-program'. Login uses
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2588 the variables `sql-user', `sql-password', `sql-database', and
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2589 `sql-server' as defaults, if set. Additional command line parameters
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2590 can be stored in the list `sql-sqlite-options'.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2591
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2592 The buffer is put in sql-interactive-mode, giving commands for sending
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2593 input. See `sql-interactive-mode'.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2594
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2595 To specify a coding system for converting non-ASCII characters
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2596 in the input and output to the process, use \\[universal-coding-system-argument]
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2597 before \\[sql-sqlite]. You can also specify this with \\[set-buffer-process-coding-system]
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2598 in the SQL buffer, after you start the process.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2599 The default comes from `process-coding-system-alist' and
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2600 `default-process-coding-system'.
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2601
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2602 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2603 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2604 (sql-product-interactive 'sqlite))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2605
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2606 (defun sql-connect-sqlite ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2607 "Create comint buffer and connect to SQLite using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2608 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2609 ;; Put all parameters to the program (if defined) in a list and call
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2610 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2611 (let ((params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2612 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2613 (setq params (append (list sql-database) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2614 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2615 (setq params (append (list (concat "--host=" sql-server)) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2616 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2617 (setq params (append (list (concat "--password=" sql-password)) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2618 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2619 (setq params (append (list (concat "--user=" sql-user)) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2620 (if (not (null sql-sqlite-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2621 (setq params (append sql-sqlite-options params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2622 (set-buffer (apply 'make-comint "SQL" sql-sqlite-program
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2623 nil params))))
51607
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2624
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2625
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2626
ead411a37669 Add support for SQLite interpreter.
Juanma Barranquero <lekktu@gmail.com>
parents: 48486
diff changeset
2627 ;;;###autoload
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2628 (defun sql-mysql ()
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2629 "Run mysql by TcX as an inferior process.
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2630
40432
225bd38b0ce7 (sql-mysql): Doc change by RMS.
Gerd Moellmann <gerd@gnu.org>
parents: 38872
diff changeset
2631 Mysql versions 3.23 and up are free software.
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2632
24268
17b13a968841 (sql-help): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 24267
diff changeset
2633 If buffer `*SQL*' exists but no process is running, make a new process.
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2634 If buffer exists and a process is running, just switch to buffer
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2635 `*SQL*'.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2636
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2637 Interpreter used comes from variable `sql-mysql-program'. Login uses
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2638 the variables `sql-user', `sql-password', `sql-database', and
36523
e72a04113eac (sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents: 34704
diff changeset
2639 `sql-server' as defaults, if set. Additional command line parameters
e72a04113eac (sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents: 34704
diff changeset
2640 can be stored in the list `sql-mysql-options'.
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2641
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2642 The buffer is put in sql-interactive-mode, giving commands for sending
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2643 input. See `sql-interactive-mode'.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2644
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2645 To specify a coding system for converting non-ASCII characters
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2646 in the input and output to the process, use \\[universal-coding-system-argument]
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2647 before \\[sql-mysql]. You can also specify this with \\[set-buffer-process-coding-system]
24267
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2648 in the SQL buffer, after you start the process.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2649 The default comes from `process-coding-system-alist' and
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2650 `default-process-coding-system'.
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2651
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2652 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
f40837b25999 Changed version to 1.2.1.
Richard M. Stallman <rms@gnu.org>
parents: 24058
diff changeset
2653 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2654 (sql-product-interactive 'mysql))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2655
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2656 (defun sql-connect-mysql ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2657 "Create comint buffer and connect to MySQL using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2658 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2659 ;; Put all parameters to the program (if defined) in a list and call
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2660 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2661 (let ((params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2662 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2663 (setq params (append (list sql-database) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2664 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2665 (setq params (append (list (concat "--host=" sql-server)) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2666 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2667 (setq params (append (list (concat "--password=" sql-password)) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2668 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2669 (setq params (append (list (concat "--user=" sql-user)) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2670 (if (not (null sql-mysql-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2671 (setq params (append sql-mysql-options params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2672 (set-buffer (apply 'make-comint "SQL" sql-mysql-program
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2673 nil params))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2674
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2675
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2676
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2677 ;;;###autoload
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2678 (defun sql-solid ()
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2679 "Run solsql by Solid as an inferior process.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2680
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2681 If buffer `*SQL*' exists but no process is running, make a new process.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2682 If buffer exists and a process is running, just switch to buffer
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2683 `*SQL*'.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2684
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2685 Interpreter used comes from variable `sql-solid-program'. Login uses
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2686 the variables `sql-user', `sql-password', and `sql-server' as
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2687 defaults, if set.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2688
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2689 The buffer is put in sql-interactive-mode, giving commands for sending
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2690 input. See `sql-interactive-mode'.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2691
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2692 To specify a coding system for converting non-ASCII characters
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2693 in the input and output to the process, use \\[universal-coding-system-argument]
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2694 before \\[sql-solid]. You can also specify this with \\[set-buffer-process-coding-system]
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2695 in the SQL buffer, after you start the process.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2696 The default comes from `process-coding-system-alist' and
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2697 `default-process-coding-system'.
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2698
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2699 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2700 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2701 (sql-product-interactive 'solid))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2702
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2703 (defun sql-connect-solid ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2704 "Create comint buffer and connect to Solid using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2705 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2706 ;; Put all parameters to the program (if defined) in a list and call
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2707 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2708 (let ((params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2709 ;; It only makes sense if both username and password are there.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2710 (if (not (or (string= "" sql-user)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2711 (string= "" sql-password)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2712 (setq params (append (list sql-user sql-password) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2713 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2714 (setq params (append (list sql-server) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2715 (set-buffer (apply 'make-comint "SQL" sql-solid-program
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2716 nil params))))
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2717
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2718
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2719
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2720 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2721 (defun sql-ingres ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2722 "Run sql by Ingres as an inferior process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2723
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2724 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2725 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2726 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2727
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2728 Interpreter used comes from variable `sql-ingres-program'. Login uses
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2729 the variable `sql-database' as default, if set.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2730
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2731 The buffer is put in sql-interactive-mode, giving commands for sending
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2732 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2733
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2734 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2735 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2736 before \\[sql-ingres]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2737 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2738 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2739 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2740
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2741 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2742 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2743 (sql-product-interactive 'ingres))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2744
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2745 (defun sql-connect-ingres ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2746 "Create comint buffer and connect to Ingres using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2747 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2748 ;; username and password are ignored.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2749 (if (string= "" sql-database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2750 (set-buffer (make-comint "SQL" sql-ingres-program nil))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2751 (set-buffer (make-comint "SQL" sql-ingres-program nil sql-database))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2752
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2753
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2754
30513
12162d90d9e4 (sql-ms): Added autoload cookie.
Gerd Moellmann <gerd@gnu.org>
parents: 29937
diff changeset
2755 ;;;###autoload
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2756 (defun sql-ms ()
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2757 "Run osql by Microsoft as an inferior process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2758
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2759 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2760 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2761 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2762
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2763 Interpreter used comes from variable `sql-ms-program'. Login uses the
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2764 variables `sql-user', `sql-password', `sql-database', and `sql-server'
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2765 as defaults, if set. Additional command line parameters can be stored
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2766 in the list `sql-ms-options'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2767
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2768 The buffer is put in sql-interactive-mode, giving commands for sending
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2769 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2770
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2771 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2772 in the input and output to the process, use \\[universal-coding-system-argument]
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2773 before \\[sql-ms]. You can also specify this with \\[set-buffer-process-coding-system]
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2774 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2775 The default comes from `process-coding-system-alist' and
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2776 `default-process-coding-system'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2777
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2778 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2779 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2780 (sql-product-interactive 'ms))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2781
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2782 (defun sql-connect-ms ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2783 "Create comint buffer and connect to Microsoft using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2784 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2785 ;; Put all parameters to the program (if defined) in a list and call
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2786 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2787 (let ((params sql-ms-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2788 (if (not (string= "" sql-server))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2789 (setq params (append (list "-S" sql-server) params)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2790 (if (not (string= "" sql-database))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2791 (setq params (append (list "-d" sql-database) params)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2792 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2793 (setq params (append (list "-U" sql-user) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2794 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2795 (setq params (append (list "-P" sql-password) params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2796 (if (string= "" sql-user)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2797 ;; if neither user nor password is provided, use system
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2798 ;; credentials.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2799 (setq params (append (list "-E") params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2800 ;; If -P is passed to ISQL as the last argument without a
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2801 ;; password, it's considered null.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2802 (setq params (append params (list "-P")))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2803 (set-buffer (apply 'make-comint "SQL" sql-ms-program
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2804 nil params))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2805
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2806
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2807
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2808 ;;;###autoload
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2809 (defun sql-postgres ()
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2810 "Run psql by Postgres as an inferior process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2811
24310
e76bade08723 Added keywords from `finder-by-keyword'.
Richard M. Stallman <rms@gnu.org>
parents: 24268
diff changeset
2812 If buffer `*SQL*' exists but no process is running, make a new process.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2813 If buffer exists and a process is running, just switch to buffer
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2814 `*SQL*'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2815
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2816 Interpreter used comes from variable `sql-postgres-program'. Login uses
24354
6a438ef0b573 Set version to 1.4.1. Changed mail address to
Richard M. Stallman <rms@gnu.org>
parents: 24353
diff changeset
2817 the variables `sql-database' and `sql-server' as default, if set.
36523
e72a04113eac (sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents: 34704
diff changeset
2818 Additional command line parameters can be stored in the list
e72a04113eac (sql-sybase): Fix typo (was: query user about server two
Gerd Moellmann <gerd@gnu.org>
parents: 34704
diff changeset
2819 `sql-postgres-options'.
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2820
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2821 The buffer is put in sql-interactive-mode, giving commands for sending
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2822 input. See `sql-interactive-mode'.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2823
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2824 To specify a coding system for converting non-ASCII characters
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2825 in the input and output to the process, use \\[universal-coding-system-argument]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2826 before \\[sql-postgres]. You can also specify this with \\[set-buffer-process-coding-system]
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2827 in the SQL buffer, after you start the process.
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2828 The default comes from `process-coding-system-alist' and
25826
e55139b50cb6 (sql-imenu-generic-expression): new, used to set
Alex Schroeder <alex@gnu.org>
parents: 25381
diff changeset
2829 `default-process-coding-system'. If your output lines end with ^M,
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2830 your might try undecided-dos as a coding system. If this doesn't help,
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2831 Try to set `comint-output-filter-functions' like this:
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2832
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2833 \(setq comint-output-filter-functions (append comint-output-filter-functions
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2834 '(comint-strip-ctrl-m)))
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2835
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2836 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2837 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2838 (sql-product-interactive 'postgres))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2839
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2840 (defun sql-connect-postgres ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2841 "Create comint buffer and connect to Postgres using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2842 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2843 ;; username and password are ignored. Mark Stosberg suggest to add
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2844 ;; the database at the end. Jason Beegan suggest using --pset and
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2845 ;; pager=off instead of \\o|cat. The later was the solution by
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2846 ;; Gregor Zych. Jason's suggestion is the default value for
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2847 ;; sql-postgres-options.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2848 (let ((params sql-postgres-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2849 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2850 (setq params (append params (list sql-database))))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2851 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2852 (setq params (append (list "-h" sql-server) params)))
55241
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2853 (if (not (string= "" sql-user))
cebca4e25fae (sql-product-alist): Rename variable `sql-product-support'.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 52482
diff changeset
2854 (setq params (append (list "-U" sql-user) params)))
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2855 (set-buffer (apply 'make-comint "SQL" sql-postgres-program
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2856 nil params))))
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2857
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2858
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2859
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2860 ;;;###autoload
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2861 (defun sql-interbase ()
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2862 "Run isql by Interbase as an inferior process.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2863
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2864 If buffer `*SQL*' exists but no process is running, make a new process.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2865 If buffer exists and a process is running, just switch to buffer
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2866 `*SQL*'.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2867
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2868 Interpreter used comes from variable `sql-interbase-program'. Login
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2869 uses the variables `sql-user', `sql-password', and `sql-database' as
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2870 defaults, if set.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2871
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2872 The buffer is put in sql-interactive-mode, giving commands for sending
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2873 input. See `sql-interactive-mode'.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2874
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2875 To specify a coding system for converting non-ASCII characters
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2876 in the input and output to the process, use \\[universal-coding-system-argument]
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2877 before \\[sql-interbase]. You can also specify this with \\[set-buffer-process-coding-system]
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2878 in the SQL buffer, after you start the process.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2879 The default comes from `process-coding-system-alist' and
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2880 `default-process-coding-system'.
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2881
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2882 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2883 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2884 (sql-product-interactive 'interbase))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2885
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2886 (defun sql-connect-interbase ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2887 "Create comint buffer and connect to Interbase using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2888 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2889 ;; Put all parameters to the program (if defined) in a list and call
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2890 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2891 (let ((params sql-interbase-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2892 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2893 (setq params (append (list "-u" sql-user) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2894 (if (not (string= "" sql-password))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2895 (setq params (append (list "-p" sql-password) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2896 (if (not (string= "" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2897 (setq params (cons sql-database params))) ; add to the front!
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2898 (set-buffer (apply 'make-comint "SQL" sql-interbase-program
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2899 nil params))))
36571
54a8a84a22f6 (sql-interbase): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36523
diff changeset
2900
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2901
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2902
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2903 ;;;###autoload
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2904 (defun sql-db2 ()
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2905 "Run db2 by IBM as an inferior process.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2906
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2907 If buffer `*SQL*' exists but no process is running, make a new process.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2908 If buffer exists and a process is running, just switch to buffer
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2909 `*SQL*'.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2910
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2911 Interpreter used comes from variable `sql-db2-program'. There is not
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2912 automatic login.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2913
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2914 The buffer is put in sql-interactive-mode, giving commands for sending
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2915 input. See `sql-interactive-mode'.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2916
38872
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
2917 If you use \\[sql-accumulate-and-indent] to send multiline commands to
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
2918 db2, newlines will be escaped if necessary. If you don't want that, set
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
2919 `comint-input-sender' back to `comint-simple-send' by writing an after
56c16908b24f (sql-db2): Doc change.
Gerd Moellmann <gerd@gnu.org>
parents: 37409
diff changeset
2920 advice. See the elisp manual for more information.
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2921
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2922 To specify a coding system for converting non-ASCII characters
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2923 in the input and output to the process, use \\[universal-coding-system-argument]
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2924 before \\[sql-db2]. You can also specify this with \\[set-buffer-process-coding-system]
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2925 in the SQL buffer, after you start the process.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2926 The default comes from `process-coding-system-alist' and
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2927 `default-process-coding-system'.
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2928
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2929 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2930 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2931 (sql-product-interactive 'db2))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2932
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2933 (defun sql-connect-db2 ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2934 "Create comint buffer and connect to DB2 using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2935 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2936 ;; Put all parameters to the program (if defined) in a list and call
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2937 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2938 (set-buffer (apply 'make-comint "SQL" sql-db2-program
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2939 nil sql-db2-options))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2940 ;; Properly escape newlines when DB2 is interactive.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2941 (setq comint-input-sender 'sql-escape-newlines-and-send))
37409
9781f3a3c955 (sql-escape-newlines-and-send): New function.
Gerd Moellmann <gerd@gnu.org>
parents: 36571
diff changeset
2942
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2943 ;;;###autoload
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2944 (defun sql-linter ()
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2945 "Run inl by RELEX as an inferior process.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2946
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2947 If buffer `*SQL*' exists but no process is running, make a new process.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2948 If buffer exists and a process is running, just switch to buffer
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2949 `*SQL*'.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2950
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2951 Interpreter used comes from variable `sql-linter-program' - usually `inl'.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2952 Login uses the variables `sql-user', `sql-password', `sql-database' and
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2953 `sql-server' as defaults, if set. Additional command line parameters
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2954 can be stored in the list `sql-linter-options'. Run inl -h to get help on
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2955 parameters.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2956
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2957 `sql-database' is used to set the LINTER_MBX environment variable for
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2958 local connections, `sql-server' refers to the server name from the
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2959 `nodetab' file for the network connection (dbc_tcp or friends must run
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2960 for this to work). If `sql-password' is an empty string, inl will use
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2961 an empty password.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2962
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2963 The buffer is put in sql-interactive-mode, giving commands for sending
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2964 input. See `sql-interactive-mode'.
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2965
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2966 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)"
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2967 (interactive)
52242
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2968 (sql-product-interactive 'linter))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2969
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2970 (defun sql-connect-linter ()
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2971 "Create comint buffer and connect to Linter using the login
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2972 parameters and command options."
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2973 ;; Put all parameters to the program (if defined) in a list and call
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2974 ;; make-comint.
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2975 (let ((params sql-linter-options) (login nil) (old-mbx (getenv "LINTER_MBX")))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2976 (if (not (string= "" sql-user))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2977 (setq login (concat sql-user "/" sql-password)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2978 (setq params (append (list "-u" login) params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2979 (if (not (string= "" sql-server))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2980 (setq params (append (list "-n" sql-server) params)))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2981 (if (string= "" sql-database)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2982 (setenv "LINTER_MBX" nil)
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2983 (setenv "LINTER_MBX" sql-database))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2984 (set-buffer (apply 'make-comint "SQL" sql-linter-program nil
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2985 params))
f5ada28bb9f0 Patch by Michael Mauger <mmaug@yahoo.com>
Alex Schroeder <alex@gnu.org>
parents: 51929
diff changeset
2986 (setenv "LINTER_MBX" old-mbx)))
48486
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2987
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2988
893d44670df9 Added LINTER support.
Juanma Barranquero <lekktu@gmail.com>
parents: 42799
diff changeset
2989
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2990 (provide 'sql)
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2991
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 87649
diff changeset
2992 ;; arch-tag: 7e1fa1c4-9ca2-402e-87d2-83a5eccb7ac3
24050
e546776e7a76 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2993 ;;; sql.el ends here