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: Re: [trentbuck@gmail.com: RFE sql-mode sql-product variable] Date: Tue, 10 Jul 2007 10:29:23 -0700 (PDT) Message-ID: <11525647.post@talk.nabble.com> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184088579 24356 80.91.229.12 (10 Jul 2007 17:29:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 10 Jul 2007 17:29:39 +0000 (UTC) To: Emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jul 10 19:29:37 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I8JWj-0007Xf-DL for ged-emacs-devel@m.gmane.org; Tue, 10 Jul 2007 19:29:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8JWi-0002Fw-QH for ged-emacs-devel@m.gmane.org; Tue, 10 Jul 2007 13:29:28 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8JWg-0002Fe-E9 for emacs-devel@gnu.org; Tue, 10 Jul 2007 13:29:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8JWf-0002FH-Gt for Emacs-devel@gnu.org; Tue, 10 Jul 2007 13:29:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8JWf-0002F7-5s for Emacs-devel@gnu.org; Tue, 10 Jul 2007 13:29:25 -0400 Original-Received: from kuber.nabble.com ([216.139.236.158]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1I8JWe-0000eO-O2 for Emacs-devel@gnu.org; Tue, 10 Jul 2007 13:29:24 -0400 Original-Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1I8JWd-0006en-5Y for Emacs-devel@gnu.org; Tue, 10 Jul 2007 10:29:23 -0700 In-Reply-To: X-Nabble-From: mmaug@yahoo.com X-detected-kernel: Linux 2.6 (newer, 3) 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:74572 Archived-At: Richard Stallman wrote: > > Would it be useful to install something like this? > > ------- Start of forwarded message ------- > X-Spam-Status: No, score=0.6 required=5.0 tests=NO_REAL_NAME, > UNPARSEABLE_RELAY autolearn=no version=3.1.0 > Date: Mon, 09 Jul 2007 20:56:41 +1000 > To: emacs-pretest-bug@gnu.org > From: trentbuck@gmail.com > Cc: trentbuck@gmail.com > Subject: RFE sql-mode sql-product variable > > I have the following handy settings in my .emacs; they might usefully > be included in Emacs. > > (put 'sql-product 'safe-local-variable 'symbolp) > (eval-after-load "sql" > '(define-key sql-mode-map (kbd "C-c C-z") > (lambda () > (interactive) > (let ((f (intern-soft (concat "sql-" (symbol-name > sql-product))))) > (if (and f (commandp f)) > (call-interactively f) > (error (format "Can't connect to %s databases." > sql-product))))))) > > Briefly, they allow you to put > > -*- sql-product: postgres -*- (for arbitrary values of "postgres") > > at the top of your foo.sql file, and sql-mode will use the appropriate > dialect, and also allow you to type C-c C-z to start the appropriate > listener. > > - -- > Trent Buck > > I've got a patch that includes this that I am preparing. It's embedded in a significant set of changes. Now that 22.1 is out, I'll send it along shortly. Unfortunately, long hours at work have slowed my progress. I hope to send it along in the next couple of weeks. I believe the safe-local-variable change ought to be made to 22.2. This use of sql-product is exactly what it was intended to do. -- View this message in context: http://www.nabble.com/-trentbuck%40gmail.com%3A-RFE-sql-mode-sql-product-variable--tf4050723.html#a11525647 Sent from the Emacs - Dev mailing list archive at Nabble.com.