From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#41741: [PATCH] Save project list as lisp data Date: Sun, 7 Jun 2020 01:59:10 +0300 Message-ID: References: <877dwkno62.fsf@simenheg@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="93338"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Cc: "Basil L. Contovounesios" , Juri Linkov To: Simen =?UTF-8?Q?Heggest=C3=B8yl?= , 41741@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 07 01:00:13 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 1jhhnR-000OCb-DG for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jun 2020 01:00:13 +0200 Original-Received: from localhost ([::1]:56258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jhhnQ-0001Tf-1B for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 06 Jun 2020 19:00:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34750) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jhhnG-0001TT-N0 for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 19:00:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jhhnG-0001iN-B3 for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 19:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jhhnG-0003M6-7c for bug-gnu-emacs@gnu.org; Sat, 06 Jun 2020 19:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 06 Jun 2020 23:00:02 +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.159148436112827 (code B ref 41741); Sat, 06 Jun 2020 23:00:02 +0000 Original-Received: (at 41741) by debbugs.gnu.org; 6 Jun 2020 22:59:21 +0000 Original-Received: from localhost ([127.0.0.1]:52723 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhhmb-0003Kp-7u for submit@debbugs.gnu.org; Sat, 06 Jun 2020 18:59:21 -0400 Original-Received: from mail-wm1-f66.google.com ([209.85.128.66]:40382) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jhhmZ-0003Kc-51 for 41741@debbugs.gnu.org; Sat, 06 Jun 2020 18:59:19 -0400 Original-Received: by mail-wm1-f66.google.com with SMTP id r15so12781355wmh.5 for <41741@debbugs.gnu.org>; Sat, 06 Jun 2020 15:59:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=aMsKtz77KpCQm8MNDZ8ZNZQjhJ8CnIDERgda/nyihSI=; b=AH+Ggzg1LNWNTFd/ja/JvGOXzEycWisGyB2/2NpGESWhQSy4xrFC/p30metto3E8nY rsaJjJwV+uqEzZcEGRj1ityV78tDWtjwdC/CVY+Y2RcBi5GKeXAs5uj2mEO76DD9kpaR HC5c+uRBO5Wb+8/ME14sKeJclg0jHD45AvOF/G87yJVUxJxA++652hqvNrncDpEXQzFh ZfZdU9APTckEiJjsMI2Ol818fEjr3U6bAEMeLQJapcCkgTfKRSelfdf+J0gD6m6iRipX QF4gfiNHQkIX7LYgK4UCXDoV0GzUn9f2vn71/fBizvvhAsOVtdKd1pZgvwcC5izA0qIB fOiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=aMsKtz77KpCQm8MNDZ8ZNZQjhJ8CnIDERgda/nyihSI=; b=h+x81Y6iQq9nstQ72E375Y1Rq3clJjE2O3MfcfSix0jtOnq0DYZIAoe9d8AJ0DzCLT B4Ad8PFsNSNMhaMLo07Ljf7FHlsFx7zKSSPgeK6bGH7QGfwGzLNZPwM9lMcq/loVFmcB 4buKgzJtPAQN1A/qtpOD4smNecQUcKVOtg/yuGHv+3zE0DBhQllfJPHfs/k6DTXx7Fm6 acBbcX1468MDtZiQn38I5SMQX4sTlSAxSznWMCdognQdAldbX34Jh0lKIVoR1NNduZHL +uqh6Jx4muofx1V/4AEKHLg/coRuqID9UyBLCq5MTZVog5E67kphqYzCkC2fU62QCHBM x3TA== X-Gm-Message-State: AOAM531yLxiNgFryttB6IKpxV5vMk6Rfn7+YvJuHsQCGDPBqE8wzqn+t L3mnqCsaflnrkPiAvYweyek= X-Google-Smtp-Source: ABdhPJyif2Mm+gCjIT47B3EvIfCCEols8C9u661OE1JmIiW4v1plrlooaNz+g4oby12OOUvnJqVlOg== X-Received: by 2002:a1c:44c3:: with SMTP id r186mr8979043wma.67.1591484353170; Sat, 06 Jun 2020 15:59:13 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id z7sm17741085wrt.6.2020.06.06.15.59.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 06 Jun 2020 15:59:12 -0700 (PDT) In-Reply-To: <877dwkno62.fsf@simenheg@gmail.com> Content-Language: en-US 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:181646 Archived-At: Hi Simen, On 06.06.2020 19:40, Simen Heggestøyl wrote: > I'm attaching a suggested patch for changing project.el's project list > format from a line based one to proper Lisp data as discussed in the > "New feature in project.el: Remembering the previously used projects" > thread on emacs-devel. Some comments below. > 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. > - "Initialize `project--list' from the project list file." > + "Initialize `project--list' from the file `project-list-file'." I think the previous string was okay. > - (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. > + (car (read-from-string (buffer-string)))))))) AKA: (goto-char (point-min)) (read (current-buffer)) Though the practical difference will be tiny.