From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gary Hollis Newsgroups: gmane.emacs.bugs Subject: bug#69420: 29.2; iSQL point/process-mark fix Date: Mon, 26 Feb 2024 23:56:05 -0500 Message-ID: <2110e7d1-153c-412a-a0dc-37531a0b6d84@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20076"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird To: 69420@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Feb 27 06:03:56 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 1repdE-0004yb-5i for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Feb 2024 06:03:56 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1repcw-00081x-Uf; Tue, 27 Feb 2024 00:03:38 -0500 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 1repcu-00081G-Um for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2024 00:03:36 -0500 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 1repcu-00064O-Mi for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2024 00:03:36 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1repdK-0006Z9-5G for bug-gnu-emacs@gnu.org; Tue, 27 Feb 2024 00:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Gary Hollis Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 27 Feb 2024 05:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 69420 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.170901022625185 (code B ref -1); Tue, 27 Feb 2024 05:04:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Feb 2024 05:03:46 +0000 Original-Received: from localhost ([127.0.0.1]:46574 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1repd3-0006Y7-7p for submit@debbugs.gnu.org; Tue, 27 Feb 2024 00:03:46 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:37944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1repW9-00069l-SQ for submit@debbugs.gnu.org; Mon, 26 Feb 2024 23:56:38 -0500 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 1repVj-0006LF-RR for bug-gnu-emacs@gnu.org; Mon, 26 Feb 2024 23:56:11 -0500 Original-Received: from mail-yw1-x1133.google.com ([2607:f8b0:4864:20::1133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1repVh-0004hC-Kp for bug-gnu-emacs@gnu.org; Mon, 26 Feb 2024 23:56:11 -0500 Original-Received: by mail-yw1-x1133.google.com with SMTP id 00721157ae682-6092387bdd0so4575107b3.3 for ; Mon, 26 Feb 2024 20:56:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709009767; x=1709614567; darn=gnu.org; h=content-transfer-encoding:from:content-language:subject:to :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=cKF4AdeuzY+J1AcLQk1F1CT4G4K6L3nx9zKzVuxShus=; b=i2IrybCM/7EMvZQuR2yUiAVvFSMhLHFNytKS5ZHjd/TdossXPu+qt8XiyD8cs/sVxZ 1JHrRrDTc53dRZs7Ixvo8sgqV4gEzcGkY9Qsn8lnK8FsvdjG3lw7penPSO4ZS1D7Bjzo ONtHakTIyaYM0Sbo3ua05YQsm0VrWx7HPTasO0OQj6LtmTSXTQXdIAQRbRW0jdpGLTno HotB615wqG6hDOP2+TPW6av/E9X3oyBWxC9Fs7ENzeIzSsfjxS+FMGGrgivDe682oHzr 9VPeeYSt1yvNO/qTXNAdqls1BiK3frULzlGgAza/58rmLWAxKw14nZGBRnOm/B+O50GH XI+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709009767; x=1709614567; h=content-transfer-encoding:from:content-language:subject:to :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=cKF4AdeuzY+J1AcLQk1F1CT4G4K6L3nx9zKzVuxShus=; b=rQbg5QK9xHxYvxdTuu+NfX48DuYo8VI3EjanRbZhSE3I4Qd2XCuLO+ZlCMn7bU81st GDaaADOyBBN12xLiMvCh91DxbtJvGoNOBjZUetywSivGx6albAgWFy6Dfw2Vue81ykvf CWTZIHQWX0oDgesxKT+EZ1Vw9/WzUsxVYQcTehQw/y2OV7IkUPXCcSGgdnqUrFu/1k0Q AFlX+2KDUB/pDCTyCgNE0+Gx+4ceHB2/V1/bcLr0kKkl7mTMDZcvgoIpTONIqQC6BWVV aJC9depo4vf7s0o0oz+UN5DMRM1TcmmSE7nrHaMMtOTtGnxemlcARBTSpf0fiIaB67Tu bfcA== X-Gm-Message-State: AOJu0YzoPV08POYuij4cYGaRAKWBoWltQ5Hm90/0GRPzKdQwSPgrKeSQ xJ9tBN3WOgI5Wl+LH/A0kt3OLSIV87tPwpq1AO+y1O6nsKvzSzoX5tsXG6jX X-Google-Smtp-Source: AGHT+IGF972p/wZPw3nFOuyFm7bN7Ck1W7aFIdP17BM2Dl+2jF9MnMxbayiGbAD7iRZd9Kt9/Nl16A== X-Received: by 2002:a05:690c:9d:b0:607:9dda:676c with SMTP id be29-20020a05690c009d00b006079dda676cmr1392372ywb.18.1709009767263; Mon, 26 Feb 2024 20:56:07 -0800 (PST) Original-Received: from [192.168.1.3] (173-093-201-060.res.spectrum.com. [173.93.201.60]) by smtp.gmail.com with ESMTPSA id x21-20020a0dd515000000b00607fab8965esm1572425ywd.32.2024.02.26.20.56.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 26 Feb 2024 20:56:06 -0800 (PST) Content-Language: en-US Received-SPF: pass client-ip=2607:f8b0:4864:20::1133; envelope-from=ghollisjr@gmail.com; helo=mail-yw1-x1133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 27 Feb 2024 00:03:43 -0500 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:280712 Archived-At: 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")))) In GNU Emacs 29.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.40, cairo version 1.18.0) Windowing system distributor 'The X.Org Foundation', version 11.0.12101011 System Description: Arch Linux Configured using: 'configure --sysconfdir=/etc --prefix=/usr --libexecdir=/usr/lib --with-tree-sitter --localstatedir=/var --with-cairo --disable-build-details --with-harfbuzz --with-libsystemd --with-modules --with-x-toolkit=gtk3 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/emacs/src=/usr/src/debug/emacs -flto=auto' 'LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now -flto=auto'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: Lisp Interaction Minor modes in effect: recentf-mode: t server-mode: t form-feed-mode: t shell-dirtrack-mode: t pyvenv-mode: t ivy-mode: t delete-selection-mode: t projectile-mode: t global-auto-revert-mode: t global-company-mode: t company-mode: t global-display-line-numbers-mode: t display-line-numbers-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t prettify-symbols-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: ~/.emacs.d/lisp/glsl-mode hides /home/ghollisjr/.emacs.d/elpa/glsl-mode-20210808.1945/glsl-mode ~/.emacs.d/lisp/popup hides /home/ghollisjr/.emacs.d/elpa/popup-20221231.1634/popup /home/ghollisjr/src/slime/slime-tests hides /home/ghollisjr/.emacs.d/elpa/slime-20230707.1938/slime-tests /home/ghollisjr/src/slime/slime hides /home/ghollisjr/.emacs.d/elpa/slime-20230707.1938/slime /home/ghollisjr/src/slime/slime-autoloads hides /home/ghollisjr/.emacs.d/elpa/slime-20230707.1938/slime-autoloads /home/ghollisjr/.emacs.d/elpa/maxima-20230529.1658/maxima-font-lock hides /usr/share/emacs/site-lisp/maxima/maxima-font-lock /home/ghollisjr/.emacs.d/elpa/maxima-20230529.1658/maxima hides /usr/share/emacs/site-lisp/maxima/maxima /home/ghollisjr/.emacs.d/elpa/csharp-mode-20221126.2005/csharp-mode hides /usr/share/emacs/29.2/lisp/progmodes/csharp-mode Features: (shadow sort mail-extr emacsbug message yank-media rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums goto-addr flyspell ispell jka-compr apropos face-remap misearch multi-isearch thai-util thai-word mule-util lao-util vc-hg vc-git vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs log-view pcvs-util vc vc-dispatcher enriched sql-indent sql-datum sql view recentf tree-widget bookmark server form-feed company-oddmuse company-keywords make-mode company-etags company-gtags company-dabbrev-code company-dabbrev company-files company-clang company-cmake company-semantic company-template company-bbdb use-package-core bash-completion shell pcomplete sh-script executable prettify-math-mode pgformatter ucsf-evan ffap multiple-cursors mc-separate-operations rectangular-region-mode mc-mark-pop mc-edit-lines mc-hide-unmatched-lines-mode mc-mark-more mc-cycle-cursors multiple-cursors-core rect yasnippet cl-extra highlight-indentation flymake-proc flymake warnings company-capf help-fns radix-tree help-mode elpy elpy-rpc pyvenv eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util elpy-shell elpy-profile elpy-django s elpy-refactor diff-mode ido hideshow files-x cus-edit cus-load ivy delsel ivy-faces ivy-overlay colir projectile skeleton ibuf-macs find-dired dired dired-loaddefs lisp-mnt grep ibuf-ext ibuffer ibuffer-loaddefs opencl-mode align find-file glsl-mode cmake-mode rst qml-mode js c-ts-common cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs css-mode smie sgml-mode facemenu imenu eww xdg url-queue shr pixel-fill kinsoku url-file svg xml dom puny mm-url gnus nnheader gnus-util time-date mail-utils range wid-edit mm-util mail-prsvr color web-mode disp-table autorevert filenotify python-black reformatter python compat treesit dash slime-company derived company pcase slime-fancy slime-indentation slime-cl-indent cl-indent slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree advice slime-scratch slime-presentations bridge slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-repl slime-parse slime easy-mmode compile text-property-search etags fileloop generator xref project arc-mode archive-mode noutline outline icons pp comint ansi-osc ansi-color ring hyperspec thingatpt display-line-numbers finder-inf ede/auto eieio-base ein-autoloads deferred-autoloads anaphora-autoloads rx polymode-autoloads simple-httpd-autoloads slime-autoloads websocket-autoloads with-editor-autoloads info compat-autoloads zmq-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 653922 33278) (symbols 48 36133 0) (strings 32 123994 8934) (string-bytes 1 4062606) (vectors 16 49840) (vector-slots 8 650455 27338) (floats 8 292 333) (intervals 56 8562 0) (buffers 984 16))