Subject: bug#69420: closed (Re: bug#69420: 29.2; iSQL point/process-mark fix)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 18 Apr 2024 08:58:11 +0000

Your bug report

#69420: 29.2; iSQL point/process-mark fix

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
69420: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69420
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#69420: 29.2; iSQL point/process-mark fix
From: Eli Zaretskii <[email-masked]>
To: [email-masked]
Cc: [email-masked], [email-masked]
Date: Thu, 18 Apr 2024 11:56:47 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> Cc: [email-masked], [email-masked]
> Date: Sat, 06 Apr 2024 11:55:48 +0300
> From: Eli Zaretskii <[email-masked]>
> 
> Ping! Ping! Ping! Michael, are you there?

No response or further comments in almost 2 months, so I have now
installed the proposed change (except that I used goto-char instead of
end-of-buffer, which is for interactive invocations only) on the
master branch, and I'm therefore boldly closing this bug.

Subject: 29.2; iSQL point/process-mark fix
From: Gary Hollis <[email-masked]>
To: [email-masked]
Date: Mon, 26 Feb 2024 23:56:05 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

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))