diff options
| author | Gerd Moellmann | 2001-03-06 12:26:35 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-03-06 12:26:35 +0000 |
| commit | eb3f61dd1f54cd5295c7f7e8e0e3ccffe7617c6a (patch) | |
| tree | 4e11fc9122036dc8542dda41e94651d82c3a0fdb | |
| parent | fa84f42ab93126b5552ec2058740dd5b410aa885 (diff) | |
| download | emacs-eb3f61dd1f54cd5295c7f7e8e0e3ccffe7617c6a.tar.gz emacs-eb3f61dd1f54cd5295c7f7e8e0e3ccffe7617c6a.zip | |
(sql-interbase): New function.
(sql-interbase-program): New option.
(sql-interbase-options): New option.
And some typos fixed: "customise" to "customize".
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/progmodes/sql.el | 92 |
2 files changed, 85 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 507c193782c..76ec40702d4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2001-03-06 Alex Schroeder <alex@gnu.org> | ||
| 2 | |||
| 3 | * sql.el (sql-interbase): New function. | ||
| 4 | (sql-interbase-program): New option. | ||
| 5 | (sql-interbase-options): New option. | ||
| 6 | And some typos fixed: "customise" to "customize". | ||
| 7 | |||
| 1 | 2001-03-06 Dave Love <fx@gnu.org> | 8 | 2001-03-06 Dave Love <fx@gnu.org> |
| 2 | 9 | ||
| 3 | * textmodes/flyspell.el (flyspell-region): Set up | 10 | * textmodes/flyspell.el (flyspell-region): Set up |
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index cc31a6dfb09..189507acbfc 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.25 | 7 | ;; Version: 1.5.0 |
| 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. |
| @@ -62,7 +62,7 @@ | |||
| 62 | ;; statements can be sent to the SQL process in the SQLi buffer. | 62 | ;; statements can be sent to the SQL process in the SQLi buffer. |
| 63 | 63 | ||
| 64 | ;; For documentation on the functionality provided by comint mode, and | 64 | ;; For documentation on the functionality provided by comint mode, and |
| 65 | ;; the hooks available for customising it, see the file `comint.el'. | 65 | ;; the hooks available for customizing it, see the file `comint.el'. |
| 66 | 66 | ||
| 67 | ;; Hint for newbies: take a look at `dabbrev-expand', `abbrev-mode', and | 67 | ;; Hint for newbies: take a look at `dabbrev-expand', `abbrev-mode', and |
| 68 | ;; `imenu-add-menubar-index'. | 68 | ;; `imenu-add-menubar-index'. |
| @@ -223,12 +223,12 @@ commands when the input history is read, as if you had set | |||
| 223 | ;; The usual hooks | 223 | ;; The usual hooks |
| 224 | 224 | ||
| 225 | (defcustom sql-interactive-mode-hook '() | 225 | (defcustom sql-interactive-mode-hook '() |
| 226 | "*Hook for customising `sql-interactive-mode'." | 226 | "*Hook for customizing `sql-interactive-mode'." |
| 227 | :type 'hook | 227 | :type 'hook |
| 228 | :group 'SQL) | 228 | :group 'SQL) |
| 229 | 229 | ||
| 230 | (defcustom sql-mode-hook '() | 230 | (defcustom sql-mode-hook '() |
| 231 | "*Hook for customising `sql-mode'." | 231 | "*Hook for customizing `sql-mode'." |
| 232 | :type 'hook | 232 | :type 'hook |
| 233 | :group 'SQL) | 233 | :group 'SQL) |
| 234 | 234 | ||
| @@ -240,7 +240,7 @@ is changed." | |||
| 240 | :type 'hook | 240 | :type 'hook |
| 241 | :group 'SQL) | 241 | :group 'SQL) |
| 242 | 242 | ||
| 243 | ;; Customisation for Oracle | 243 | ;; Customization for Oracle |
| 244 | 244 | ||
| 245 | (defcustom sql-oracle-program "sqlplus" | 245 | (defcustom sql-oracle-program "sqlplus" |
| 246 | "*Command to start sqlplus by Oracle. | 246 | "*Command to start sqlplus by Oracle. |
| @@ -261,7 +261,7 @@ The program can also specify a TCP connection. See `make-comint'." | |||
| 261 | :version "20.8" | 261 | :version "20.8" |
| 262 | :group 'SQL) | 262 | :group 'SQL) |
| 263 | 263 | ||
| 264 | ;; Customisation for MySql | 264 | ;; Customization for MySql |
| 265 | 265 | ||
| 266 | (defcustom sql-mysql-program "mysql" | 266 | (defcustom sql-mysql-program "mysql" |
| 267 | "*Command to start mysql by TcX. | 267 | "*Command to start mysql by TcX. |
| @@ -280,7 +280,7 @@ on Windows: \"-C\" \"-t\" \"-f\" \"-n\"." | |||
| 280 | :version "20.8" | 280 | :version "20.8" |
| 281 | :group 'SQL) | 281 | :group 'SQL) |
| 282 | 282 | ||
| 283 | ;; Customisation for Solid | 283 | ;; Customization for Solid |
| 284 | 284 | ||
| 285 | (defcustom sql-solid-program "solsql" | 285 | (defcustom sql-solid-program "solsql" |
| 286 | "*Command to start SOLID SQL Editor. | 286 | "*Command to start SOLID SQL Editor. |
| @@ -291,7 +291,7 @@ The program can also specify a TCP connection. See `make-comint'." | |||
| 291 | :type 'file | 291 | :type 'file |
| 292 | :group 'SQL) | 292 | :group 'SQL) |
| 293 | 293 | ||
| 294 | ;; Customisation for SyBase | 294 | ;; Customization for SyBase |
| 295 | 295 | ||
| 296 | (defcustom sql-sybase-program "isql" | 296 | (defcustom sql-sybase-program "isql" |
| 297 | "*Command to start isql by SyBase. | 297 | "*Command to start isql by SyBase. |
| @@ -309,7 +309,7 @@ Some versions of isql might require the -n option in order to work." | |||
| 309 | :version "20.8" | 309 | :version "20.8" |
| 310 | :group 'SQL) | 310 | :group 'SQL) |
| 311 | 311 | ||
| 312 | ;; Customisation for Informix | 312 | ;; Customization for Informix |
| 313 | 313 | ||
| 314 | (defcustom sql-informix-program "dbaccess" | 314 | (defcustom sql-informix-program "dbaccess" |
| 315 | "*Command to start dbaccess by Informix. | 315 | "*Command to start dbaccess by Informix. |
| @@ -320,7 +320,7 @@ The program can also specify a TCP connection. See `make-comint'." | |||
| 320 | :type 'file | 320 | :type 'file |
| 321 | :group 'SQL) | 321 | :group 'SQL) |
| 322 | 322 | ||
| 323 | ;; Customisation for Ingres | 323 | ;; Customization for Ingres |
| 324 | 324 | ||
| 325 | (defcustom sql-ingres-program "sql" | 325 | (defcustom sql-ingres-program "sql" |
| 326 | "*Command to start sql by Ingres. | 326 | "*Command to start sql by Ingres. |
| @@ -331,7 +331,7 @@ The program can also specify a TCP connection. See `make-comint'." | |||
| 331 | :type 'file | 331 | :type 'file |
| 332 | :group 'SQL) | 332 | :group 'SQL) |
| 333 | 333 | ||
| 334 | ;; Customisation for Microsoft | 334 | ;; Customization for Microsoft |
| 335 | 335 | ||
| 336 | (defcustom sql-ms-program "isql" | 336 | (defcustom sql-ms-program "isql" |
| 337 | "*Command to start isql by Microsoft. | 337 | "*Command to start isql by Microsoft. |
| @@ -342,7 +342,7 @@ The program can also specify a TCP connection. See `make-comint'." | |||
| 342 | :type 'file | 342 | :type 'file |
| 343 | :group 'SQL) | 343 | :group 'SQL) |
| 344 | 344 | ||
| 345 | ;; Customisation for Postgres | 345 | ;; Customization for Postgres |
| 346 | 346 | ||
| 347 | (defcustom sql-postgres-program "psql" | 347 | (defcustom sql-postgres-program "psql" |
| 348 | "Command to start psql by Postgres. | 348 | "Command to start psql by Postgres. |
| @@ -364,6 +364,23 @@ string \"-u\" to the list of options." | |||
| 364 | :version "20.8" | 364 | :version "20.8" |
| 365 | :group 'SQL) | 365 | :group 'SQL) |
| 366 | 366 | ||
| 367 | ;; Customization for Interbase | ||
| 368 | |||
| 369 | (defcustom sql-interbase-program "isql" | ||
| 370 | "*Command to start isql by Interbase. | ||
| 371 | |||
| 372 | Starts `sql-interactive-mode' after doing some setup. | ||
| 373 | |||
| 374 | The program can also specify a TCP connection. See `make-comint'." | ||
| 375 | :type 'file | ||
| 376 | :group 'SQL) | ||
| 377 | |||
| 378 | (defcustom sql-interbase-options nil | ||
| 379 | "*List of additional options for `sql-interbase-program'." | ||
| 380 | :type '(repeat string) | ||
| 381 | :version "20.8" | ||
| 382 | :group 'SQL) | ||
| 383 | |||
| 367 | 384 | ||
| 368 | 385 | ||
| 369 | ;;; Variables which do not need customization | 386 | ;;; Variables which do not need customization |
| @@ -776,7 +793,7 @@ even in old versions of Emacs." | |||
| 776 | "Get username, password and database from the user. | 793 | "Get username, password and database from the user. |
| 777 | 794 | ||
| 778 | The variables `sql-user', `sql-password', `sql-server', and | 795 | The variables `sql-user', `sql-password', `sql-server', and |
| 779 | `sql-database' can be customised. They are used as the default values. | 796 | `sql-database' can be customized. They are used as the default values. |
| 780 | Usernames, servers and databases are stored in `sql-user-history', | 797 | Usernames, servers and databases are stored in `sql-user-history', |
| 781 | `sql-server-history' and `database-history'. Passwords are not stored | 798 | `sql-server-history' and `database-history'. Passwords are not stored |
| 782 | in a history. | 799 | in a history. |
| @@ -1552,7 +1569,6 @@ The default comes from `process-coding-system-alist' and | |||
| 1552 | (message "Login...done") | 1569 | (message "Login...done") |
| 1553 | (pop-to-buffer sql-buffer))) | 1570 | (pop-to-buffer sql-buffer))) |
| 1554 | 1571 | ||
| 1555 | |||
| 1556 | 1572 | ||
| 1557 | 1573 | ||
| 1558 | ;;;###autoload | 1574 | ;;;###autoload |
| @@ -1613,6 +1629,54 @@ Try to set `comint-output-filter-functions' like this: | |||
| 1613 | (message "Login...done") | 1629 | (message "Login...done") |
| 1614 | (pop-to-buffer sql-buffer))) | 1630 | (pop-to-buffer sql-buffer))) |
| 1615 | 1631 | ||
| 1632 | |||
| 1633 | |||
| 1634 | ;;;###autoload | ||
| 1635 | (defun sql-interbase () | ||
| 1636 | "Run isql by Interbase as an inferior process. | ||
| 1637 | |||
| 1638 | If buffer `*SQL*' exists but no process is running, make a new process. | ||
| 1639 | If buffer exists and a process is running, just switch to buffer | ||
| 1640 | `*SQL*'. | ||
| 1641 | |||
| 1642 | Interpreter used comes from variable `sql-interbase-program'. Login | ||
| 1643 | uses the variables `sql-user', `sql-password', and `sql-database' as | ||
| 1644 | defaults, if set. | ||
| 1645 | |||
| 1646 | The buffer is put in sql-interactive-mode, giving commands for sending | ||
| 1647 | input. See `sql-interactive-mode'. | ||
| 1648 | |||
| 1649 | To specify a coding system for converting non-ASCII characters | ||
| 1650 | in the input and output to the process, use \\[universal-coding-system-argument] | ||
| 1651 | before \\[sql-interbase]. You can also specify this with \\[set-buffer-process-coding-system] | ||
| 1652 | in the SQL buffer, after you start the process. | ||
| 1653 | The default comes from `process-coding-system-alist' and | ||
| 1654 | `default-process-coding-system'. | ||
| 1655 | |||
| 1656 | \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" | ||
| 1657 | (interactive) | ||
| 1658 | (if (comint-check-proc "*SQL*") | ||
| 1659 | (pop-to-buffer "*SQL*") | ||
| 1660 | (sql-get-login 'user 'password 'database) | ||
| 1661 | (message "Login...") | ||
| 1662 | ;; Put all parameters to the program (if defined) in a list and call | ||
| 1663 | ;; make-comint. | ||
| 1664 | (let ((params sql-interbase-options)) | ||
| 1665 | (if (not (string= "" sql-user)) | ||
| 1666 | (setq params (append (list "-u" sql-user) params))) | ||
| 1667 | (if (not (string= "" sql-password)) | ||
| 1668 | (setq params (append (list "-p" sql-password) params))) | ||
| 1669 | (if (not (string= "" sql-database)) | ||
| 1670 | (setq params (cons sql-database params))); add to the front! | ||
| 1671 | (set-buffer (apply 'make-comint "SQL" sql-interbase-program | ||
| 1672 | nil params))) | ||
| 1673 | (setq sql-prompt-regexp "^SQL> ") | ||
| 1674 | (setq sql-prompt-length 5) | ||
| 1675 | (setq sql-buffer (current-buffer)) | ||
| 1676 | (sql-interactive-mode) | ||
| 1677 | (message "Login...done") | ||
| 1678 | (pop-to-buffer sql-buffer))) | ||
| 1679 | |||
| 1616 | (provide 'sql) | 1680 | (provide 'sql) |
| 1617 | 1681 | ||
| 1618 | ;;; sql.el ends here | 1682 | ;;; sql.el ends here |