GNU bug report logs - #41536
uniquify can select non-unique prefix

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: ydirson@HIDDEN; dated Tue, 26 May 2020 12:57:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.
Severity set to 'wishlist' from 'normal' Request was from Stefan Kangas <stefan@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at 41536 <at> debbugs.gnu.org:


Received: (at 41536) by debbugs.gnu.org; 27 May 2020 22:59:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 27 18:59:02 2020
Received: from localhost ([127.0.0.1]:50305 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1je50o-00041x-Ir
	for submit <at> debbugs.gnu.org; Wed, 27 May 2020 18:59:02 -0400
Received: from smtp6-g21.free.fr ([212.27.42.6]:44594)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ydirson@HIDDEN>) id 1je50m-00041X-6K
 for 41536 <at> debbugs.gnu.org; Wed, 27 May 2020 18:59:00 -0400
Received: from zimbra39-e7.priv.proxad.net (unknown [172.20.243.189])
 by smtp6-g21.free.fr (Postfix) with ESMTP id 9F4DE7802FE;
 Thu, 28 May 2020 00:58:58 +0200 (CEST)
Date: Thu, 28 May 2020 00:58:58 +0200 (CEST)
From: ydirson@HIDDEN
To: Noam Postavsky <npostavs@HIDDEN>
Message-ID: <908011962.1041896177.1590620338618.JavaMail.root@zimbra39-e7>
In-Reply-To: <521374123.1041844255.1590618192543.JavaMail.root@zimbra39-e7>
Subject: Re: bug#41536: uniquify can select non-unique prefix
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [91.170.159.152]
X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - FF3.0 (Linux)/7.2.0-GA2598)
X-Authenticated-User: ydirson@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 41536
Cc: 41536 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)


> > 
> > > In my case the "y" level is even a python package for modules
> > > containing abstract
> > > classes, call it "lib" -- you'll understand that "lib/foo.py" is
> > > not really
> > > helpful, when other packages could have a module of the same name
> > > in a "lib/"
> > > subpackage.
> > 
> > I agree this can be annoying in many cases, but how do you expect
> > Emacs
> > to know which directory names should be considered?  Have a
> > backlist
> > of
> > "too generic" words like "lib", "utils", "config", etc?
> 
> No, I'd rather using a couple of rules, but I do agree finding a
> one-fits-all
> heuristic is likely hard to get.  Let me think aloud a bit, in the
> hope it will
> stir ideas from others as well.
> 
> (by the way, I did not look at the code yet, getting the gist of the
> current heuristic
> will be obviously useful)
> 
> My initial thought when seeing a/x/b/y/c vs. a/b/c resolved as y/c vs
> b/c was
> something like "never select a dirname for one buffer if it exists
> for all".
> Obviously that formulation is not sufficient, as it would not handle
> the a/b/c vs.
> b/a/c case, but maybe but as a work approximation we can leave the
> latter case
> for later rule refining if needed..
> 
> That rule would result, for my a/x/b/y/c vs. a/b/c case, in
> "(x/)?(y/)?c" vs. just "c".
> That could be an option, although arguably the "c" part does appear
> in both paths and
> we don't want strip it.
> 
> When only 2 files are at hand, maybe a heuristic like "strip all
> common leading
> dirs and take the next" would fit: that would let a/x/b/y/c vs. a/b/c
> to resolve
> as x/c vs. b/c.  The idea is that an outer directory is likely to
> carry more semantic
> weight.
> 
> With more than 2 files if ambiguities arise, it is likely acceptable
> in many cases
> to keep this first dir and recurse.  Say we add a/x/t/c to the lot,
> that would give
> x/b/c, x/t/c, and b/c.

For the record, another case where the current heuristic is wrong for me:
projname/b/c/d vs. projname/a/b/c/d.  It is currently resolved as "projname/d"
vs. "a/d", presumably by removing all common _suffix_ until a diff is found,
whereas with a heuristic of removing all common _prefix_ it would have
settled with "b/d" vs. "a/d", which would have made much more sense.

Hope this can clarify further :)
-- 
Yann




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#41536; Package emacs. Full text available.

Message received at 41536 <at> debbugs.gnu.org:


Received: (at 41536) by debbugs.gnu.org; 27 May 2020 22:23:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 27 18:23:17 2020
Received: from localhost ([127.0.0.1]:50251 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1je4SC-00039T-Nj
	for submit <at> debbugs.gnu.org; Wed, 27 May 2020 18:23:17 -0400
Received: from smtp3-g21.free.fr ([212.27.42.3]:23610)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ydirson@HIDDEN>) id 1je4SA-00039I-6m
 for 41536 <at> debbugs.gnu.org; Wed, 27 May 2020 18:23:14 -0400
Received: from zimbra39-e7.priv.proxad.net (unknown [172.20.243.189])
 by smtp3-g21.free.fr (Postfix) with ESMTP id 8ECB513F89A;
 Thu, 28 May 2020 00:23:12 +0200 (CEST)
