From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: "Basil L. Contovounesios" Newsgroups: gmane.emacs.devel Subject: Re: New feature in project.el: Remembering the previously used projects Date: Fri, 29 May 2020 00:05:12 +0100 Message-ID: <87pnan8xuf.fsf@tcd.ie> References: <6f0f6cc9-52f4-8383-9827-ead54e898472@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="58094"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Simen =?utf-8?Q?Heggest=C3=B8yl?= , emacs-devel To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri May 29 01:07:25 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 1jeRcT-000F0n-Dv for ged-emacs-devel@m.gmane-mx.org; Fri, 29 May 2020 01:07:25 +0200 Original-Received: from localhost ([::1]:59322 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeRcS-0000BC-Dv for ged-emacs-devel@m.gmane-mx.org; Thu, 28 May 2020 19:07:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:57550) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeRaS-0005N7-9g for emacs-devel@gnu.org; Thu, 28 May 2020 19:05:20 -0400 Original-Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:34563) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jeRaP-000609-0S for emacs-devel@gnu.org; Thu, 28 May 2020 19:05:19 -0400 Original-Received: by mail-wm1-x32e.google.com with SMTP id u26so5477343wmn.1 for ; Thu, 28 May 2020 16:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=nqp8SyGfjp+72V4VgiwOnWQPTETTuULKQnU1QWMgOKo=; b=DzEp/LjcqK+mMmPmW5Z8ewfS52ZgV6MWbqFqtbctKszRyLFGc2OncFtD62ZWXPYPjJ dp59XKMCMNNQFSqQxooM54sajkmpNr5W7gTa8C9gS7QWe7PZhrf4YDynfYEpHY4havAR XAWvKgdZAOAS6o30afezAucsJklCabCBgkJKpOMVQqMJXvw8aVF8+5KyH1PNVUHFsZEc 9DTLZ4ULPUveHxFbD+FTlnwkZs6d66JLwT7nH02586Pkk6cmgU8harugmNK1rdrwk+li d6tRvkv7eoVkN/xJoq4Q67YA7B1ExmKCoe18u6zfu3QE7pydPx64lOB52VT8t2t6juL0 ce1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=nqp8SyGfjp+72V4VgiwOnWQPTETTuULKQnU1QWMgOKo=; b=hZZBDJof2kNhENbA7mbjkatW66XCp166Pswcz+AxhIAzseeCzRS4WPUNUgFgzcPj+W 7BNOFDZg0/SgieptciCCK9dCcBrk+22OxDGMXiI9sauFHTOiItLAu/SqNFM2l5zi8bn4 WzVjmY5p+VVwBR0rEe4ADardF2rPSvmEnjXBmlaCk84d4DrYvhzS5zuLoiJ8b3lRhWJ6 I1Spj2AgvqdFp+Cva+ZO7upqg+0xnvXlLRq2cO2znKCyCIYhmgrXTMx92r9bqVQRCStC hsf7UalkR2l+OnpFrCOD3CN7RNKq4tPkyHySWMxun9SPFdxu65l4YUCGcED+1nvEGA0v +WAA== X-Gm-Message-State: AOAM531o4M3Gn+5HmwgimKchPReBSu7R399tqlc+4mqOyN7RBe62M/zl rXoYCV0JMd29vBermlVFijDIqA== X-Google-Smtp-Source: ABdhPJwVM4cg+MlZyTfWdih0+3VEz/Bm3neOP8XIQQ5UXexP4YAw9xhnkIMxNgbCVY9uvM1YSO7Efw== X-Received: by 2002:a1c:2644:: with SMTP id m65mr5422736wmm.178.1590707114658; Thu, 28 May 2020 16:05:14 -0700 (PDT) Original-Received: from localhost ([2a02:8084:20e2:c380:1f68:7ff5:120d:64e]) by smtp.gmail.com with ESMTPSA id r7sm7079288wmb.32.2020.05.28.16.05.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 May 2020 16:05:14 -0700 (PDT) In-Reply-To: <6f0f6cc9-52f4-8383-9827-ead54e898472@yandex.ru> (Dmitry Gutov's message of "Thu, 28 May 2020 23:06:32 +0300") Received-SPF: none client-ip=2a00:1450:4864:20::32e; envelope-from=contovob@tcd.ie; helo=mail-wm1-x32e.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: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, 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:251589 Archived-At: Dmitry Gutov writes: > Thanks some good work by Simen, project commands (project-find-file, etc) now > prompt you to choose among known projects, if currently outside of all project > directories. > > It's now on master. > > There's also a new command, project-switch-project. Thanks! > Please let us know how you like the change, and if you see any new problems. Only one feature request and some minor questions from me. Can the project-list file name please be customisable? Could the contents of the project-list file comprise easily readable, printable, and even extensible sexps? Could project-switch-project reuse read-multiple-choice or similar? Isn't there a race here? (defun project--ensure-file-exists (filename) "Create an empty file FILENAME if it doesn't exist." (unless (file-exists-p filename) (with-temp-buffer (write-file filename)))) Why not use something like the following instead? (ignore-error file-already-exists (write-region "" nil filename nil 0 nil 'excl)) In fact, couldn't project--ensure-file-exists be eliminated altogether? If the file doesn't exist, just don't set project--list, or set it to nil. Thanks, -- Basil