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:17:03 +0300 Message-ID: <633d3e6a-1c54-c222-57c1-4615b4dae9f3@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> <5ed1f7ae.1c69fb81.9b99b.4ce7SMTPIN_ADDED_BROKEN@mx.google.com> <87eer161c8.fsf@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="102897"; 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 To: =?UTF-8?Q?K=c3=a9vin_Le_Gouguec?= , =?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:18:02 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 1jf1NC-000Qg9-Dq for ged-emacs-devel@m.gmane-mx.org; Sat, 30 May 2020 15:18:02 +0200 Original-Received: from localhost ([::1]:45336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jf1NB-0007x7-GY for ged-emacs-devel@m.gmane-mx.org; Sat, 30 May 2020 09:18:01 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50114) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jf1ML-0007LC-OM for emacs-devel@gnu.org; Sat, 30 May 2020 09:17:10 -0400 Original-Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:44109) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jf1MJ-0002DJ-S8 for emacs-devel@gnu.org; Sat, 30 May 2020 09:17:09 -0400 Original-Received: by mail-wr1-x42a.google.com with SMTP id y17so6863625wrn.11 for ; Sat, 30 May 2020 06:17:07 -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=GJaBJqPO/9gQ6kzfRo/yTaWaLFxiheZEyfHwBHwamQ8=; b=sNh+I4oiCh7Ya636ljY8DM/R4IRxRsCcscsiihW5cADnZY/qSOV54h8Oa8+80IXevl qdlOtJfb7KcrgJq7MrfhWv6xwGPlvU7HwTSGUSZ0rQbPWP161u+0ujj3OfgIe5Zbk5eU W9VPCfsU5s+nfAPfSGt596OObiHLDt/jlJVDfA1fEQ2M5OkIPeuiWth8xImHqRcyd14J 8y6sBIMmIyn+It6glsXVlFuOln5aXJne2GA4r1BIn+88BaqSO053egtVW7fEYkzyhxSQ ETs0CSG1uMX6C9AriSdtMdSEEYQNSRkb8+7Doe4xA4omjYIVscGK4nyOvg9Zf1n7y4Zs +sIQ== 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=GJaBJqPO/9gQ6kzfRo/yTaWaLFxiheZEyfHwBHwamQ8=; b=JTcmKVif6GdImkwgHFjZQtz7enqDrQ32CbvqeaXNmTFWovrEKS9n9l2b1HxQjSe+id 7vmGFMtkpK9v25yQ6I61ANpxpx2/mnonWkVBvnw5lPcgWbAqXc07r5LVnEYOaVZPAT/p ybFrBWD8MDJNVgQgS65X2xo2SsCWsLqydp0cSG5EAW/+OcxwXBFq4X2Lv0KnAYgxLlgO PAy9f+5aSdV4fiU9M6CAmXpJvEGTp6OtmxlH4Xn6JIZ9U+iqRx48S2S75+nkf2UAq1hq pRMWjACSuYIbuyqK8spNA9ktZarDBe8fY4xK0PI3J5TZZoBOt8aCPAxbwI3ql00JhZGE BwyA== X-Gm-Message-State: AOAM532TCnvUYsrCU4nhmhpGy9Mkheng7E04amA04g1+L8oyE9RywQ/m D5FvInNOkuSR54TT6uusNN3OMUk8 X-Google-Smtp-Source: ABdhPJzvxW+9Cu5u1RgSRGhB84vV2h0L/+A/UxpujaQRTJaPQNCwzx/qsxeZaTK+X6W/UIIk6/h14Q== X-Received: by 2002:adf:a157:: with SMTP id r23mr14101743wrr.92.1590844625453; Sat, 30 May 2020 06:17:05 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id g82sm3993758wmf.1.2020.05.30.06.17.03 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 30 May 2020 06:17:04 -0700 (PDT) In-Reply-To: <87eer161c8.fsf@gmail.com> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42a.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: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 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 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:251649 Archived-At: On 30.05.2020 15:42, Kévin Le Gouguec wrote: > (Though I've just noticed that project-current now returns transient > projects unconditionally when project--find-in-directory returns nil; BTW, that's a bug. :-( > since I'm not interested in showing transient projects in the frame > title, I might just go with project-try-vc like Dmitry suggested…) Not really what I was suggesting. Here's another patch you can try, it should cover both problems: diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 1f2a4e8471..2d0b6c4a21 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -115,10 +115,11 @@ project-current maybe-prompt) (setq dir (project-prompt-project-dir) pr (project--find-in-directory dir)))) - (if pr - (project--add-to-project-list-front pr) - (project--remove-from-project-list dir) - (setq pr (cons 'transient dir))) + (when maybe-prompt + (if pr + (project--add-to-project-list-front pr) + (project--remove-from-project-list dir) + (setq pr (cons 'transient dir)))) pr)) (defun project--find-in-directory (dir)