From: john muhl via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 64964@debbugs.gnu.org
Subject: bug#64964: [PATCH] Handle tabs in the SQL shown in the column listing
Date: Sun, 30 Jul 2023 13:48:20 -0500 [thread overview]
Message-ID: <873515i5qj.fsf@pub.pink> (raw)
[-- 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 --]
next reply other threads:[~2023-07-30 18:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-30 18:48 john muhl via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-08-03 8:49 ` bug#64964: [PATCH] Handle tabs in the SQL shown in the column listing Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=873515i5qj.fsf@pub.pink \
--to=bug-gnu-emacs@gnu.org \
--cc=64964@debbugs.gnu.org \
--cc=jm@pub.pink \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).