Subject: Re: bug#73499: 31.0.50; sql-interactive-mode problem with package caps-lock-mode
From: Stephen Berman <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], Andrea Corallo <[email-masked]>, [email-masked], [email-masked]
Date: Sun, 13 Oct 2024 11:21:15 +0200
List-Id: <debbugs-submit.debbugs.gnu.org>

On Sat, 05 Oct 2024 22:03:59 +0200 Stephen Berman <[email-masked]> wrote:

> On Sat, 05 Oct 2024 13:22:02 +0300 Eli Zaretskii <[email-masked]> wrote:
>
>>> From: Andrea Corallo <[email-masked]>
>>> Cc: Eli Zaretskii <[email-masked]>,  Stephen Berman <[email-masked]>,
>>>   Stefan Kangas <[email-masked]>,  [email-masked]
>>> Date: Tue, 01 Oct 2024 14:44:13 -0400
>>>
>>> Stefan Monnier <[email-masked]> writes:
>>>
>>> >> Stefan, Andrea, Stefan: any opinions on which way is better?
>>> >
>>> > My vote is clearly for `post-self-insert-hook`.
>>>
>>> Same
>>
>> OK, so Stephen, please do it that way, and thanks.
>
> Sure; however, my testing of the patch before posting it was inadequate,
> and the patch needs to be amended.  As is it now, if you customize
> sql-electric-stuff to use sql-magic-go and then type "go" at the prompt
> in a comint-derived mode other than sql-interactive-mode, that wrongly
> calls comint-send-input.  E.g. in shell-mode, this results in the shell
> output "bash: go: command not found".  And in an arbitary buffer not
> derived from comint-mode, typing "go" at BOB causes a ding and shows the
> message "Current buffer has no process".  These problems are because the
> patch adds sql-magic-go to post-self-insert-hook globally; since this is
> done when customizing sql-electric-stuff, the current buffer need not
> (and probably won't) be in sql-interactive-mode, so the hook can't be
> added locally.  AFAICS the simplest fix is to check (eq major-mode
> 'sql-interactive-mode) in sql-magic-go, as in the attached patch.  If
> there's no objection to this, then I'll go ahead and commit the amended
> patch to master.

It's been over a week with no objection, so I pushed the amended patch
to master as commit da048c69270 and am closing the bug.

Steve Berman