From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.devel Subject: Re: sqlite3 Date: Sun, 5 Dec 2021 21:06:22 -0800 Message-ID: <6C525329-06A5-414F-965C-49941DC38416@gmail.com> References: <87tufmjyai.fsf@gnus.org> Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.20.0.1.32\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37339"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 06 06:07:44 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mu6E4-0009c0-1s for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Dec 2021 06:07:44 +0100 Original-Received: from localhost ([::1]:60798 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mu6E2-0007jv-Lv for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Dec 2021 00:07:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:34468) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mu6Cs-0006mP-Ub for emacs-devel@gnu.org; Mon, 06 Dec 2021 00:06:30 -0500 Original-Received: from [2607:f8b0:4864:20::72c] (port=36770 helo=mail-qk1-x72c.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mu6Cq-0005bC-GN for emacs-devel@gnu.org; Mon, 06 Dec 2021 00:06:30 -0500 Original-Received: by mail-qk1-x72c.google.com with SMTP id i9so10071045qki.3 for ; Sun, 05 Dec 2021 21:06:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=21NpYU8bafzjwaZSIYAEOZLZqWRnm4bhGZ0uoXyiE5M=; b=iKP7II6lHSXjjWa3bh3WuZCKX+RyHM0TTWqe1749P5cXJAb65nSwCblpcLrmziFC3t LIkO+CCfOWpTt6owF1jcOXuR504S/wwFsr9qPyTrlPgVEmdNP1+acIQnE+4P3KSXs7oa mnMNPMmdEI+2lnrWy/mTDnml7yszbOVn2EXOAYPwn4WEXO99V7yNkWGaj6sCMKdB4yHs yqWWArRpmKF+dacD7lmWd9p2d7aJO6p8bLJq9YlosRlK8uMYkgSzdur3PhxRWy7nGh5l 8uyO5ULlm1cDMXK65mXQeQ+wyWbgHCv073VJU7q0Y/OOBwdwy+WF7jrh0mk/xTFoL48k CoSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=21NpYU8bafzjwaZSIYAEOZLZqWRnm4bhGZ0uoXyiE5M=; b=CfgBNGDoJOf03MSTzD4E50Yb8grB4nDlEGudOw93OyijXAAi5/nSxrD6gkjsRGXo2v IsQUCpdbXdQHuHGCBp1uN3cIaT7qfXOWxPkEUpvf09vJ4heIpoiBp6T7fnnqDBiuM5Vw c2rkWeyQ+9LcjLZNrIjNUgyEUFkZfltMQ8/r1kVnS/6/uOwHDw49lb2P6NWMfeiv4GeT S0Xm8smiCnLRCNsNN+m1ZTiMzoZrQ7sstVuZqdTX/c9yvVeEtLw4geR4pr9dtWwhS62s GegBqz1mTi1QHVbbYsDQP/EnEnJZ+0lAFKqHK93Ywl6RvyuUQbmTdj5STgStPzrc2wKS OBhg== X-Gm-Message-State: AOAM532dQbWrepORmw6OYhunXH4ndZsh4+UsznZiCwj1ZryqrfoRuYzL CLikI3TJAJUl05dLZzDAN1k= X-Google-Smtp-Source: ABdhPJxej3/h+IDHn3XqYvo5DJBuyWwttTY55RqWYkJCcAjEAhxw7sYMjp4q6h1NsPGm6JMBsX3cmA== X-Received: by 2002:a05:620a:f10:: with SMTP id v16mr30913965qkl.626.1638767184650; Sun, 05 Dec 2021 21:06:24 -0800 (PST) Original-Received: from smtpclient.apple ([2600:1700:2ec7:8c90:449:be31:4caa:febf]) by smtp.gmail.com with ESMTPSA id b11sm7175679qtx.85.2021.12.05.21.06.23 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Dec 2021 21:06:24 -0800 (PST) In-Reply-To: <87tufmjyai.fsf@gnus.org> X-Mailer: Apple Mail (2.3693.20.0.1.32) X-Host-Lookup-Failed: Reverse DNS lookup failed for 2607:f8b0:4864:20::72c (failed) Received-SPF: pass client-ip=2607:f8b0:4864:20::72c; envelope-from=casouri@gmail.com; helo=mail-qk1-x72c.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:281048 Archived-At: > On Dec 5, 2021, at 5:51 PM, Lars Ingebrigtsen wrote: >=20 > I think many user experience things in Emacs would be better if Emacs > remembered more. >=20 > The bigger systems don't have this problem -- Gnus needs a large > .newsrc.eld file, and it maintains that. >=20 > The tiny things don't really have this problem, either: You save = options > with `customize-save-variable', and that fine. >=20 > It's the many things that fall between these two extremes that have = the > problem: Where you want to store some state, but figuring it's just = too > much work to figure out Yet Another Storage Format, but the data is = too > messy to stash in somebody's .emacs file via Customize (like lists of > stuff). >=20 > So there's a bunch of stuff that Emacs just forgets when you shut = down, > where it perhaps shouldn't. >=20 > I've brought this up before, but I didn't really have a solution then, > but I think I do now: sqlite3. >=20 > sqlite3 is supported on more platforms than Emacs is, the interface is > small and stable, and (best of all) somebody has already created > interface functions for Emacs (via a module): >=20 > https://github.com/syohex/emacs-sqlite3 >=20 > I think it'd be good to bring that into core, and then write a small > wrapper library (well, a trivial ORM) for the rest of Emacs to use, so > that we don't have to write SQL all over the place. That is: >=20 > (setf (persistent-data :namespace "emoji" :key "favorites") = emoji--favorites) >=20 > I.e., what Emacs needs is a persistent key/value store, and this would > give us that. >=20 > In addition, if somebody really wants to write SQL stuff (it can be = very > handy for some things), having sqlite3 in there gives us that in > addition for free. Cool idea. Stuff like autosave, backup and recentf could benefit from a = database. Other things could be REPL histories, transient settings and = histories, etc. If everyone uses sqlite, .emacs.d could be less = littered, too. Especially for autosave and backup, they are a bit tricky = to configure so that Emacs doesn=E2=80=99t throw autosave and backup = files all over the place. > This comes with questions about how the users are supposed be able to > clear out the data, for instance, but we could have a `M-x > list-persistent-data' where the users could blow out whatever they = want > to. Maybe also record time automatically, so a user can clear data based on = age. Yuan=