From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Mauger Newsgroups: gmane.emacs.devel Subject: Minor sql-mode bug fixes Date: Mon, 18 Dec 2006 21:38:18 -0800 (PST) Message-ID: <515595.62208.qm@web62507.mail.re1.yahoo.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="0-1198421609-1166506698=:62208" Content-Transfer-Encoding: 8bit X-Trace: sea.gmane.org 1166506740 27682 80.91.229.2 (19 Dec 2006 05:39:00 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 19 Dec 2006 05:39:00 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 19 06:38:57 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GwXgW-0004rq-8X for ged-emacs-devel@m.gmane.org; Tue, 19 Dec 2006 06:38:40 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GwXgV-0007d9-O8 for ged-emacs-devel@m.gmane.org; Tue, 19 Dec 2006 00:38:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GwXgD-0007bJ-OK for emacs-devel@gnu.org; Tue, 19 Dec 2006 00:38:21 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GwXgB-0007a5-SF for emacs-devel@gnu.org; Tue, 19 Dec 2006 00:38:21 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GwXgB-0007Zu-I3 for emacs-devel@gnu.org; Tue, 19 Dec 2006 00:38:19 -0500 Original-Received: from [69.147.75.99] (helo=web62507.mail.re1.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.52) id 1GwXgB-0005q7-9V for emacs-devel@gnu.org; Tue, 19 Dec 2006 00:38:19 -0500 Original-Received: (qmail 62235 invoked by uid 60001); 19 Dec 2006 05:38:18 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-ID; b=bi9tuBc7ONQJmwFLz5AYlc6HADBDY/bhO3gQ+fhz1itXndKzwpbAbALYy5OuQpMZ06XGgfopfxOrVU6iCrWSvPbxaadvrWci5DpBypDXm7Ae5YT90Q9Kj+fVZ/sPMpibkYeWiqM4pxN38tRKnycvkwYNGtoq931CJY17AYA/SoU=; X-YMail-OSG: p2L5XTAVM1lkMAI_zUx4NliEsQC3n5uONfHzRJrm Original-Received: from [151.203.3.166] by web62507.mail.re1.yahoo.com via HTTP; Mon, 18 Dec 2006 21:38:18 PST Original-To: Emacs Devel X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:63945 Archived-At: --0-1198421609-1166506698=:62208 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Content-Id: Content-Disposition: inline I reviewed the behavior of sql-mode in the pretest and found some problems. I had fixed these in my local patches but there are too many additional feature enhancements in the patches to release them during the feature freeze/pretest. (That'll teach me to take the feature freeze seriously! ;) ) Anyways, attached is a patch that corrects several specific bugs and updates the commentary to more accurately reflect the state of the mode and it's future directions. I've also included the ChangeLog entry. Please review and apply. Thx. --0-1198421609-1166506698=:62208 Content-Type: text/plain; name="sql22.diff" Content-Description: 1124890444-sql22.diff Content-Disposition: inline; filename="sql22.diff" *** emacs/lisp/progmodes/sql.el.orig Sun Dec 17 15:43:07 2006 --- emacs/lisp/progmodes/sql.el Mon Dec 18 23:46:34 2006 *************** *** 5,11 **** ;; Author: Alex Schroeder ;; Maintainer: Michael Mauger ! ;; Version: 2.0.1 ;; Keywords: comm languages processes ;; URL: http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode --- 5,11 ---- ;; Author: Alex Schroeder ;; Maintainer: Michael Mauger ! ;; Version: 2.0.2 ;; Keywords: comm languages processes ;; URL: http://savannah.gnu.org/cgi-bin/viewcvs/emacs/emacs/lisp/progmodes/sql.el ;; URL: http://www.emacswiki.org/cgi-bin/wiki.pl?SqlMode *************** *** 30,55 **** ;;; Commentary: ;; Please send bug reports and bug fixes to the mailing list at ! ;; sql.el@gnu.org. If you want to subscribe to the mailing list, send ! ;; mail to sql.el-request@gnu.org with `subscribe sql.el FIRSTNAME ! ;; LASTNAME' in the mail body. ! ! ;; This file provides a sql-mode and a sql-interactive-mode. My goals ! ;; were two simple modes providing syntactic hilighting. The ! ;; interactive mode had to provide a command-line history; the other ! ;; mode had to provide "send region/buffer to SQL interpreter" ! ;; functions. "simple" in this context means easy to use, easy to ! ;; maintain and little or no bells and whistles. ;; If anybody feels like extending this sql mode, take a look at the ;; above mentioned modes and write a sqlx-mode on top of this one. If ;; this proves to be difficult, please suggest changes that will ! ;; facilitate your plans. ;; sql-interactive-mode is used to interact with a SQL interpreter ;; process in a SQLi buffer (usually called `*SQL*'). The SQLi buffer ! ;; is created by calling a SQL interpreter-specific entry function. Do ! ;; *not* call sql-interactive-mode by itself. ;; The list of currently supported interpreters and the corresponding ;; entry function used to create the SQLi buffers is shown with --- 30,69 ---- ;;; Commentary: ;; Please send bug reports and bug fixes to the mailing list at ! ;; help-gnu-emacs@gnu.org. If you want to subscribe to the mailing ! ;; list, see the web page at ! ;; http://lists.gnu.org/mailman/listinfo/help-gnu-emacs for ! ;; instructions. I monitor this list actively. If you send an e-mail ! ;; to Alex Schroeder it usually makes it to me when Alex has a chance ! ;; to forward them along (Thanks, Alex). ! ! ;; This file provides a sql-mode and a sql-interactive-mode. The ! ;; original goals were two simple modes providing syntactic ! ;; highlighting. The interactive mode had to provide a command-line ! ;; history; the other mode had to provide "send region/buffer to SQL ! ;; interpreter" functions. "simple" in this context means easy to ! ;; use, easy to maintain and little or no bells and whistles. This ! ;; has changed somewhat as experience with the mode has accumulated. ! ! ;; Support for different flavors of SQL and command interpreters was ! ;; available in early versions of sql.el. This support has been ! ;; extended and formalized in later versions. Part of the impetus for ! ;; the improved support of SQL flavors was borne out of the current ! ;; maintainer's consulting experience. In the past fifteen years, I ! ;; have used Oracle, Sybase, Informix, MySQL, Postgres, and SQLServer. ! ;; On some assignments, I have used two or more of these concurrently. ;; If anybody feels like extending this sql mode, take a look at the ;; above mentioned modes and write a sqlx-mode on top of this one. If ;; this proves to be difficult, please suggest changes that will ! ;; facilitate your plans. Facilities have been provided to add ! ;; products and product-specific configuration. ;; sql-interactive-mode is used to interact with a SQL interpreter ;; process in a SQLi buffer (usually called `*SQL*'). The SQLi buffer ! ;; is created by calling a SQL interpreter-specific entry function or ! ;; sql-product-interactive. Do *not* call sql-interactive-mode by ! ;; itself. ;; The list of currently supported interpreters and the corresponding ;; entry function used to create the SQLi buffers is shown with *************** *** 850,856 **** (define-abbrev-table 'sql-mode-abbrev-table nil)) (mapcar ! ;; In Emacs 21.3+, provide SYSTEM-FLAG to define-abbrev. '(lambda (abbrev) (let ((name (car abbrev)) (expansion (cdr abbrev))) --- 864,870 ---- (define-abbrev-table 'sql-mode-abbrev-table nil)) (mapcar ! ;; In Emacs 22+, provide SYSTEM-FLAG to define-abbrev. '(lambda (abbrev) (let ((name (car abbrev)) (expansion (cdr abbrev))) *************** *** 858,870 **** (define-abbrev sql-mode-abbrev-table name expansion nil 0 t) (error (define-abbrev sql-mode-abbrev-table name expansion))))) ! '(("ins" "insert") ! ("upd" "update") ! ("del" "delete") ! ("sel" "select") ! ("proc" "procedure") ! ("func" "function") ! ("cr" "create"))) ;; Syntax Table --- 872,884 ---- (define-abbrev sql-mode-abbrev-table name expansion nil 0 t) (error (define-abbrev sql-mode-abbrev-table name expansion))))) ! '(("ins" . "insert") ! ("upd" . "update") ! ("del" . "delete") ! ("sel" . "select") ! ("proc" . "procedure") ! ("func" . "function") ! ("cr" . "create"))) ;; Syntax Table *************** *** 873,885 **** ;; C-style comments /**/ (see elisp manual "Syntax Flags")) (modify-syntax-entry ?/ ". 14" table) (modify-syntax-entry ?* ". 23" table) ! ;; double-dash starts comment (modify-syntax-entry ?- ". 12b" table) ! ;; newline and formfeed end coments (modify-syntax-entry ?\n "> b" table) (modify-syntax-entry ?\f "> b" table) ! ;; single quotes (') quotes delimit strings (modify-syntax-entry ?' "\"" table) ;; backslash is no escape character (modify-syntax-entry ?\\ "." table) table) --- 887,901 ---- ;; C-style comments /**/ (see elisp manual "Syntax Flags")) (modify-syntax-entry ?/ ". 14" table) (modify-syntax-entry ?* ". 23" table) ! ;; double-dash starts comments (modify-syntax-entry ?- ". 12b" table) ! ;; newline and formfeed end comments (modify-syntax-entry ?\n "> b" table) (modify-syntax-entry ?\f "> b" table) ! ;; single quotes (') delimit strings (modify-syntax-entry ?' "\"" table) + ;; double quotes (") don't delimit strings + (modify-syntax-entry ?\" "." table) ;; backslash is no escape character (modify-syntax-entry ?\\ "." table) table) *************** *** 888,899 **** ;; Font lock support (defvar sql-mode-font-lock-object-name ! (list (concat "^\\s-*\\(create\\|drop\\|alter\\)\\s-+" ;; lead off with CREATE, DROP or ALTER ! "\\(\\w+\\s-+\\)*" ;; optional intervening keywords ! "\\(table\\|view\\|package\\(\\s-+body\\)?\\|proc\\(edure\\)?" ! "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+" ! "\\(\\w+\\)") ! 6 'font-lock-function-name-face) "Pattern to match the names of top-level objects. --- 904,916 ---- ;; Font lock support (defvar sql-mode-font-lock-object-name ! (eval-when-compile ! (list (concat "^\\s-*\\(?:create\\|drop\\|alter\\)\\s-+" ;; lead off with CREATE, DROP or ALTER ! "\\(?:\\w+\\s-+\\)*" ;; optional intervening keywords ! "\\(?:table\\|view\\|\\(?:package\\|type\\)\\(?:\\s-+body\\)?\\|proc\\(?:edure\\)?" ! "\\|function\\|trigger\\|sequence\\|rule\\|default\\)\\s-+" ! "\\(\\w+\\)") ! 1 'font-lock-function-name-face)) "Pattern to match the names of top-level objects. --0-1198421609-1166506698=:62208 Content-Type: text/plain; name="sql22.cl" Content-Description: 3488599612-sql22.cl Content-Disposition: inline; filename="sql22.cl" 2006-12-18 Michael R. Mauger * progmodes/sql.el: Updated commentary and contact info. (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. --0-1198421609-1166506698=:62208 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --0-1198421609-1166506698=:62208--