From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: master 1e3b0f2: Improve doc strings of project.el Date: Sun, 5 Jul 2020 22:45:19 +0300 Message-ID: <95fd893e-0da5-4cdc-a3e8-3c22af750aae@yandex.ru> References: <87bllfqj82.fsf@warpmail.net> <83o8pfxhzq.fsf@gnu.org> <83imfnxgt3.fsf@gnu.org> <626efe11-0f9c-081b-11dd-0d61cee8168d@yandex.ru> <83h7v7xf7w.fsf@gnu.org> <831rmayj55.fsf@gnu.org> <6dc2c2ac-8e17-f044-dc78-8c109f936ad2@yandex.ru> <83wo42w83e.fsf@gnu.org> <6762abf5-71c1-aa54-1bac-d4c90c20870b@yandex.ru> <831rmavsuq.fsf@gnu.org> <83a70wv4mj.fsf@gnu.org> <5542db0c-cc0d-2743-87ae-7728a0cc94bb@yandex.ru> <83ftaf2rj2.fsf@gnu.org> <43a8f8d4-83fb-f012-8e1d-c1a618b0ef59@yandex.ru> <83mu4m0vub.fsf@gnu.org> <44f2f1f4-ae34-f0bf-b153-f33b8ee6069f@yandex.ru> <83mu4fvjh3.fsf@gnu.org> <7c2e93d4-8d86-bbbb-77a0-bf5d73051907@yandex.ru> <83imf2t4w4.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30180"; 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: philip@warpmail.net, theo@thornhill.no, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jul 05 21:46: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 1jsAaP-0007m3-QP for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jul 2020 21:46:01 +0200 Original-Received: from localhost ([::1]:40878 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsAaO-0002tq-Sl for ged-emacs-devel@m.gmane-mx.org; Sun, 05 Jul 2020 15:46:00 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsAZr-0002Py-A4 for emacs-devel@gnu.org; Sun, 05 Jul 2020 15:45:27 -0400 Original-Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:36839) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jsAZp-0005ql-GN; Sun, 05 Jul 2020 15:45:27 -0400 Original-Received: by mail-wr1-x42e.google.com with SMTP id k6so38627914wrn.3; Sun, 05 Jul 2020 12:45:24 -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=O2bVNWOKUZILNCvEXOjRuJpEjO7aH6a2NbXP3CfePUE=; b=RT45+opctV8lBTtufzuz9fjfubfQBFm+c1oKV83TrG57A4av5hAEZBw05lyKulOi/U +ITBLRvHxUG1pwWU9IJ42eZ3/Yys2Jh5xdyGMsB4VREvHb+a8zYUumFyXApZu5INYPLR +PkM+Jyz7a0Uhh/S7VnrGrO5/oFUzerSeZYTxrpsSaUAfeFZ2+v9MfECMVY0jChI5tXf Ql+9Jxuawe7ateJWIFwC5VlVakYf99FdNgAwZQ7vLtiMc9IPTQwUJ/ZVKLWUYIRixcgE fLwHnPtbD9Wxcgute4VeWfSHPhb/SZxlhojsaO2awBQBD44hKyQ8dQGcwNJY36CF7txF pBCw== 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=O2bVNWOKUZILNCvEXOjRuJpEjO7aH6a2NbXP3CfePUE=; b=NQgE1FaFtC27nsgoHUzYhawfCzD+2Y7IIYuxHhT1QogeRvolrR6yeiFLAEwMrzMxlN i+teTayoT2vrkCMtv6bnOQpFVmxEE+Olt/v5WLT2Sr5xYDK16UaKELQ3FMTgcsk7ixaY L0XmHJz27fMapbkp7Qd11rCTjNopaQDWJtgS8jXoFoxdcb/8dEK9TyypweI/Qkj/Mz8T F8EZjeDN2XSDNs0yFEdbbvM6dUNvIb9jDBXh0P2zOvqqq5GyWiztXoI6qOur5MsJnkpL d/8gelD5fe+OmDAvJ8nMdxeTm/v1XOzLZGepfdgX4V4xdgWV5N76E4jihfbJVn3h+4yJ Hy7g== X-Gm-Message-State: AOAM531kcysuhRsgkaPbncfgdRefI9Lfk90WsvER34/NxKfHHerFqd20 z4ASJMTeGeJ51JLJ9e9CUdb8h3Rw X-Google-Smtp-Source: ABdhPJxpyZdtUOwTcenVjBA60zpTVUZfToe8tw31ta+RE9CRA1p4+csnkdppons1XCQ2+tUxzA5JOQ== X-Received: by 2002:a5d:43d2:: with SMTP id v18mr44722098wrr.196.1593978322948; Sun, 05 Jul 2020 12:45:22 -0700 (PDT) Original-Received: from [192.168.0.3] ([66.205.73.129]) by smtp.googlemail.com with ESMTPSA id d18sm21991420wrj.8.2020.07.05.12.45.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Jul 2020 12:45:22 -0700 (PDT) In-Reply-To: <83imf2t4w4.fsf@gnu.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=raaahh@gmail.com; helo=mail-wr1-x42e.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: 0 X-Spam_score: 0.0 X-Spam_bar: / X-Spam_report: (0.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=1, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, 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:252714 Archived-At: On 05.07.2020 17:26, Eli Zaretskii wrote: >> The problems I can see with that are: >> >> - Since project is not a minor mode, we don't call it in major mode >> hooks. Which, by itself, is probably a good thing (causing no >> unnecessary work/slowdown). But that means that in the middle of any >> session we could have 100s of buffers that don't have any cached project >> value. > > We have project-find-file and other similar project-* commands that > could cache that as side effect. That would still potentially leave hundreds of buffers in which said commands have never been used. >> - A project configuration can change mid-session (due to a customization >> of some user option, or due to an edit in some .dir-locals.el). Or >> simply due to 'git init'. As a result, a given file's current project >> can change. It will be good to be able to support that without >> necessitating Emacs' restart or requiring manual cache invalidation. > > I don't see how you can avoid some user command which would mean a > project configuration change. Alternatively, this could be solved > lazily, when the cached value is found to be outdated. Speaking of standards set by other editors, have you ever seen an IDE with an "invalidate project cache" button? I haven't. Luckily, in the common configuration we can rely on 'git ls-files' to be pretty fast, though that will only handle projects up to certain size. I was thinking filenotify could help us with cache invalidation, but past discussions have left an impression that we can't fully rely on it either. > We don't need to solve every possible complication up front before we > decide that a method is workable, we just need to have a vague idea > how it could be solved when the time comes. As mentioned, I have that "vague idea" now. Though it will also only scale up to a certain number of buffers/directories. >>> or a directory if all the files in the directory belong >>> to the project. >> >> The problem is in the case of *nested* projects. > > The first part above should take care of that. The second part was to > suggest a shortcut: let a directory stand for all the files in it. For its direct contents, but not subdirectories? Yes, that's what I was thinking of as well. Anyway, the current version of code should support your and Stephen's kinds of projects. Someone can try experimenting with writing the backend now.