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: project-find-file: switch to include non-tracked files Date: Thu, 14 Oct 2021 15:01:21 +0300 Message-ID: References: <2b9ae9f3-a253-f4f4-c08c-05e3c8ef1115@yandex.ru> <9995e361-34f1-9aa6-f854-eb197723a8fd@yandex.ru> <792bff0a-7121-2830-f00c-794614e61350@yandex.ru> <3d7d8880-8cfd-51a8-1ccd-52afb04c95e6@inventati.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18729"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 To: Manuel Uberti , emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Oct 14 14:06:06 2021 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 1mazUs-0004d8-Mf for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Oct 2021 14:06:06 +0200 Original-Received: from localhost ([::1]:39924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mazUr-0002eW-4y for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Oct 2021 08:06:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mazQZ-0007eu-TF for emacs-devel@gnu.org; Thu, 14 Oct 2021 08:01:40 -0400 Original-Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]:43560) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mazQT-0003pM-Qn for emacs-devel@gnu.org; Thu, 14 Oct 2021 08:01:39 -0400 Original-Received: by mail-lf1-x12b.google.com with SMTP id r19so25412526lfe.10 for ; Thu, 14 Oct 2021 05:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=gnn6lBTAICutf4pdfPUGMt1ijydAfIQ649fTi524GaM=; b=a0jNKGmZ7FJ8BqhPq0UPP4bPjhK0EaM8hKSaD+GueYURbfb1QiUVbutF5d7L6aNygo uazJ77H1BiTTak8KwqdFzMh4HEH0TOcaAkH4JryqTeISfOtVoeyMpctyh01yB8lV3fhw kCXnR9rM2FUA2un8shPncAIcpIS12CXKTmqbbocJiCT9gIp1v8kQIXUiMfVvtJh/0BuM Icpxgs5tUUBJJ5PRHgE4nHiC7GUCvU4Rw8r9LhWtT9dKK7QcB6Lbo5Koa0vMum6ptQAZ rrkN+hPJKP22mN3RI3HhLBHKZw9WaT44T2eZtEj7CwObMQ7bDYoU0NodQ7iSwaNzxjjo CUeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=gnn6lBTAICutf4pdfPUGMt1ijydAfIQ649fTi524GaM=; b=RH/0JbU4YRzlku+2GmDk0hhadDLtx6/Lcqi9hHMmjC661B+xklcbZGaTJQMkbDOAHq i9RkZ9oNBPzhpZeckGherjEuCmbT+fvBnMKEhr7tj0QtHq0y98X6LCQEkoQcGFCCLUeC BSBjGjktMmjkqBaTPdLLwRJNMrlEWkWS5skrID7SI3s3hJwdmHk7MLLduI0fyVDjDe52 Mlvf2o+nI+te1aAHoadEsk6gjo9cLDAb8iUNaS1lRDlV5jZEh0VkuxqCnTFji9GS0YX+ r0vsqsSOCUpHZM7l5z0M1Ib1I47mBP/7dbOziz9I3nDnA7nuKhuuMgLBJgzC8DBXNpLi WBXQ== X-Gm-Message-State: AOAM531dq0AQ7JqsCW+3nUR/N88bgKMZzT4eOkxua3UYZYJ8jBKJJqAO x7rem8L+35e31BlgcaYw7RqA929wtUs= X-Google-Smtp-Source: ABdhPJwqYtbWNQr+jN4HgsKe5QaCxJZbCN97IX1DoVeKG/IWyqgJaO6kLxE0lHyYCQds+t8NZcVAIg== X-Received: by 2002:a05:6512:3190:: with SMTP id i16mr4584923lfe.241.1634212883273; Thu, 14 Oct 2021 05:01:23 -0700 (PDT) Original-Received: from [192.168.0.103] ([5.18.248.29]) by smtp.googlemail.com with ESMTPSA id f10sm211371lfs.56.2021.10.14.05.01.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Oct 2021 05:01:22 -0700 (PDT) In-Reply-To: <3d7d8880-8cfd-51a8-1ccd-52afb04c95e6@inventati.org> Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::12b; envelope-from=raaahh@gmail.com; helo=mail-lf1-x12b.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.25, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no 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:276997 Archived-At: On 14.10.2021 09:37, Manuel Uberti wrote: > On 14/10/21 02:47, Dmitry Gutov wrote: >> Thanks for confirming. >> >> I've pushed the discussed change to master, to be released in Emacs 29 >> (but of course you'll be able to install a updated version of >> project.el from ELPA much sooner). > > Thank you for the update. On Emacs 29 it works as expected on different > projects (including Emacs source directory) Excellent. > albeit one, which > unfortunately I can share much about because the customer owns the code. > > I can report the bug if you want, but I will not be able to share a much > detailed recipe to reproduce the error. In general, but reports are better, but I don't want to give you the run-around. Since reported here, let's continue here. > From 'emacs -Q' the only thing I > did is the following: > > (dolist (dir '(".clj-kondo" ".cpcache" ".gitlab" "node_modules")) >   (add-to-list 'vc-directory-exclusion-list dir t)) As an aside, I can see what kind of problem this is solving, and this is a (meta) problem by itself. We need, like, ignores which are still honored when we don't use any other ignore instructions. Maybe a separate variable or something? AFAICS helm-ls-git doesn't have anything for this. The above will continue to work until we try to move the listing logic to a backend-specific method. Then vc-directory-exclusion-list won't be referenced anymore. That's the main reason this feature is not in emacs-28 anyway. Also note that 'find' gets a noticeable slowdown the more ignore entries we ask it to handle. Consider removing some entries from vc-directory-exclusion-list as well. > Then C-u C-x p f in the customer's project and I got this: > > Debugger entered--Lisp error: (error "File listing failed: > ./shadow-cljs.edn\0./public/cs...") >   error("File listing failed: %s" > "./shadow-cljs.edn\0./public/css/site.css\0./public/i...") >   project--files-in-directory("~/7bridges/skuro/cockpit/" ("SCCS/" > "RCS/" "CVS/" "MCVS/" ".src/" ".svn/" ".git/" ".hg/" ".bzr/" "_MTN/" > "_darcs/" "{arch}/" ".clj-kondo/" ".cpcache/" ".gitlab/" "node_modules/")) >   #f(compiled-function (dir) # 0x16d43be495cb8511>)("~/7bridges/skuro/cockpit/") >   project-find-file-in(nil ("~/7bridges/skuro/cockpit/") (vc . > "~/7bridges/skuro/cockpit/") (4)) >   project-find-file((4)) >   funcall-interactively(project-find-file (4)) >   command-execute(project-find-file) > > Let me know if you want me to file a proper bug. As a rough guess, perhaps some directories in this repo are not readable for you? Try edebug-ing project--files-in-directory. When you reach the (zerop status) line, the status will be non-zero for some reason. And there you could examine the buffer contents (though they are likely to be quite large). Another approach is to step through the method, then evaluate the constructed 'command' (perhaps call (message "%s" command) to make sure it's not truncated), then copy it to the terminal with appropriate escaping and see the full output and the error status returned. The output might include an explanation. You might want to replace '-print0' with '-print' when running the command in the terminal, too, so that it's not just one long line.