emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 7187167 2/3: sql-mode w/ sqlite: In-memory database


From: Noam Postavsky
Subject: [Emacs-diffs] master 7187167 2/3: sql-mode w/ sqlite: In-memory database
Date: Thu, 2 Mar 2017 19:03:58 -0500 (EST)

branch: master
commit 71871670c816f2ecc4383ef0fe516cbd9c9f781f
Author: Rolf Ade <address@hidden>
Commit: Noam Postavsky <address@hidden>

    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 uses an in-memory database.
    
    Copyright-paperwork-exempt: yes
---
 lisp/progmodes/sql.el | 25 ++++++++++++++-----------
 1 file 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 @@ value.  (The property value is used as the PREDICATE 
argument to
           (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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]