diff options
| author | Gerd Moellmann | 2000-09-05 10:44:21 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-09-05 10:44:21 +0000 |
| commit | 311e7a8990e1bebd53ebe186307cabc185f0290f (patch) | |
| tree | dda6e4cf66a238639288f24a6293a99aaf525a85 | |
| parent | 179fc9ef03060813603a33b7c26dd3d906d17d47 (diff) | |
| download | emacs-311e7a8990e1bebd53ebe186307cabc185f0290f.tar.gz emacs-311e7a8990e1bebd53ebe186307cabc185f0290f.zip | |
(sql-postgres): Use sql-postgres-options.
(sql-postgres-options): New variable.
(sql-mode-menu): Work around missing variable mark-active
in XEmacs.
(sql-mode): Added call to easy-menu-add for XEmacs compatibility.
(sql-interactive-mode): Added call to easy-menu-add for XEmacs
compatibility.
| -rw-r--r-- | lisp/progmodes/sql.el | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 0485517bae2..7a57ff485a9 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | ;; Author: Alex Schroeder <alex@gnu.org> | 5 | ;; Author: Alex Schroeder <alex@gnu.org> |
| 6 | ;; Maintainer: Alex Schroeder <alex@gnu.org> | 6 | ;; Maintainer: Alex Schroeder <alex@gnu.org> |
| 7 | ;; Version: 1.4.19 | 7 | ;; Version: 1.4.21 |
| 8 | ;; Keywords: comm languages processes | 8 | ;; Keywords: comm languages processes |
| 9 | 9 | ||
| 10 | ;; This file is part of GNU Emacs. | 10 | ;; This file is part of GNU Emacs. |
| @@ -58,10 +58,8 @@ | |||
| 58 | ;; modes derived from comint mode. This makes these modes easier to | 58 | ;; modes derived from comint mode. This makes these modes easier to |
| 59 | ;; use. | 59 | ;; use. |
| 60 | 60 | ||
| 61 | ;; sql-mode can be used to enable syntactic hilighting for SQL | 61 | ;; sql-mode can be used to keep editing SQL statements. The SQL |
| 62 | ;; statements in another buffer. SQL statements can then be sent to | 62 | ;; statements can be sent to the SQL process in the SQLi buffer. |
| 63 | ;; the SQL process in the SQLi buffer. sql-mode has already been | ||
| 64 | ;; used as a template to a simple PL/SQL mode. | ||
| 65 | 63 | ||
| 66 | ;; For documentation on the functionality provided by comint mode, and | 64 | ;; For documentation on the functionality provided by comint mode, and |
| 67 | ;; the hooks available for customising it, see the file `comint.el'. | 65 | ;; the hooks available for customising it, see the file `comint.el'. |
| @@ -340,6 +338,16 @@ The program can also specify a TCP connection. See `make-comint'." | |||
| 340 | :type 'file | 338 | :type 'file |
| 341 | :group 'SQL) | 339 | :group 'SQL) |
| 342 | 340 | ||
| 341 | (defcustom sql-postgres-options '("--pset" "pager=off") | ||
| 342 | "*List of additional options for `sql-postgres-program'. | ||
| 343 | The default setting includes the --pset option which breaks | ||
| 344 | older versions of the psql client (such as version 6.5.3). | ||
| 345 | If you want the psql to prompt you for a user name, add the | ||
| 346 | string \"-u\" to the list of options." | ||
| 347 | :type '(repeat string) | ||
| 348 | :version "20.8" | ||
| 349 | :group 'SQL) | ||
| 350 | |||
| 343 | 351 | ||
| 344 | 352 | ||
| 345 | ;;; Variables which do not need customization | 353 | ;;; Variables which do not need customization |
| @@ -415,7 +423,9 @@ Based on `comint-mode-map'.") | |||
| 415 | '("SQL" | 423 | '("SQL" |
| 416 | ["Send Paragraph" sql-send-paragraph (and (buffer-live-p sql-buffer) | 424 | ["Send Paragraph" sql-send-paragraph (and (buffer-live-p sql-buffer) |
| 417 | (get-buffer-process sql-buffer))] | 425 | (get-buffer-process sql-buffer))] |
| 418 | ["Send Region" sql-send-region (and mark-active | 426 | ["Send Region" sql-send-region (and (or (and (boundp 'mark-active); Emacs |
| 427 | mark-active) | ||
| 428 | (mark)); XEmacs | ||
| 419 | (buffer-live-p sql-buffer) | 429 | (buffer-live-p sql-buffer) |
| 420 | (get-buffer-process sql-buffer))] | 430 | (get-buffer-process sql-buffer))] |
| 421 | ["Send Buffer" sql-send-buffer (and (buffer-live-p sql-buffer) | 431 | ["Send Buffer" sql-send-buffer (and (buffer-live-p sql-buffer) |
| @@ -1011,6 +1021,8 @@ For information on how to create multiple SQLi buffers, see | |||
| 1011 | (setq major-mode 'sql-mode) | 1021 | (setq major-mode 'sql-mode) |
| 1012 | (setq mode-name "SQL") | 1022 | (setq mode-name "SQL") |
| 1013 | (use-local-map sql-mode-map) | 1023 | (use-local-map sql-mode-map) |
| 1024 | (if sql-mode-menu | ||
| 1025 | (easy-menu-add sql-mode-menu)); XEmacs | ||
| 1014 | (set-syntax-table sql-mode-syntax-table) | 1026 | (set-syntax-table sql-mode-syntax-table) |
| 1015 | (make-local-variable 'font-lock-defaults) | 1027 | (make-local-variable 'font-lock-defaults) |
| 1016 | ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try | 1028 | ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try |
| @@ -1124,6 +1136,8 @@ you entered, right above the output it created. | |||
| 1124 | (setq major-mode 'sql-interactive-mode) | 1136 | (setq major-mode 'sql-interactive-mode) |
| 1125 | (setq mode-name "SQLi") | 1137 | (setq mode-name "SQLi") |
| 1126 | (use-local-map sql-interactive-mode-map) | 1138 | (use-local-map sql-interactive-mode-map) |
| 1139 | (if sql-interactive-mode-menu | ||
| 1140 | (easy-menu-add sql-interactive-mode-menu)); XEmacs | ||
| 1127 | (set-syntax-table sql-mode-syntax-table) | 1141 | (set-syntax-table sql-mode-syntax-table) |
| 1128 | (make-local-variable 'font-lock-defaults) | 1142 | (make-local-variable 'font-lock-defaults) |
| 1129 | ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try | 1143 | ;; Note that making KEYWORDS-ONLY nil will cause havoc if you try |
| @@ -1557,11 +1571,9 @@ Try to set `comint-output-filter-functions' like this: | |||
| 1557 | (message "Login...") | 1571 | (message "Login...") |
| 1558 | ;; username and password are ignored. Jason Beegan suggest using | 1572 | ;; username and password are ignored. Jason Beegan suggest using |
| 1559 | ;; --pset and pager=off instead of \\o|cat. The later was the | 1573 | ;; --pset and pager=off instead of \\o|cat. The later was the |
| 1560 | ;; solution by Gregor Zych. If you find that your postgres doesn't | 1574 | ;; solution by Gregor Zych. Jason's suggestion is the default value |
| 1561 | ;; like Jason Beegans's solution and prefers Gregor Zych's solution, | 1575 | ;; for sql-postgres-options. |
| 1562 | ;; then I'd love to hear from you. Send your comments to the | 1576 | (let ((params sql-postgres-options)) |
| 1563 | ;; mailing list. | ||
| 1564 | (let ((params (list "--pset" "pager=off"))) | ||
| 1565 | (if (not (string= "" sql-database)) | 1577 | (if (not (string= "" sql-database)) |
| 1566 | (setq params (append (list sql-database) params))) | 1578 | (setq params (append (list sql-database) params))) |
| 1567 | (if (not (string= "" sql-server)) | 1579 | (if (not (string= "" sql-server)) |