emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] emacs-26 845fe03: Fix buffer names in sql.el


From: Eli Zaretskii
Subject: [Emacs-diffs] emacs-26 845fe03: Fix buffer names in sql.el
Date: Sun, 20 May 2018 03:26:09 -0400 (EDT)

branch: emacs-26
commit 845fe038e790c7c62c6b294f88648644a4ae7ddd
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix buffer names in sql.el
    
    * lisp/progmodes/sql.el (sql-product-interactive): Fix the way the
    buffer name is determined by prefix arg.  (Bug#31446)
---
 lisp/progmodes/sql.el | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index e4db6cc..d783f65 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -4263,9 +4263,17 @@ the call to \\[sql-product-interactive] with
                 (funcall (sql-get-product-feature product :sqli-comint-func)
                          product
                          (sql-get-product-feature product :sqli-options)
-                         (if (and new-name (string-prefix-p "SQL" new-name t))
-                             new-name
-                           (concat "SQL: " new-name))))
+                         (cond
+                          ((zerop new-name)
+                           "*SQL*")
+                          ((stringp new-name)
+                           (if (string-prefix-p "*SQL: " new-name t)
+                               new-name
+                             (concat "*SQL: " new-name "*")))
+                          ((eq new-name '(4))
+                           (sql-rename-buffer new-name))
+                          (t
+                           (format "*SQL: %s*" new-name)))))
 
               ;; Set SQLi mode.
               (let ((sql-interactive-product product))



reply via email to

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