Subject: bug#60175: 30.0.50; sql-product-interactive doesn't switch to interactive buffer

From: Eshel Yaron <[email-masked]>
Date: Sun, 18 Dec 2022 12:49:20 +0200

The docstring of sql-product-interactive states that "if [an interactive
SQL] buffer exists and a process is running, just switch to [it]".
However, sql-product-interactive seems to only display the existing
interactive buffer, without actually switching to it.  AFAICT this
happens because sql-display-sqli-buffer-function defaults to
display-buffer, which causes sql-display-buffer to invoke display-buffer
instead of pop-to-buffer.

In GNU Emacs 30.0.50 (build 15, x86_64-apple-darwin22.1.0, NS
 appkit-2299.00 Version 13.0 (Build 22A380)) of 2022-12-16 built on
 esmac
Repository revision: 4331771222fe670bd45c460b5e4f68e0dd4dc3c1
Repository branch: master
Windowing system distributor 'Apple', version 10.3.2299
System Description:  macOS 13.0

Configured using:
 'configure --with-native-compilation --enable-link-time-optimization
 --with-json --with-xwidgets --with-mailutils --with-imagemagick
 --without-dbus'

Configured features:
ACL GIF GLIB GMP GNUTLS IMAGEMAGICK JPEG JSON LCMS2 LIBXML2 MODULES
NATIVE_COMP NOTIFY KQUEUE NS PDUMPER PNG RSVG SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS ZLIB

Important settings:
  value of $LC_CTYPE: UTF-8
  locale-coding-system: utf-8-unix

Major mode: SQL[Postgres]

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr dabbrev emacsbug message mailcap yank-media puny
dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068
epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util mail-prsvr mail-utils cl-print debug backtrace find-func
shortdoc text-property-search time-date help-fns radix-tree files-x sql
auth-source eieio eieio-core password-cache json map byte-opt view
thingatpt comint ansi-osc ansi-color ring cl-loaddefs comp comp-cstr
warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp
byte-compile cl-lib rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/ns-win ns-win ucs-normalize mule-util term/common-win tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads xwidget-internal kqueue cocoa
ns lcms2 multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 136590 9392)
 (symbols 48 8882 0)
 (strings 32 29054 1233)
 (string-bytes 1 1195471)
 (vectors 16 21293)
 (vector-slots 8 412771 17679)
 (floats 8 201 71)
 (intervals 56 1875 0)
 (buffers 984 18))