GNU bug report logs -
#62621
29.0.60; uniquify can't make buffers unique based on things other than filename
Previous Next
Reported by: Spencer Baugh <sbaugh <at> janestreet.com>
Date: Sun, 2 Apr 2023 17:38:02 UTC
Severity: normal
Found in version 29.0.60
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #35 received at 62621 <at> debbugs.gnu.org (full text, mbox):
> From: Spencer Baugh <sbaugh <at> janestreet.com>
> Cc: sbaugh <at> catern.com, 62621 <at> debbugs.gnu.org
> Date: Fri, 14 Jul 2023 08:20:02 -0400
>
> Eli Zaretskii <eliz <at> gnu.org> writes:
>
> >> I agree, and I'm happy to change it to use a simple symbolic value
> >> 'project instead for the transform I wrote, but I'm not sure how best to
> >> handle the dependencies: uniquify.el is in loadup.el, is it OK for it to
> >> rely on project-uniquify-dirname-transform being autoloaded?
> >
> > I don't understand the difficulty. If the function value could be
> > defined in uniquify.el, why cannot a symbolic value be defined there?
>
> I don't understand your question :)
>
> Here's concretely the diff I would apply. This makes uniquify.el mention a
> function from project.el. Is that OK?
No.
> > If the symbolic values are specific to project, simply let-bind
> > uniquify-dirname-transform to the value of the appropriate project.el
> > defcustom when project.el calls uniquify.
>
> These customizations are in effect all the time, not just when the user
> is calling a project.el command. e.g. rename-buffer triggers uniquify.
Then you can set the buffer-local value of uniquify-dirname-transform
in the project.el buffers. Would that solve the problem?
> >> Unfortunately, this isn't quite right. uniquify never uses
> >> default-directory, counterintuitively - by default, it uses the
> >> directory of buffer-file-name, which can differ from default-directory.
> >
> > That's a minor issue, just use "buffer's directory" instead.
> >
> > But I wonder why uniquify does something counterintuitive like that.
>
> I assume it's something like "default-directory changes (such as by M-x
> cd) shouldn't change the buffer name too".
default-directory of a file-visiting buffer doesn't change.
> The fact that uniquify doesn't use default-directory also means it's
> unable to uniquify buffers which aren't visiting files
Exactly.
This bug report was last modified 2 years and 19 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.