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#44297: [Feature request] project.el: Additional utility functions Date: Fri, 30 Oct 2020 01:20:21 +0200 Message-ID: <64182b62-dad4-08db-379b-acfddea26327@yandex.ru> References: <1785587458.69035.1603939939547@ichabod.co-bxl> <871rhhv4q8.fsf@mail.linkov.net> 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="15483"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 Cc: leungbk@mailfence.com To: Juri Linkov , 44297@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Oct 30 00:21:20 2020 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 1kYHEO-0003vG-Nh for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 30 Oct 2020 00:21:20 +0100 Original-Received: from localhost ([::1]:49802 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kYHEN-0001mc-PU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 29 Oct 2020 19:21:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kYHE6-0001Yq-CX for bug-gnu-emacs@gnu.org; Thu, 29 Oct 2020 19:21:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:43778) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kYHE6-0007jQ-2h for bug-gnu-emacs@gnu.org; Thu, 29 Oct 2020 19:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kYHE5-0000gz-Vd for bug-gnu-emacs@gnu.org; Thu, 29 Oct 2020 19:21: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: Thu, 29 Oct 2020 23:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 44297 X-GNU-PR-Package: emacs Original-Received: via spool by 44297-submit@debbugs.gnu.org id=B44297.16040136312588 (code B ref 44297); Thu, 29 Oct 2020 23:21:01 +0000 Original-Received: (at 44297) by debbugs.gnu.org; 29 Oct 2020 23:20:31 +0000 Original-Received: from localhost ([127.0.0.1]:55323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYHDb-0000fe-9W for submit@debbugs.gnu.org; Thu, 29 Oct 2020 19:20:31 -0400 Original-Received: from mail-ej1-f52.google.com ([209.85.218.52]:40975) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kYHDZ-0000fQ-2d for 44297@debbugs.gnu.org; Thu, 29 Oct 2020 19:20:29 -0400 Original-Received: by mail-ej1-f52.google.com with SMTP id s15so6093378ejf.8 for <44297@debbugs.gnu.org>; Thu, 29 Oct 2020 16:20:29 -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=unlIW4sl1JfLVeoVdrzyHXWCfA/jV4TsR1AdBCwA9QU=; b=F77FEDjlos0cysKP8DrqW9FEthAvWM7D1XwnUkQDElAjwEqlzlNznZX5eqbwI8xC/b FG4SKpV0MixtGOHATb69JQw0XgkWzFsNkVnUNPYXkiQ7LrTD0LpcMv4GzfWKOiFSpO7D YJ9SCMrxbrBuprFs6OTRxT/w3WPHQrgXhgKv5ehSZwLcFQe2OOsjcUiguzviiUm1aY3q odFXuhzioaZr0lFviGwSLMqbiwVMTFdUrAVsraEW5uXvGQWYcrGogzF9yX1P3GMfvX0J /n2PNy92+AdzpxcIbfZB+koK9QNT/Muxlyr9F7VR9jcIlvughy0ranb6LtR11k8+PhlN Bgfw== 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=unlIW4sl1JfLVeoVdrzyHXWCfA/jV4TsR1AdBCwA9QU=; b=Nw0DmqkJ8tpNyiPq3KYsPLwZguPoD0rN2DaYRduRZEdRisIFYXSU8iyi/0Gyyfnqwu CeyLk54V184APrU7R+UkqJwB7DGP4FzEl5ofe+b2uqnvR7n//kwQEy7ZKTs2vlQvg3dd ll7ktay7jG2C4ORFGBiI2rY9ufzu0Xo7bupjGAxjRUSAvstIJuYQ8uV34uKo7yOFBSPM evnPRHUXRuO2c6N/+BwVrwjyynWsAxgOgiiTJO+KJFnUxs8fD9iwoXUTHNw1n1dDkqKG 8ChC3ebXur4YpHIVb9/jiWSJRhkNOpiuqlq/AMc4o/Ra7WrwGiZYZWzk06JP1uedoOUk TRBg== X-Gm-Message-State: AOAM53331GmVzlz62CVnLZsfWhcFKvVsWbguGqY3RDQTdPrKjrnyO7GT JrC5PMf3LVtwf4WAyt39ZHE= X-Google-Smtp-Source: ABdhPJwXbnOM4UelHoltFh7IWY1pBQ5CtaZwfjdYo1Ozc1IH9aXkOtUVlIDRScYuzUsr8cqV8F7Q2w== X-Received: by 2002:a17:906:b043:: with SMTP id bj3mr6312387ejb.338.1604013623285; Thu, 29 Oct 2020 16:20:23 -0700 (PDT) Original-Received: from [192.168.0.4] ([66.205.71.3]) by smtp.googlemail.com with ESMTPSA id j24sm2281783edq.29.2020.10.29.16.20.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 29 Oct 2020 16:20:22 -0700 (PDT) In-Reply-To: <871rhhv4q8.fsf@mail.linkov.net> 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:192018 Archived-At: On 29.10.2020 11:03, Juri Linkov wrote: >> It would be nice if project.el had the following interactive functions: >> >> project-find-other-file: Find a file with the same basename as the current file but a different extension > > Maybe then it should be named project-find-other-extension? > Otherwise, project-find-other-file might imply a similarity > with find-alternate-file (C-x C-v). I think the term is pretty much established: https://www.emacswiki.org/emacs/FindOtherFile Projectile also has a command with a similar name. The feature will be pretty C/C++-centric, but I suppose it's useful enough. What I don't understand, is why should it be in the project- namespace? Looking for a file with the same name in the current dir doesn't execute the notion of the current project, even a little bit. Projectile does a project-wide search for a file with the same basename (but a different extension). Is that actually useful? > Another question: how it should work? Maybe running this command > should completing-read on all files with the same basename > ignoring the extension? Projectile has projectile-other-file-alist. A similar defcustom should narrow the search somewhat. >> project-find-file-in-directory: completing-read for a directory within >> the project, and then within the selected directory, completing-read >> for a file within that directory >> project-find-directory: completing-read for a directory within the project > > Another useful command would be: > project-find-file-only using completing-read to match on file names only, > not on directory parts. And then... disambiguate files with the same base name with another prompt? IME, having multiple files with the same name in the project is very common. Your experience can vary, though. A fuzzy search across full names works best for me, personally. We could also try some differently weighted, fuzzy matching styles. >> project-recentf: completing-read recently-accessed files in the project > > All project file-reading commands could provide a list of recent files > as the default values available via M-n key presses. Perhaps a flat, immediately visible list will have its own value, though?