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.devel Subject: Re: New feature in project.el: Remembering the previously used projects Date: Sat, 30 May 2020 16:21:43 +0300 Message-ID: <5b697000-4e00-24bf-0a64-78bf24bb7a87@yandex.ru> References: <6f0f6cc9-52f4-8383-9827-ead54e898472@yandex.ru> <87h7vy9wrv.fsf@gmail.com> <81be7027-4079-0de6-b4dc-d669cd4c6f71@yandex.ru> <7b8fe2bf-3d1e-65f8-0fdb-111bd39490b5@yandex.ru> <877dwuc5zu.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="119155"; 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: emacs-devel , =?UTF-8?Q?K=c3=a9vin_Le_Gouguec?= To: =?UTF-8?Q?Simen_Heggest=c3=b8yl?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat May 30 15:22:22 2020 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 1jf1RO-000Uu6-P1 for ged-emacs-devel@m.gmane-mx.org; Sat, 30 May 2020 15:22:22 +0200 Original-Received: from localhost ([::1]:47764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jf1RN-0000mV-OC for ged-emacs-devel@m.gmane-mx.org; Sat, 30 May 2020 09:22:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50728) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jf1Qp-0000MV-R1 for emacs-devel@gnu.org; Sat, 30 May 2020 09:21:47 -0400 Original-Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]:33372) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jf1Qo-0004TT-PB for emacs-devel@gnu.org; Sat, 30 May 2020 09:21:47 -0400 Original-Received: by mail-wm1-x331.google.com with SMTP id j198so8695355wmj.0 for ; Sat, 30 May 2020 06:21:46 -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=mLy2K7dIYLv2VJ4hgJzoPaLd0qDd5UepgwWsSbL/UL4=; b=f1xWRTAIzQGgcnNBMDUo7cp+TGoLdPDqf+AWUbn7WYruDnYu2/rEcbnXutKKiZq3ZE zeXARoIy1W3S6GCLKCSREnr/Jf0epDZOCkkk5Pv2i/K9O8oq7j8GDlDNBAwHRAt3o6xz nAYfA98G+16GoidmsM9MqFWHL0NeuRNnGvAl0to3X1OxKt+T58f31/BXGCyiX0faMEJC MkKjXZSp/t6DJ00XBkMDORjLtGMnZWTS+69Mso4bLnMSRvkVgwMpDAR8zOPvRPZDwoei Cd8nla/d719etOn6jjRtjPOtbcETyXlnrKOlaZjF0p0CwC71+MWurLiPy5iX9MbQFUSb qFBw== 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=mLy2K7dIYLv2VJ4hgJzoPaLd0qDd5UepgwWsSbL/UL4=; b=FwEZ88xiFCLyCLUFn+Hz09WPOzBCc3tTjhVnMg0VgTYcCSqC7vEkDEjQi2VvrsYtXF Vv0Fbo0ylBCQZy84Y84iKtpXIz4NyybQTTSn1Ncri5voOnAKqo0Mg6RVckzzwjcvuZD7 fT+uMdJy1Lj/XGPpBCA0AN2PRnuBQvCuEEVf2atY2KpM+TxtpKw6RlIqVKt0RQH4RVnw LwT35GQNqMTeMByb16dr1iPrgDT3e0zEHuwGKbphzAHCRXsGkDlcgXkJTzy6Vwy8yR2T j2AY6LAdZlBnaNHYqaG3ZoCCckKspd44T5xsqvipcKsEWDlthyDUGFv40yh33TvjouRL oAFQ== X-Gm-Message-State: AOAM5317rvk43W4hwxkMECCILAnUVPtnqtawwX5++sNijDe0LXnI5T+9 mtVVKyNJeMEXyr5ACjOBVa0rW2WL X-Google-Smtp-Source: ABdhPJxDKUvZcrpudJKE191qFnkrKe0aWHVPQQMWXb64MVpSLqROoB7P3R9XBKB63O4n+7pPVZvNgQ== X-Received: by 2002:a1c:6142:: with SMTP id v63mr12627014wmb.61.1590844905083; Sat, 30 May 2020 06:21:45 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id d4sm13298041wre.22.2020.05.30.06.21.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 May 2020 06:21:44 -0700 (PDT) In-Reply-To: <877dwuc5zu.fsf@simenheg@gmail.com> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=raaahh@gmail.com; helo=mail-wm1-x331.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:251650 Archived-At: On 30.05.2020 09:05, Simen Heggestøyl wrote: >> The patch below mostly does that, except it misses the case when a >> directory was selected from project-switch-project. [...] > > Hm, I think it misses all cases when project-switch-project is used, > since project-current will find the project using > project--find-in-directory (project-switch-project already did the > prompting part). Yes, I mentioned that downside. See another patch I just posted. > Maybe a simple solution could be to only write to the file when the > addition caused the project list to change? I think it's a good change > regardless, but is it enough to fix your issue, Kévin? Seems like a good idea either way. > Dmitry Gutov writes: > >> Alternatively, we could defer writing the file until Emacs is being >> closed (and do that in kill-emacs-hook). > > Maybe. I think doing it more eagerly has some advantages though if we > can make it work: > > - Launching a new Emacs session while another one is running will use > the latest project list. > > - If there's any problem writing to the file I imagine it's better to be > notified about it up front rather than at the time Emacs is killed. If that's your preference, let's go with it. Note that the above downsides are common for other features that use kill-emacs-hook, so we're probably used to them. And I wouldn't say that the project list is really critical to avoid losing. So I'm fine with either.