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: Sun, 31 May 2020 16:00:12 +0300 Message-ID: References: <6f0f6cc9-52f4-8383-9827-ead54e898472@yandex.ru> <87pnan8xuf.fsf@tcd.ie> <8834c5e9-90c7-a8ad-3dcd-b8fb95f99df5@yandex.ru> <87eer3nqnd.fsf@warpmail.net> <871rn2ivne.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="84114"; 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" , "Philip K." , emacs-devel To: =?UTF-8?Q?Simen_Heggest=c3=b8yl?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun May 31 15:01:34 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 1jfNan-000LoO-Dg for ged-emacs-devel@m.gmane-mx.org; Sun, 31 May 2020 15:01:33 +0200 Original-Received: from localhost ([::1]:53368 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jfNam-0000kV-8U for ged-emacs-devel@m.gmane-mx.org; Sun, 31 May 2020 09:01:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36438) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jfNZZ-00008Q-Sw for emacs-devel@gnu.org; Sun, 31 May 2020 09:00:17 -0400 Original-Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:40601) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jfNZY-0007bq-Ma for emacs-devel@gnu.org; Sun, 31 May 2020 09:00:17 -0400 Original-Received: by mail-wr1-x42f.google.com with SMTP id h5so2804540wrc.7 for ; Sun, 31 May 2020 06:00:16 -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=aoV3NZ3KHWuYm40Q//z7iF7rqESr/zquCMmUBwA1lQY=; b=c6Hn4NLG/XDtzO5+l7YaYxARJAk+epw+y/K5lXnHSYVxngZquh+nYXAG5V+HV9qw0o gtcgBme6FKk4oRQTRKdE0Jyw8WPxnPN6S1Tt4HcXxU8BMvIFJ7GA4miPZAzIBcI/YedM 7S7x7XUo6GHToE95EfO1UCja5+4YH4AEGCz5TMJfnV0iHcyBO7pGdKko2MwjDRPeedk4 O9i/x3ncP80hwyze6+WKarLZeZm8NGwrzbe6cWDO7pZ4oELdeTMxRqI0+517yaXS+lf6 HTlpyjeLI8lRvjjkGbe6aM9vEFAK4B/rCcaHBgnVVo54SiXA7rGQ6B2Q5qYl/lC97YM4 jKiA== 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=aoV3NZ3KHWuYm40Q//z7iF7rqESr/zquCMmUBwA1lQY=; b=CmqQhaiXtG461DVLwXdlBe5R2BN/ON194iJTQZ97X7keVbE+vchqazvIu47p17m3hg xzWYMPcoXO5cX+mEgUMIrN2zWGYliZHOfik6LWVmaDl/Hgc4r2Q1523y2EOns+OeoGaR HocDthjqdq6MewxynPeezw4zNvJNcjQKSGHjDkm9a39hyBGs4Ip9qTDIxX59sXPKiwln Zf5LaB0wIRWGgYc0keMtOdaLi6QbnhMIkPWtY79AU6us8v0l6QYs70GAsBPMayxqpMI8 qsEaC1w7Eniu/4bUjBO6n7g+/8HvZLN2dn7DdnZq1Xyb16g75J0L//CJfgAF2jabAJw3 +6pA== X-Gm-Message-State: AOAM530f9MMtLpuRKEgkZ334yX3+9Ej+HINowcVIIoStxvrSi2iFfwXb F5vCzLhf6OvyOzJxiBIBOpNNGl+r X-Google-Smtp-Source: ABdhPJwYFqGNGNPKRmaceandugi/LoHzjFjMRTkmJpj4nir9hHrw1lZbkUDBSq6LgMQaHJYGyWO4+A== X-Received: by 2002:a5d:45c2:: with SMTP id b2mr16574481wrs.323.1590930014593; Sun, 31 May 2020 06:00:14 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id q11sm11287148wrv.67.2020.05.31.06.00.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 31 May 2020 06:00:13 -0700 (PDT) In-Reply-To: <871rn2ivne.fsf@simenheg@gmail.com> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42f.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:251674 Archived-At: On 29.05.2020 18:54, Simen Heggestøyl wrote: >> On 29.05.2020 02:05, Basil L. Contovounesios wrote: >> >>> Can the project-list file name please be customisable? >> Of course. Just an omission. > Yup. Simen what do you say? diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 2d0b6c4a21..70ee8d11ed 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -93,6 +93,10 @@ (require 'cl-generic) (eval-when-compile (require 'subr-x)) +(defgroup project nil + "Operations on the current project." + :group 'tools) + (defvar project-find-functions (list #'project-try-vc) "Special hook to find the project containing a given directory. Each functions on this hook is called in turn with one @@ -249,6 +253,7 @@ project-vc-merge-submodules After changing this variable (using Customize or .dir-locals.el) you might have to restart Emacs to see the effect." :type 'boolean + :version "28.1" :package-version '(project . "0.2.0") :safe 'booleanp) @@ -601,6 +606,7 @@ project-read-file-name-function (const :tag "Read with completion from absolute names" project--read-file-absolute) (function :tag "Custom function" nil)) + :group 'project :version "27.1") (defun project--read-file-cpd-relative (prompt @@ -716,6 +722,11 @@ project-compile ;;; Project list +(defcustom project-list-file (locate-user-emacs-file "project-list") + "File to save the list of known projects list." + :type 'string + :group 'project) + (defvar project--list 'unset "List of known project directories.") @@ -727,7 +738,7 @@ project--ensure-file-exists (defun project--read-project-list () "Initialize `project--list' from the project list file." - (let ((filename (locate-user-emacs-file "project-list"))) + (let ((filename project-list-file)) (project--ensure-file-exists filename) (with-temp-buffer (insert-file-contents filename) @@ -746,7 +757,7 @@ project--ensure-read-project-list (defun project--write-project-list () "Persist `project--list' to the project list file." - (let ((filename (locate-user-emacs-file "project-list"))) + (let ((filename project-list-file)) (with-temp-buffer (insert (string-join project--list "\n")) (write-region nil nil filename nil 'silent))))