From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Mutating existing persistent data Date: Tue, 07 Dec 2021 11:33:02 +0800 Message-ID: <87sfv5jdht.fsf@localhost> References: <87tufmjyai.fsf@gnus.org> <875ys2lyt0.fsf@yahoo.com> <87wnkhlxb9.fsf@yahoo.com> <2FD7D920-D92C-480B-B2AC-91A17F0397C4@mit.edu> <87zgpdi0rk.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15133"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Qiantan Hong , "emacs-devel@gnu.org" , Po Lu , Stefan Monnier , Arthur Miller , John Yates To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Dec 07 04:32:28 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 1muRDQ-0003jT-Bv for ged-emacs-devel@m.gmane-mx.org; Tue, 07 Dec 2021 04:32:28 +0100 Original-Received: from localhost ([::1]:39276 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1muRDO-0002BU-S2 for ged-emacs-devel@m.gmane-mx.org; Mon, 06 Dec 2021 22:32:26 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57360) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1muRCe-0001Tn-5g for emacs-devel@gnu.org; Mon, 06 Dec 2021 22:31:40 -0500 Original-Received: from [2a00:1450:4864:20::235] (port=37555 helo=mail-lj1-x235.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1muRCc-0007wT-O8 for emacs-devel@gnu.org; Mon, 06 Dec 2021 22:31:39 -0500 Original-Received: by mail-lj1-x235.google.com with SMTP id k2so24879559lji.4 for ; Mon, 06 Dec 2021 19:31:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=uyg51SGRTFlYySQSeUfFNH7uiPrvUgHKHgU6Vif+rTA=; b=pTN20KSv3OBvWCK0nm9GB7D3Qt45GzQnMmTS4k/XY7lYqSyMhV+qAZx0feR8sDlN1T NJwNfkoJASxD3vGyIp5T6wzARl07sWfyh/6/wAVJlB0zTRyMkiHggmkpk3LSDp+OHksm 1ilsZkRYb9bI8D8ptlvW+Wq++rB5jXYxD4djvkuhNLqTBpumYfT6r/y4ywwjBSyrFKwl kcrBB0DE3nesUg1qbfgN56bP6pa6bmEaB+JHvNZlAnlTB5elG1J+hBaml8Sqw29zU8bz cA1Bxfd+suLhYiCV6O8l2uil2ESMhGDOwOu33LHN4AI9z+u0e9RZgHFlHeJ44fZDdlQt W0nA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=uyg51SGRTFlYySQSeUfFNH7uiPrvUgHKHgU6Vif+rTA=; b=617so+G0cma5b1WvdF6YLC/hWc2owe2OAwtU4q36igBT/dTcGHYDv/4RIzuPeiazcc IxNQ4iQPVL7gJ3jZ0AW+rn6Uj6S7yStJFK859CUdbpfB2OBREau7R4caEouvbxrejGb+ 3ZjSX3sYfABpA9ble0VsynK9JG/p8aSS31TrvO41KHSg24pnEtAm78v9qQvlzndv7pjX hnIvfufyuzvs9xkcUq/KAnc7QNaiuP+J3cmB/SN9HKg3VvZzBQRBNxrZ+XzKMyydI/wd cwUXswBwwR0Rehc4eDCy+k2UFXRXrMhuga7aDe+cEWfaoW/F3bqRp2OETvQ+O89KUdPU gASQ== X-Gm-Message-State: AOAM533ephdeM1rXiYptjH06WDG2H60+EnOJTGZUuBO9ICFFGwW0atuS F315beLtoE+7GYHeieBGrJAaweBO7QAo3fXlMPo= X-Google-Smtp-Source: ABdhPJxGhrno+0911PsCop/rxzhzkayUGcTtrr3+jjm6BMvwejyiuwrIVlq7Dq3bcwRvM6/vds2K0g== X-Received: by 2002:a2e:3813:: with SMTP id f19mr40037502lja.183.1638847897051; Mon, 06 Dec 2021 19:31:37 -0800 (PST) Original-Received: from localhost ([141.105.67.194]) by smtp.gmail.com with ESMTPSA id i18sm1528007lfe.186.2021.12.06.19.31.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Dec 2021 19:31:36 -0800 (PST) In-Reply-To: <87zgpdi0rk.fsf@gnus.org> X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::235 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::235; envelope-from=yantar92@gmail.com; helo=mail-lj1-x235.google.com X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 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_ENVFROM_END_DIGIT=0.25, 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:281194 Archived-At: Lars Ingebrigtsen writes: > (setf (sticky-value foo) 'bar) Before you go too far into specific implementation, could you also consider buffer-local persistent values or even generalised key:value storage? Org mode uses its own take on persistent storage to cache parsed representation of individual buffers [1]. Our persistent values have to be associated with specific files/buffer hashes. It's not just storage of one global variable-symbol:value pair, but rather a generalised key:value pair with key constructed from the variable symbol and also file name + buffer hash. [1] https://git.savannah.gnu.org/cgit/emacs/org-mode.git/tree/lisp/org-persist.el Best, Ihor