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: Fri, 15 Oct 2021 00:55:37 +0300 Message-ID: <24fbdd11-d6a6-f7e6-0be2-3f7f199686f2@yandex.ru> 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: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17710"; 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 23:57:10 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 1mb8ir-0004Iy-Mz for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Oct 2021 23:57:09 +0200 Original-Received: from localhost ([::1]:60808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mb8ip-0006PU-Pw for ged-emacs-devel@m.gmane-mx.org; Thu, 14 Oct 2021 17:57:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mb8hT-0005V9-13 for emacs-devel@gnu.org; Thu, 14 Oct 2021 17:55:43 -0400 Original-Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]:34392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mb8hR-0004VZ-3d for emacs-devel@gnu.org; Thu, 14 Oct 2021 17:55:42 -0400 Original-Received: by mail-lf1-x12a.google.com with SMTP id t9so32228594lfd.1 for ; Thu, 14 Oct 2021 14:55:40 -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=iU8hmsWiyWhnGztlZE0Qc0gNj60qSxVfVXulCR94M2Y=; b=JDaZtpq008OMhlvggvy9fcUw6M2YBdTBv7AS8R4+UlpXwZdCK4eGA7fb84EDy0BZBg uTYhmmhKLRw9cM6Sqmn2rDNWdG37tvtWjY8UARHIDh2dTNhmGCfpE31uhsfKEHLyrqT5 ARPwctgUWlLAORe0I8VwbIGCUxihi1KJ0ym4+w69yvwa16TD56G0+9T4fQ6YpYNPcTTP LROZ4L4potK7SO0sU5bG8TMBc2yve8zYQFldhg1ZikqQVBhaff50OtuVuVAI1CPPaVyI PBLOLkfzC4SifMnlRDAxpb/+Dar6MECp26WyZx44wkQayK7mR+zmWweD1uSzlOGnNxZn iT7A== 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=iU8hmsWiyWhnGztlZE0Qc0gNj60qSxVfVXulCR94M2Y=; b=wQ61Vo6SRTCfAE66yTiZIbzmZ2PpdzK6C7FogkhGP/R6vbs1+Ac+i19Nfb5QoSDXgk V4eln+SKdb8R0TGDJ2hwH/Q/u5tj1v5p5Y5LfqaSD8gs8nqLsIbfiLz8AMcPS8d+jxHO UVFSeZ5+epXsSmq7cOYjDN3D9dcMM2vFsy1U7vzdzsQaZVfnUPMueIBrFiLTXVch0u8N iRZ1O3rDSkDckL5GVKvB1MRnt94lQEvZWQRB9Wiwq+jkqyMTZAfmn/5IYN6vhoqZv3zr ccDRug7fTePT1RqtZAuIZ9sBoI444p3tUcOmS8yCFUamWHLEoz71vbYhCZeRqJjKktbd wzqA== X-Gm-Message-State: AOAM5320IAG+uzf2L+Z9Pd174/oNkORiC0T3aw0QYLSJHMHfCDwHCKwi +yC7w2rRYbGTBIQq/+Xm8igGp0MbO5s= X-Google-Smtp-Source: ABdhPJza9YMidis+kVkpPofGc2p3PU2k/kFIXqU2YyP/waE3Asm6dcU6vW2Vuc0uEPWTvY05Ht8qVw== X-Received: by 2002:a05:6512:3130:: with SMTP id p16mr7410243lfd.559.1634248539386; Thu, 14 Oct 2021 14:55:39 -0700 (PDT) Original-Received: from [192.168.0.103] ([5.18.248.29]) by smtp.googlemail.com with ESMTPSA id m7sm327195lfo.181.2021.10.14.14.55.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Oct 2021 14:55:38 -0700 (PDT) In-Reply-To: Content-Language: en-US Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=raaahh@gmail.com; helo=mail-lf1-x12a.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:277072 Archived-At: On 14.10.2021 15:06, Manuel Uberti wrote: > On 14/10/21 14:01, Dmitry Gutov wrote: >> 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. > > I didn't know about this. If we end up adding a new user option for this, what would you call it? >> As a rough guess, perhaps some directories in this repo are not >> readable for you? > > Yes, great tip, you nailed it. There is one directory I cannot read in > there, so I just added that to vc-directory-exclusion-list and > everything works as expected now. We should probably try to handle this is a more transparent way, showing the exact error message to the user (when the buffer contains lots of output as well, the message becomes next to useless). Could you try applying the patch below, removing your recent customization and seeing whether the error message is better now? diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 79d2e050d9..7c3bb9229d 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -322,7 +322,15 @@ project--files-in-directory (process-file-shell-command command nil t)) (pt (point-min))) (unless (zerop status) - (error "File listing failed: %s" (buffer-string))) + (goto-char (point-min)) + (if (and + (not (eql status 127)) + (search-forward "Permission denied\n")) + (let ((end (1- (point)))) + (re-search-backward "\\`\\|\0") + (error "File listing failed: %s" + (buffer-substring (1+ (point)) end))) + (error "File listing failed: %s" (buffer-string)))) (goto-char pt) (while (search-forward "\0" nil t) (push (buffer-substring-no-properties (1+ pt) (1- (point)))