From: Steve Purcell <steve@sanityinc.com>
To: 22596@debbugs.gnu.org
Subject: bug#22596: Acknowledgement (25.1.50; Broken prompt-regexp for sql-postgres)
Date: Tue, 9 Feb 2016 21:18:12 +1300 [thread overview]
Message-ID: <564B7BA1-2B2D-4567-96FE-4053992A6EE1@sanityinc.com> (raw)
In-Reply-To: <071F8E2E-1C7B-40FD-880F-368B64D31FA6@sanityinc.com>
[-- Attachment #1: Type: text/plain, Size: 95 bytes --]
Updated patch is attached, following discussion on emacs-devel. (I have a CA on file, btw.)
[-- Attachment #2: 0001-Safer-prompt-regexp-for-postgres-vertica-in-sql-inte.patch --]
[-- Type: application/octet-stream, Size: 2088 bytes --]
From fcbbb4598f7e7c5d9d9a460ef3af668c84f907c6 Mon Sep 17 00:00:00 2001
From: Steve Purcell <steve@sanityinc.com>
Date: Mon, 8 Feb 2016 20:47:43 +1300
Subject: [PATCH] Safer prompt-regexp for postgres/vertica in
sql-interactive-mode
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes issue 22596, whereby "_" is now not considered a word constituent
character in sql-interactive-mode, so prompts like "foo_dev# " are not
correctly detected. Rather than piggy-back on the symbol table, we
explicitly match against alphanumeric chars or "_".
In the general case, almost any characters are valid in a PostgreSQL
database name, so we must choose between matching “reasonable” database
names with a tight regexp, or matching all allowable names with a
permissive regexp which would likely match all sorts of other buffer
text. This commit follows the former approach.
---
lisp/progmodes/sql.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el
index fd59f46..be7c4dd 100644
--- a/lisp/progmodes/sql.el
+++ b/lisp/progmodes/sql.el
@@ -462,9 +462,9 @@ sql-product-alist
:list-all ("\\d+" . "\\dS+")
:list-table ("\\d+ %s" . "\\dS+ %s")
:completion-object sql-postgres-completion-object
- :prompt-regexp "^\\w*=[#>] "
+ :prompt-regexp "^[[:alnum:]_]*=[#>] "
:prompt-length 5
- :prompt-cont-regexp "^\\w*[-(][#>] "
+ :prompt-cont-regexp "^[[:alnum:]_]*[-(][#>] "
:input-filter sql-remove-tabs-filter
:terminator ("\\(^\\s-*\\\\g$\\|;\\)" . "\\g"))
@@ -514,9 +514,9 @@ sql-product-alist
:sqli-comint-func sql-comint-vertica
:list-all ("\\d" . "\\dS")
:list-table "\\d %s"
- :prompt-regexp "^\\w*=[#>] "
+ :prompt-regexp "^[[:alnum:]_]*=[#>] "
:prompt-length 5
- :prompt-cont-regexp "^\\w*[-(][#>] ")
+ :prompt-cont-regexp "^[[:alnum:]_]*[-(][#>] ")
)
"An alist of product specific configuration settings.
--
2.7.1
next prev parent reply other threads:[~2016-02-09 8:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-08 7:41 bug#22596: 25.1.50; Broken prompt-regexp for sql-postgres Steve
[not found] ` <handler.22596.B.145491733432512.ack@debbugs.gnu.org>
2016-02-08 7:55 ` bug#22596: Acknowledgement (25.1.50; Broken prompt-regexp for sql-postgres) Steve Purcell
2016-02-08 8:03 ` Steve Purcell
2016-02-09 8:18 ` Steve Purcell [this message]
2016-02-23 4:02 ` Lars Ingebrigtsen
2016-04-24 6:46 ` Steve Purcell
2016-04-24 11:45 ` Lars Magne Ingebrigtsen
2016-04-24 21:04 ` Steve Purcell
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564B7BA1-2B2D-4567-96FE-4053992A6EE1@sanityinc.com \
--to=steve@sanityinc.com \
--cc=22596@debbugs.gnu.org \
/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 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.