emacs-diffs
[Top][All Lists]
Advanced

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

scratch/sqlite 8cf8723: Fix up some file names


From: Lars Ingebrigtsen
Subject: scratch/sqlite 8cf8723: Fix up some file names
Date: Tue, 7 Dec 2021 20:46:42 -0500 (EST)

branch: scratch/sqlite
commit 8cf8723a1850c860daf34348d019c252e570e653
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix up some file names
---
 lisp/emacs-lisp/sticky.el | 10 ++++++++--
 src/sqlite.c              |  4 +++-
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/lisp/emacs-lisp/sticky.el b/lisp/emacs-lisp/sticky.el
index a84057f..f326735 100644
--- a/lisp/emacs-lisp/sticky.el
+++ b/lisp/emacs-lisp/sticky.el
@@ -27,6 +27,13 @@
 (require 'eieio)
 (require 'sqlite)
 
+(defcustom sticky-database-file
+  (expand-file-name "sticky.sqlite3" user-emacs-directory)
+  "File to store sticky variables."
+  :type 'file
+  :version "29.1"
+  :group 'files)
+
 (defmacro define-sticky-variable (name initial-value &optional doc
                                        &rest args)
   "Make NAME into a sticky variable initialized from INITIAL-VALUE.
@@ -67,8 +74,7 @@ DOC should be a doc string, and ARGS are keywords as 
applicable to
 
 (defun sticky--ensure-db ()
   (unless sticky--db
-    (setq sticky--db
-          (sqlite-open (expand-file-name "sticky.sqlite" "~/.emacs.d/"))))
+    (setq sticky--db (sqlite-open sticky-database-file)))
   (with-sqlite-transaction sticky--db
     (unless (sqlite-select
              sticky--db
diff --git a/src/sqlite.c b/src/sqlite.c
index 5932952..0072fcf 100644
--- a/src/sqlite.c
+++ b/src/sqlite.c
@@ -423,7 +423,9 @@ MODULE should be the file name of an SQlite module .so 
file.  */)
   CHECK_STRING (module);
 
   sqlite3 *sdb = XSQLITE (db)->db;
-  int result = sqlite3_load_extension (sdb, SSDATA (module), NULL, NULL);
+  int result = sqlite3_load_extension (sdb,
+                                      SSDATA (Fexpand_file_name (module, 
Qnil)),
+                                      NULL, NULL);
   if (result ==  SQLITE_OK)
     return Qt;
   return Qnil;



reply via email to

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