Subject: bug#16814: closed (Re: bug#16814: `sql-interactive-mode' overwrites `comint' variables)

From: [email-masked] (GNU bug Tracking System)
Date: Fri, 28 Feb 2014 01:57:03 +0000

Your bug report

#16814: `sql-interactive-mode' overwrites `comint' variables

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
16814: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16814
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#16814: `sql-interactive-mode' overwrites `comint' variables
From: Glenn Morris <[email-masked]>
To: [email-masked]
Date: Thu, 27 Feb 2014 20:56:19 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

Version: 24.4

Emilio C. Lopes wrote:

> `sql-interactive-mode' sets the variables `comint-input-ring-separator'
> and `comint-input-ring-file-name' without making them buffer-local.

You're right about comint-input-ring-separator, but sql-interactive-mode
first calls comint-mode, which makes comint-input-ring-file-name
buffer-local.

> Here is a patch:

Partially applied, thanks.

Subject: `sql-interactive-mode' overwrites `comint' variables
From: Emilio C. Lopes <[email-masked]>
To: [email-masked]
Date: Wed, 19 Feb 2014 21:05:45 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

`sql-interactive-mode' sets the variables `comint-input-ring-separator'
and `comint-input-ring-file-name' without making them buffer-local.

When I use `sql-interactive-mode' and afterwards run
`(comint-read-input-ring)' in `shell-mode' I get an empty
`comint-input-ring'.

Here is a patch:

2012-10-09  Emilio C. Lopes  <[email-masked]>

    * progmodes/sql.el (sql-interactive-mode): make variables `comint-input-ring-separator' and
          `comint-input-ring-file-name' buffer-local before setting.

diff --unified lisp/progmodes/sql.el.\~1\~ lisp/progmodes/sql.el
--- lisp/progmodes/sql.el.~1~    2014-02-19 14:31:34.000000000 +0100
+++ lisp/progmodes/sql.el    2014-02-19 14:45:36.000000000 +0100
@@ -3928,8 +3928,8 @@
   ;; People wanting a different history file for each
   ;; buffer/process/client/whatever can change separator and file-name
   ;; on the sql-interactive-mode-hook.
-  (setq comint-input-ring-separator sql-input-ring-separator
-    comint-input-ring-file-name sql-input-ring-file-name)
+  (setq-local comint-input-ring-separator sql-input-ring-separator)
+  (setq-local comint-input-ring-file-name sql-input-ring-file-name)
   ;; Calling the hook before calling comint-read-input-ring allows users
   ;; to set comint-input-ring-file-name in sql-interactive-mode-hook.
   (comint-read-input-ring t))

Diff finished.  Wed Feb 19 14:45:41 2014