From 845fe038e790c7c62c6b294f88648644a4ae7ddd Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 20 May 2018 10:25:26 +0300 Subject: [PATCH] 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 e4db6cc38a2..d783f6542e6 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)) -- 2.11.4.GIT