From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Rolf Ade Newsgroups: gmane.emacs.bugs Subject: bug#25628: 26.0.50; [PATCH] sql-mode w/ sqlite: In-memory database Date: Sun, 05 Feb 2017 20:19:04 +0100 Message-ID: <8737fsv42f.fsf@point> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1486322231 2207 195.159.176.226 (5 Feb 2017 19:17:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 5 Feb 2017 19:17:11 +0000 (UTC) To: 25628@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Feb 05 20:17:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caSJ8-0000LB-46 for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Feb 2017 20:17:06 +0100 Original-Received: from localhost ([::1]:44198 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caSJD-0006L2-PK for geb-bug-gnu-emacs@m.gmane.org; Sun, 05 Feb 2017 14:17:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caSJ7-0006Ki-My for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 14:17:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caSJ4-0007vt-Ht for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 14:17:05 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:58705) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1caSJ4-0007vn-FE for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 14:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1caSJ4-0001Ci-26 for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 14:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Rolf Ade Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 05 Feb 2017 19:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 25628 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.14863221984595 (code B ref -1); Sun, 05 Feb 2017 19:17:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 5 Feb 2017 19:16:38 +0000 Original-Received: from localhost ([127.0.0.1]:56904 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caSIf-0001C1-SC for submit@debbugs.gnu.org; Sun, 05 Feb 2017 14:16:38 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:41374) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1caSIe-0001Bo-8d for submit@debbugs.gnu.org; Sun, 05 Feb 2017 14:16:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caSIY-0007ql-9E for submit@debbugs.gnu.org; Sun, 05 Feb 2017 14:16:31 -0500 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:42857) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1caSIY-0007qh-6F for submit@debbugs.gnu.org; Sun, 05 Feb 2017 14:16:30 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60576) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1caSIX-0006Hj-0w for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 14:16:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1caSIT-0007p8-SY for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 14:16:29 -0500 Original-Received: from mxout3.interscholz.de ([85.236.196.238]:36726) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1caSIT-0007ox-MO for bug-gnu-emacs@gnu.org; Sun, 05 Feb 2017 14:16:25 -0500 Original-Received: from localhost (mxout3 [127.0.0.1]) by mxout3.interscholz.de (Postfix) with ESMTP id 9D83F274D9 for ; Sun, 5 Feb 2017 20:16:19 +0100 (CET) X-Virus-Scanned: interscholz amavisd-new at mxout3.interscholz.de Original-Received: from server.web01.interscholz.net (server.web01.interscholz.net [85.236.196.138]) by mxout3.interscholz.de (Postfix) with ESMTP id 17BBE21467 for ; Sun, 5 Feb 2017 20:16:19 +0100 (CET) Original-Received: from point (x5d842f34.dyn.telefonica.de [93.132.47.52]) by server.web01.interscholz.net (Postfix) with ESMTPSA id 1E6D4F0001; Sun, 5 Feb 2017 20:16:18 +0100 (CET) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:128999 Archived-At: >From 8ea7a41eab9465bba14349cb948d779748bc9516 Mon Sep 17 00:00:00 2001 From: Rolf Ade Date: Sun, 5 Feb 2017 19:46:24 +0100 Subject: [PATCH] sql-mode w/ sqlite: In-memory database Enable the usage of an in-memory database. Prior to this, sql-mode w/ sqlite could only be used with file databases. * list/progmodes/sql.el (sql-get-login-ext): Don't expand an empty file name provided by the user, but call sub-process sqlite with that, in which case it use an in-memory database. Copyright-paperwork-exempt: yes --- lisp/progmodes/sql.el | 25 ++++++++++++++----------- 1 files changed, 14 insertions(+), 11 deletions(-) diff --git a/lisp/progmodes/sql.el b/lisp/progmodes/sql.el index 8868343..634c6b5 100644 --- a/lisp/progmodes/sql.el +++ b/lisp/progmodes/sql.el @@ -2952,17 +2952,20 @@ sql-get-login-ext (use-dialog-box nil)) (cond ((plist-member plist :file) - (expand-file-name - (read-file-name prompt - (file-name-directory last-value) default 'confirm - (file-name-nondirectory last-value) - (when (plist-get plist :file) - `(lambda (f) - (if (not (file-regular-p f)) - t - (string-match - (concat "\\<" ,(plist-get plist :file) "\\>") - (file-name-nondirectory f)))))))) + (let ((file-name + (read-file-name prompt + (file-name-directory last-value) default 'confirm + (file-name-nondirectory last-value) + (when (plist-get plist :file) + `(lambda (f) + (if (not (file-regular-p f)) + t + (string-match + (concat "\\<" ,(plist-get plist :file) "\\>") + (file-name-nondirectory f)))))))) + (if (string= file-name "") + "" + (expand-file-name file-name)))) ((plist-member plist :completion) (completing-read prompt-def (plist-get plist :completion) nil t -- 1.7.3 In GNU Emacs 26.0.50.7 (i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2017-02-04 built on point Repository revision: f6ff7bb1fcd062fe4ebf6c89890524110501583e