Date: Thu, 28 May 2020 00:23:12 +0200 (CEST)
From: ydirson@HIDDEN
To: Noam Postavsky <npostavs@HIDDEN>
Message-ID: <521374123.1041844255.1590618192543.JavaMail.root@zimbra39-e7>
In-Reply-To: <857dwxt67f.fsf@HIDDEN>
Subject: Re: bug#41536: uniquify can select non-unique prefix
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Originating-IP: [91.170.159.152]
X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - FF3.0 (Linux)/7.2.0-GA2598)
X-Authenticated-User: ydirson@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 41536
Cc: 41536 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)



----- Mail original -----
> De: "Noam Postavsky" <npostavs@HIDDEN>
> =C3=80: ydirson@HIDDEN
> Cc: 41536 <at> debbugs.gnu.org
> Envoy=C3=A9: Mercredi 27 Mai 2020 23:32:04
> Objet: Re: bug#41536: uniquify can select non-unique prefix
>=20
> ydirson@HIDDEN writes:
>=20
> > In my case the "y" level is even a python package for modules
> > containing abstract
> > classes, call it "lib" -- you'll understand that "lib/foo.py" is
> > not really
> > helpful, when other packages could have a module of the same name
> > in a "lib/"
> > subpackage.
>=20
> I agree this can be annoying in many cases, but how do you expect
> Emacs
> to know which directory names should be considered?  Have a backlist
> of
> "too generic" words like "lib", "utils", "config", etc?

No, I'd rather using a couple of rules, but I do agree finding a one-fits-a=
ll
heuristic is likely hard to get.  Let me think aloud a bit, in the hope it =
will
stir ideas from others as well.

(by the way, I did not look at the code yet, getting the gist of the curren=
t heuristic
will be obviously useful)

My initial thought when seeing a/x/b/y/c vs. a/b/c resolved as y/c vs b/c w=
as
something like "never select a dirname for one buffer if it exists for all"=
.
Obviously that formulation is not sufficient, as it would not handle the a/=
b/c vs.
b/a/c case, but maybe but as a work approximation we can leave the latter c=
ase
for later rule refining if needed..

That rule would result, for my a/x/b/y/c vs. a/b/c case, in "(x/)?(y/)?c" v=
s. just "c".
That could be an option, although arguably the "c" part does appear in both=
 paths and
we don't want strip it.

When only 2 files are at hand, maybe a heuristic like "strip all common lea=
ding
dirs and take the next" would fit: that would let a/x/b/y/c vs. a/b/c to re=
solve
as x/c vs. b/c.  The idea is that an outer directory is likely to carry mor=
e semantic
weight.

With more than 2 files if ambiguities arise, it is likely acceptable in man=
y cases
to keep this first dir and recurse.  Say we add a/x/t/c to the lot, that wo=
uld give
x/b/c, x/t/c, and b/c.

Does that make any sense to anyone beside me ?

Best regards,
--=20
Yann




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#41536; Package emacs. Full text available.

Message received at 41536 <at> debbugs.gnu.org:


Received: (at 41536) by debbugs.gnu.org; 27 May 2020 21:32:30 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed May 27 17:32:30 2020
Received: from localhost ([127.0.0.1]:50176 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1je3f3-0008D7-MJ
	for submit <at> debbugs.gnu.org; Wed, 27 May 2020 17:32:29 -0400
Received: from mail-io1-f46.google.com ([209.85.166.46]:38029)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <npostavs@HIDDEN>) id 1je3el-0007zR-It
 for 41536 <at> debbugs.gnu.org; Wed, 27 May 2020 17:32:26 -0400
Received: by mail-io1-f46.google.com with SMTP id d7so27801230ioq.5
 for <41536 <at> debbugs.gnu.org>; Wed, 27 May 2020 14:32:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=from:to:cc:subject:references:date:in-reply-to:message-id
 :user-agent:mime-version;
 bh=2/wxBzDJfay6+1PHicrKQ0aB0jA/M8Ka3hjTZL834Qs=;
 b=kslEICxoypaEndCZN/oClPmqga2l0jY7lfltKU3xOSMYW1HlPlH8v7chPyB4SObhUp
 ZJtlnN3F697U6KyxBFMmLsr1WP6a47Q5Lq9Kv0YB+lWeXVYLoKOw+nHQ8q+zN2xgYyPR
 CIoEJ1aV6+YwKXIQDoVnfvnRU7vClWtcPRg603uUyb52G4FnSsfm1QXlbEwgbWUjijCG
 QBjk+13Ux1HY9YtwHdgEJAlq9vjux4sSUVkS8u+cToaTuC7xV6TaHN6hqWSg47ENgDtF
 qsrDIMOfaWVPgoHJttx5VEMDYQzvOVbv41CMfMiOAPgnExF7/uTs/b3PGxXx6iHE3PEG
 1QaQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to
 :message-id:user-agent:mime-version;
 bh=2/wxBzDJfay6+1PHicrKQ0aB0jA/M8Ka3hjTZL834Qs=;
 b=mr8Y5XZCaBDFDkA8nktyk1qd1sBpkl8nZUtwmU1yBg7ibjHcjA4hF23Cp70HWy+uM5
 a6k/8VVxlH55bd1T3XyT1UNkYI9+Xv9R9opbgaqZeZU1/49LAyN8MJFx7AU0OxEKPjH6
 e3lPiDkkHb6YuOqBIHp2ei4d/M7oiEDvD/oyHpQrkEWmWxPuGK8N41twtiQM6b/x1M4L
 OUpja7MvxXIdH60Tx6jj7vReRwQaHBYDow6fs5rK2om8govy1FqPyli2iSWtJnUdjA7t
 QE0pnT3K8vi2d91nZ8LZ/FBjHF5/MAWfj1zYc8hh63CQogYMeoaIxU8mZf6msW2NEPXd
 4UAg==
