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.bugs Subject: bug#49204: 28.0.50; How to create new file in project by project-find-file Date: Sun, 4 Jul 2021 04:07:29 +0300 Message-ID: References: <6f475812-e088-f0e0-e01f-11cd643ff3e6@yandex.ru> 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="17129"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Cc: Stephen Leake , Stefan Monnier , 49204@debbugs.gnu.org To: Giap Tran Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 04 03:08:10 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1lzqcE-0004Fn-GT for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 04 Jul 2021 03:08:10 +0200 Original-Received: from localhost ([::1]:53472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lzqcB-0006OY-Ei for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 03 Jul 2021 21:08:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lzqc6-0006Nm-3D for bug-gnu-emacs@gnu.org; Sat, 03 Jul 2021 21:08:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56887) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lzqc5-0007dd-Rp for bug-gnu-emacs@gnu.org; Sat, 03 Jul 2021 21:08:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lzqc5-0006Ng-M2 for bug-gnu-emacs@gnu.org; Sat, 03 Jul 2021 21:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 04 Jul 2021 01:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49204 X-GNU-PR-Package: emacs Original-Received: via spool by 49204-submit@debbugs.gnu.org id=B49204.162536086024498 (code B ref 49204); Sun, 04 Jul 2021 01:08:01 +0000 Original-Received: (at 49204) by debbugs.gnu.org; 4 Jul 2021 01:07:40 +0000 Original-Received: from localhost ([127.0.0.1]:40200 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzqbk-0006N4-IF for submit@debbugs.gnu.org; Sat, 03 Jul 2021 21:07:40 -0400 Original-Received: from mail-wm1-f54.google.com ([209.85.128.54]:41810) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lzqbi-0006Mr-Em for 49204@debbugs.gnu.org; Sat, 03 Jul 2021 21:07:38 -0400 Original-Received: by mail-wm1-f54.google.com with SMTP id a5-20020a7bc1c50000b02901e3bbe0939bso8892388wmj.0 for <49204@debbugs.gnu.org>; Sat, 03 Jul 2021 18:07:38 -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=MLt3ICuw1gqAMLI3gsAj6RhDcv6aofF4yQdjHDW3gZo=; b=oqTEJqY5CO9NH+PleZds0UK/Qffy0GeVilL0kkskWGuDsqVJOLICUX13NUvdEgmJRw e8FCP+9/Fgree0kN/oND1q5AdHrmcKyforRuvEL6djKFLb8RmYkYlab76VJ7n/+GTxv5 ItJkWtqNvTsyy/JscQbrc8rb4lM/LLCRAVv0/tGlObNKDWz6VEUW8QFWVVegwsFhULCm o7tNT4NQp7dYlkCNU9Ux4eB/qdfoVcToktAbSMHJb8I9b6nhe5lY48JfAuC/DgVnmHdv FCfZTZI9HDcTa3eR4J8SV2g5LPgyEFmWG/WMpZzh6omliRi1JlQYnwCBHBo8roo6BWPn 62dQ== 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=MLt3ICuw1gqAMLI3gsAj6RhDcv6aofF4yQdjHDW3gZo=; b=HvqDV4Eig1+ErZyT1vpziSU/kOM4HVqBbkCZwCGIO//LZq8qJRbgod16cnJoJ9dWCL SYK1uWdpeY3BHsIQnNI4v2Pci0CnAn1aQu7lUoRR4tfVZ8EeiMxPqVLivdqr2/6TWFEM qbfXAcvndnBlQucmZczxc36SxAj7ILRPFdikn/m3y4FDeMSm5DTGSYoAWMmym2Bl7P99 UadYQvypYWE5NKcX23VJHRnRChkYJj181niWbAXL8kO4uhYRyweghOfNmnZtTTjdoagX zNiRoEZQwKHbUvbYf97SletQGQEeeArF5cK7zF8/w7WApcjuALea9bL53qa/Us9KeCwM NSJA== X-Gm-Message-State: AOAM5320V+YOJtscWs1dL8Y1UiDE84NCBWA7Fe/RcFZw19GIpfeZrJEe rrg+c51yrkOsgfVgBqA/V1h8GwTUNbk= X-Google-Smtp-Source: ABdhPJwxiP4GKmWmMf5DDZcntiGimstwPtyOJpDrqOh1eHNvxv4uDJZ2EKhSBKiNbUV6camKy0l/Bw== X-Received: by 2002:a1c:f312:: with SMTP id q18mr7164241wmq.12.1625360852532; Sat, 03 Jul 2021 18:07:32 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id f2sm8186310wrq.69.2021.07.03.18.07.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 03 Jul 2021 18:07:31 -0700 (PDT) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:209372 Archived-At: On 30.06.2021 07:44, Giap Tran wrote: > On 6/29/21 8:49 PM, Dmitry Gutov wrote: >>> >> >> Thanks for the explanations. You previously wrote about Projectile. >> Does it enable this workflow? > > Yes, as I see projectile support this feature by default (1). I used it > before Thanks for the link. projectile-find-file doesn't specify any INITIAL-INPUT when calling projectile-completing-read, so Projectile seems exempt from this dilemma that I described. >> I wonder how we can reconcile this requirement with the "find name at >> point" behavior: we use whatever string at point that looks similar >> enough to a file name (or a part of it). To avoid mistakes, we >> currently even call completing-read again if the first finished input >> doesn't match any files. >> >> If the command allows non-matching input, having a default value that >> doesn't necessarily match any file names exactly will be a problem. >> Moving it from DEFAULT to INITIAL-INPUT shouldn't make a difference >> either. > > Thanks for clarifying, I will try to override > project--completing-read-strict func when calling completing-read with > REQUIRE-MATCH is nil > > (1) - > https://github.com/bbatsov/projectile/blob/6b88b69ecd7e6f2b6bbcae0b68026a486be516a4/projectile.el#L1885 Better than that, you can set project-read-file-name-function to a function with the same signature that uses REQUIRE-MATCH=nil. But I suppose an override for project--completing-read-strict might require less code, if you still want to retain the "completion from relative names" part of behavior from project--read-file-cpd-relative. The flip side is someday you might have to deal with breakage when we have to make a change to project--completing-read-strict (which is a "private" function) or stop using it. Let me know which approach you choose in the end, and how it works out.