Subject: Re: bug#31446: 26.1; sql-interactive-mode buffer naming is broken

From: Filipp Gunbin <[email-masked]>
Date: Fri, 18 May 2018 21:03:00 +0300

On 18/05/2018 19:04 +0300, Eli Zaretskii wrote:

>> From: Filipp Gunbin <[email-masked]>
>> Cc: [email-masked],  [email-masked]
>> Date: Fri, 18 May 2018 18:44:38 +0300
>>
>> 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.
>
> I'm sorry, but I don't understand the issue you are alluding to.  The
> bug I tried to fix was that the buffer got named incorrectly.  Is that
> fixed by the patch?  If it isn't, please tell why.
>
> If the patch does fix the bug, then the issues you mention are
> separate problems, because I don't think I changed the logic of which
> buffer is going to become the current.
>
> What am I missing?

I was trying to say that probably this function should not mess with the
buffer name at all.

Your patch, while it may have fixed the bug, introduces some logic on
setting buffer name - so we could get undesired behaviour change.

While a simpler approach would be just to pass `new-name' like I
proposed.

I'm not the person who filed this bug, but I also suffer from sqli-mode
buffers naming problem :-)

Sorry if it's actually me who's missing something.

Filipp