Mercurial > emacs
comparison lisp/progmodes/sql.el @ 108352:cf2043af9228
* progmodes/sql.el: Fix typos.
author | Juanma Barranquero <lekktu@gmail.com> |
---|---|
date | Sat, 24 Apr 2010 04:59:23 +0200 |
parents | 1d1d5d9bd884 |
children | aa05f2497948 6fa185318a59 |
comparison
equal
deleted
inserted
replaced
108351:b9c7f875c4e8 | 108352:cf2043af9228 |
---|---|
417 If set to the symbol `go', then hitting `go' on a line by itself will | 417 If set to the symbol `go', then hitting `go' on a line by itself will |
418 send current input in the SQLi buffer to the process. | 418 send current input in the SQLi buffer to the process. |
419 If set to nil, then you must use \\[comint-send-input] in order to send | 419 If set to nil, then you must use \\[comint-send-input] in order to send |
420 current input in the SQLi buffer to the process." | 420 current input in the SQLi buffer to the process." |
421 :type '(choice (const :tag "Nothing" nil) | 421 :type '(choice (const :tag "Nothing" nil) |
422 (const :tag "The semikolon `;'" semicolon) | 422 (const :tag "The semicolon `;'" semicolon) |
423 (const :tag "The string `go' by itself" go)) | 423 (const :tag "The string `go' by itself" go)) |
424 :version "20.8" | 424 :version "20.8" |
425 :group 'SQL) | 425 :group 'SQL) |
426 | 426 |
427 (defcustom sql-pop-to-buffer-after-send-region nil | 427 (defcustom sql-pop-to-buffer-after-send-region nil |
448 ("Indexes" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*index\\s-+\\(\\w+\\)" 2) | 448 ("Indexes" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*index\\s-+\\(\\w+\\)" 2) |
449 ("Tables/Views" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(table\\|view\\)\\s-+\\(\\w+\\)" 3)) | 449 ("Tables/Views" "^\\s-*create\\s-+\\(\\w+\\s-+\\)*\\(table\\|view\\)\\s-+\\(\\w+\\)" 3)) |
450 "Define interesting points in the SQL buffer for `imenu'. | 450 "Define interesting points in the SQL buffer for `imenu'. |
451 | 451 |
452 This is used to set `imenu-generic-expression' when SQL mode is | 452 This is used to set `imenu-generic-expression' when SQL mode is |
453 entered. Subsequent changes to sql-imenu-generic-expression will not | 453 entered. Subsequent changes to `sql-imenu-generic-expression' will |
454 affect existing SQL buffers because imenu-generic-expression is a | 454 not affect existing SQL buffers because imenu-generic-expression is |
455 local variable.") | 455 a local variable.") |
456 | 456 |
457 ;; history file | 457 ;; history file |
458 | 458 |
459 (defcustom sql-input-ring-file-name nil | 459 (defcustom sql-input-ring-file-name nil |
460 "*If non-nil, name of the file to read/write input history. | 460 "*If non-nil, name of the file to read/write input history. |
514 (defcustom sql-oracle-program "sqlplus" | 514 (defcustom sql-oracle-program "sqlplus" |
515 "*Command to start sqlplus by Oracle. | 515 "*Command to start sqlplus by Oracle. |
516 | 516 |
517 Starts `sql-interactive-mode' after doing some setup. | 517 Starts `sql-interactive-mode' after doing some setup. |
518 | 518 |
519 Under NT, \"sqlplus\" usually starts the sqlplus \"GUI\". In order to | 519 On Windows, \"sqlplus\" usually starts the sqlplus \"GUI\". In order to |
520 start the sqlplus console, use \"plus33\" or something similar. You | 520 start the sqlplus console, use \"plus33\" or something similar. You |
521 will find the file in your Orant\\bin directory. | 521 will find the file in your Orant\\bin directory. |
522 | 522 |
523 The program can also specify a TCP connection. See `make-comint'." | 523 The program can also specify a TCP connection. See `make-comint'." |
524 :type 'file | 524 :type 'file |
540 The program can also specify a TCP connection. See `make-comint'." | 540 The program can also specify a TCP connection. See `make-comint'." |
541 :type 'file | 541 :type 'file |
542 :group 'SQL) | 542 :group 'SQL) |
543 | 543 |
544 (defcustom sql-sqlite-options nil | 544 (defcustom sql-sqlite-options nil |
545 "*List of additional options for `sql-sqlite-program'. | 545 "*List of additional options for `sql-sqlite-program'." |
546 The following list of options is reported to make things work | |
547 on Windows: \"-C\" \"-t\" \"-f\" \"-n\"." | |
548 :type '(repeat string) | 546 :type '(repeat string) |
549 :version "20.8" | 547 :version "20.8" |
550 :group 'SQL) | 548 :group 'SQL) |
551 | 549 |
552 ;; Customization for MySql | 550 ;; Customization for MySql |
725 ;; Passwords are not kept in a history. | 723 ;; Passwords are not kept in a history. |
726 | 724 |
727 (defvar sql-buffer nil | 725 (defvar sql-buffer nil |
728 "Current SQLi buffer. | 726 "Current SQLi buffer. |
729 | 727 |
730 The global value of sql-buffer is the name of the latest SQLi buffer | 728 The global value of `sql-buffer' is the name of the latest SQLi buffer |
731 created. Any SQL buffer created will make a local copy of this value. | 729 created. Any SQL buffer created will make a local copy of this value. |
732 See `sql-interactive-mode' for more on multiple sessions. If you want | 730 See `sql-interactive-mode' for more on multiple sessions. If you want |
733 to change the SQLi buffer a SQL mode sends its SQL strings to, change | 731 to change the SQLi buffer a SQL mode sends its SQL strings to, change |
734 the local value of `sql-buffer' using \\[sql-set-sqli-buffer].") | 732 the local value of `sql-buffer' using \\[sql-set-sqli-buffer].") |
735 | 733 |
990 "ANSI SQL keywords used by font-lock. | 988 "ANSI SQL keywords used by font-lock. |
991 | 989 |
992 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 990 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
993 regular expressions are created during compilation by calling the | 991 regular expressions are created during compilation by calling the |
994 function `regexp-opt'. Therefore, take a look at the source before | 992 function `regexp-opt'. Therefore, take a look at the source before |
995 you define your own sql-mode-ansi-font-lock-keywords. You may want to | 993 you define your own `sql-mode-ansi-font-lock-keywords'. You may want |
996 add functions and PL/SQL keywords.") | 994 to add functions and PL/SQL keywords.") |
997 | 995 |
998 (defvar sql-mode-oracle-font-lock-keywords | 996 (defvar sql-mode-oracle-font-lock-keywords |
999 (let ((oracle-functions (sql-keywords-re | 997 (let ((oracle-functions (sql-keywords-re |
1000 "abs" "acos" "add_months" "ascii" "asciistr" "asin" "atan" "atan2" | 998 "abs" "acos" "add_months" "ascii" "asciistr" "asin" "atan" "atan2" |
1001 "avg" "bfilename" "bin_to_num" "bitand" "cast" "ceil" "chartorowid" | 999 "avg" "bfilename" "bin_to_num" "bitand" "cast" "ceil" "chartorowid" |
1206 "Oracle SQL keywords used by font-lock. | 1204 "Oracle SQL keywords used by font-lock. |
1207 | 1205 |
1208 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1206 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1209 regular expressions are created during compilation by calling the | 1207 regular expressions are created during compilation by calling the |
1210 function `regexp-opt'. Therefore, take a look at the source before | 1208 function `regexp-opt'. Therefore, take a look at the source before |
1211 you define your own sql-mode-oracle-font-lock-keywords. You may want | 1209 you define your own `sql-mode-oracle-font-lock-keywords'. You may want |
1212 to add functions and PL/SQL keywords.") | 1210 to add functions and PL/SQL keywords.") |
1213 | 1211 |
1214 (defvar sql-mode-postgres-font-lock-keywords | 1212 (defvar sql-mode-postgres-font-lock-keywords |
1215 (let ((pg-funcs (sql-keywords-re | 1213 (let ((pg-funcs (sql-keywords-re |
1216 "abbrev" "abs" "acos" "age" "area" "ascii" "asin" "atab2" "atan" | 1214 "abbrev" "abs" "acos" "age" "area" "ascii" "asin" "atab2" "atan" |
1294 "Postgres SQL keywords used by font-lock. | 1292 "Postgres SQL keywords used by font-lock. |
1295 | 1293 |
1296 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1294 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1297 regular expressions are created during compilation by calling the | 1295 regular expressions are created during compilation by calling the |
1298 function `regexp-opt'. Therefore, take a look at the source before | 1296 function `regexp-opt'. Therefore, take a look at the source before |
1299 you define your own sql-mode-postgres-font-lock-keywords.") | 1297 you define your own `sql-mode-postgres-font-lock-keywords'.") |
1300 | 1298 |
1301 (defvar sql-mode-linter-font-lock-keywords | 1299 (defvar sql-mode-linter-font-lock-keywords |
1302 (let ((linter-keywords (sql-keywords-re | 1300 (let ((linter-keywords (sql-keywords-re |
1303 "autocommit" "autoinc" "autorowid" "cancel" "cascade" "channel" | 1301 "autocommit" "autoinc" "autorowid" "cancel" "cascade" "channel" |
1304 "committed" "count" "countblob" "cross" "current" "data" "database" | 1302 "committed" "count" "countblob" "cross" "current" "data" "database" |
1480 "Microsoft SQLServer SQL keywords used by font-lock. | 1478 "Microsoft SQLServer SQL keywords used by font-lock. |
1481 | 1479 |
1482 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1480 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1483 regular expressions are created during compilation by calling the | 1481 regular expressions are created during compilation by calling the |
1484 function `regexp-opt'. Therefore, take a look at the source before | 1482 function `regexp-opt'. Therefore, take a look at the source before |
1485 you define your own sql-mode-ms-font-lock-keywords.") | 1483 you define your own `sql-mode-ms-font-lock-keywords'.") |
1486 | 1484 |
1487 (defvar sql-mode-sybase-font-lock-keywords nil | 1485 (defvar sql-mode-sybase-font-lock-keywords nil |
1488 "Sybase SQL keywords used by font-lock. | 1486 "Sybase SQL keywords used by font-lock. |
1489 | 1487 |
1490 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1488 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1491 regular expressions are created during compilation by calling the | 1489 regular expressions are created during compilation by calling the |
1492 function `regexp-opt'. Therefore, take a look at the source before | 1490 function `regexp-opt'. Therefore, take a look at the source before |
1493 you define your own sql-mode-sybase-font-lock-keywords.") | 1491 you define your own `sql-mode-sybase-font-lock-keywords'.") |
1494 | 1492 |
1495 (defvar sql-mode-informix-font-lock-keywords nil | 1493 (defvar sql-mode-informix-font-lock-keywords nil |
1496 "Informix SQL keywords used by font-lock. | 1494 "Informix SQL keywords used by font-lock. |
1497 | 1495 |
1498 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1496 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1499 regular expressions are created during compilation by calling the | 1497 regular expressions are created during compilation by calling the |
1500 function `regexp-opt'. Therefore, take a look at the source before | 1498 function `regexp-opt'. Therefore, take a look at the source before |
1501 you define your own sql-mode-informix-font-lock-keywords.") | 1499 you define your own `sql-mode-informix-font-lock-keywords'.") |
1502 | 1500 |
1503 (defvar sql-mode-interbase-font-lock-keywords nil | 1501 (defvar sql-mode-interbase-font-lock-keywords nil |
1504 "Interbase SQL keywords used by font-lock. | 1502 "Interbase SQL keywords used by font-lock. |
1505 | 1503 |
1506 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1504 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1507 regular expressions are created during compilation by calling the | 1505 regular expressions are created during compilation by calling the |
1508 function `regexp-opt'. Therefore, take a look at the source before | 1506 function `regexp-opt'. Therefore, take a look at the source before |
1509 you define your own sql-mode-interbase-font-lock-keywords.") | 1507 you define your own `sql-mode-interbase-font-lock-keywords'.") |
1510 | 1508 |
1511 (defvar sql-mode-ingres-font-lock-keywords nil | 1509 (defvar sql-mode-ingres-font-lock-keywords nil |
1512 "Ingres SQL keywords used by font-lock. | 1510 "Ingres SQL keywords used by font-lock. |
1513 | 1511 |
1514 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1512 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1515 regular expressions are created during compilation by calling the | 1513 regular expressions are created during compilation by calling the |
1516 function `regexp-opt'. Therefore, take a look at the source before | 1514 function `regexp-opt'. Therefore, take a look at the source before |
1517 you define your own sql-mode-interbase-font-lock-keywords.") | 1515 you define your own `sql-mode-interbase-font-lock-keywords'.") |
1518 | 1516 |
1519 (defvar sql-mode-solid-font-lock-keywords nil | 1517 (defvar sql-mode-solid-font-lock-keywords nil |
1520 "Solid SQL keywords used by font-lock. | 1518 "Solid SQL keywords used by font-lock. |
1521 | 1519 |
1522 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1520 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1523 regular expressions are created during compilation by calling the | 1521 regular expressions are created during compilation by calling the |
1524 function `regexp-opt'. Therefore, take a look at the source before | 1522 function `regexp-opt'. Therefore, take a look at the source before |
1525 you define your own sql-mode-solid-font-lock-keywords.") | 1523 you define your own `sql-mode-solid-font-lock-keywords'.") |
1526 | 1524 |
1527 (defvar sql-mode-mysql-font-lock-keywords | 1525 (defvar sql-mode-mysql-font-lock-keywords |
1528 (let ((mysql-funcs (sql-keywords-re | 1526 (let ((mysql-funcs (sql-keywords-re |
1529 "ascii" "avg" "bdmpolyfromtext" "bdmpolyfromwkb" "bdpolyfromtext" | 1527 "ascii" "avg" "bdmpolyfromtext" "bdmpolyfromwkb" "bdpolyfromtext" |
1530 "bdpolyfromwkb" "benchmark" "bin" "bit_and" "bit_length" "bit_or" | 1528 "bdpolyfromwkb" "benchmark" "bin" "bit_and" "bit_length" "bit_or" |
1597 "MySQL SQL keywords used by font-lock. | 1595 "MySQL SQL keywords used by font-lock. |
1598 | 1596 |
1599 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1597 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1600 regular expressions are created during compilation by calling the | 1598 regular expressions are created during compilation by calling the |
1601 function `regexp-opt'. Therefore, take a look at the source before | 1599 function `regexp-opt'. Therefore, take a look at the source before |
1602 you define your own sql-mode-mysql-font-lock-keywords.") | 1600 you define your own `sql-mode-mysql-font-lock-keywords'.") |
1603 | 1601 |
1604 (defvar sql-mode-sqlite-font-lock-keywords nil | 1602 (defvar sql-mode-sqlite-font-lock-keywords nil |
1605 "SQLite SQL keywords used by font-lock. | 1603 "SQLite SQL keywords used by font-lock. |
1606 | 1604 |
1607 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1605 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1608 regular expressions are created during compilation by calling the | 1606 regular expressions are created during compilation by calling the |
1609 function `regexp-opt'. Therefore, take a look at the source before | 1607 function `regexp-opt'. Therefore, take a look at the source before |
1610 you define your own sql-mode-sqlite-font-lock-keywords.") | 1608 you define your own `sql-mode-sqlite-font-lock-keywords'.") |
1611 | 1609 |
1612 (defvar sql-mode-db2-font-lock-keywords nil | 1610 (defvar sql-mode-db2-font-lock-keywords nil |
1613 "DB2 SQL keywords used by font-lock. | 1611 "DB2 SQL keywords used by font-lock. |
1614 | 1612 |
1615 This variable is used by `sql-mode' and `sql-interactive-mode'. The | 1613 This variable is used by `sql-mode' and `sql-interactive-mode'. The |
1616 regular expressions are created during compilation by calling the | 1614 regular expressions are created during compilation by calling the |
1617 function `regexp-opt'. Therefore, take a look at the source before | 1615 function `regexp-opt'. Therefore, take a look at the source before |
1618 you define your own sql-mode-db2-font-lock-keywords.") | 1616 you define your own `sql-mode-db2-font-lock-keywords'.") |
1619 | 1617 |
1620 (defvar sql-mode-font-lock-keywords nil | 1618 (defvar sql-mode-font-lock-keywords nil |
1621 "SQL keywords used by font-lock. | 1619 "SQL keywords used by font-lock. |
1622 | 1620 |
1623 Setting this variable directly no longer has any affect. Use | 1621 Setting this variable directly no longer has any affect. Use |
1624 `sql-product' and `sql-add-product-keywords' to control the | 1622 `sql-product' and `sql-add-product-keywords' to control the |
1625 highlighting rules in sql-mode.") | 1623 highlighting rules in SQL mode.") |
1626 | 1624 |
1627 | 1625 |
1628 | 1626 |
1629 ;;; SQL Product support functions | 1627 ;;; SQL Product support functions |
1630 | 1628 |
1631 (defun sql-product-feature (feature &optional product) | 1629 (defun sql-product-feature (feature &optional product) |
1632 "Lookup `feature' needed to support the current SQL product. | 1630 "Lookup `feature' needed to support the current SQL product. |
1633 | 1631 |
1634 See \[sql-product-alist] for a list of products and supported features." | 1632 See `sql-product-alist' for a list of products and supported features." |
1635 (plist-get | 1633 (plist-get |
1636 (cdr (assoc (or product sql-product) | 1634 (cdr (assoc (or product sql-product) |
1637 sql-product-alist)) | 1635 sql-product-alist)) |
1638 feature)) | 1636 feature)) |
1639 | 1637 |
1718 | 1716 |
1719 | 1717 |
1720 ;;; Functions to switch highlighting | 1718 ;;; Functions to switch highlighting |
1721 | 1719 |
1722 (defun sql-highlight-product () | 1720 (defun sql-highlight-product () |
1723 "Turns on the appropriate font highlighting for the SQL product | 1721 "Turn on the appropriate font highlighting for the SQL product selected." |
1724 selected." | |
1725 (when (derived-mode-p 'sql-mode) | 1722 (when (derived-mode-p 'sql-mode) |
1726 ;; Setup font-lock | 1723 ;; Setup font-lock |
1727 (sql-product-font-lock nil t) | 1724 (sql-product-font-lock nil t) |
1728 | 1725 |
1729 ;; Set the mode name to include the product. | 1726 ;; Set the mode name to include the product. |
1730 (setq mode-name (concat "SQL[" (prin1-to-string sql-product) "]")))) | 1727 (setq mode-name (concat "SQL[" (prin1-to-string sql-product) "]")))) |
1731 | 1728 |
1732 (defun sql-set-product (product) | 1729 (defun sql-set-product (product) |
1733 "Set `sql-product' to product and enable appropriate | 1730 "Set `sql-product' to product and enable appropriate highlighting." |
1734 highlighting." | |
1735 (interactive | 1731 (interactive |
1736 (list (completing-read "Enter SQL product: " | 1732 (list (completing-read "Enter SQL product: " |
1737 (mapcar (lambda (info) (symbol-name (car info))) | 1733 (mapcar (lambda (info) (symbol-name (car info))) |
1738 sql-product-alist) | 1734 sql-product-alist) |
1739 nil 'require-match))) | 1735 nil 'require-match))) |
1750 ;;; Compatibility functions | 1746 ;;; Compatibility functions |
1751 | 1747 |
1752 (if (not (fboundp 'comint-line-beginning-position)) | 1748 (if (not (fboundp 'comint-line-beginning-position)) |
1753 ;; comint-line-beginning-position is defined in Emacs 21 | 1749 ;; comint-line-beginning-position is defined in Emacs 21 |
1754 (defun comint-line-beginning-position () | 1750 (defun comint-line-beginning-position () |
1755 "Returns the buffer position of the beginning of the line, after any prompt. | 1751 "Return the buffer position of the beginning of the line, after any prompt. |
1756 The prompt is assumed to be any text at the beginning of the line matching | 1752 The prompt is assumed to be any text at the beginning of the line matching |
1757 the regular expression `comint-prompt-regexp', a buffer local variable." | 1753 the regular expression `comint-prompt-regexp', a buffer local variable." |
1758 (save-excursion (comint-bol nil) (point)))) | 1754 (save-excursion (comint-bol nil) (point)))) |
1759 | 1755 |
1760 | 1756 |
1972 (system-name) | 1968 (system-name) |
1973 sql-server) | 1969 sql-server) |
1974 sql-database))) | 1970 sql-database))) |
1975 | 1971 |
1976 (defun sql-rename-buffer () | 1972 (defun sql-rename-buffer () |
1977 "Renames a SQLi buffer." | 1973 "Rename a SQLi buffer." |
1978 (interactive) | 1974 (interactive) |
1979 (rename-buffer (format "*SQL: %s*" sql-alternate-buffer-name) t)) | 1975 (rename-buffer (format "*SQL: %s*" sql-alternate-buffer-name) t)) |
1980 | 1976 |
1981 (defun sql-copy-column () | 1977 (defun sql-copy-column () |
1982 "Copy current column to the end of buffer. | 1978 "Copy current column to the end of buffer. |
2005 (insert " "))))) | 2001 (insert " "))))) |
2006 ;; in any case, insert the column | 2002 ;; in any case, insert the column |
2007 (insert column) | 2003 (insert column) |
2008 (message "%s" column)))) | 2004 (message "%s" column)))) |
2009 | 2005 |
2010 ;; On NT, SQL*Plus for Oracle turns on full buffering for stdout if it | 2006 ;; On Windows, SQL*Plus for Oracle turns on full buffering for stdout |
2011 ;; is not attached to a character device; therefore placeholder | 2007 ;; if it is not attached to a character device; therefore placeholder |
2012 ;; replacement by SQL*Plus is fully buffered. The workaround lets | 2008 ;; replacement by SQL*Plus is fully buffered. The workaround lets |
2013 ;; Emacs query for the placeholders. | 2009 ;; Emacs query for the placeholders. |
2014 | 2010 |
2015 (defvar sql-placeholder-history nil | 2011 (defvar sql-placeholder-history nil |
2016 "History of placeholder values used.") | 2012 "History of placeholder values used.") |
2017 | 2013 |
2018 (defun sql-query-placeholders-and-send (proc string) | 2014 (defun sql-query-placeholders-and-send (proc string) |
2019 "Send to PROC input STRING, maybe replacing placeholders. | 2015 "Send to PROC input STRING, maybe replacing placeholders. |
2020 Placeholders are words starting with and ampersand like &this. | 2016 Placeholders are words starting with an ampersand like &this. |
2021 This function is used for `comint-input-sender' if using `sql-oracle' on NT." | 2017 This function is used for `comint-input-sender' if using |
2018 `sql-oracle' on Windows." | |
2022 (while (string-match "&\\(\\sw+\\)" string) | 2019 (while (string-match "&\\(\\sw+\\)" string) |
2023 (setq string (replace-match | 2020 (setq string (replace-match |
2024 (read-from-minibuffer | 2021 (read-from-minibuffer |
2025 (format "Enter value for %s: " (match-string 1 string)) | 2022 (format "Enter value for %s: " (match-string 1 string)) |
2026 nil nil nil sql-placeholder-history) | 2023 nil nil nil sql-placeholder-history) |
2102 | 2099 |
2103 (defun sql-toggle-pop-to-buffer-after-send-region (&optional value) | 2100 (defun sql-toggle-pop-to-buffer-after-send-region (&optional value) |
2104 "Toggle `sql-pop-to-buffer-after-send-region'. | 2101 "Toggle `sql-pop-to-buffer-after-send-region'. |
2105 | 2102 |
2106 If given the optional parameter VALUE, sets | 2103 If given the optional parameter VALUE, sets |
2107 sql-toggle-pop-to-buffer-after-send-region to VALUE." | 2104 `sql-toggle-pop-to-buffer-after-send-region' to VALUE." |
2108 (interactive "P") | 2105 (interactive "P") |
2109 (if value | 2106 (if value |
2110 (setq sql-pop-to-buffer-after-send-region value) | 2107 (setq sql-pop-to-buffer-after-send-region value) |
2111 (setq sql-pop-to-buffer-after-send-region | 2108 (setq sql-pop-to-buffer-after-send-region |
2112 (null sql-pop-to-buffer-after-send-region )))) | 2109 (null sql-pop-to-buffer-after-send-region )))) |
2185 | 2182 |
2186 (defun sql-interactive-mode () | 2183 (defun sql-interactive-mode () |
2187 "Major mode to use a SQL interpreter interactively. | 2184 "Major mode to use a SQL interpreter interactively. |
2188 | 2185 |
2189 Do not call this function by yourself. The environment must be | 2186 Do not call this function by yourself. The environment must be |
2190 initialized by an entry function specific for the SQL interpreter. See | 2187 initialized by an entry function specific for the SQL interpreter. |
2191 `sql-help' for a list of available entry functions. | 2188 See `sql-help' for a list of available entry functions. |
2192 | 2189 |
2193 \\[comint-send-input] after the end of the process' output sends the | 2190 \\[comint-send-input] after the end of the process' output sends the |
2194 text from the end of process to the end of the current line. | 2191 text from the end of process to the end of the current line. |
2195 \\[comint-send-input] before end of process output copies the current | 2192 \\[comint-send-input] before end of process output copies the current |
2196 line minus the prompt to the end of the buffer and sends it. | 2193 line minus the prompt to the end of the buffer and sends it. |
2358 Interpreter used comes from variable `sql-oracle-program'. Login uses | 2355 Interpreter used comes from variable `sql-oracle-program'. Login uses |
2359 the variables `sql-user', `sql-password', and `sql-database' as | 2356 the variables `sql-user', `sql-password', and `sql-database' as |
2360 defaults, if set. Additional command line parameters can be stored in | 2357 defaults, if set. Additional command line parameters can be stored in |
2361 the list `sql-oracle-options'. | 2358 the list `sql-oracle-options'. |
2362 | 2359 |
2363 The buffer is put in sql-interactive-mode, giving commands for sending | 2360 The buffer is put in SQL interactive mode, giving commands for sending |
2364 input. See `sql-interactive-mode'. | 2361 input. See `sql-interactive-mode'. |
2365 | 2362 |
2366 To specify a coding system for converting non-ASCII characters | 2363 To specify a coding system for converting non-ASCII characters |
2367 in the input and output to the process, use \\[universal-coding-system-argument] | 2364 in the input and output to the process, use \\[universal-coding-system-argument] |
2368 before \\[sql-oracle]. You can also specify this with \\[set-buffer-process-coding-system] | 2365 before \\[sql-oracle]. You can also specify this with \\[set-buffer-process-coding-system] |
2390 (setq parameter (concat parameter "@" sql-database))) | 2387 (setq parameter (concat parameter "@" sql-database))) |
2391 (setq parameter (if parameter | 2388 (setq parameter (if parameter |
2392 (nconc (list parameter) sql-oracle-options) | 2389 (nconc (list parameter) sql-oracle-options) |
2393 sql-oracle-options)) | 2390 sql-oracle-options)) |
2394 (set-buffer (apply 'make-comint "SQL" sql-oracle-program nil parameter)) | 2391 (set-buffer (apply 'make-comint "SQL" sql-oracle-program nil parameter)) |
2395 ;; SQL*Plus is buffered on WindowsNT; this handles &placeholders. | 2392 ;; SQL*Plus is buffered on Windows; this handles &placeholders. |
2396 (if (eq window-system 'w32) | 2393 (if (eq window-system 'w32) |
2397 (setq comint-input-sender 'sql-query-placeholders-and-send)))) | 2394 (setq comint-input-sender 'sql-query-placeholders-and-send)))) |
2398 | 2395 |
2399 | 2396 |
2400 | 2397 |
2409 Interpreter used comes from variable `sql-sybase-program'. Login uses | 2406 Interpreter used comes from variable `sql-sybase-program'. Login uses |
2410 the variables `sql-server', `sql-user', `sql-password', and | 2407 the variables `sql-server', `sql-user', `sql-password', and |
2411 `sql-database' as defaults, if set. Additional command line parameters | 2408 `sql-database' as defaults, if set. Additional command line parameters |
2412 can be stored in the list `sql-sybase-options'. | 2409 can be stored in the list `sql-sybase-options'. |
2413 | 2410 |
2414 The buffer is put in sql-interactive-mode, giving commands for sending | 2411 The buffer is put in SQL interactive mode, giving commands for sending |
2415 input. See `sql-interactive-mode'. | 2412 input. See `sql-interactive-mode'. |
2416 | 2413 |
2417 To specify a coding system for converting non-ASCII characters | 2414 To specify a coding system for converting non-ASCII characters |
2418 in the input and output to the process, use \\[universal-coding-system-argument] | 2415 in the input and output to the process, use \\[universal-coding-system-argument] |
2419 before \\[sql-sybase]. You can also specify this with \\[set-buffer-process-coding-system] | 2416 before \\[sql-sybase]. You can also specify this with \\[set-buffer-process-coding-system] |
2453 `*SQL*'. | 2450 `*SQL*'. |
2454 | 2451 |
2455 Interpreter used comes from variable `sql-informix-program'. Login uses | 2452 Interpreter used comes from variable `sql-informix-program'. Login uses |
2456 the variable `sql-database' as default, if set. | 2453 the variable `sql-database' as default, if set. |
2457 | 2454 |
2458 The buffer is put in sql-interactive-mode, giving commands for sending | 2455 The buffer is put in SQL interactive mode, giving commands for sending |
2459 input. See `sql-interactive-mode'. | 2456 input. See `sql-interactive-mode'. |
2460 | 2457 |
2461 To specify a coding system for converting non-ASCII characters | 2458 To specify a coding system for converting non-ASCII characters |
2462 in the input and output to the process, use \\[universal-coding-system-argument] | 2459 in the input and output to the process, use \\[universal-coding-system-argument] |
2463 before \\[sql-informix]. You can also specify this with \\[set-buffer-process-coding-system] | 2460 before \\[sql-informix]. You can also specify this with \\[set-buffer-process-coding-system] |
2492 Interpreter used comes from variable `sql-sqlite-program'. Login uses | 2489 Interpreter used comes from variable `sql-sqlite-program'. Login uses |
2493 the variables `sql-user', `sql-password', `sql-database', and | 2490 the variables `sql-user', `sql-password', `sql-database', and |
2494 `sql-server' as defaults, if set. Additional command line parameters | 2491 `sql-server' as defaults, if set. Additional command line parameters |
2495 can be stored in the list `sql-sqlite-options'. | 2492 can be stored in the list `sql-sqlite-options'. |
2496 | 2493 |
2497 The buffer is put in sql-interactive-mode, giving commands for sending | 2494 The buffer is put in SQL interactive mode, giving commands for sending |
2498 input. See `sql-interactive-mode'. | 2495 input. See `sql-interactive-mode'. |
2499 | 2496 |
2500 To specify a coding system for converting non-ASCII characters | 2497 To specify a coding system for converting non-ASCII characters |
2501 in the input and output to the process, use \\[universal-coding-system-argument] | 2498 in the input and output to the process, use \\[universal-coding-system-argument] |
2502 before \\[sql-sqlite]. You can also specify this with \\[set-buffer-process-coding-system] | 2499 before \\[sql-sqlite]. You can also specify this with \\[set-buffer-process-coding-system] |
2536 Interpreter used comes from variable `sql-mysql-program'. Login uses | 2533 Interpreter used comes from variable `sql-mysql-program'. Login uses |
2537 the variables `sql-user', `sql-password', `sql-database', and | 2534 the variables `sql-user', `sql-password', `sql-database', and |
2538 `sql-server' as defaults, if set. Additional command line parameters | 2535 `sql-server' as defaults, if set. Additional command line parameters |
2539 can be stored in the list `sql-mysql-options'. | 2536 can be stored in the list `sql-mysql-options'. |
2540 | 2537 |
2541 The buffer is put in sql-interactive-mode, giving commands for sending | 2538 The buffer is put in SQL interactive mode, giving commands for sending |
2542 input. See `sql-interactive-mode'. | 2539 input. See `sql-interactive-mode'. |
2543 | 2540 |
2544 To specify a coding system for converting non-ASCII characters | 2541 To specify a coding system for converting non-ASCII characters |
2545 in the input and output to the process, use \\[universal-coding-system-argument] | 2542 in the input and output to the process, use \\[universal-coding-system-argument] |
2546 before \\[sql-mysql]. You can also specify this with \\[set-buffer-process-coding-system] | 2543 before \\[sql-mysql]. You can also specify this with \\[set-buffer-process-coding-system] |
2583 | 2580 |
2584 Interpreter used comes from variable `sql-solid-program'. Login uses | 2581 Interpreter used comes from variable `sql-solid-program'. Login uses |
2585 the variables `sql-user', `sql-password', and `sql-server' as | 2582 the variables `sql-user', `sql-password', and `sql-server' as |
2586 defaults, if set. | 2583 defaults, if set. |
2587 | 2584 |
2588 The buffer is put in sql-interactive-mode, giving commands for sending | 2585 The buffer is put in SQL interactive mode, giving commands for sending |
2589 input. See `sql-interactive-mode'. | 2586 input. See `sql-interactive-mode'. |
2590 | 2587 |
2591 To specify a coding system for converting non-ASCII characters | 2588 To specify a coding system for converting non-ASCII characters |
2592 in the input and output to the process, use \\[universal-coding-system-argument] | 2589 in the input and output to the process, use \\[universal-coding-system-argument] |
2593 before \\[sql-solid]. You can also specify this with \\[set-buffer-process-coding-system] | 2590 before \\[sql-solid]. You can also specify this with \\[set-buffer-process-coding-system] |
2625 `*SQL*'. | 2622 `*SQL*'. |
2626 | 2623 |
2627 Interpreter used comes from variable `sql-ingres-program'. Login uses | 2624 Interpreter used comes from variable `sql-ingres-program'. Login uses |
2628 the variable `sql-database' as default, if set. | 2625 the variable `sql-database' as default, if set. |
2629 | 2626 |
2630 The buffer is put in sql-interactive-mode, giving commands for sending | 2627 The buffer is put in SQL interactive mode, giving commands for sending |
2631 input. See `sql-interactive-mode'. | 2628 input. See `sql-interactive-mode'. |
2632 | 2629 |
2633 To specify a coding system for converting non-ASCII characters | 2630 To specify a coding system for converting non-ASCII characters |
2634 in the input and output to the process, use \\[universal-coding-system-argument] | 2631 in the input and output to the process, use \\[universal-coding-system-argument] |
2635 before \\[sql-ingres]. You can also specify this with \\[set-buffer-process-coding-system] | 2632 before \\[sql-ingres]. You can also specify this with \\[set-buffer-process-coding-system] |
2662 Interpreter used comes from variable `sql-ms-program'. Login uses the | 2659 Interpreter used comes from variable `sql-ms-program'. Login uses the |
2663 variables `sql-user', `sql-password', `sql-database', and `sql-server' | 2660 variables `sql-user', `sql-password', `sql-database', and `sql-server' |
2664 as defaults, if set. Additional command line parameters can be stored | 2661 as defaults, if set. Additional command line parameters can be stored |
2665 in the list `sql-ms-options'. | 2662 in the list `sql-ms-options'. |
2666 | 2663 |
2667 The buffer is put in sql-interactive-mode, giving commands for sending | 2664 The buffer is put in SQL interactive mode, giving commands for sending |
2668 input. See `sql-interactive-mode'. | 2665 input. See `sql-interactive-mode'. |
2669 | 2666 |
2670 To specify a coding system for converting non-ASCII characters | 2667 To specify a coding system for converting non-ASCII characters |
2671 in the input and output to the process, use \\[universal-coding-system-argument] | 2668 in the input and output to the process, use \\[universal-coding-system-argument] |
2672 before \\[sql-ms]. You can also specify this with \\[set-buffer-process-coding-system] | 2669 before \\[sql-ms]. You can also specify this with \\[set-buffer-process-coding-system] |
2715 Interpreter used comes from variable `sql-postgres-program'. Login uses | 2712 Interpreter used comes from variable `sql-postgres-program'. Login uses |
2716 the variables `sql-database' and `sql-server' as default, if set. | 2713 the variables `sql-database' and `sql-server' as default, if set. |
2717 Additional command line parameters can be stored in the list | 2714 Additional command line parameters can be stored in the list |
2718 `sql-postgres-options'. | 2715 `sql-postgres-options'. |
2719 | 2716 |
2720 The buffer is put in sql-interactive-mode, giving commands for sending | 2717 The buffer is put in SQL interactive mode, giving commands for sending |
2721 input. See `sql-interactive-mode'. | 2718 input. See `sql-interactive-mode'. |
2722 | 2719 |
2723 To specify a coding system for converting non-ASCII characters | 2720 To specify a coding system for converting non-ASCII characters |
2724 in the input and output to the process, use \\[universal-coding-system-argument] | 2721 in the input and output to the process, use \\[universal-coding-system-argument] |
2725 before \\[sql-postgres]. You can also specify this with \\[set-buffer-process-coding-system] | 2722 before \\[sql-postgres]. You can also specify this with \\[set-buffer-process-coding-system] |
2766 | 2763 |
2767 Interpreter used comes from variable `sql-interbase-program'. Login | 2764 Interpreter used comes from variable `sql-interbase-program'. Login |
2768 uses the variables `sql-user', `sql-password', and `sql-database' as | 2765 uses the variables `sql-user', `sql-password', and `sql-database' as |
2769 defaults, if set. | 2766 defaults, if set. |
2770 | 2767 |
2771 The buffer is put in sql-interactive-mode, giving commands for sending | 2768 The buffer is put in SQL interactive mode, giving commands for sending |
2772 input. See `sql-interactive-mode'. | 2769 input. See `sql-interactive-mode'. |
2773 | 2770 |
2774 To specify a coding system for converting non-ASCII characters | 2771 To specify a coding system for converting non-ASCII characters |
2775 in the input and output to the process, use \\[universal-coding-system-argument] | 2772 in the input and output to the process, use \\[universal-coding-system-argument] |
2776 before \\[sql-interbase]. You can also specify this with \\[set-buffer-process-coding-system] | 2773 before \\[sql-interbase]. You can also specify this with \\[set-buffer-process-coding-system] |
2808 `*SQL*'. | 2805 `*SQL*'. |
2809 | 2806 |
2810 Interpreter used comes from variable `sql-db2-program'. There is not | 2807 Interpreter used comes from variable `sql-db2-program'. There is not |
2811 automatic login. | 2808 automatic login. |
2812 | 2809 |
2813 The buffer is put in sql-interactive-mode, giving commands for sending | 2810 The buffer is put in SQL interactive mode, giving commands for sending |
2814 input. See `sql-interactive-mode'. | 2811 input. See `sql-interactive-mode'. |
2815 | 2812 |
2816 If you use \\[sql-accumulate-and-indent] to send multiline commands to | 2813 If you use \\[sql-accumulate-and-indent] to send multiline commands to |
2817 db2, newlines will be escaped if necessary. If you don't want that, set | 2814 db2, newlines will be escaped if necessary. If you don't want that, set |
2818 `comint-input-sender' back to `comint-simple-send' by writing an after | 2815 `comint-input-sender' back to `comint-simple-send' by writing an after |
2857 local connections, `sql-server' refers to the server name from the | 2854 local connections, `sql-server' refers to the server name from the |
2858 `nodetab' file for the network connection (dbc_tcp or friends must run | 2855 `nodetab' file for the network connection (dbc_tcp or friends must run |
2859 for this to work). If `sql-password' is an empty string, inl will use | 2856 for this to work). If `sql-password' is an empty string, inl will use |
2860 an empty password. | 2857 an empty password. |
2861 | 2858 |
2862 The buffer is put in sql-interactive-mode, giving commands for sending | 2859 The buffer is put in SQL interactive mode, giving commands for sending |
2863 input. See `sql-interactive-mode'. | 2860 input. See `sql-interactive-mode'. |
2864 | 2861 |
2865 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" | 2862 \(Type \\[describe-mode] in the SQL buffer for a list of commands.)" |
2866 (interactive) | 2863 (interactive) |
2867 (sql-product-interactive 'linter)) | 2864 (sql-product-interactive 'linter)) |