From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Newsgroups: gmane.emacs.bugs Subject: bug#41741: [PATCH] Save project list as lisp data Date: Sun, 07 Jun 2020 21:55:06 +0200 Message-ID: <42759.3830203236$1591559907@news.gmane.org> References: <877dwkno62.fsf@simenheg@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="45967"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.91 (gnu/linux) Cc: "Basil L. Contovounesios" , 41741@debbugs.gnu.org, Juri Linkov To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 07 21:58:23 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ji1R0-000BpX-L7 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jun 2020 21:58:22 +0200 Original-Received: from localhost ([::1]:35196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ji1Qz-0002D5-Jv for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jun 2020 15:58:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ji1Ok-0007Kt-9H for bug-gnu-emacs@gnu.org; Sun, 07 Jun 2020 15:56:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43449) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ji1Oj-0006ME-Un for bug-gnu-emacs@gnu.org; Sun, 07 Jun 2020 15:56:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ji1Oj-0003SD-Sf for bug-gnu-emacs@gnu.org; Sun, 07 Jun 2020 15:56:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Simen =?UTF-8?Q?Heggest=C3=B8yl?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jun 2020 19:56:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41741 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41741-submit@debbugs.gnu.org id=B41741.159155971813211 (code B ref 41741); Sun, 07 Jun 2020 19:56:01 +0000 Original-Received: (at 41741) by debbugs.gnu.org; 7 Jun 2020 19:55:18 +0000 Original-Received: from localhost ([127.0.0.1]:54992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ji1O2-0003R1-Br for submit@debbugs.gnu.org; Sun, 07 Jun 2020 15:55:18 -0400 Original-Received: from aibo.runbox.com ([91.220.196.211]:39872) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ji1Nz-0003Qr-Kh for 41741@debbugs.gnu.org; Sun, 07 Jun 2020 15:55:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=runbox.com; s=selector1; h=Content-Transfer-Encoding:Content-Type:MIME-Version: Message-ID:In-Reply-To:Date:References:Subject:Cc:To:From; bh=m7y7FMpqty6hgNh4FfFLbZlPsSIC72J8pDp8oa2UsAk=; b=FhrUpvkR+mLQ1emOYhsjrI2wyN w9PZ2F36ayY4VR1fvhnx4/bubbEh3YP/Lkx7pG38RkC9Yk8ViLqrR/JEJviE5Pb7PTtsd0sjcojIP 6SeL9Z4G2HgiRzD1QiPM19x1ypGLyWIxSvEBUSKDJdujjdS681e7AzHtVd2zjaZqCiUB1gHqIkjBN A47KY7Obe2kZmKE8kFutqPMbGLf+IcK+6jqdhBQKK21RuRMoipOZk+XD68bCd6wMbBPEeuZ2bmpNO /o5j5lypqbq2kq2BHVifNaKYA6nhjvjkGlpBYVdUQCfWfsHaco65gSB3HwVsqhd6WQQBGFIeqkGGj qeFuH8XQ==; Original-Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1ji1Nw-00064s-FF; Sun, 07 Jun 2020 21:55:12 +0200 Original-Received: by submission02.runbox with esmtpsa [Authenticated alias (963757)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1ji1Nr-0004UW-08; Sun, 07 Jun 2020 21:55:07 +0200 In-Reply-To: (Dmitry Gutov's message of "Sun, 7 Jun 2020 01:59:10 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:181707 Archived-At: Dmitry Gutov writes: > On 06.06.2020 19:40, Simen Heggest=C3=B8yl wrote: > >> No metadata is added at this point, but it makes it extensible for the >> future. > > I'm not sure we'd really be able to store metadata in it. The list is > more or less transient: the entries are added automatically, and > removed automatically as well. If someone needs to know something > about a project, it's better to leave that to an overridable method, > and maybe add a project-vc- variable (if that value needs to be > user-customizable). > > For that reason, we should probably opt for storing directories only. It is transient now, yes. But the biggest gain from going from the one-directory-per-line format to the proposed alist format is (in my view) having the possibility to extend its uses in the future without breaking backward compatibility with existing project list files. Just as an example I can imagine an optional feature in the future where you could name a project interactively the first time it's seen (i.e. when it's added to the project list for the first time). I wouldn't like to maintain that in my config file; having the name live in the project list only would be fine with me. That would require extending project.el to keep project metadata when rearranging them. >> - "Initialize `project--list' from the project list file." >> + "Initialize `project--list' from the file `project-list-file'." > > I think the previous string was okay. Alright, reverted. >> - (when (file-exists-p filename) >> + (when (file-readable-p filename) > > What's the difference? File exists, but belongs to another account? > I'm not sure we'd want to silently fail in that case (kinda puzzling > behavior), and writing to the file is likely to fail later too. Hm, yes. I snatched that part from saveplace.el, but after you pointed it out I now also think it's better to get an error in that case. Reverted. >> + (car (read-from-string (buffer-string)))))))) > > AKA: > > (goto-char (point-min)) > (read (current-buffer)) > > Though the practical difference will be tiny. I don't mind changing it, but could you explain the difference to me? My understanding isn't deep enough to see anything but one line versus two. :) -- Simen