[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] SQL enhancements
From: |
Juri Linkov |
Subject: |
Re: [patch] SQL enhancements |
Date: |
Wed, 21 Apr 2010 11:49:05 +0300 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu) |
>> Maybe the name of the file to read/write the input history
>> should be product-specific. Because the default history file name
>> for SQLite is ~/.sqlite_history, for MySQL is ~/.mysql_history, etc.
>> It would be better to reuse the existing history files in SQLi mode.
>
> Couldn't you do something like the following:
>
> (defun my-sqli-setup ()
> "Set the input ring file name based on the product name."
> (setq sql-input-ring-file-name
> (concat user-emacs-directory "." (symbol-name sql-product)
> "_history")))
> (setq sql-interactive-mode-hook 'my-sqli-setup)
Thanks. The following seems to work:
(defun my-sqli-setup ()
"Set the input ring file name based on the product name."
(setq sql-input-ring-file-name
(concat "~/." (symbol-name sql-product) "_history"))
(setq sql-input-ring-separator "\n"))
(add-hook 'sql-interactive-mode-hook 'my-sqli-setup)
But as you can see it requires changing the value of the separator
from "\n--\n" to "\n", because for compatibility with database
command line interfaces multi-line commands should be disallowed.
--
Juri Linkov
http://www.jurta.org/emacs/