X-Gm-Message-State: AOAM531vF//6pqzbxpJYUGrhbXcHZRfp4FLciMGDXu08PbKjHkPWEldN
 DVrRkGP/txb5u9OghvzS6nrtnnsJ
X-Google-Smtp-Source: ABdhPJzDYLYkQgYX3fctVSTzqFhUV9Tsw3In9x9ph2V5p3zAg31SUB3ZPr0nzIEEQ7HwSfyiywcJ+w==
X-Received: by 2002:a02:3341:: with SMTP id k1mr7772622jak.74.1590615125769;
 Wed, 27 May 2020 14:32:05 -0700 (PDT)
Received: from vhost2
 (CPE001143542e1f-CMf81d0f809fa0.cpe.net.cable.rogers.com. [99.230.38.42])
 by smtp.gmail.com with ESMTPSA id g4sm2160876ilj.45.2020.05.27.14.32.04
 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256);
 Wed, 27 May 2020 14:32:05 -0700 (PDT)
From: Noam Postavsky <npostavs@HIDDEN>
To: ydirson@HIDDEN
Subject: Re: bug#41536: uniquify can select non-unique prefix
References: <1422112800.1035313346.1590497810370.JavaMail.root@zimbra39-e7>
Date: Wed, 27 May 2020 17:32:04 -0400
In-Reply-To: <1422112800.1035313346.1590497810370.JavaMail.root@zimbra39-e7>
 (ydirson@HIDDEN's message of "Tue, 26 May 2020 14:56:50 +0200 (CEST)")
Message-ID: <857dwxt67f.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (windows-nt)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 41536
Cc: 41536 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

ydirson@HIDDEN writes:

> In my case the "y" level is even a python package for modules containing abstract
> classes, call it "lib" -- you'll understand that "lib/foo.py" is not really
> helpful, when other packages could have a module of the same name in a "lib/"
> subpackage.

I agree this can be annoying in many cases, but how do you expect Emacs
to know which directory names should be considered?  Have a backlist of
"too generic" words like "lib", "utils", "config", etc?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#41536; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 26 May 2020 12:56:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue May 26 08:56:54 2020
Received: from localhost ([127.0.0.1]:44384 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1jdZ8Y-0007ib-49
	for submit <at> debbugs.gnu.org; Tue, 26 May 2020 08:56:54 -0400
Received: from smtp4-g21.free.fr ([212.27.42.4]:47998)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <ydirson@HIDDEN>) id 1jdZ8V-0007iS-VH
 for submit <at> debbugs.gnu.org; Tue, 26 May 2020 08:56:52 -0400
Received: from zimbra39-e7.priv.proxad.net (unknown [172.20.243.189])
 by smtp4-g21.free.fr (Postfix) with ESMTP id 7A6AA19F5B5
 for <submit <at> debbugs.gnu.org>; Tue, 26 May 2020 14:56:50 +0200 (CEST)
Date: Tue, 26 May 2020 14:56:50 +0200 (CEST)
From: ydirson@HIDDEN
To: submit <at> debbugs.gnu.org
Message-ID: <1422112800.1035313346.1590497810370.JavaMail.root@zimbra39-e7>
In-Reply-To: <1806725215.1035270044.1590497113540.JavaMail.root@zimbra39-e7>
Subject: uniquify can select non-unique prefix
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [91.170.159.152]
X-Mailer: Zimbra 7.2.0-GA2598 (ZimbraWebClient - FF3.0 (Linux)/7.2.0-GA2598)
X-Authenticated-User: ydirson@HIDDEN
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Package: emacs
Version: 26.3

After openning the following two files:

 /tmp/a/b/c
 /tmp/a/x/b/y/c

With style "forward" and all other customization vars as "standard",
the buffer names are respectively:

 b/c
 y/c

With my source-directory layout respecting the "higher-level is most significant"
principle, I would have expected the second buffer to be "x/b/c" instead.

In my case the "y" level is even a python package for modules containing abstract
classes, call it "lib" -- you'll understand that "lib/foo.py" is not really
helpful, when other packages could have a module of the same name in a "lib/"
subpackage.




Acknowledgement sent to ydirson@HIDDEN:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#41536; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 25 Aug 2020 14:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.