Subject: bug#64964: closed (Re: bug#64964: [PATCH] Handle tabs in the SQL shown in the column listing)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 03 Aug 2023 08:50:02 +0000

Your bug report

#64964: [PATCH] Handle tabs in the SQL shown in the column listing

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].

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

Subject: Re: bug#64964: [PATCH] Handle tabs in the SQL shown in the column listing
From: Eli Zaretskii <[email-masked]>
To: john muhl <[email-masked]>
Cc: [email-masked]
Date: Thu, 03 Aug 2023 11:49:06 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> 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" <[email-masked]>
> 
> 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.

Subject: [PATCH] Handle tabs in the SQL shown in the column listing
From: john muhl <[email-masked]>
To: [email-masked]
Date: Sun, 30 Jul 2023 13:48:20 -0500
List-Id: <debbugs-submit.debbugs.gnu.org>

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'

>From 07920c70d7180cf969c264120ef267e960f779ae Mon Sep 17 00:00:00 2001
From: john muhl <[email-masked]>
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