diff options
| author | Michael Mauger | 2012-01-04 22:45:30 -0500 |
|---|---|---|
| committer | Michael Mauger | 2012-01-04 22:45:30 -0500 |
| commit | bb5aa5d6c3a0138c36e2879a78d9cdb22e6f410e (patch) | |
| tree | 854acf3d1f9e7ca918802397b2485a61d351fe73 | |
| parent | 9937bef4b8f3a820220d0309b340f25285808fae (diff) | |
| download | emacs-bb5aa5d6c3a0138c36e2879a78d9cdb22e6f410e.tar.gz emacs-bb5aa5d6c3a0138c36e2879a78d9cdb22e6f410e.zip | |
2012-01-05 Michael R. Mauger <mmaug@yahoo.com>
* progmodes/sql.el (sql-login-hook): Add hook to respond to the
first prompt in `sql-interacive-mode'.
(sql-mode-oracle-font-lock-keywords): Add CONNECT_BY_* builtin
keywords.
(sql-mode-mysql-font-lock-keywords): Add ELSEIF keyword.
(sql-product-interactive): Bug fix: Set `sql-buffer' in
context of original buffer. Invoke `sql-login-hook'.
| -rw-r--r-- | lisp/ChangeLog | 10 | ||||
| -rw-r--r-- | lisp/progmodes/sql.el | 23 |
2 files changed, 28 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 1125097feb7..ae03053db9b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,13 @@ | |||
| 1 | 2012-01-05 Michael R. Mauger <mmaug@yahoo.com> | ||
| 2 | |||
| 3 | * progmodes/sql.el (sql-login-hook): Add hook to respond to the | ||
| 4 | first prompt in `sql-interacive-mode'. | ||
| 5 | (sql-mode-oracle-font-lock-keywords): Add CONNECT_BY_* builtin | ||
| 6 | keywords. | ||
| 7 | (sql-mode-mysql-font-lock-keywords): Add ELSEIF keyword. | ||
| 8 | (sql-product-interactive): Bug fix: Set `sql-buffer' in | ||
| 9 | context of original buffer. Invoke `sql-login-hook'. | ||
| 10 | |||
| 1 | 2012-01-04 Eli Zaretskii <eliz@gnu.org> | 11 | 2012-01-04 Eli Zaretskii <eliz@gnu.org> |
| 2 | 12 | ||
| 3 | * mail/rmail.el (rmail-font-lock-keywords): Accept non-ASCII | 13 | * mail/rmail.el (rmail-font-lock-keywords): Accept non-ASCII |
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 60ba768a80e..2e59d8f8517 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; sql.el --- specialized comint.el for SQL interpreters | 1 | ;;; sql.el --- specialized comint.el for SQL interpreters |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1998-2011 Free Software Foundation, Inc. | 3 | ;; Copyright (C) 1998-2012 Free Software Foundation, Inc. |
| 4 | 4 | ||
| 5 | ;; Author: Alex Schroeder <alex@gnu.org> | 5 | ;; Author: Alex Schroeder <alex@gnu.org> |
| 6 | ;; Maintainer: Michael Mauger <mmaug@yahoo.com> | 6 | ;; Maintainer: Michael Mauger <mmaug@yahoo.com> |
| @@ -219,6 +219,8 @@ | |||
| 219 | ;; Drew Adams <drew.adams@oracle.com> -- Emacs 20 support | 219 | ;; Drew Adams <drew.adams@oracle.com> -- Emacs 20 support |
| 220 | ;; Harald Maier <maierh@myself.com> -- sql-send-string | 220 | ;; Harald Maier <maierh@myself.com> -- sql-send-string |
| 221 | ;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections; code polish | 221 | ;; Stefan Monnier <monnier@iro.umontreal.ca> -- font-lock corrections; code polish |
| 222 | ;; Paul Sleigh <bat@flurf.net> -- MySQL keyword enhancement | ||
| 223 | ;; Andrew Schein <andrew@andrewschein.com> -- sql-port bug | ||
| 222 | 224 | ||
| 223 | 225 | ||
| 224 | 226 | ||
| @@ -811,6 +813,14 @@ is changed." | |||
| 811 | :type 'hook | 813 | :type 'hook |
| 812 | :group 'SQL) | 814 | :group 'SQL) |
| 813 | 815 | ||
| 816 | (defcustom sql-login-hook '() | ||
| 817 | "Hook for interacting with a buffer in `sql-interactive-mode'. | ||
| 818 | |||
| 819 | This hook is invoked in a buffer once it is ready to accept input | ||
| 820 | for the first time." | ||
| 821 | :type 'hook | ||
| 822 | :group 'SQL) | ||
| 823 | |||
| 814 | ;; Customization for ANSI | 824 | ;; Customization for ANSI |
| 815 | 825 | ||
| 816 | (defcustom sql-ansi-statement-starters (regexp-opt '( | 826 | (defcustom sql-ansi-statement-starters (regexp-opt '( |
| @@ -1594,6 +1604,7 @@ to add functions and PL/SQL keywords.") | |||
| 1594 | "atan" "atan2" "avg" "bfilename" "bin_to_num" "bitand" "cardinality" | 1604 | "atan" "atan2" "avg" "bfilename" "bin_to_num" "bitand" "cardinality" |
| 1595 | "cast" "ceil" "chartorowid" "chr" "cluster_id" "cluster_probability" | 1605 | "cast" "ceil" "chartorowid" "chr" "cluster_id" "cluster_probability" |
| 1596 | "cluster_set" "coalesce" "collect" "compose" "concat" "convert" "corr" | 1606 | "cluster_set" "coalesce" "collect" "compose" "concat" "convert" "corr" |
| 1607 | "connect_by_root" "connect_by_iscycle" "connect_by_isleaf" | ||
| 1597 | "corr_k" "corr_s" "cos" "cosh" "count" "covar_pop" "covar_samp" | 1608 | "corr_k" "corr_s" "cos" "cosh" "count" "covar_pop" "covar_samp" |
| 1598 | "cube_table" "cume_dist" "current_date" "current_timestamp" "cv" | 1609 | "cube_table" "cume_dist" "current_date" "current_timestamp" "cv" |
| 1599 | "dataobj_to_partition" "dbtimezone" "decode" "decompose" "deletexml" | 1610 | "dataobj_to_partition" "dbtimezone" "decode" "decompose" "deletexml" |
| @@ -2279,7 +2290,7 @@ you define your own `sql-mode-solid-font-lock-keywords'.") | |||
| 2279 | "collation" "column" "columns" "comment" "committed" "concurrent" | 2290 | "collation" "column" "columns" "comment" "committed" "concurrent" |
| 2280 | "constraint" "create" "cross" "data" "database" "default" | 2291 | "constraint" "create" "cross" "data" "database" "default" |
| 2281 | "delay_key_write" "delayed" "delete" "desc" "directory" "disable" | 2292 | "delay_key_write" "delayed" "delete" "desc" "directory" "disable" |
| 2282 | "distinct" "distinctrow" "do" "drop" "dumpfile" "duplicate" "else" | 2293 | "distinct" "distinctrow" "do" "drop" "dumpfile" "duplicate" "else" "elseif" |
| 2283 | "enable" "enclosed" "end" "escaped" "exists" "fields" "first" "for" | 2294 | "enable" "enclosed" "end" "escaped" "exists" "fields" "first" "for" |
| 2284 | "force" "foreign" "from" "full" "fulltext" "global" "group" "handler" | 2295 | "force" "foreign" "from" "full" "fulltext" "global" "group" "handler" |
| 2285 | "having" "heap" "high_priority" "if" "ignore" "in" "index" "infile" | 2296 | "having" "heap" "high_priority" "if" "ignore" "in" "index" "infile" |
| @@ -3423,7 +3434,7 @@ list of SQLi command strings." | |||
| 3423 | :prompt-regexp)) | 3434 | :prompt-regexp)) |
| 3424 | (start nil)) | 3435 | (start nil)) |
| 3425 | (with-current-buffer buf | 3436 | (with-current-buffer buf |
| 3426 | (toggle-read-only -1) | 3437 | (setq view-read-only nil) |
| 3427 | (unless save-prior | 3438 | (unless save-prior |
| 3428 | (erase-buffer)) | 3439 | (erase-buffer)) |
| 3429 | (goto-char (point-max)) | 3440 | (goto-char (point-max)) |
| @@ -3532,7 +3543,7 @@ buffer is popped into a view window. " | |||
| 3532 | (get-lru-window)))) | 3543 | (get-lru-window)))) |
| 3533 | (with-current-buffer outbuf | 3544 | (with-current-buffer outbuf |
| 3534 | (set-buffer-modified-p nil) | 3545 | (set-buffer-modified-p nil) |
| 3535 | (toggle-read-only 1)) | 3546 | (setq view-read-only t)) |
| 3536 | (view-buffer-other-window outbuf) | 3547 | (view-buffer-other-window outbuf) |
| 3537 | (when one-win | 3548 | (when one-win |
| 3538 | (shrink-window-if-larger-than-buffer))))) | 3549 | (shrink-window-if-larger-than-buffer))))) |
| @@ -4097,7 +4108,8 @@ the call to \\[sql-product-interactive] with | |||
| 4097 | (setq new-sqli-buffer (current-buffer)) | 4108 | (setq new-sqli-buffer (current-buffer)) |
| 4098 | (when new-name | 4109 | (when new-name |
| 4099 | (sql-rename-buffer new-name)) | 4110 | (sql-rename-buffer new-name)) |
| 4100 | (setq sql-buffer (buffer-name new-sqli-buffer)) | 4111 | (set (make-local-variable 'sql-buffer) |
| 4112 | (buffer-name new-sqli-buffer)) | ||
| 4101 | 4113 | ||
| 4102 | ;; Set `sql-buffer' in the start buffer | 4114 | ;; Set `sql-buffer' in the start buffer |
| 4103 | (with-current-buffer start-buffer | 4115 | (with-current-buffer start-buffer |
| @@ -4107,6 +4119,7 @@ the call to \\[sql-product-interactive] with | |||
| 4107 | 4119 | ||
| 4108 | ;; All done. | 4120 | ;; All done. |
| 4109 | (message "Login...done") | 4121 | (message "Login...done") |
| 4122 | (run-hooks 'sql-login-hook) | ||
| 4110 | (pop-to-buffer new-sqli-buffer))))) | 4123 | (pop-to-buffer new-sqli-buffer))))) |
| 4111 | (message "No default SQL product defined. Set `sql-product'."))) | 4124 | (message "No default SQL product defined. Set `sql-product'."))) |
| 4112 | 4125 | ||