emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r118251: * sql.el (sql-interactive-mode, sql-stop):


From: Michael Mauger
Subject: [Emacs-diffs] trunk r118251: * sql.el (sql-interactive-mode, sql-stop): Correct fix for
Date: Sat, 01 Nov 2014 22:14:04 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 118251
revision-id: address@hidden
parent: address@hidden
committer: Michael R. Mauger <address@hidden>
branch nick: trunk
timestamp: Sat 2014-11-01 18:14:01 -0400
message:
  * sql.el (sql-interactive-mode, sql-stop): Correct fix for
  Bug#16814 with let-bind of comint-input-ring variables around read
  and save functions.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/progmodes/sql.el          sql.el-20091113204419-o5vbwnq5f7feedwu-1303
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2014-11-01 18:05:30 +0000
+++ b/lisp/ChangeLog    2014-11-01 22:14:01 +0000
@@ -1,3 +1,9 @@
+2014-11-01  Michael R. Mauger  <address@hidden>
+
+       * sql.el (sql-interactive-mode, sql-stop): Correct fix for
+       Bug#16814 with let-bind of comint-input-ring variables around read
+       and save functions.
+
 2014-11-01  Michael Albinus  <address@hidden>
 
        * net/tramp-cache.el (tramp-get-file-property)

=== modified file 'lisp/progmodes/sql.el'
--- a/lisp/progmodes/sql.el     2014-09-29 18:14:08 +0000
+++ b/lisp/progmodes/sql.el     2014-11-01 22:14:01 +0000
@@ -3959,11 +3959,10 @@
   ;; 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-local comint-input-ring-separator sql-input-ring-separator)
-  (setq 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))
+  (let
+      ((comint-input-ring-separator sql-input-ring-separator)
+       (comint-input-ring-file-name sql-input-ring-file-name))
+    (comint-read-input-ring t)))
 
 (defun sql-stop (process event)
   "Called when the SQL process is stopped.
@@ -3973,11 +3972,15 @@
 
 This function is a sentinel watching the SQL interpreter process.
 Sentinels will always get the two parameters PROCESS and EVENT."
-  (comint-write-input-ring)
-  (if (and (eq (current-buffer) sql-buffer)
-          (not buffer-read-only))
-      (insert (format "\nProcess %s %s\n" process event))
-    (message "Process %s %s" process event)))
+  (with-current-buffer (process-buffer process)
+    (let
+        ((comint-input-ring-separator sql-input-ring-separator)
+         (comint-input-ring-file-name sql-input-ring-file-name))
+      (comint-write-input-ring))
+
+    (if (not buffer-read-only)
+        (insert (format "\nProcess %s %s\n" process event))
+      (message "Process %s %s" process event))))
 
 
 


reply via email to

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