Commit graph

129 commits

Author SHA1 Message Date
Chong Yidong
2699a55464 Merge changes from emacs-23 branch 2010-10-31 10:40:01 -04:00
Glenn Morris
e084bc3d41 * lisp/progmodes/sql.el: Remove comment link to defunct viewcvs url. 2010-10-30 19:16:20 -07:00
Michael Mauger
7479021013 SQL Mode, Version 2.8 - sql-list-all and sql-list-table functions.
* progmodes/sql.el: Version 2.8
	(sql-login-params): Updated widget structure; changes still
	needed.
	(sql-product-alist): Add :list-all and :list-table features for
	SQLite, Postgres and MySQL products.
	(sql-redirect): Handle default value.
	(sql-execute, sql-execute-feature): New functions.
	(sql-read-table-name): New function.
	(sql-list-all, sql-list-table): New functions. User API
	(sql-mode-map, sql-interactive-mode-map): Add key definitions
	for above functions.
	(sql-mode-menu, sql-interactive-mode-menu): Add menu definitions
	for above functions.
	(sql-postgres-login-params): Add user and database defaults.
	(sql-buffer-live-p): Bug fix.
	(sql-product-history); New variable.
	(sql-read-product): New function. Use it.
	(sql-set-product, sql-product-interactive): Use it.
	(sql-connection-history): New variable.
	(sql-read-connection): New function. Use it.
	(sql-connect): New function.
	(sql-for-each-login): Redesign function interface.
	(sql-make-alternate-buffer-name, sql-save-connection): Use it.
	(sql-get-login-ext, sql-get-login): Use it. Handle default values.
	(sql-comint): Check for program. Existing live buffer.
	(sql-comint-postgres): Add port parameter.
