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: Sat, 06 Apr 2024 11:55:48 +0300 Message-ID: <86cyr250q3.fsf@gnu.org> References: <2110e7d1-153c-412a-a0dc-37531a0b6d84@gmail.com> <864jduuxy1.fsf@gnu.org> <86le6rye7v.fsf@gnu.org> <86frwk2db5.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="10884"; 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 Sat Apr 06 10:57:20 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 1rt1rU-0002dK-2I for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Apr 2024 10:57:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rt1r8-00075a-Ge; Sat, 06 Apr 2024 04:56:58 -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 1rt1r7-00075P-3E for bug-gnu-emacs@gnu.org; Sat, 06 Apr 2024 04:56:57 -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 1rt1r6-0007SO-RZ for bug-gnu-emacs@gnu.org; Sat, 06 Apr 2024 04:56:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rt1rB-0006nj-SL for bug-gnu-emacs@gnu.org; Sat, 06 Apr 2024 04:57: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: Sat, 06 Apr 2024 08:57: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.171239376525837 (code B ref 69420); Sat, 06 Apr 2024 08:57:01 +0000 Original-Received: (at 69420) by debbugs.gnu.org; 6 Apr 2024 08:56:05 +0000 Original-Received: from localhost ([127.0.0.1]:38227 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt1qG-0006ie-KS for submit@debbugs.gnu.org; Sat, 06 Apr 2024 04:56:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50642) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rt1qE-0006i9-GU for 69420@debbugs.gnu.org; Sat, 06 Apr 2024 04:56:02 -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 1rt1q2-0007MM-Nn; Sat, 06 Apr 2024 04:55:50 -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=pWEGE2I+iE1KDBO43fJSGKJtzdyH9nMa796WHJFSby4=; b=a/22dWO400GOSUAmSTyW YycyFY0DhRrBYGPSJ0LVSaVTC5G+8uXycaALF6T18toRSXbb24AAyKGiP4hgJ5HgI6XjE4OzmcjTp yhGhAX9h26Pnmtpcooy8PUYDRDmn8io1ByxVUFVyN13gx5vL4um+ReOUHBtajbl4Dst4iUx9Gm7aP zuduLkv1CzAqJvoORXaYPWtMvgrh4nqoUC/39PMBnFLcCzi4m6FSvpwdrnAUNzGrjuxs6WX5WWG/d d1LaQ4P6idBmqRCB0S3T6h464Cx9GFZbqa/F4miRCaq7a/GSuCfbpsHvje9Buyre/UAXvjxsUGTtp pwFLpYbnhg/LZQ==; In-Reply-To: <86frwk2db5.fsf@gnu.org> (message from Eli Zaretskii on Thu, 21 Mar 2024 10:34:38 +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:282760 Archived-At: Ping! Ping! Ping! Michael, are you there? > Cc: ghollisjr@gmail.com, 69420@debbugs.gnu.org > Date: Thu, 21 Mar 2024 10:34:38 +0200 > From: Eli Zaretskii > > 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? > > > > > > > > > > > > > > > > > > > > > > > >