GNU bug report logs - #69420
29.2; iSQL point/process-mark fix

Previous Next

Package: emacs;

Reported by: Gary Hollis <ghollisjr <at> gmail.com>

Date: Tue, 27 Feb 2024 05:04:01 UTC

Severity: normal

Found in version 29.2

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 69420 in the body.
You can then email your comments to 69420 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#69420; Package emacs. (Tue, 27 Feb 2024 05:04:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Gary Hollis <ghollisjr <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 27 Feb 2024 05:04:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Gary Hollis <ghollisjr <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.2; iSQL point/process-mark fix
Date: Mon, 26 Feb 2024 23:56:05 -0500
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))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69420; Package emacs. (Tue, 27 Feb 2024 08:15:01 GMT) Full text and rfc822 format available.

Message #8 received at 69420 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Gary Hollis <ghollisjr <at> gmail.com>, Michael Mauger <michael <at> mauger.com>
Cc: 69420 <at> debbugs.gnu.org
Subject: Re: bug#69420: 29.2; iSQL point/process-mark fix
Date: Tue, 27 Feb 2024 10:13:26 +0200
> Date: Mon, 26 Feb 2024 23:56:05 -0500
> From: Gary Hollis <ghollisjr <at> gmail.com>
> 
> 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69420; Package emacs. (Sat, 09 Mar 2024 08:59:01 GMT) Full text and rfc822 format available.

Message #11 received at 69420 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: michael <at> mauger.com
Cc: ghollisjr <at> gmail.com, 69420 <at> debbugs.gnu.org
Subject: Re: bug#69420: 29.2; iSQL point/process-mark fix
Date: Sat, 09 Mar 2024 10:57:40 +0200
Ping! Michael, any comments?

> Cc: 69420 <at> debbugs.gnu.org
> Date: Tue, 27 Feb 2024 10:13:26 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> > Date: Mon, 26 Feb 2024 23:56:05 -0500
> > From: Gary Hollis <ghollisjr <at> gmail.com>
> > 
> > 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?
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69420; Package emacs. (Thu, 21 Mar 2024 08:36:01 GMT) Full text and rfc822 format available.

Message #14 received at 69420 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: michael <at> mauger.com
Cc: ghollisjr <at> gmail.com, 69420 <at> debbugs.gnu.org
Subject: Re: bug#69420: 29.2; iSQL point/process-mark fix
Date: Thu, 21 Mar 2024 10:34:38 +0200
Ping! Ping!  Michael, would you please responds and comment on this
issue?

> Cc: ghollisjr <at> gmail.com, 69420 <at> debbugs.gnu.org
> Date: Sat, 09 Mar 2024 10:57:40 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> Ping! Michael, any comments?
> 
> > Cc: 69420 <at> debbugs.gnu.org
> > Date: Tue, 27 Feb 2024 10:13:26 +0200
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > 
> > > Date: Mon, 26 Feb 2024 23:56:05 -0500
> > > From: Gary Hollis <ghollisjr <at> gmail.com>
> > > 
> > > 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?
> > 
> > 
> > 
> > 
> 
> 
> 
> 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69420; Package emacs. (Sat, 06 Apr 2024 08:57:01 GMT) Full text and rfc822 format available.

Message #17 received at 69420 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: michael <at> mauger.com
Cc: ghollisjr <at> gmail.com, 69420 <at> debbugs.gnu.org
Subject: Re: bug#69420: 29.2; iSQL point/process-mark fix
Date: Sat, 06 Apr 2024 11:55:48 +0300
Ping! Ping! Ping! Michael, are you there?