2010-09-18 22:11:18 -04:00
Michael Mauger
a386ac7011 SQL Mode 2.7: Code cleanup and primatives for SQL redirection
* progmodes/sql.el: Version 2.7.
	(sql-buffer-live-p): Improve detection.
	(sql-find-sqli-buffer, sql-set-sqli-buffer-generally)
	(sql-set-sqli-buffer): Use it.
	(sql-product-interactive): Run `sql-set-sqli-hook'.
	(sql-rename-buffer): Code cleanup.
	(sql-redirect, sql-redirect-value): New functions.  More to come.
2010-09-13 16:05:23 -04:00
Michael Mauger
9250002f81 SQL Mode, Version 2.6
* progmodes/sql.el: Version 2.6
	(sql-dialect): Synonym for "sql-product".
	(sql-find-sqli-buffer, sql-set-sqli-buffer-generally)
	(sql-set-sqli-buffer, sql-show-sqli-buffer, sql-interactive-mode):
	Set "sql-buffer" to buffer name not buffer object so multiple sql
	interactive buffers work properly.  Reverts misguided changes in
	earlier work.
	(sql-comint): Make sure different buffer name is used if "*SQL*"
	buffer is for a different product.
	(sql-make-alternate-buffer-name): Fix bug with "sql-database"
	login param.
	(sql-oracle, sql-sybase, sql-informix, sql-sqlite, sql-mysql)
	(sql-solid, sql-ingres, sql-ms, sql-postgres, sql-interbase)
	(sql-db2, sql-linter, sql-product-interactive, sql-rename-buffer):
	Accept new buffer name or prompt for one.
	(sql-port): Default to zero.
	(sql-comint-mysql): Handle "sql-port" as a numeric.
	(sql-port-history): Delete unused variable.
	(sql-get-login): Default "sql-port" to a number.
	(sql-product-alist): Correct Postgres prompt and terminator
	regexp.
	(sql-sqlite-program): Dynamically detect presence of "sqlite" or
	"sqlite3" executables.
	(sql-sqlite-login-params): Add "*.sqlite[23]?" database name
	pattern.
	(sql-buffer-live-p): New function.
	(sql-mode-menu, sql-send-string): Use it.
	(sql-mode-oracle-font-lock-keywords): Improve SQL*Plus REMARK
	syntax pattern.
	(sql-mode-postgres-font-lock-keywords): Support Postgres V9.
	(sql-mode-sqlite-font-lock-keywords): Hilight sqlite commands.
2010-09-10 23:17:02 -04:00
Michael Mauger
3bd2cfef67 Suppress continuation prompts in SQL interactive mode
* progmodes/sql.el: Version 2.5
        (sql-product-alist): Add :prompt-cont-regexp property for several
        database products.
        (sql-prompt-cont-regexp): New variable.
        (sql-output-newline-count, sql-output-by-send): New
        variables. Record number of newlines in input text.
        (sql-send-string): Handle multiple filters and count newlines.
        (sql-send-magic-terminator): Count terminator newline.
        (sql-interactive-remove-continuation-prompt): Filters output to
        remove continuation prompts; one for each newline.
        (sql-interactive-mode): Set up new variables, prompt regexp and
        output filter.
        (sql-mode-sqlite-font-lock-keywords): Correct some keywords.
        (sql-make-alternate-buffer-name): Correct buffer name in edge
        cases.
2010-08-10 19:04:32 -04:00
Michael Mauger
b93d4f22cb * progmodes/sql.el (sql-mode-sqlite-font-lock-keywords): Added
SQLite 3 keywords, functions and datatypes.
        (sql-interactive-mode): Removed `comint-process-echoes' set to t
        (Bug#6686).
2010-08-07 19:57:07 -04:00
Michael Mauger
5474c40f3e SQL Mode Version2.4 - Improved login prompting
* progmodes/sql.el: Version 2.4.  Improved Login prompting.
	(sql-login-params): New widget definition.
	(sql-oracle-login-params, sql-mysql-login-params)
	(sql-solid-login-params, sql-sybase-login-params)
	(sql-informix-login-params, sql-ingres-login-params)
	(sql-ms-login-params, sql-postgres-login-params)
	(sql-interbase-login-params, sql-db2-login-params)
	(sql-linter-login-params): Use it.
	(sql-sqlite-login-params): Use it; Define "database" parameter as
	a file name.
	(sql-sqlite-program): Change to "sqlite3"
	(sql-comint-sqlite): Make sure database name is complete.
	(sql-for-each-login): New function.
	(sql-connect, sql-save-connection): Use it.
	(sql-get-login-ext): New function.
	(sql-get-login): Use it.
	(sql-make-alternate-buffer-name): Handle :file parameters.
2010-07-22 20:59:43 -04:00
Michael Mauger
d26b0ea9c5 SQL Mode V2.3 - cleanup connection handling 2010-07-20 21:56:55 -04:00
Michael Mauger
30c4d8dcb8 SQL Mode V2.2 - Added sql-connect and sql-connection-alist 2010-07-18 14:44:32 -04:00
Bob Rogers
b15922cc08 * lisp/progmodes/sql.el (sql-connect-mysql): Fix typo. 2010-06-14 20:34:12 -07:00
Juanma Barranquero
c38762fdfb * progmodes/sql.el: Fix typos in docstrings. 2010-05-14 15:31:36 +02:00
Michael Mauger
7492acc936 SQL mode version 2.1
Redesigned product specific definition and handling.  Includes many
bug fixes and enhancements.
2010-05-09 22:07:58 -04:00
Juanma Barranquero
063c632403 * progmodes/sql.el: Fix typos. 2010-04-24 04:59:23 +02:00
Glenn Morris
114f9c9679 Add 2010 to copyright years. 2010-01-13 00:35:10 -08:00
Stefan Monnier
556594956b (sql-product-alist): Add :name tag to entries.
(sql-product): Use it.
(sql-mode-menu): Auto-generate the menu based on sql-product-alist.
(sql-set-product): Add completion.
(sql-highlight-oracle-keywords, sql-highlight-postgres-keywords)
(sql-highlight-linter-keywords, sql-highlight-ms-keywords)
(sql-highlight-ansi-keywords, sql-highlight-sybase-keywords)
(sql-highlight-informix-keywords, sql-highlight-interbase-keywords)
(sql-highlight-ingres-keywords, sql-highlight-solid-keywords)
(sql-highlight-mysql-keywords, sql-highlight-sqlite-keywords)
(sql-highlight-db2-keywords): Remove.
(sql-find-sqli-buffer, sql-set-sqli-buffer-generally)
(sql-highlight-product): Use derived-mode-p.
(sql-set-sqli-buffer): Use with-current-buffer.
(sql-connect-informix, sql-connect-ingres, sql-connect-oracle): Simplify.
2009-08-16 15:48:15 +00:00
Glenn Morris
f5107fea3e Ian Eure <ian at digg.com> (tiny change)
(sql-product-alist, sql-connect-sqlite): Remove host, user, password
options not applicable to SQlite. (Bug#1904)
2009-02-14 03:38:00 +00:00
Glenn Morris
ae940284fa Add 2009 to copyright years. 2009-01-05 03:18:22 +00:00
Glenn Morris
fffa137cb7 American English spelling fix. 2008-06-27 07:34:53 +00:00
Glenn Morris
b1fc2b5014 Switch to recommended form of GPLv3 permissions notice. 2008-05-06 07:25:26 +00:00
Stefan Monnier
cbee283dd7 Fix up comment convention on the arch-tag lines. 2008-04-10 14:10:46 +00:00
Miles Bader
59ce725a3b Merge from emacs--rel--22
Revision: emacs@sv.gnu.org/emacs--devo--0--patch-987
2008-01-08 20:46:54 +00:00
Glenn Morris
4e643dd23c Add 2008 to copyright years. 2008-01-07 02:11:00 +00:00
Juanma Barranquero
f77183c083 (top): Use mapc' rather than mapcar'. 2007-09-26 00:28:25 +00:00
Glenn Morris
1a484753b2 Switch license to GPLv3 or later. 2007-07-25 04:29:40 +00:00
Glenn Morris
d7a0267c8d Add 2007 to copyright years. 2007-01-21 03:53:13 +00:00
Richard M. Stallman
01295a2211 (sql-mode-abbrev-table): Corrected initialization.
(sql-mode-syntax-table): Disable double quoted strings.
(sql-mode-font-lock-object-name): Added TYPE and TYPE BODY.
2006-12-25 20:11:21 +00:00
Glenn Morris
e5a4bf4852 (sql-mode-abbrev-table): Define abbrevs even if abbrev-table is
non-nil (saved user abbrevs may have been restored).
2006-12-05 05:25:36 +00:00
Nick Roberts
d91362c9e0 Update copyright for 2006. 2006-02-10 09:00:31 +00:00
Juanma Barranquero
ec38bb4664 (font-lock-keyword-face, font-lock-set-defaults, font-lock-string-face):
Add defvars.
2005-08-30 11:15:37 +00:00
Juanma Barranquero
280412d8d4 (sql-interactive-mode): Fix typo in docstring. 2005-08-29 11:02:42 +00:00
Richard M. Stallman
8d68e9b541 (sql-interactive-mode-map): Use fboundp.
(sql-read-passwd): Use read-passwd.
2005-08-09 11:42:54 +00:00
Nick Roberts
034babe1e1 Update copyright for release of 22.1 for progmodes directory. 2005-08-01 08:43:45 +00:00
Lute Kamstra
3a35cf56e7 Update FSF's address. 2005-07-04 17:55:18 +00:00
Juanma Barranquero
b9584f65f3 (SQL): Finish `defgroup' description with period.
(sql-copy-column): "?\ " -> "?\s".
2005-07-04 03:25:26 +00:00
Lute Kamstra
03789b211d (sql-interactive-mode): Use delay-mode-hooks. 2005-06-14 12:03:52 +00:00
Lute Kamstra
9a9691963d * progmodes/ada-mode.el (ada-mode):
* progmodes/antlr-mode.el (antlr-mode):
* progmodes/autoconf.el (autoconf-mode):
* progmodes/dcl-mode.el (dcl-mode):
* progmodes/delphi.el (delphi-mode):
* progmodes/ebrowse.el (ebrowse-tree-mode)
(ebrowse-electric-list-mode, ebrowse-member-mode)
(ebrowse-electric-position-mode):
* progmodes/f90.el (f90-mode):
* progmodes/fortran.el (fortran-mode):
* progmodes/icon.el (icon-mode):
* progmodes/idlw-help.el (idlwave-help-mode):
* progmodes/idlw-shell.el (idlwave-shell-mode):
* progmodes/idlwave.el (idlwave-mode):
* progmodes/inf-lisp.el (inferior-lisp-mode):
* progmodes/m4-mode.el (m4-mode):
* progmodes/meta-mode.el (metafont-mode, metapost-mode):
* progmodes/modula2.el (modula-2-mode):
* progmodes/octave-inf.el (inferior-octave-mode):
* progmodes/octave-mod.el (octave-mode):
* progmodes/pascal.el (pascal-mode):
* progmodes/sh-script.el (sh-mode):
* progmodes/sql.el (sql-mode, sql-interactive-mode):
* progmodes/vhdl-mode.el (vhdl-mode):
* progmodes/xscheme.el (scheme-interaction-mode):  Use run-mode-hooks.
2005-05-26 16:43:37 +00:00
Kim F. Storm
bf247b6ed0 Change release version from 21.4 to 22.1 throughout.
Change development version from 21.3.50 to 22.0.50.
2005-02-09 15:50:47 +00:00
Stefan Monnier
9a9069c994 (sql-xemacs-p, sql-emacs19-p, sql-emacs20-p): Remove.
(sql-mode-syntax-table): Use shared GNU EMacs/XEmacs syntax.
(sql-builtin-face, sql-doc-face): Remove.
(sql-mode-ansi-font-lock-keywords)
(sql-mode-oracle-font-lock-keywords)
(sql-mode-postgres-font-lock-keywords)
(sql-mode-linter-font-lock-keywords)
(sql-mode-ms-font-lock-keywords)
(sql-mode-mysql-font-lock-keywords): Use standard fonts.
(sql-product-font-lock): Fix font-lock reset when font rules change.
(sql-highlight-product): Remove incorrect font-lock reset logic.
2004-05-04 21:59:40 +00:00
Stefan Monnier
9fd8cb3673 (sql-product-alist): Rename variable `sql-product-support'.
Add Postgres login parameters.
(sql-set-product, sql-product-feature): Update with renamed variable.
(sql-connect-postgres): Add username prompt.
(sql-imenu-generic-expression, sql-mode-font-lock-object-name):
Make patterns less product specific.
(sql-xemacs-p, sql-emacs19-p): Add flags for emacs variants.
(sql-mode-abbrev-table): Modify initialization.
(sql-builtin-face): Add variable.
(sql-keywords-re): Add macro.
(sql-mode-ansi-font-lock-keywords): Update for ANSI-92.
(sql-mode-oracle-font-lock-keywords): Update for Oracle 9i.
(sql-mode-postgres-font-lock-keywords): Update for Postgres 7.3.
(sql-mode-mysql-font-lock-keywords): Update for MySql 4.0.
(sql-mode-linter-font-lock-keywords)
(sql-mode-ms-font-lock-keywords): Use `sql-keywords-re' macro.
(sql-mode-sybase-font-lock-keywords, sql-mode-informix-font-lock-keywords)
(sql-mode-interbase-font-lock-keywords, sql-mode-ingres-font-lock-keywords)
(sql-mode-solid-font-lock-keywords, sql-mode-sqlite-font-lock-keywords)
(sql-mode-db2-font-lock-keywords): Default to nil.
(sql-product-font-lock): Always highlight ANSI keywords.
(sql-add-product-keywords): Made similar to `font-lock-add-keywords'.
(sql-send-string): Add function.
2004-04-29 21:55:28 +00:00
Richard M. Stallman
dc45d1a608 Change maintainer. 2003-09-12 00:55:27 +00:00
Miles Bader
ab5796a9f9 Add arch taglines 2003-09-01 15:45:59 +00:00
Alex Schroeder
78024f8836 Patch by Michael Mauger <mmaug@yahoo.com>
Version 1.8.0 of sql-mode.

Simplify selection of SQL products to define highlighting and
interactive mode.  Includes detailed instructions on adding
support for new products.

* sql.el (sql-product): New variable.  Identifies SQL product for
use in highlighting and interactive mode.
(sql-interactive-product): New variable.  SQL product for
sql-interactive-mode.
(sql-product-support): New variable.  Specifies product-specific
parameters to drive highlighting and interactive mode.
(sql-imenu-generic-expression): Add more object types.
(sql-sqlite-options): Correct comment.
(sql-ms-program): Use "osql" rather than "isql".
(sql-prompt-regexp, sql-prompt-length): Update comment.
(sql-mode-menu): Add "Start SQLi session" entry.  Replace
Highlighting submenu with Product menu.  Fix Send Region entry.
(sql-mode-abbrev-table): Add abbreviations.  Support of
SYSTEM-FLAG on define-abbrev.  Support was removed with last
check-in; it now handles older Emacsen without the SYSTEM-FLAG.
(sql-mode-font-lock-object-name): Add font-lock pattern for object
names.
(sql-mode-ansi-font-lock-keywords): Set as default value.
(sql-mode-oracle-font-lock-keywords): Set as default value.
Support Oracle 9i keywords.
(sql-mode-postgres-font-lock-keywords): Set as default value.
(sql-mode-linter-font-lock-keywords): Set as default value.
(sql-mode-ms-font-lock-keywords): New variable.  Support Microsoft
SQLServer 2000.
(sql-mode-sybase-font-lock-keywords)
(sql-mode-interbase-font-lock-keywords)
(sql-mode-sqlite-font-lock-keywords)
(sql-mode-strong-font-lock-keywords)
(sql-mode-mysql-font-lock-keywords)
(sql-mode-db2-font-lock-keywords): New variables.  Default to ANSI
keywords.
(sql-mode-font-lock-defaults): Update comment.
(sql-product-feature): New function.  Returns feature associated
with a product from `sql-product-support' alist.
(sql-product-font-lock): New function.  Set font-lock support
based on `sql-product'.
(sql-add-product-keywords): New function.  Add font-lock rules to
product-specific keyword variables.
(sql-set-product): New function.  Set `sql-product' and apply
appropriate font-lock highlighting.
(sql-highlight-product): New function.  Set font-lock support
based on a product.  Also set mode name to include product name.
(sql-highlight-ansi-keywords, sql-highlight-oracle-keywords)
(sql-highlight-postgres-keywords, sql-highlight-linter-keywords):
Use `sql-set-product'.
(sql-highlight-ms-keywords)
(sql-highlight-sybase-keywords)
(sql-highlight-interbase-keywords)
(sql-highlight-strong-keywords)
(sql-highlight-mysql-keywords)
(sql-highlight-sqlite-keywords)
(sql-highlight-db2-keywords): New functions.  Use
`sql-set-product'.
(sql-get-login): Prompt in the same order as the tokens.
(sql-mode): Uses `sql-product-highlight' and
`sql-product-font-lock'.
(sql-product-interactive): New function.  Common portions of
product-specific interactive mode wrappers.
(sql-interactive-mode): Rewritten to use product features.
(sql-oracle, sql-sybase, sql-informix, sql-sqlite, sql-mysql)
(sql-solid, sql-ingres, sql-ms, sql-postgres, sql-interbase)
(sql-db2, sql-linter): Use `sql-product-interactive'.
(sql-connect-oracle, sql-connect-sybase, sql-connect-informix)
(sql-connect-sqlite, sql-connect-mysql, sql-connect-solid)
(sql-connect-ingres, sql-connect-postgres)
(sql-connect-interbase, sql-connect-db2, sql-connect-linter): New
functions.  Format command line parameters and invoke comint on
the appropriate interpreter.  Code was in the corresponding
`sql-xyz' function before.
(sql-connect-ms): New function.  Support -E argument to use
operating system credentials for authentication.
2003-08-18 17:29:23 +00:00
Juanma Barranquero
b4dd5c9ca5 Revert last change. 2003-07-14 20:39:39 +00:00
Juanma Barranquero
9c7bda2fc1 Version 1.8.0 of sql-mode.
Simplify selection of SQL products to define highlighting and
interactive mode.  Includes detailed instructions on adding support
for new products.

(sql-product): New variable.  Identifies SQL product for use in highlighting and
interactive mode.
(sql-interactive-product): New variable.  SQL product for sql-interactive-mode.
(sql-product-support): New variable.  Specifies product-specific parameters to
drive highlighting and interactive mode.
(sql-imenu-generic-expression): Add more object types.
(sql-sqlite-options): Correct comment.
(sql-ms-program): Use "osql" rather than "isql".
(sql-prompt-regexp, sql-prompt-length): Update comment.
(sql-mode-menu): Add "Start SQLi session" entry.  Replace Highlighting submenu
with Product menu.  Fix Send Region entry.
(sql-mode-abbrev-table): Add abbreviations.  Support of SYSTEM-FLAG on
define-abbrev.  Support was removed with last check-in; it now handles older
Emacsen without the SYSTEM-FLAG.
(sql-mode-font-lock-object-name): Add font-lock pattern for object names.
(sql-mode-ansi-font-lock-keywords): Set as default value.
(sql-mode-oracle-font-lock-keywords): Set as default value.  Support Oracle 9i
keywords.
(sql-mode-postgres-font-lock-keywords): Set as default value.
(sql-mode-linter-font-lock-keywords): Set as default value.
(sql-mode-ms-font-lock-keywords): New variable.  Support Microsoft SQLServer
2000.
(sql-mode-sybase-font-lock-keywords)
(sql-mode-interbase-font-lock-keywords)
(sql-mode-sqlite-font-lock-keywords)
(sql-mode-strong-font-lock-keywords)
(sql-mode-mysql-font-lock-keywords)
(sql-mode-db2-font-lock-keywords): New variables.  Default to ANSI keywords.
(sql-mode-font-lock-defaults): Update comment.
(sql-product-feature): New function.  Returns feature associated with a product
from `sql-product-support' alist.
(sql-product-font-lock): New function.  Set font-lock support based on
`sql-product'.
(sql-add-product-keywords): New function.  Add font-lock rules to
product-specific keyword variables.
(sql-set-product): New function.  Set `sql-product' and apply appropriate
font-lock highlighting.
(sql-highlight-product): New function.  Set font-lock support based on a
product.  Also set mode name to include product name.
(sql-highlight-ansi-keywords, sql-highlight-oracle-keywords)
(sql-highlight-postgres-keywords, sql-highlight-linter-keywords):
Use `sql-set-product'.
(sql-highlight-ms-keywords)
(sql-highlight-sybase-keywords)
(sql-highlight-interbase-keywords)
(sql-highlight-strong-keywords)
(sql-highlight-mysql-keywords)
(sql-highlight-sqlite-keywords)
(sql-highlight-db2-keywords): New functions.  Use `sql-set-product'.
(sql-get-login): Prompt in the same order as the tokens.
(sql-mode): Uses `sql-product-highlight' and `sql-product-font-lock'.
(sql-product-interactive): New function.  Common portions of product-specific
interactive mode wrappers.
(sql-interactive-mode): Rewritten to use product features.
(sql-oracle, sql-sybase, sql-informix, sql-sqlite, sql-mysql)
(sql-solid, sql-ingres, sql-ms, sql-postgres, sql-interbase)
(sql-db2, sql-linter): Use `sql-product-interactive'.
(sql-connect-oracle, sql-connect-sybase, sql-connect-informix)
(sql-connect-sqlite, sql-connect-mysql, sql-connect-solid)
(sql-connect-ingres, sql-connect-postgres)
(sql-connect-interbase, sql-connect-db2, sql-connect-linter): New functions.
Format command line parameters and invoke comint on the appropriate interpreter.
Code was in the corresponding `sql-xyz' function before.
(sql-connect-ms): New function.  Support -E argument to use operating system
credentials for authentication.
2003-07-13 17:19:18 +00:00
Juanma Barranquero
5d538ce37e Add support for SQLite interpreter. 2003-06-17 20:58:37 +00:00
Juanma Barranquero
f4df536d0a Added LINTER support.
(sql-linter-program): New variable.
(sql-linter-options): New variable.
(sql-mode-menu): Added Linter keywords.
(sql-mode-linter-font-lock-keywords): New variable.
(sql-highlight-linter-keywords): New function.
(sql-linter): New function.
(sql-ms-options): New variable.
(sql-ms): Use it.
2002-11-21 08:32:06 +00:00
Richard M. Stallman
754dfe82dc (sql-escape-newlines-and-send)
(sql-query-placeholders-and-send): Fix previous change.
2002-01-17 01:39:49 +00:00
Richard M. Stallman
60a193e282 (sql-query-placeholders-and-send): Handle
comint-input-sender-no-newline like comint-simple-send.
(sql-escape-newlines-and-send): Likewise.
2002-01-13 04:44:22 +00:00
Pavel Janík
42f2e96aea (sql-mode-abbrev-table): Mark all the predefined abbrevs as "system"
abbrevs.
2001-12-30 22:12:02 +00:00