unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [trentbuck@gmail.com: RFE sql-mode sql-product variable]
@ 2007-07-09 17:22 Richard Stallman
  2007-07-10  4:26 ` tomas
  2007-07-10 17:29 ` Michael Mauger
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Stallman @ 2007-07-09 17:22 UTC (permalink / raw)
  To: emacs-devel

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 -------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [trentbuck@gmail.com: RFE sql-mode sql-product variable]
  2007-07-09 17:22 [trentbuck@gmail.com: RFE sql-mode sql-product variable] Richard Stallman
@ 2007-07-10  4:26 ` tomas
  2007-07-10 22:01   ` Richard Stallman
  2007-07-10 17:29 ` Michael Mauger
  1 sibling, 1 reply; 5+ messages in thread
From: tomas @ 2007-07-10  4:26 UTC (permalink / raw)
  To: Richard Stallman; +Cc: emacs-devel

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Jul 09, 2007 at 01:22:04PM -0400, Richard Stallman wrote:
> Would it be useful to install something like this?
[...]
> Briefly, they allow you to put
> 
>     -*- sql-product: postgres -*- (for arbitrary values of "postgres")

I do like the idea. I'd rather use a tag "sql-dialect" or similar --
product has many meanings (unless there is a special reason to use
product, that is).

regards
- - tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFGkwpxBcgs9XrR2kYRArR5AJ9sQAdljkR512snlNMxweU6rEJtXQCfQg3S
fjJol+aZN0nkk0l+bC6JHtg=
=e77c
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [trentbuck@gmail.com: RFE sql-mode sql-product variable]
  2007-07-09 17:22 [trentbuck@gmail.com: RFE sql-mode sql-product variable] Richard Stallman
  2007-07-10  4:26 ` tomas
@ 2007-07-10 17:29 ` Michael Mauger
  2007-07-11  3:05   ` Richard Stallman
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Mauger @ 2007-07-10 17:29 UTC (permalink / raw)
  To: Emacs-devel



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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [trentbuck@gmail.com: RFE sql-mode sql-product variable]
  2007-07-10  4:26 ` tomas
@ 2007-07-10 22:01   ` Richard Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2007-07-10 22:01 UTC (permalink / raw)
  To: tomas; +Cc: emacs-devel

    I do like the idea. I'd rather use a tag "sql-dialect" or similar --
    product has many meanings (unless there is a special reason to use
    product, that is).

What do others think?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [trentbuck@gmail.com: RFE sql-mode sql-product variable]
  2007-07-10 17:29 ` Michael Mauger
@ 2007-07-11  3:05   ` Richard Stallman
  0 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2007-07-11  3:05 UTC (permalink / raw)
  To: Michael Mauger; +Cc: Emacs-devel

    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.

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-07-11  3:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-09 17:22 [trentbuck@gmail.com: RFE sql-mode sql-product variable] Richard Stallman
2007-07-10  4:26 ` tomas
2007-07-10 22:01   ` Richard Stallman
2007-07-10 17:29 ` Michael Mauger
2007-07-11  3:05   ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).