GNU bug report logs - #31446
26.1; sql-interactive-mode buffer naming is broken

Previous Next

Package: emacs;

Reported by: Phil Sainty <psainty <at> orcon.net.nz>

Date: Mon, 14 May 2018 05:56:02 UTC

Severity: normal

Found in version 26.1

Done: Michael Mauger <mmauger <at> protonmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Filipp Gunbin <fgunbin <at> fastmail.fm>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: psainty <at> orcon.net.nz, 31446 <at> debbugs.gnu.org
Subject: bug#31446: 26.1; sql-interactive-mode buffer naming is broken
Date: Fri, 18 May 2018 18:44:38 +0300
On 18/05/2018 15:19 +0300, Eli Zaretskii wrote:
...
>                  (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)
> +                           sql-alternate-buffer-name)
> +                          (t
> +                           (format "*SQL: %s*" new-name)))))
...

But `sql-comint' (called from `sql-comint-postgres' and the like) has
logic which prepares buffer name (adding those asterisks etc.)

In `sql-product-interactive', `new-name', if set to '(4) from prefix, or
to some other value from argument, controls this:

          (if (and (not new-name) buf)
              (pop-to-buffer buf)

So if `new-name' is set, we shouldn't switch to existing buffer.

Maybe just pass `new-name' to comint func like this (undoing possible
setting of `new-name' to '(4) above), letting it do all the
name-choosing work?

                (funcall (sql-get-product-feature product :sqli-comint-func)
                         product
                         (sql-get-product-feature product :sqli-options)
                         (if (equal '(4) new-name)
                            nil
                          new-name))

Filipp




This bug report was last modified 6 years and 24 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.