unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64964: [PATCH] Handle tabs in the SQL shown in the column listing
@ 2023-07-30 18:48 john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2023-08-03  8:49 ` Eli Zaretskii
  0 siblings, 1 reply; 2+ messages in thread
From: john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2023-07-30 18:48 UTC (permalink / raw)
  To: 64964

[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]

Tags: patch

In sqlite-mode if the SQL used to create a column used tabs then the
hide part of list columns would not remove anything after the first tab.

M-x sqlite-mode-open-file my.db

Table Name      Number of Rows  
images                        0 
users                         0

With point on ‘images’ execute sqlite-mode-list-columns (or press c)

Table Name      Number of Rows  
images                        0 
  id INTEGER PRIMARY KEY AUTOINCREMENT
  user_id INTEGER
  FOREIGN KEY (user_id) REFERENCES users (id)
		ON DELETE CASCADE
users                         0

There are two tab characters before ‘ON DELETE’. Press c again and it
collapses to:

Table Name      Number of Rows  
images                        0 
		ON DELETE CASCADE
users                         0

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.38, cairo version 1.17.8) of 2023-07-28 built on localhost
Repository revision: febf4889d196895b07b3278cfac3f8ccb6a34235
Repository branch: jm/lua-ts-mode
System Description: Fedora Linux 38 (Workstation Edition)

Configured using:
 'configure --with-native-compilation=aot --with-pgtk'


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Handle-tabs-in-the-SQL-shown-in-the-column-listing.patch --]
[-- Type: text/patch, Size: 935 bytes --]

From 07920c70d7180cf969c264120ef267e960f779ae Mon Sep 17 00:00:00 2001
From: john muhl <jm@pub.pink>
Date: Sun, 30 Jul 2023 13:43:10 -0500
Subject: [PATCH] Handle tabs in the SQL shown in the column listing

* lisp/sqlite-mode.el (sqlite-mode-list-columns): Handle tabs.
---
 lisp/sqlite-mode.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/sqlite-mode.el b/lisp/sqlite-mode.el
index c3047c786f7..8cb94485369 100644
--- a/lisp/sqlite-mode.el
+++ b/lisp/sqlite-mode.el
@@ -126,7 +126,7 @@ sqlite-mode-list-columns
         (forward-line 1)
         (if (looking-at " ")
             ;; Delete the info.
-            (delete-region (point) (if (re-search-forward "^[^ ]" nil t)
+            (delete-region (point) (if (re-search-forward "^[^ \t]" nil t)
                                        (match-beginning 0)
                                      (point-max)))
           ;; Insert the info.
-- 
2.41.0


[-- Attachment #3.1: Type: text/plain, Size: 0 bytes --]



[-- Attachment #3.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 503 bytes --]

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

* bug#64964: [PATCH] Handle tabs in the SQL shown in the column listing
  2023-07-30 18:48 bug#64964: [PATCH] Handle tabs in the SQL shown in the column listing john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2023-08-03  8:49 ` Eli Zaretskii
  0 siblings, 0 replies; 2+ messages in thread
From: Eli Zaretskii @ 2023-08-03  8:49 UTC (permalink / raw)
  To: john muhl; +Cc: 64964-done

> Date: Sun, 30 Jul 2023 13:48:20 -0500
> From:  john muhl via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
> 
> In sqlite-mode if the SQL used to create a column used tabs then the
> hide part of list columns would not remove anything after the first tab.
> 
> M-x sqlite-mode-open-file my.db
> 
> Table Name      Number of Rows  
> images                        0 
> users                         0
> 
> With point on ‘images’ execute sqlite-mode-list-columns (or press c)
> 
> Table Name      Number of Rows  
> images                        0 
>   id INTEGER PRIMARY KEY AUTOINCREMENT
>   user_id INTEGER
>   FOREIGN KEY (user_id) REFERENCES users (id)
> 		ON DELETE CASCADE
> users                         0
> 
> There are two tab characters before ‘ON DELETE’. Press c again and it
> collapses to:
> 
> Table Name      Number of Rows  
> images                        0 
> 		ON DELETE CASCADE
> users                         0

Thanks, I installed your patch on the emacs-29 branch, and I'm
therefore closing this bug.





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

end of thread, other threads:[~2023-08-03  8:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-30 18:48 bug#64964: [PATCH] Handle tabs in the SQL shown in the column listing john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-08-03  8:49 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).