From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69420: 29.2; iSQL point/process-mark fix Date: Thu, 21 Mar 2024 10:34:38 +0200 Message-ID: <86frwk2db5.fsf@gnu.org> References: <2110e7d1-153c-412a-a0dc-37531a0b6d84@gmail.com> <864jduuxy1.fsf@gnu.org> <86le6rye7v.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18419"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ghollisjr@gmail.com, 69420@debbugs.gnu.org To: michael@mauger.com Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 21 09:35:39 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rnDtj-0004VQ-2i for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Mar 2024 09:35:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rnDtT-00067I-HK; Thu, 21 Mar 2024 04:35:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnDtS-000679-9P for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 04:35:22 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rnDtR-0000Kq-QW for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 04:35:22 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rnDu5-0003It-Jq for bug-gnu-emacs@gnu.org; Thu, 21 Mar 2024 04:36:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 21 Mar 2024 08:36:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69420 X-GNU-PR-Package: emacs Original-Received: via spool by 69420-submit@debbugs.gnu.org id=B69420.171101012912652 (code B ref 69420); Thu, 21 Mar 2024 08:36:01 +0000 Original-Received: (at 69420) by debbugs.gnu.org; 21 Mar 2024 08:35:29 +0000 Original-Received: from localhost ([127.0.0.1]:34222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnDtY-0003I0-UT for submit@debbugs.gnu.org; Thu, 21 Mar 2024 04:35:29 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:44802) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rnDtX-0003Ho-32 for 69420@debbugs.gnu.org; Thu, 21 Mar 2024 04:35:27 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rnDsn-0000DK-OC; Thu, 21 Mar 2024 04:34:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=86DDIZwulloe1b8t84P4MqlSsBsVKecML3qdG/cvtHU=; b=YdlWjdGr65I4+nVdnGxd fIqngo3bCvuyWuBqVXUz4U/4murn8OIf2vMFmPi0oqMjoUCt3ly43GXnneX4ln5kcb98VeUyWeDId mM6mnyq+W9FSiUB1v12HbyPMSTTXChP/iSs3uTUt5GEao1DwaXInSJPp7A6Oe0UGL83AAfTS5ntUy dqtdpPyafdmkHBUMh7gxen0AWkPAYJBmaNgOwQbEDthnklIr4mSMMBR8/nfIFeWxf4MvvRf35QVIB PRBAPfkqLr0DC+gCUTQ02cs1KWbicF81HNMLvT68EM5xd9dIjIcH+BOCqpz4gOCcRmVBFIJH3JNff 83CB/ELTNEvbBQ==; In-Reply-To: <86le6rye7v.fsf@gnu.org> (message from Eli Zaretskii on Sat, 09 Mar 2024 10:57:40 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:281885 Archived-At: Ping! Ping! Michael, would you please responds and comment on this issue? > Cc: ghollisjr@gmail.com, 69420@debbugs.gnu.org > Date: Sat, 09 Mar 2024 10:57:40 +0200 > From: Eli Zaretskii > > Ping! Michael, any comments? > > > Cc: 69420@debbugs.gnu.org > > Date: Tue, 27 Feb 2024 10:13:26 +0200 > > From: Eli Zaretskii > > > > > Date: Mon, 26 Feb 2024 23:56:05 -0500 > > > From: Gary Hollis > > > > > > When the point is not at the very end of the iSQL buffer, the > > > process-mark is not kept in a reasonable state if sql-send-string is > > > called. > > > > > > Example to reproduce bug: > > > 1. Open a sql-mode buffer. > > > 2. Connect to a SQL database of choice. > > > 3. Move the point of the iSQL buffer to the top, e.g. with M-< > > > 4. Send good queries via sql-send-string, sql-send-region etc. > > > 5. In iSQL buffer, move point to end, e.g. with M-> > > > 6. Enter a good query. > > > > > > Expected result: The new query successfully sends and sql process > > > returns output. > > > Actual result: Whatever contents had been output from the > > > sql-send-string, sql-send-region etc. will be sent along with the new query. > > > > > > To fix: a call to (end-of-buffer) can be placed within the > > > (save-excursion ...) context before sending any input in the > > > sql-send-string function, e.g. > > > > > > ;; from sql.el with fix for bug added with BUG FIX comment: > > > (defun sql-send-string (str) > > >   "Send the string STR to the SQL process." > > >   (interactive "sSQL Text: ") > > > > > >   (let ((comint-input-sender-no-newline nil) > > >         (s (replace-regexp-in-string "[[:space:]\n\r]+\\'" "" str))) > > >     (if (sql-buffer-live-p sql-buffer) > > >     (progn > > >       ;; Ignore the hoping around... > > >       (save-excursion > > >         ;; Set product context > > >         (with-current-buffer sql-buffer > > >               (end-of-buffer) ; BUG FIX: correct point before sending input > > >               (when sql-debug-send > > >                 (message ">>SQL> %S" s)) > > >               (insert "\n") > > >               (comint-set-process-mark) > > > > > >           ;; Send the string (trim the trailing whitespace) > > >           (sql-input-sender (get-buffer-process (current-buffer)) s) > > > > > >           ;; Send a command terminator if we must > > >           (sql-send-magic-terminator sql-buffer s sql-send-terminator) > > > > > >               (when sql-pop-to-buffer-after-send-region > > >             (message "Sent string to buffer %s" sql-buffer)))) > > > > > >       ;; Display the sql buffer > > >       (sql-display-buffer sql-buffer)) > > > > > >       ;; We don't have no stinkin' sql > > >       (user-error "No SQL process started")))) > > > > > > > Thanks. > > > > Michael, any comments or suggestions? > > > > > > > > > > > >