emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RFE sql-mode sql-product variable


From: trentbuck
Subject: RFE sql-mode sql-product variable
Date: Mon, 09 Jul 2007 20:56:41 +1000

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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]