From debbugs-submit-bounces@debbugs.gnu.org Thu Sep 26 08:44:56 2024 Received: (at submit) by debbugs.gnu.org; 26 Sep 2024 12:44:56 +0000 Received: from localhost ([127.0.0.1]:60312 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stnrb-0004tL-NV for submit@debbugs.gnu.org; Thu, 26 Sep 2024 08:44:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:32924) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1stnrZ-0004t8-OP for submit@debbugs.gnu.org; Thu, 26 Sep 2024 08:44:55 -0400 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 1stnr6-0008CU-FR for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 08:44:26 -0400 Received: from mout.gmx.net ([212.227.15.18]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1stnr2-00073W-6V for bug-gnu-emacs@gnu.org; Thu, 26 Sep 2024 08:44:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1727354653; x=1727959453; i=stephen.berman@gmx.net; bh=qxLn0twivd2/16xaH1UjIQa2nfyL5A//fkJJW2QzNKU=; h=X-UI-Sender-Class:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type:cc:content-transfer-encoding:content-type:date:from: message-id:mime-version:reply-to:subject:to; b=lwPT5WHLH+kdSRScsAfnKtS+tIa/3aJ/745DPMZa24yzFfHT3Huii/PYgmoNv6QC 3BzzeY/ZVbLLdfWI6eiPcVhl6h12sMk6JA5BDigu/2l8Igf9AwEBeqOlUCWR668lx 7HKqEEdhmdPohR8XBAQWYKQCfKGJrr4aS1yT9ntUVSiQMK81T29JkDvJjhr3iENte u8uyoosisQ71XzpkYaz9/d/se56hCT6ilyueTJ/iIyezwJYjHt9NO/qLDE2f1pa+D PMiwULMO5SUEuEGmoeKKYrZbrIvPcgW7LrQgol+YIu1Z6z307fpcSB9OJAR+p9Vob 0bNiZV03/W6STRh6Cg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfssd ([88.130.50.241]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MYvY2-1sOxCO46EK-00Ywi4 for ; Thu, 26 Sep 2024 14:44:13 +0200 From: Stephen Berman To: bug-gnu-emacs@gnu.org Subject: 31.0.50; sql-interactive-mode problem with package caps-lock-mode X-Debbugs-Cc: Date: Thu, 26 Sep 2024 14:44:12 +0200 Message-ID: <87tte2oa8z.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:6H/P46geoo+JdViIndiOTcT2Nj8Q4OnPsy9ai1wSN0W1Q5btXjz J5wwuxry1kIcx8pBZB8M6pBlRnEewJh+kiQyE+prFDVqa5EUaJsOP8D1+mMhGDSUcsdaOm8 RV4ZZa35rdBZTXO6DR7zCxCoIzpK2MgVaTt1QPiTzGMt0F4FuZyokcwMsCp0nagRmEkhugu g5HSba2L4/+SMSjo3pC8w== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:8SwtZVBIWAk=;Rj8Y1qR5lbYHZHNE8jB3/inzEEi cIjZwACJ+GVn78Owx4rlTD1WTEXc4bRHLJLb1k7ydZXEghsG4gA25CbxVwtZ44z8w9KyrI+/3 iggYTlZPlJ9bARkLs+HE1bXsbj4EP7+W0ja3QmlDVnZSIOyqRFVBssuEnT2enwMlpr1IGN+0O OqtRTMASaQjPNyPGkpPpr8n83Kvi/pLgbpnNePL41Vp2yzNNvBbUJ06K8sgZzczXco+9RliNq 3OHr4VY4/O1J5tKC+R1+SFUpQMU8npoTOtumG8MUrwvrzdmr7o46Ze5YoF3spza0EGXkKFm04 J0+lLdIHCxc9b3CavFrY/ui8A6wk1kvbvEYE8Fdzjt2EigHkqQWru+VZ3iK22tDQ26a9pPYlp rnevkWbcZgUybefiSWmpYqSnC5cC9ooVHnFTisFfxy/GYJ8hE7eC7iK0P7BbEbAUQ1c+7T41d Y426chA4Zr7fBQdcW9QpPL9yYs5SyTwp/XxfbhOn2orvxctpswjYZjEMtgpS3Zgqf/I1Zy+ew nPewqS4ieZ2TOefnm5v1f/BMBb0E9d0M4D0nDDS64OUWTaIzD0qzUoEP6plzKFocSTf2hVWVC 7ZDvxjCWbcwZ2keisJgonBgds2vwUuePyDtiYC1VRcZImBbjVeWBKR8XKtH9UCq81fr4iBmU0 pISXaNA82dr+pw1phpLHbBAJfCl6HjDZvDroL4Jwh/jAU6LykKWLHFdxiz/QtSAZq1VlLDLQ6 WVGmvd6Kvt2/5UIcGUHHJJKydhvJ6ghJm6STvUSGSsOC6kB91Fp4+tIjeW5vTQHb3Ze7Zvx8k OIujBJYk2XP+Bpz5BEBFF1xw== Received-SPF: pass client-ip=212.227.15.18; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net 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_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) --=-=-= Content-Type: text/plain 0. Install the GNU ELPA package caps-lock. 1. emacs -Q 2. M-x package-initialize 3. Start an SQL inferior process, e.g. with `M-x sql-sqlite RET test RET'. 4. In the *SQL: SQLite* buffer type `M-x caps-lock-mode' and at sqlite> prompt type "select * from". => The typed text appears as this: "SELECT * FRoM", with a lowercase "o" instead of an uppercase "O". This is because sql-interactive-mode-map binds both "o" and "O" to the command `sql-magic-go', but caps-lock-mode changes case only if the last key event either invoked `self-insert-command' or `isearch-printing-char' or if the command it invoked remaps self-insert-command, and since neither is the case here, no case change occurs. (You can of course enter "O" by typing S-o, but caps-lock-mode is supposed to obviate the need to do that.) This problem also happens with PostgreSQL and presumably other SQL interpreters supported by sql.el (but I have only tested SQLite and PostgreSQL). I have found two ways to fix this problem. One is simply to add `sql-magic-go' to the list `caps-lock-commands'. In caps-lock.el this is a defvar with the value '(self-insert-command isearch-printing-char). Instead of just changing this value in the source code, I think it would be better to make the variable a defcustom, since many packages bind letter keys to commands other than `self-insert-command' but may nevertheless want to change the case of these letters when caps-lock-mode is enabled. So it would be up to the user to add `sql-magic-go' to the value. Here's a patch that allows this (I don't have a local clone of the GNU ELPA repo, so it's just a plain diff): --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: caps-lock patch Content-Transfer-Encoding: quoted-printable diff -c /home/steve/.emacs.d/elpa/caps-lock-1.0/caps-lock.el_orig /home/st= eve/.emacs.d/elpa/caps-lock-1.0/caps-lock.el *** /home/steve/.emacs.d/elpa/caps-lock-1.0/caps-lock.el_orig 2024-06-27 1= 1:21:19.635674501 +0200 =2D-- /home/steve/.emacs.d/elpa/caps-lock-1.0/caps-lock.el 2024-09-26 11:1= 0:54.443573430 +0200 *************** *** 22,35 **** ;;; Code: ! (defvar caps-lock-commands ! '(self-insert-command isearch-printing-char) ! "List of commands that are subject to `caps-lock-mode'.") ;;;###autoload (define-minor-mode caps-lock-mode "Make self-inserting keys invert the capitalization." ! :global t (if caps-lock-mode (add-hook 'pre-command-hook #'caps-lock--pch) (remove-hook 'pre-command-hook #'caps-lock--pch))) =2D-- 22,38 ---- ;;; Code: ! (defcustom caps-lock-commands '(self-insert-command isearch-printing-cha= r) ! "List of commands that are subject to `caps-lock-mode'." ! :type '(repeat (restricted-sexp :match-alternatives (commandp null))) ! ;; FIXME: which group, or both or neither? (Fix below too?) ! ;; :group 'editing ! :group 'convenience) ;;;###autoload (define-minor-mode caps-lock-mode "Make self-inserting keys invert the capitalization." ! :global t :group 'convenience (if caps-lock-mode (add-hook 'pre-command-hook #'caps-lock--pch) (remove-hook 'pre-command-hook #'caps-lock--pch))) Diff finished. Thu Sep 26 12:05:47 2024 --=-=-= Content-Type: text/plain The alternative fix is to change the implemention of `sql-magic-go' so it doesn't interfere with caps-lock-mode; this would absolve the user from the responsability of customizing which commands trigger case change, but requires more invasive changes to sql.el (at least I haven't come up with a simpler change), specifically, (i) removing the bindings of "o" and "O", (ii) making `sql-magic-go' a function instead of a command, which checks if the last keyboard input was either of these letters and if so, does what `sql-magic-go' is supposed to do, and (iii) adding `sql-magic-go' to `post-self-insert-hook' if `sql-electric-stuff' is customized to give the string "go" special handling. Here's the patch: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: sql-magic-go patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 5273ba2bee1..f39eee1fb77 100644 =2D-- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -869,7 +869,13 @@ sql-electric-stuff :type '(choice (const :tag "Nothing" nil) (const :tag "The semicolon `;'" semicolon) (const :tag "The string `go' by itself" go)) - :version "20.8") + :initialize #'custom-initialize-default + :set (lambda (symbol value) + (custom-set-default symbol value) + (if (eq value 'go) + (add-hook 'post-self-insert-hook 'sql-magic-go) + (remove-hook 'post-self-insert-hook 'sql-magic-go))) + :version "31.1") (defcustom sql-send-terminator nil "When non-nil, add a terminator to text sent to the SQL interpreter. @@ -1359,8 +1365,6 @@ sql-interactive-mode-map :parent comint-mode-map "C-j" #'sql-accumulate-and-indent "C-c C-w" #'sql-copy-column - "O" #'sql-magic-go - "o" #'sql-magic-go ";" #'sql-magic-semicolon "C-c C-l a" #'sql-list-all "C-c C-l t" #'sql-list-table) @@ -3067,16 +3071,15 @@ sql-end-of-statement ;;; Small functions -(defun sql-magic-go (arg) +(defun sql-magic-go () "Insert \"o\" and call `comint-send-input'. `sql-electric-stuff' must be the symbol `go'." - (interactive "P") - (self-insert-command (prefix-numeric-value arg)) - (if (and (equal sql-electric-stuff 'go) - (save-excursion - (comint-bol nil) - (looking-at "go\\b"))) - (comint-send-input))) + (and (equal sql-electric-stuff 'go) + (or (eq last-command-event ?o) (eq last-command-event ?O)) + (save-excursion + (comint-bol nil) + (looking-at "go\\b")) + (comint-send-input))) (put 'sql-magic-go 'delete-selection t) (defun sql-magic-semicolon (arg) --=-=-= Content-Type: text/plain In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.43, cairo version 1.18.2) of 2024-09-22 built on strobelfssd Repository revision: 3fb966dc6392e1908304a1b6fe481da9f670cfbb Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12101013 System Description: Linux From Scratch r12.2-5-systemd Configured using: 'configure -C 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt6/lib/pkgconfig' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 07:15:25 2024 Received: (at 73499) by debbugs.gnu.org; 28 Sep 2024 11:15:25 +0000 Received: from localhost ([127.0.0.1]:52006 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suVQ4-0005RV-Vc for submit@debbugs.gnu.org; Sat, 28 Sep 2024 07:15:25 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53746) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suVQ2-0005RA-Cp for 73499@debbugs.gnu.org; Sat, 28 Sep 2024 07:15:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1suVPS-0004pJ-1A; Sat, 28 Sep 2024 07:14:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=JaqnQpGRH60P2mF6GrBB5qJJISCjsiLRbRebfb3QyY8=; b=Bg4N9oFh8sPS 4md1/qyVPhRaMEse31WCrD+21oYEQLKgqwL6Y+M41vVf3n+AUV9sZjXgGcciUg09Jh5Y0j5TquBpL EHDaLeKcoIoPY3/+ydHnLl2VXAbbf0lOpd2gqaa7cTZxxxJpYhC7t0xR3VaGqZM0sugDYtdq1lZnV xToLaUwwttxNKNRVgKreoZRLfJ0dq2p7ZIzIEm+7fPNlPsNQL5VGPIStGkZTPTUmO/sT9FgGhfcwH Ea5QZXTnH6leAoDlJiOmkuHmLQZJaBl1U2BVF5Z0hp0yDycVR9QCnIu2EFx1MSKgnyOSBMtxoono3 vQs9bEmRg6IomC3I6WTe/w==; Date: Sat, 28 Sep 2024 14:14:42 +0300 Message-Id: <86y13c58t9.fsf@gnu.org> From: Eli Zaretskii To: Stephen Berman , Stefan Monnier , Stefan Kangas , Andrea Corallo In-Reply-To: <87tte2oa8z.fsf@gmx.net> (bug-gnu-emacs@gnu.org) Subject: Re: bug#73499: 31.0.50; sql-interactive-mode problem with package caps-lock-mode References: <87tte2oa8z.fsf@gmx.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73499 Cc: 73499@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Date: Thu, 26 Sep 2024 14:44:12 +0200 > From: Stephen Berman via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > 0. Install the GNU ELPA package caps-lock. > 1. emacs -Q > 2. M-x package-initialize > 3. Start an SQL inferior process, e.g. with `M-x sql-sqlite RET test RET'. > 4. In the *SQL: SQLite* buffer type `M-x caps-lock-mode' and at sqlite> > prompt type "select * from". > => The typed text appears as this: "SELECT * FRoM", with a lowercase "o" > instead of an uppercase "O". > > This is because sql-interactive-mode-map binds both "o" and "O" to the > command `sql-magic-go', but caps-lock-mode changes case only if the last > key event either invoked `self-insert-command' or > `isearch-printing-char' or if the command it invoked remaps > self-insert-command, and since neither is the case here, no case change > occurs. (You can of course enter "O" by typing S-o, but caps-lock-mode > is supposed to obviate the need to do that.) This problem also happens > with PostgreSQL and presumably other SQL interpreters supported by > sql.el (but I have only tested SQLite and PostgreSQL). > > I have found two ways to fix this problem. One is simply to add > `sql-magic-go' to the list `caps-lock-commands'. In caps-lock.el this > is a defvar with the value '(self-insert-command isearch-printing-char). > Instead of just changing this value in the source code, I think it would > be better to make the variable a defcustom, since many packages bind > letter keys to commands other than `self-insert-command' but may > nevertheless want to change the case of these letters when > caps-lock-mode is enabled. So it would be up to the user to add > `sql-magic-go' to the value. Here's a patch that allows this (I don't > have a local clone of the GNU ELPA repo, so it's just a plain diff): > > > The alternative fix is to change the implemention of `sql-magic-go' so > it doesn't interfere with caps-lock-mode; this would absolve the user > from the responsability of customizing which commands trigger case > change, but requires more invasive changes to sql.el (at least I haven't > come up with a simpler change), specifically, (i) removing the bindings > of "o" and "O", (ii) making `sql-magic-go' a function instead of a > command, which checks if the last keyboard input was either of these > letters and if so, does what `sql-magic-go' is supposed to do, and (iii) > adding `sql-magic-go' to `post-self-insert-hook' if `sql-electric-stuff' > is customized to give the string "go" special handling. Here's the > patch: Stefan, Andrea, Stefan: any opinions on which way is better? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Sep 28 11:04:00 2024 Received: (at 73499) by debbugs.gnu.org; 28 Sep 2024 15:04:00 +0000 Received: from localhost ([127.0.0.1]:35135 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suYzI-0005W1-BM for submit@debbugs.gnu.org; Sat, 28 Sep 2024 11:04:00 -0400 Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13864) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1suYzG-0005Vf-72 for 73499@debbugs.gnu.org; Sat, 28 Sep 2024 11:03:58 -0400 Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B90B1441D53; Sat, 28 Sep 2024 11:03:22 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1727535801; bh=qPPSF6lO/XPMNUQRGwTeHHTR632r51mBn8/ZU2joIY0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=pkWHNTFgpJRyiU7tDyOACcwOwgrIJukjp6O7IyXHlxx/MRJjJPk52NTkYCZzEUZMY UC9zPGk45gbuWj3H5LWmH3BSH22CfEVmOA04QmqXDWZHxdxali2MQnH1wB3iO3RFfZ AIvR3lvBiEuyHv61xwHiSjfXzGBtX6NlQGLQgMTOZitOVyc0xUPHhYho+zLnSmW4e+ miECIYUt2POwWPLXE81abl6BC9AtKr4MMZalBn+AuRT/6xQ19Y4DJuOHxtO6ksPQaf XPTQnqA2KyAJBymDUCXxzlq+7Z77i38Xxlm1vS0xogRckU2nSZ9FxEJOxVUPVs/KMz cidnITwvNhifg== Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id C1724441D08; Sat, 28 Sep 2024 11:03:21 -0400 (EDT) Received: from pastel (unknown [216.154.18.220]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 82384120213; Sat, 28 Sep 2024 11:03:21 -0400 (EDT) From: Stefan Monnier To: Eli Zaretskii Subject: Re: bug#73499: 31.0.50; sql-interactive-mode problem with package caps-lock-mode In-Reply-To: <86y13c58t9.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 28 Sep 2024 14:14:42 +0300") Message-ID: References: <87tte2oa8z.fsf@gmx.net> <86y13c58t9.fsf@gnu.org> Date: Sat, 28 Sep 2024 11:03:20 -0400 User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-SPAM-INFO: Spam detection results: 0 ALL_TRUSTED -1 Passed through trusted hosts only via SMTP AWL 0.173 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% DKIM_SIGNED 0.1 Message has a DKIM or DK signature, not necessarily valid DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's domain DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from domain X-SPAM-LEVEL: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73499 Cc: Andrea Corallo , Stephen Berman , Stefan Kangas , 73499@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Stefan, Andrea, Stefan: any opinions on which way is better? My vote is clearly for `post-self-insert-hook`. I added this hook specifically to solve these kinds of problems. Stefan From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 29 16:39:52 2024 Received: (at 73499) by debbugs.gnu.org; 29 Sep 2024 20:39:52 +0000 Received: from localhost ([127.0.0.1]:42217 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sv0hs-0005VA-6g for submit@debbugs.gnu.org; Sun, 29 Sep 2024 16:39:52 -0400 Received: from mail-ed1-f43.google.com ([209.85.208.43]:56528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sv0hp-0005V3-TH for 73499@debbugs.gnu.org; Sun, 29 Sep 2024 16:39:50 -0400 Received: by mail-ed1-f43.google.com with SMTP id 4fb4d7f45d1cf-5c89bdb9019so209537a12.0 for <73499@debbugs.gnu.org>; Sun, 29 Sep 2024 13:39:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1727642292; x=1728247092; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=cetH5FgPbKawXAYf3ZWVjK5e1wanv/IyviuVI9Si3FQ=; b=QEz4SopcMBLrvgxJUI0dDhfY0I4L2DvrNLJdGGyI9sn3bY2T5t34U2JzJ908z8bbSY tqF2akC19v1MBMNpYJMJ7chV0HURWFj4piMe/jJnB6fq3aAXjIjOiWoWAOc0OH7FEgBK PqvIG9m4XUN/p/49j8kVvxoOrqV3zMohOSeftxt0Dfe050zFNRb3ttAwxPpye79oNJIi J75YGlsOzF6JEPPOe0EWClH015YGPZR2S6fUihwX8kxrI359dhehAOjK9J6lFFioC6fW DKVkWSzbseKPYZU2lsSbl6NKJ7HUMFRWXwfiTPVk0+DnTiFJDs4bu8rGrHgqqMci9FZb zKIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1727642292; x=1728247092; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=cetH5FgPbKawXAYf3ZWVjK5e1wanv/IyviuVI9Si3FQ=; b=g2vjdKIi+e6q71SfF++jJo4CnJkj2MFvxg4yZCy7V4P0N7q4TTk9j9oPbADl9HJ4vi cLcbXTMPP8NYT+pKOqSqnsGxQgxaWYtzbYUxU3F9pgWl/wLePfSu7+bqXNktDaqYW+BU n/INNyVIBQr/ZOLSUxw8wo9H7xmsV1GmAQABS50POvSEhy2WZCmM07cu5vWFlNpHcAmb ++WyjCip9bmyNvCz3YwyyaaETMr6/q4usFYHz9+bMmxS/Omtfcug3X8vdJuuDDJkrDaD YdyEbcA39WWDnaDU5jxYj66cPEIYUgC8RURoec0YYaMEfHFOfTEOPkef6oQk3ZAyiRza 2TPg== X-Forwarded-Encrypted: i=1; AJvYcCU8juDPEFF1DYE0u5Vj9OZPJ24dA+HIoJWWQn4t7catVkhUjuzf7zwWvVjAoEA+2VWGKrw2jw==@debbugs.gnu.org X-Gm-Message-State: AOJu0YzTOi/ajANU5hrpI77L+M1VTqJOleNpPPdj9AJ6her5sQyS9q9m 0vO96zhiDd4SkR4w7zWh9KYC8w15mTh/BIptFCgss05Smtf2FgUKvgbXcS6XvdjLQQyQFk89cCi 9Dmyllk0+SYKJY0ITkvsl0vBOlt4= X-Google-Smtp-Source: AGHT+IG7Gyz37Pg/Iy0fC6dW2WPUcwf05MKSnSOOrsuEWUy8OuV9GyOW2l5jsG2jBBF/j41zfI5WYnQ0nrbVdlYHbfM= X-Received: by 2002:a50:d701:0:b0:5c2:1910:8e9 with SMTP id 4fb4d7f45d1cf-5c88260d764mr7531815a12.36.1727642292076; Sun, 29 Sep 2024 13:38:12 -0700 (PDT) Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Sun, 29 Sep 2024 13:38:11 -0700 From: Stefan Kangas In-Reply-To: References: <87tte2oa8z.fsf@gmx.net> <86y13c58t9.fsf@gnu.org> MIME-Version: 1.0 Date: Sun, 29 Sep 2024 13:38:11 -0700 Message-ID: Subject: Re: bug#73499: 31.0.50; sql-interactive-mode problem with package caps-lock-mode To: Stefan Monnier , Eli Zaretskii Content-Type: text/plain; charset="UTF-8" X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 73499 Cc: Andrea Corallo , Stephen Berman , 73499@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.9 (-) Stefan Monnier writes: >> Stefan, Andrea, Stefan: any opinions on which way is better? > > My vote is clearly for `post-self-insert-hook`. +1, it seems like the cleaner option, and will fix this not only for `caps-lock-mode' but other similar modes as well. From debbugs-submit-bounces@debbugs.gnu.org Tue Oct 01 14:44:57 2024 Received: (at 73499) by debbugs.gnu.org; 1 Oct 2024 18:44:57 +0000 Received: from localhost ([127.0.0.1]:52989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svhrl-0004j0-Hc for submit@debbugs.gnu.org; Tue, 01 Oct 2024 14:44:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46726) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1svhrj-0004iu-8h for 73499@debbugs.gnu.org; Tue, 01 Oct 2024 14:44:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1svhrd-0003aN-R5; Tue, 01 Oct 2024 14:44:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=UZFa3Z4sqlKko6sx1fP7m9zlASvRCIfGnKhZpzxI9eU=; b=P3C+UEvlJHXRYFqrnI5u JoEf+4JNo5J6cXp5/CewuyQ+h2hLiMLcE+CIesQAyIy5txc4s+J/fGOr4VkNPFBIHgBgHTnQsVh0O bnONlp5G28EqNRbc5e0Uau8MuQf1P9Jfh9sNJyX9RRxMZo5FdUOyF716PFbou9mXajP+KZYTJwp2J w55EEx7F+MvZufr/FHtdm3wfBKlyM8+UwUuNROVlwwmvsRu7j3JCojeE1d2+dmL/GDNUoTGb08d3Y PvfIe50nOmLd3VoGWZs77+ppDQnF1DDSd1yA5sBtdFqWiKKt4kaem3VckVNyS/Sb9BYiF/O8BrW7f tojR/lGl3PaLVg==; Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1svhr3-0002qW-3s; Tue, 01 Oct 2024 14:44:40 -0400 From: Andrea Corallo To: Stefan Monnier Subject: Re: bug#73499: 31.0.50; sql-interactive-mode problem with package caps-lock-mode In-Reply-To: (Stefan Monnier's message of "Sat, 28 Sep 2024 11:03:20 -0400") References: <87tte2oa8z.fsf@gmx.net> <86y13c58t9.fsf@gnu.org> Date: Tue, 01 Oct 2024 14:44:13 -0400 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73499 Cc: Eli Zaretskii , Stephen Berman , Stefan Kangas , 73499@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Stefan Monnier writes: >> Stefan, Andrea, Stefan: any opinions on which way is better? > > My vote is clearly for `post-self-insert-hook`. Same Andrea From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 06:22:18 2024 Received: (at 73499) by debbugs.gnu.org; 5 Oct 2024 10:22:19 +0000 Received: from localhost ([127.0.0.1]:37337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx1vW-0005X6-DA for submit@debbugs.gnu.org; Sat, 05 Oct 2024 06:22:18 -0400 Received: from eggs.gnu.org ([209.51.188.92]:60126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sx1vU-0005Wu-TK for 73499@debbugs.gnu.org; Sat, 05 Oct 2024 06:22:17 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sx1vJ-0002F2-GN; Sat, 05 Oct 2024 06:22:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=r0hhFG0UCWczNt+PmIG4JKB6GZgRa+ZLZ0nSmn8wXZU=; b=QzESV6iwioTj qD+oG4ffyAigm6b1UW5vktuU88JzEMtvbhovbkvelK3Y+H3++vAr1wJcLZIYRPU21zZ3988Z7spem 0ahyoSIabq+YsEmkY+YqwtKe6HdJ4CzA0Vk6hoLIQznwWoafyln8CsoYknWt+ABTeUR612hIcnu/Z LC16APHrqZyQg34E2R9vV+ewwjJKivNKQOxoqdPo2/+AqmraQmn3nXAHNt9ZJ51sjzDegxPM2abHi Gf40FZvqInicQb57NlNe63SFg4uKg0hJ/D/N426TY55EzoeHQ6E7bp/R/Q6IqgGTlRJ5b9qEcQd3C TvI78zEw27oFeWn2iZxeIQ==; Date: Sat, 05 Oct 2024 13:22:02 +0300 Message-Id: <86ldz2x31x.fsf@gnu.org> From: Eli Zaretskii To: stephen.berman@gmx.net, Andrea Corallo In-Reply-To: (message from Andrea Corallo on Tue, 01 Oct 2024 14:44:13 -0400) Subject: Re: bug#73499: 31.0.50; sql-interactive-mode problem with package caps-lock-mode References: <87tte2oa8z.fsf@gmx.net> <86y13c58t9.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 73499 Cc: 73499@debbugs.gnu.org, monnier@iro.umontreal.ca, stefankangas@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Andrea Corallo > Cc: Eli Zaretskii , Stephen Berman , > Stefan Kangas , 73499@debbugs.gnu.org > Date: Tue, 01 Oct 2024 14:44:13 -0400 > > Stefan Monnier writes: > > >> Stefan, Andrea, Stefan: any opinions on which way is better? > > > > My vote is clearly for `post-self-insert-hook`. > > Same OK, so Stephen, please do it that way, and thanks. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 05 16:04:26 2024 Received: (at 73499) by debbugs.gnu.org; 5 Oct 2024 20:04:26 +0000 Received: from localhost ([127.0.0.1]:39649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxB0r-00043X-JX for submit@debbugs.gnu.org; Sat, 05 Oct 2024 16:04:26 -0400 Received: from mout.gmx.net ([212.227.15.15]:59197) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sxB0p-00043E-58 for 73499@debbugs.gnu.org; Sat, 05 Oct 2024 16:04:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1728158645; x=1728763445; i=stephen.berman@gmx.net; bh=gicKOBfC+MpDKV6UQj27RrhQ1jfc3JPKLqTurO3AH1o=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=B8JZtxIdjRUuB+j+5J7yg9RyrjbFWlQPjw0hgUIZ0WoBXPnnjHx23d41q7U+Tb4e nmq9ooTa45sISspNkuP/fjUc6KxCJJqvtr6zH0hADiJmzy4Q3JzaUgWUMeBnosHVa deP+duyE4zuhrjk3lTOue/StT9ZMr5t3IRlVgrw/j0zKI3D52Zv0opZqiMLdpaybC A/1vifVa01rHyp/qC+QS7yZxfYCiRXczjtoM0ksFkGtnWk62FWQtva12pj950IlRg p+Nt4IABbl0OH6rNGcViHUD+2wPKp2vDxW1yKrkV+oZoKND40Na/9uvPYkk2o1/Vp QyoxCgwyuqwKEYCO3Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfssd ([94.134.95.165]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtOGa-1trkPD0vKI-00rFXH; Sat, 05 Oct 2024 22:04:05 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#73499: 31.0.50; sql-interactive-mode problem with package caps-lock-mode In-Reply-To: <86ldz2x31x.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 Oct 2024 13:22:02 +0300") References: <87tte2oa8z.fsf@gmx.net> <86y13c58t9.fsf@gnu.org> <86ldz2x31x.fsf@gnu.org> Date: Sat, 05 Oct 2024 22:03:59 +0200 Message-ID: <878qv2z58w.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K1:SzG3aYSTRyt+M+ILsDDi2THqf3+UPVbOevs1g+ruiWdXm6gYyYd ZSoW3lnljdogQd9ALg8Rxs7TEH4Z1MhnFGhZIdV90zdFImEQ4KGttBUuELUROxkW7etgqQa BZmb+QG/2y/NWD+jzyLYZjpGFVdjwv7NGoT0H7RdvWKDKSJ3RIdWbKcOuWu8AGYcEK6lTE6 j6tUo1Zrcz8W7jvNxLnKA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:NYJyAJUiZQ8=;QXTbKFoLyLKBGEXw8Zv5/1XhfWP IgeSNWiDASvXr1a+TKzBLHDgNlmFHLl4aczQNCF1/BFjdo7DB8m4EnaTUF48kxhHqa/oLuPYx PKPIA/kxlOsXBEqHB8WN03406WmMEbP2HSTABAroO+eEYKS139394Ktnqrj3ceSiHjr6QWHHR X6uEdf7N+4646wTFYsgm9ETvrioAs34AhqUuL35egqJtDgPoCntXVMKox9ayQhZAHl7Sewjqk PzueA3MbuJjInsqwbx9gPYJ9XEdUljnwl5nLIWCMi3SDlGyY3oufNWfdl4aoRYk/afUmJzxXI FVVhuz/3a0FCSwL5PiOFIo7i+EDJd6pwAG/BCs4DEVuuUaQ7d7giW5CDnzKMWfPb/ewhpO6jx Ev0ON57Djrf5e6HGItN6bjmhufb0Kq3ELEAo93CAh//jIG/uCWUKDBiBLpNCCzr+tW2vmRdhk 7oh3CxQnC3fRAu5bR4TaaBzT6XwLh/7sgV3IyyJmjn/J9aYZXUPNBJXh3li7lonsNgE2T+GyV bvAWxkGJq26AxAS7Xo4omYM+AcHMZUDRo5VP7Tl953H121B84N/Y/wYk2m968gNVSxBHYrHxl IcrbOj+tJmaiZa+xHNDZPP8b0Qt9VfCovjLIpR/dturto25lMzESvvvnWRRVXsUSAY58GL7By Y5GYiYA084vdNVUIChbZTxwh+OaI2AQT3ksVZd00swN+U5SW19m2/sbuhymao91/D5baQ6nxb Eg/qOJO8PEOcsX/nwyCLhYgQAACOpNgW3w0EoMre4aL2Dio2YisMdY4pfkR3DYr/I53GtZmBl dm8Ch/+CZxXdnvFjmxQwgl7ktTZ6b3vZ8ffQr08t7A/Ts= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73499 Cc: 73499@debbugs.gnu.org, Andrea Corallo , monnier@iro.umontreal.ca, stefankangas@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sat, 05 Oct 2024 13:22:02 +0300 Eli Zaretskii wrote: >> From: Andrea Corallo >> Cc: Eli Zaretskii , Stephen Berman , >> Stefan Kangas , 73499@debbugs.gnu.org >> Date: Tue, 01 Oct 2024 14:44:13 -0400 >> >> Stefan Monnier writes: >> >> >> Stefan, Andrea, Stefan: any opinions on which way is better? >> > >> > My vote is clearly for `post-self-insert-hook`. >> >> Same > > OK, so Stephen, please do it that way, and thanks. Sure; however, my testing of the patch before posting it was inadequate, and the patch needs to be amended. As is it now, if you customize sql-electric-stuff to use sql-magic-go and then type "go" at the prompt in a comint-derived mode other than sql-interactive-mode, that wrongly calls comint-send-input. E.g. in shell-mode, this results in the shell output "bash: go: command not found". And in an arbitary buffer not derived from comint-mode, typing "go" at BOB causes a ding and shows the message "Current buffer has no process". These problems are because the patch adds sql-magic-go to post-self-insert-hook globally; since this is done when customizing sql-electric-stuff, the current buffer need not (and probably won't) be in sql-interactive-mode, so the hook can't be added locally. AFAICS the simplest fix is to check (eq major-mode 'sql-interactive-mode) in sql-magic-go, as in the attached patch. If there's no objection to this, then I'll go ahead and commit the amended patch to master. Steve Berman --=-=-= Content-Type: text/x-patch Content-Disposition: attachment Content-Description: sql-magic-go patch Content-Transfer-Encoding: quoted-printable diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index a0b350ce54f..13bf5e874b0 100644 =2D-- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -869,7 +869,13 @@ sql-electric-stuff :type '(choice (const :tag "Nothing" nil) (const :tag "The semicolon `;'" semicolon) (const :tag "The string `go' by itself" go)) - :version "20.8") + :initialize #'custom-initialize-default + :set (lambda (symbol value) + (custom-set-default symbol value) + (if (eq value 'go) + (add-hook 'post-self-insert-hook 'sql-magic-go) + (remove-hook 'post-self-insert-hook 'sql-magic-go))) + :version "31.1") (defcustom sql-send-terminator nil "When non-nil, add a terminator to text sent to the SQL interpreter. @@ -1359,8 +1365,6 @@ sql-interactive-mode-map :parent comint-mode-map "C-j" #'sql-accumulate-and-indent "C-c C-w" #'sql-copy-column - "O" #'sql-magic-go - "o" #'sql-magic-go ";" #'sql-magic-semicolon "C-c C-l a" #'sql-list-all "C-c C-l t" #'sql-list-table) @@ -3067,16 +3071,16 @@ sql-end-of-statement ;;; Small functions -(defun sql-magic-go (arg) +(defun sql-magic-go () "Insert \"o\" and call `comint-send-input'. `sql-electric-stuff' must be the symbol `go'." - (interactive "P") - (self-insert-command (prefix-numeric-value arg)) - (if (and (equal sql-electric-stuff 'go) - (save-excursion - (comint-bol nil) - (looking-at "go\\b"))) - (comint-send-input))) + (and (eq major-mode 'sql-interactive-mode) + (equal sql-electric-stuff 'go) + (or (eq last-command-event ?o) (eq last-command-event ?O)) + (save-excursion + (comint-bol nil) + (looking-at "go\\b")) + (comint-send-input))) (put 'sql-magic-go 'delete-selection t) (defun sql-magic-semicolon (arg) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Oct 13 05:21:54 2024 Received: (at 73499-done) by debbugs.gnu.org; 13 Oct 2024 09:21:54 +0000 Received: from localhost ([127.0.0.1]:50197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szunR-0005nK-SH for submit@debbugs.gnu.org; Sun, 13 Oct 2024 05:21:54 -0400 Received: from mout.gmx.net ([212.227.17.22]:54453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1szunP-0005n0-KX for 73499-done@debbugs.gnu.org; Sun, 13 Oct 2024 05:21:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1728811286; x=1729416086; i=stephen.berman@gmx.net; bh=PmaK0QsJ0ezMj6URqIJbZHi6i1KHjtKQbi3/0kLYULg=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=FAvPrLBHKqUGtmvNqwMOB1SJM/D+hnJ6LQZRVlK6gdxo8MVhHy5QHwaGSuxYj5QZ abLHAubQVHV2hRJ3fDAVVeyxo19oOrcdcNthgEvQMg7Rz+QQe3ZGc848vSLUHHPDL +IbTFWPPyltD3R2bTp1jKwZ0gVMhfDa6db1H9O5E9dxzEGSSS9aMzOKHaVi8kvGHR LZdVoFblrHMH0b/RJo2QdhUfKOj4+OTdHey9Z4Fk1d4+q+mXz8Sw8Blavhe8Vx0JN 5KEdooe9zJ3ZPTxphWzeVwDhwTqVtFl7ipMu7b4B+cUv/Kqa7xAIHebMnhVxfJDc6 UuPxZtRVM4i5jdZmIw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from strobelfssd ([94.134.95.201]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MAOJP-1t5jYb2CT5-00Gbs4; Sun, 13 Oct 2024 11:21:26 +0200 From: Stephen Berman To: Eli Zaretskii Subject: Re: bug#73499: 31.0.50; sql-interactive-mode problem with package caps-lock-mode In-Reply-To: <878qv2z58w.fsf@gmx.net> (Stephen Berman's message of "Sat, 05 Oct 2024 22:03:59 +0200") References: <87tte2oa8z.fsf@gmx.net> <86y13c58t9.fsf@gnu.org> <86ldz2x31x.fsf@gnu.org> <878qv2z58w.fsf@gmx.net> Date: Sun, 13 Oct 2024 11:21:15 +0200 Message-ID: <87msj8s6ic.fsf@gmx.net> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Provags-ID: V03:K1:oxuP51LmkbYzzUfAvtV/CjNuhQoNKVQl+qYEkwLseYCKZfo+u5u fDW75Hsyuaw1oljKFJ8555PLT+oIx6tBBW8ERO5tSsk4P3bi1+1UCbkZYSZtfT+HzCH+RQJ HPUmy/39Ok0jY2s5HNuWwZKiFX1DYZG/taB6dMYcTeCMWaelexoESBuIvmwB3JvbgofsiC2 X7PWSx3wGsJAvxfmPNdlw== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:h5oRovbAl+s=;1HppfqwktJ66B+w3u3JBiAy+SOU SW0rpLaH7Wn6hc/6tp21LvZbi/R0XrPxYkcEgydS+oUymaAOxV6VF/epbNaUXAOY/mz9gqbe5 xoxcun1KlGCM65PaYKg6ydJeOGlNj2l1kjMeGUksG8y64XoeRTNDhe4VIx+NNDnrBU0IsVopG KefuKjcT3SFctAsyx71RVuhTdpibNelslcXkY2ZFKBhuirt2GYRzbJvqqM8lalPoEgRwRsUXk n5hOORQooxdwiTzoMxIvBmhZ+1q7GXAon4T16xAHTusm68tR9e0Df7jq43LjO5Fmp1UJdUkRK RFeke8Ua/uFAuVUbfrU5Xpkpi04IyKMBvTGxHvMXHHf/N33oPTUruIrK/0vjx0PLO92D7h38I iNohjk9kHgEYRoCcgjhkJno/tsjnejJP0DcHk8iqqgk6NgSDbBeidhPgs3Ul63Q+dgXviI0FY bVUSTeV+WRdkllwLUm9U2KAeVhEWenLLe52g4O/1Be5dYdGWunz7aK9o75xplU1INug3QqRj4 dxDeMWQOPZioF7+jUxAxVNKK5qyaKWTAFqSHLC8CEhXoG8NcaR2LTYoRBMNIJFvCnBkwRKWvh yO6f3xK5ke8L6A7O6n+Ezm3AQavxFX1xKnGN5Vsb5tZBL6tKPOhfAKg9dWF3wtEa+ctBb5uRP BmLtAGz060cRYqfJ/aTnt3RMnZGqoyzbMFdMc5HztOuaVBq8a88dUo0N4QhQ9BwhkaGSlYGJV lrzns+tUX3r++/RqfNA7VsIjV5U7yrwv5xJUv8nq5Uouh3jA9uXTGFn+j8DobhusqxzD/mz5S V2I/DwWc98Z7CI9zEE551WIw== Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 73499-done Cc: 73499-done@debbugs.gnu.org, Andrea Corallo , monnier@iro.umontreal.ca, stefankangas@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On Sat, 05 Oct 2024 22:03:59 +0200 Stephen Berman = wrote: > On Sat, 05 Oct 2024 13:22:02 +0300 Eli Zaretskii wrote: > >>> From: Andrea Corallo >>> Cc: Eli Zaretskii , Stephen Berman , >>> Stefan Kangas , 73499@debbugs.gnu.org >>> Date: Tue, 01 Oct 2024 14:44:13 -0400 >>> >>> Stefan Monnier writes: >>> >>> >> Stefan, Andrea, Stefan: any opinions on which way is better? >>> > >>> > My vote is clearly for `post-self-insert-hook`. >>> >>> Same >> >> OK, so Stephen, please do it that way, and thanks. > > Sure; however, my testing of the patch before posting it was inadequate, > and the patch needs to be amended. As is it now, if you customize > sql-electric-stuff to use sql-magic-go and then type "go" at the prompt > in a comint-derived mode other than sql-interactive-mode, that wrongly > calls comint-send-input. E.g. in shell-mode, this results in the shell > output "bash: go: command not found". And in an arbitary buffer not > derived from comint-mode, typing "go" at BOB causes a ding and shows the > message "Current buffer has no process". These problems are because the > patch adds sql-magic-go to post-self-insert-hook globally; since this is > done when customizing sql-electric-stuff, the current buffer need not > (and probably won't) be in sql-interactive-mode, so the hook can't be > added locally. AFAICS the simplest fix is to check (eq major-mode > 'sql-interactive-mode) in sql-magic-go, as in the attached patch. If > there's no objection to this, then I'll go ahead and commit the amended > patch to master. It's been over a week with no objection, so I pushed the amended patch to master as commit da048c69270 and am closing the bug. Steve Berman From unknown Sun Aug 10 02:41:10 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 10 Nov 2024 12:24:14 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator