diff options
author | Karoly Lorentey <lorentey@elte.hu> | 2007-01-01 17:38:32 +0000 |
---|---|---|
committer | Karoly Lorentey <lorentey@elte.hu> | 2007-01-01 17:38:32 +0000 |
commit | 65e86587ab836aaa86b12ce30b219bcb4fcbaa06 (patch) | |
tree | 7e13feee7387635f52df3613cf1bba4414781aab /lisp/progmodes/sql.el | |
parent | 8c778e28bcf16b4baef6400a124ec2403941e940 (diff) | |
parent | 1fc8c92b50100da709c94a0faa47deed5603634f (diff) | |
download | emacs-65e86587ab836aaa86b12ce30b219bcb4fcbaa06.tar.gz |
Merged from emacs@sv.gnu.org.
Patches applied:
* emacs@sv.gnu.org/emacs--devo--0--patch-536
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-537
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-538
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-539
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-540
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-541
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-542
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-543
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-544
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-545
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-546
Update from erc--emacs--22
* emacs@sv.gnu.org/emacs--devo--0--patch-547
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-548
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-549
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-550
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-551
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-552
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-553
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-554
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-555
erc-iswitchb: Temporarily enable iswitchb mode
* emacs@sv.gnu.org/emacs--devo--0--patch-556
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-557
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-558
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-559
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-560
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-561
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-562
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-563
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-564
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-565
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-566
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-567
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-568
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-569
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-570
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-571
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-572
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-573
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-574
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-575
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-576
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-577
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-578
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-579
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-580
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-581
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-582
Merge from gnus--rel--5.10
* emacs@sv.gnu.org/emacs--devo--0--patch-583
Update from CVS
* emacs@sv.gnu.org/emacs--devo--0--patch-584
Fix admin/quick-install-emacs to work with recent versions of autoconf
* emacs@sv.gnu.org/gnus--rel--5.10--patch-171
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-172
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-173
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-174
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-175
Update from CVS: lisp/legacy-gnus-agent.el: Add Copyright notice.
* emacs@sv.gnu.org/gnus--rel--5.10--patch-176
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-177
Merge from emacs--devo--0
* emacs@sv.gnu.org/gnus--rel--5.10--patch-178
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-179
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-180
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-181
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-182
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-183
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-184
Update from CVS
* emacs@sv.gnu.org/gnus--rel--5.10--patch-185
Merge from emacs--devo--0
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-590
Diffstat (limited to 'lisp/progmodes/sql.el')
-rw-r--r-- | lisp/progmodes/sql.el | 98 |
1 files changed, 58 insertions, 40 deletions
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index ff5493de364..afc0f35f26c 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -5,7 +5,7 @@ ;; Author: Alex Schroeder <alex@gnu.org> ;; Maintainer: Michael Mauger <mmaug@yahoo.com> -;; Version: 2.0.1 +;; Version: 2.0.2 ;; Keywords: comm languages processes ;; URL: http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode @@ -30,26 +30,40 @@ ;;; Commentary: ;; Please send bug reports and bug fixes to the mailing list at -;; sql.el@gnu.org. If you want to subscribe to the mailing list, send -;; mail to sql.el-request@gnu.org with `subscribe sql.el FIRSTNAME -;; LASTNAME' in the mail body. - -;; This file provides a sql-mode and a sql-interactive-mode. My goals -;; were two simple modes providing syntactic hilighting. The -;; interactive mode had to provide a command-line history; the other -;; mode had to provide "send region/buffer to SQL interpreter" -;; functions. "simple" in this context means easy to use, easy to -;; maintain and little or no bells and whistles. +;; help-gnu-emacs@gnu.org. If you want to subscribe to the mailing +;; list, see the web page at +;; http://lists.gnu.org/mailman/listinfo/help-gnu-emacs for +;; instructions. I monitor this list actively. If you send an e-mail +;; to Alex Schroeder it usually makes it to me when Alex has a chance +;; to forward them along (Thanks, Alex). + +;; This file provides a sql-mode and a sql-interactive-mode. The +;; original goals were two simple modes providing syntactic +;; highlighting. The interactive mode had to provide a command-line +;; history; the other mode had to provide "send region/buffer to SQL +;; interpreter" functions. "simple" in this context means easy to +;; use, easy to maintain and little or no bells and whistles. This +;; has changed somewhat as experience with the mode has accumulated. + +;; Support for different flavors of SQL and command interpreters was +;; available in early versions of sql.el. This support has been +;; extended and formalized in later versions. Part of the impetus for +;; the improved support of SQL flavors was borne out of the current +;; maintainer's consulting experience. In the past fifteen years, I +;; have used Oracle, Sybase, Informix, MySQL, Postgres, and SQLServer. +;; On some assignments, I have used two or more of these concurrently. ;; If anybody feels like extending this sql mode, take a look at the ;; above mentioned modes and write a sqlx-mode on top of this one. If ;; this proves to be difficult, please suggest changes that will -;; facilitate your plans. +;; facilitate your plans. Facilities have been provided to add +;; products and product-specific configuration. ;; sql-interactive-mode is used to interact with a SQL interpreter ;; process in a SQLi buffer (usually called `*SQL*'). The SQLi buffer -;; is created by calling a SQL interpreter-specific entry function. Do -;; *not* call sql-interactive-mode by itself. +;; is created by calling a SQL interpreter-specific entry function or +;; sql-product-interactive. Do *not* call sql-interactive-mode by +;; itself. ;; The list of currently supported interpreters and the corresponding ;; entry function used to create the SQLi buffers is shown with @@ -847,23 +861,24 @@ Based on `comint-mode-map'.") (defvar sql-mode-abbrev-table nil "Abbrev table used in `sql-mode' and `sql-interactive-mode'.") (unless sql-mode-abbrev-table - (define-abbrev-table 'sql-mode-abbrev-table nil) - (mapcar - ;; In Emacs 21.3+, provide SYSTEM-FLAG to define-abbrev. - '(lambda (abbrev) - (let ((name (car abbrev)) - (expansion (cdr abbrev))) - (condition-case nil - (define-abbrev sql-mode-abbrev-table name expansion nil 0 t) - (error - (define-abbrev sql-mode-abbrev-table name expansion))))) - '(("ins" "insert") - ("upd" "update") - ("del" "delete") - ("sel" "select") - ("proc" "procedure") - ("func" "function") - ("cr" "create")))) + (define-abbrev-table 'sql-mode-abbrev-table nil)) + +(mapcar + ;; In Emacs 22+, provide SYSTEM-FLAG to define-abbrev. + '(lambda (abbrev) + (let ((name (car abbrev)) + (expansion (cdr abbrev))) + (condition-case nil + (define-abbrev sql-mode-abbrev-table name expansion nil 0 t) + (error + (define-abbrev sql-mode-abbrev-table name expansion))))) + '(("ins" . "insert") + ("upd" . "update") + ("del" . "delete") + ("sel" . "select") + ("proc" . "procedure") + ("func" . "function") + ("cr" . "create"))) ;; Syntax Table @@ -872,13 +887,15 @@ Based on `comint-mode-map'.") ;; C-style comments /**/ (see elisp manual "Syntax Flags")) (modify-syntax-entry ?/ ". 14" table) (modify-syntax-entry ?* ". 23" table) - ;; double-dash starts comment + ;; double-dash starts comments (modify-syntax-entry ?- ". 12b" table) - ;; newline and formfeed end coments + ;; newline and formfeed end comments (modify-syntax-entry ?\n "> b" table) (modify-syntax-entry ?\f "> b" table) - ;; single quotes (') quotes delimit strings + ;; single quotes (') delimit strings (modify-syntax-entry ?' "\"" table) + ;; double quotes (") don't delimit strings + (modify-syntax-entry ?\" "." table) ;; backslash is no escape character (modify-syntax-entry ?\\ "." table) table) @@ -887,12 +904,13 @@ Based on `comint-mode-map'.") ;; Font lock support (defvar sql-mode-font-lock-object-name - (list (concat "^\\s-*\\(create\\|drop\\|alter\\)\\s-+" ;; lead off with CREATE, DROP or ALTER - "\\(\\w+\\s-+\\)*" ;; optional intervening keywords - "\\(table\\|view\\|package\\(\\s-+body\\)?\\|proc\\(edure\\)?" - "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+" - "\\(\\w+\\)") - 6 'font-lock-function-name-face) + (eval-when-compile + (list (concat "^\\s-*\\(?:create\\|drop\\|alter\\)\\s-+" ;; lead off with CREATE, DROP or ALTER + "\\(?:\\w+\\s-+\\)*" ;; optional intervening keywords + "\\(?:table\\|view\\|\\(?:package\\|type\\)\\(?:\\s-+body\\)?\\|proc\\(?:edure\\)?" + "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+" + "\\(\\w+\\)") + 1 'font-lock-function-name-face)) "Pattern to match the names of top-level objects. |