> Cc: ghollisjr <at> gmail.com, 69420 <at> debbugs.gnu.org
> Date: Thu, 21 Mar 2024 10:34:38 +0200
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> Ping! Ping!  Michael, would you please responds and comment on this
> issue?
> 
> > Cc: ghollisjr <at> gmail.com, 69420 <at> debbugs.gnu.org
> > Date: Sat, 09 Mar 2024 10:57:40 +0200
> > From: Eli Zaretskii <eliz <at> gnu.org>
> > 
> > Ping! Michael, any comments?
> > 
> > > Cc: 69420 <at> debbugs.gnu.org
> > > Date: Tue, 27 Feb 2024 10:13:26 +0200
> > > From: Eli Zaretskii <eliz <at> gnu.org>
> > > 
> > > > Date: Mon, 26 Feb 2024 23:56:05 -0500
> > > > From: Gary Hollis <ghollisjr <at> gmail.com>
> > > > 
> > > > 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?
> > > 
> > > 
> > > 
> > > 
> > 
> > 
> > 
> > 
> 
> 
> 
> 




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Thu, 18 Apr 2024 08:58:10 GMT) Full text and rfc822 format available.

Notification sent to Gary Hollis <ghollisjr <at> gmail.com>:
bug acknowledged by developer. (Thu, 18 Apr 2024 08:58:11 GMT) Full text and rfc822 format available.

Message #22 received at 69420-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: ghollisjr <at> gmail.com
Cc: 69420-done <at> debbugs.gnu.org, michael <at> mauger.com
Subject: Re: bug#69420: 29.2; iSQL point/process-mark fix
Date: Thu, 18 Apr 2024 11:56:47 +0300
> Cc: ghollisjr <at> gmail.com, 69420 <at> debbugs.gnu.org
> Date: Sat, 06 Apr 2024 11:55:48 +0300
> From: Eli Zaretskii <eliz <at> gnu.org>
> 
> 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69420; Package emacs. (Sun, 21 Apr 2024 21:34:05 GMT) Full text and rfc822 format available.

Message #25 received at 69420 <at> debbugs.gnu.org (full text, mbox):

From: Michael Mauger <mmauger <at> protonmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: ghollisjr <at> gmail.com, michael <at> mauger.com, 69420 <at> debbugs.gnu.org
Subject: Re: bug#69420: 29.2; iSQL point/process-mark fix
Date: Sun, 21 Apr 2024 21:33:16 +0000
On Saturday, March 9th, 2024 at 3:57 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:

> Ping! Michael, any comments?
> 

Sorry for the delay--the fix looks reasonable. I'm unable to do any real testing 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 in Sep '23, which has kept me out of commission for much of the last six months. I'm slowly crawling out of the hole and hope to be back bt LibrePlanet in early May.

> > Cc: 69420 <at> debbugs.gnu.org
> > Date: Tue, 27 Feb 2024 10:13:26 +0200
> > From: Eli Zaretskii eliz <at> gnu.org
> > 
> > > Date: Mon, 26 Feb 2024 23:56:05 -0500
> > > From: Gary Hollis ghollisjr <at> gmail.com
> > > 
> > > 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?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#69420; Package emacs. (Mon, 22 Apr 2024 05:42:03 GMT) Full text and rfc822 format available.

Message #28 received at 69420 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Mauger <mmauger <at> protonmail.com>
Cc: ghollisjr <at> gmail.com, michael <at> mauger.com, 69420 <at> debbugs.gnu.org
Subject: Re: bug#69420: 29.2; iSQL point/process-mark fix
Date: Mon, 22 Apr 2024 08:40:37 +0300
> Date: Sun, 21 Apr 2024 21:33:16 +0000
> From: Michael Mauger <mmauger <at> protonmail.com>
> Cc: michael <at> mauger.com, ghollisjr <at> gmail.com, 69420 <at> debbugs.gnu.org
> 
> On Saturday, March 9th, 2024 at 3:57 AM, Eli Zaretskii <eliz <at> gnu.org> wrote:
> 
> > Ping! Michael, any comments?
> > 
> 
> Sorry for the delay--the fix looks reasonable. I'm unable to do any real testing 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 in Sep '23, which has kept me out of commission for much of the last six months. I'm slowly crawling out of the hole and hope to be back bt LibrePlanet in early May.

Be well.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 20 May 2024 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 67 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.