unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Bozhidar Batsov" <bozhidar@batsov.dev>
To: "Emacs Devel" <emacs-devel@gnu.org>
Subject: Re: Can project.el or projectile.el help? How about completion?
Date: Mon, 01 Nov 2021 14:20:41 +0200	[thread overview]
Message-ID: <aaf93413-8396-4c7b-b82a-de056760ff55@www.fastmail.com> (raw)
In-Reply-To: <CAJnXXoj3xQXoO8veCsLGcnKwHWOEJf2KKzZnOLD+Mo+8quwfJA@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2198 bytes --]

Projectile's author here. 

Some examples of the nature of the problem would be useful, as I don't quite understand if we're talking about exactly the same files appearing at different places of the repo or it's files with the name that are actually different.

Projectile returns the project files relative to the project root, so it's pretty easy to tell apart files in the second case, but I'm assuming your problem is probably the first case. I'm not aware of any existing sort order based on the distance from the current folder, although I can imagine this shouldn't very hard to implement. 

At any rate - projectile's quite flexible when it comes both to indexing strategies and to sorting orders, so it will definitely be possible to use something custom there, if the built-in options don't work well for you. 

On Sun, Oct 31, 2021, at 8:48 PM, John Yates wrote:
> I work on a large corporate mono-repo in which numerous
> filenames occur repeatedly.  Further, various directories
> above such duplicates also have duplicated names.
> 
> Currently I use a self-built emacs tool to index this space:
> * Build a map from a unique filename to a set of
>   repo-relative directory paths to files with that name
> * Compute a disambiguation string for completing reads
>   for unique filenames this string is empty; otherwise:
>   * Repeatedly strip identical leading directories
>   * Repeatedly strip identical trailing directories
> 
> I would like to replace this tool with something like
> project.el or projectile.el.  So the first question is does
> either package do anything intelligent when filenames
> are duplicated?  If so, what?
> 
> Then, is there any completion package that can present
> the candidates in an order reflecting their distance from
> the current buffer's working directory?  My thought is to
> sort identically named candidates by their repo-relative
> paths.  A focused, incrementally widening presentation
> of candidates would show initially those in or below the
> current working directory.  Each time instructed to widen
> the presentation it would advance up the parent directory
> chain, showing candidates in or below that directory.
> 
> /john
> 
> 

[-- Attachment #2: Type: text/html, Size: 2939 bytes --]

  parent reply	other threads:[~2021-11-01 12:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-31 18:48 Can project.el or projectile.el help? How about completion? John Yates
2021-11-01  0:39 ` Stephen Leake
2021-11-01 12:20 ` Bozhidar Batsov [this message]
2021-11-01 13:48 ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aaf93413-8396-4c7b-b82a-de056760ff55@www.fastmail.com \
    --to=bozhidar@batsov.dev \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).