From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Mauger via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#69420: 29.2; iSQL point/process-mark fix Date: Sun, 21 Apr 2024 21:33:16 +0000 Message-ID: References: <2110e7d1-153c-412a-a0dc-37531a0b6d84@gmail.com> <864jduuxy1.fsf@gnu.org> <86le6rye7v.fsf@gnu.org> Reply-To: Michael Mauger Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="22417"; mail-complaints-to="usenet@ciao.gmane.io" Cc: ghollisjr@gmail.com, michael@mauger.com, 69420@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 21 23:34:17 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 1ryepE-0005ay-9B for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 21 Apr 2024 23:34:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ryeor-0007hb-LW; Sun, 21 Apr 2024 17:33:53 -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 1ryeoo-0007fF-3g for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2024 17:33:50 -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 1ryeon-0004kS-Ol for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2024 17:33:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ryep3-0000z2-7m for bug-gnu-emacs@gnu.org; Sun, 21 Apr 2024 17:34:05 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Mauger Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Apr 2024 21:34:05 +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.17137352333659 (code B ref 69420); Sun, 21 Apr 2024 21:34:05 +0000 Original-Received: (at 69420) by debbugs.gnu.org; 21 Apr 2024 21:33:53 +0000 Original-Received: from localhost ([127.0.0.1]:44994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryeoq-0000wr-KN for submit@debbugs.gnu.org; Sun, 21 Apr 2024 17:33:53 -0400 Original-Received: from mail-40131.protonmail.ch ([185.70.40.131]:64687) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ryeom-0000vd-Fp for 69420@debbugs.gnu.org; Sun, 21 Apr 2024 17:33:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1713735206; x=1713994406; bh=AM2W4CbdDGYzzr1qnZbqTuWKgDxmzAjfquJQ5Dwz1FQ=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Rkyj+5O0Rqy42lW10QGrBsLL4DZADOh1HENMsUbfo+AmVc/OaVBYeWTOqxh7T/O3k ZaiSuMlbAxYruy2AItz0vV3BvzDYNzqFaFRY3W/HNTZywlS46C9RhA+sSDBeaMXczi 8naafRUGKTQ2nWtDVamARlMSRzUDie9l/Qn8vdVJ9MKoN71SgpIWbluMJDxopZ0ZHo JA1AQsPuCwxB6R+s/7UCAHbYZAcNBDKE7NmioRgmv7WYbR5KHrH/xlAqTVh1laZkGl GFJLKhQbn6qmgWuE1dXf5zsLDpyomtUjUnp8gsdwCCdIOzf6Sx4HStZRaCdn5hpigB pp+J95xRnd7og== In-Reply-To: <86le6rye7v.fsf@gnu.org> Feedback-ID: 119932:user:proton X-Pm-Message-ID: 4ec0cb7260063b8aebae0d94f1e7b47b40abdf32 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:283780 Archived-At: On Saturday, March 9th, 2024 at 3:57 AM, Eli Zaretskii wrote= : > Ping! Michael, any comments? >=20 Sorry for the delay--the fix looks reasonable. I'm unable to do any real te= sting right now, and I don't use the `sql-send-*` myself and have a limited= setup currently. I'm recovering from cardiac surgery, along with a severe hamstring injury i= n Sep '23, which has kept me out of commission for much of the last six mon= ths. I'm slowly crawling out of the hole and hope to be back bt LibrePlanet= in early May. > > Cc: 69420@debbugs.gnu.org > > Date: Tue, 27 Feb 2024 10:13:26 +0200 > > From: Eli Zaretskii eliz@gnu.org > >=20 > > > Date: Mon, 26 Feb 2024 23:56:05 -0500 > > > From: Gary Hollis ghollisjr@gmail.com > > >=20 > > > 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. > > >=20 > > > 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. > > >=20 > > > 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. > > >=20 > > > 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. > > >=20 > > > ;; 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: ") > > >=20 > > > (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) > > >=20 > > > ;; Send the string (trim the trailing whitespace) > > > (sql-input-sender (get-buffer-process (current-buffer)) s) > > >=20 > > > ;; Send a command terminator if we must > > > (sql-send-magic-terminator sql-buffer s sql-send-terminator) > > >=20 > > > (when sql-pop-to-buffer-after-send-region > > > (message "Sent string to buffer %s" sql-buffer)))) > > >=20 > > > ;; Display the sql buffer > > > (sql-display-buffer sql-buffer)) > > >=20 > > > ;; We don't have no stinkin' sql > > > (user-error "No SQL process started")))) > >=20 > > Thanks. > >=20 > > Michael, any comments or suggestions?