emacs-devel
[Top][All Lists]
Advanced

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

Re: [patch] SQL enhancements


From: Michael Mauger
Subject: Re: [patch] SQL enhancements
Date: Wed, 21 Apr 2010 21:25:24 -0700 (PDT)

On Wed, April 21, 2010, Juri Linkov said:

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

I'm not seeing the same problem (i.e., leaving the separator as "/n--/n" seems 
to be handled by comint correctly).  My experience working with Oracle is that 
the default works but that occasionally the history disappears.  I assumed that 
it was 
a bug in comint and hadn't had a chance to debug further.

Antone else aware of any issues with comint's input-ring handling?





reply via email to

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