all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#69420: 29.2; iSQL point/process-mark fix
@ 2024-02-27  4:56 Gary Hollis
  2024-02-27  8:13 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Gary Hollis @ 2024-02-27  4:56 UTC (permalink / raw)
  To: 69420

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-04-22  5:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-27  4:56 bug#69420: 29.2; iSQL point/process-mark fix Gary Hollis
2024-02-27  8:13 ` Eli Zaretskii
2024-03-09  8:57   ` Eli Zaretskii
2024-03-21  8:34     ` Eli Zaretskii
2024-04-06  8:55       ` Eli Zaretskii
2024-04-18  8:56         ` Eli Zaretskii
2024-04-21 21:33     ` Michael Mauger via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-04-22  5:40       ` Eli Zaretskii

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.