From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: [trentbuck@gmail.com: RFE sql-mode sql-product variable] Date: Mon, 09 Jul 2007 13:22:04 -0400 Message-ID: Reply-To: rms@gnu.org NNTP-Posting-Host: lo.gmane.org Content-Type: text/plain; charset=ISO-8859-15 X-Trace: sea.gmane.org 1184001869 10572 80.91.229.12 (9 Jul 2007 17:24:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 9 Jul 2007 17:24:29 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 09 19:24:25 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 1I7wyH-0005ae-8o for ged-emacs-devel@m.gmane.org; Mon, 09 Jul 2007 19:24:25 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7wyG-00062j-9I for ged-emacs-devel@m.gmane.org; Mon, 09 Jul 2007 13:24:24 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I7wvm-0004Lx-J3 for emacs-devel@gnu.org; Mon, 09 Jul 2007 13:21:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I7wvk-0004It-N9 for emacs-devel@gnu.org; Mon, 09 Jul 2007 13:21:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I7wvk-0004IQ-Ho for emacs-devel@gnu.org; Mon, 09 Jul 2007 13:21:48 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I7wvk-0005Ws-3b for emacs-devel@gnu.org; Mon, 09 Jul 2007 13:21:48 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.60) (envelope-from ) id 1I7ww0-00080f-Br; Mon, 09 Jul 2007 13:22:04 -0400 X-detected-kernel: Linux 2.6, seldom 2.4 (older, 4) 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:74512 Archived-At: 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 _______________________________________________ emacs-pretest-bug mailing list emacs-pretest-bug@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug ------- End of forwarded message -------