GNU bug report logs -
#79409
31.0.50; project.el uses define-completion-category but depends on 26.1
Previous Next
To reply to this bug, email your comments to 79409 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 13:51:01 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Daniel Mendler <mail <at> daniel-mendler.de>
:
New bug report received and forwarded. Copy sent to
dmitry <at> gutov.dev, bug-gnu-emacs <at> gnu.org
.
(Mon, 08 Sep 2025 13:51:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Since a few days ago project.el uses define-completion-category which is
not yet available on old Emacs versions. project.el is published on ELPA
and depends on Emacs 26.1.
See also https://old.reddit.com/r/emacs/comments/1nblwbl/suddenly_everything_wants_definecompletioncategory/
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 16:08:02 GMT)
Full text and
rfc822 format available.
Message #8 received at submit <at> debbugs.gnu.org (full text, mbox):
Daniel Mendler writes:
> Since a few days ago project.el uses define-completion-category which is
> not yet available on old Emacs versions. project.el is published on ELPA
> and depends on Emacs 26.1.
Right, thanks, should now be fixed on master (with commit 6b6cfa8e40b).
Eshel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 16:08:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 16:20:01 GMT)
Full text and
rfc822 format available.
Message #14 received at submit <at> debbugs.gnu.org (full text, mbox):
Eshel Yaron <me <at> eshelyaron.com> writes:
> Daniel Mendler writes:
>
>> Since a few days ago project.el uses define-completion-category which is
>> not yet available on old Emacs versions. project.el is published on ELPA
>> and depends on Emacs 26.1.
>
> Right, thanks, should now be fixed on master (with commit 6b6cfa8e40b).
Thanks, I didn't see that you've already sent a mail to devel a short
while before my report. I wonder if some fallback code is needed, such
that project-buffer is treated like the buffer completion category on
older Emacs versions?
Daniel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 16:20:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 18:10:02 GMT)
Full text and
rfc822 format available.
Message #20 received at submit <at> debbugs.gnu.org (full text, mbox):
Daniel Mendler <mail <at> daniel-mendler.de> writes:
> Eshel Yaron <me <at> eshelyaron.com> writes:
>
>> Daniel Mendler writes:
>>
>>> Since a few days ago project.el uses define-completion-category which is
>>> not yet available on old Emacs versions. project.el is published on ELPA
>>> and depends on Emacs 26.1.
>>
>> Right, thanks, should now be fixed on master (with commit 6b6cfa8e40b).
>
> Thanks, I didn't see that you've already sent a mail to devel a short
> while before my report. I wonder if some fallback code is needed, such
> that project-buffer is treated like the buffer completion category on
> older Emacs versions?
I thought about that, and it seems like a good idea.
IIUC, there was no such arrangement in Dmitry's introduction of the
project-buffer category though, so I'll leave that to him.
Regards,
Eshel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 18:10:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 19:02:02 GMT)
Full text and
rfc822 format available.
Message #26 received at submit <at> debbugs.gnu.org (full text, mbox):
On 08/09/2025 19:18, Daniel Mendler wrote:
> Eshel Yaron<me <at> eshelyaron.com> writes:
>
>> Daniel Mendler writes:
>>
>>> Since a few days ago project.el uses define-completion-category which is
>>> not yet available on old Emacs versions. project.el is published on ELPA
>>> and depends on Emacs 26.1.
>> Right, thanks, should now be fixed on master (with commit 6b6cfa8e40b).
> Thanks, I didn't see that you've already sent a mail to devel a short
> while before my report. I wonder if some fallback code is needed, such
> that project-buffer is treated like the buffer completion category on
> older Emacs versions?
Thanks for the report.
I've asked what Stefan thinks about a fallback route in this case.
Maybe it would be a good use for the 'compat' dependency, in addition to
the FR in bug#79327.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 19:02:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 19:20:02 GMT)
Full text and
rfc822 format available.
Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):
Dmitry Gutov <dmitry <at> gutov.dev> writes:
> On 08/09/2025 19:18, Daniel Mendler wrote:
>> Eshel Yaron<me <at> eshelyaron.com> writes:
>>
>>> Daniel Mendler writes:
>>>
>>>> Since a few days ago project.el uses define-completion-category which is
>>>> not yet available on old Emacs versions. project.el is published on ELPA
>>>> and depends on Emacs 26.1.
>>> Right, thanks, should now be fixed on master (with commit 6b6cfa8e40b).
>> Thanks, I didn't see that you've already sent a mail to devel a short
>> while before my report. I wonder if some fallback code is needed, such
>> that project-buffer is treated like the buffer completion category on
>> older Emacs versions?
>
> Thanks for the report.
>
> I've asked what Stefan thinks about a fallback route in this case.
>
> Maybe it would be a good use for the 'compat' dependency, in addition to the FR
> in bug#79327.
I don't think we can use Compat here, since we cannot replace the
completion-metadata-get function such that callers magically learn about
category inheritance. We could provide a poor implementation for
define-completion-category which either does nothing or which copies the
completion category overrides and defaults from the parent to the
inherited category, but as such would behave differently than the new
mechanism. Neither is a satisfactory solution.
(buffer-match-p from the other bug report has been ported back, so this
can be used.)
Daniel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 19:20:02 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 19:25:02 GMT)
Full text and
rfc822 format available.
Message #38 received at submit <at> debbugs.gnu.org (full text, mbox):
On 08/09/2025 22:19, Daniel Mendler wrote:
> I don't think we can use Compat here, since we cannot replace the
> completion-metadata-get function such that callers magically learn about
> category inheritance.
Huh, right.
I guess Compat could do that with advice and such, but that way lies
trouble.
> We could provide a poor implementation for
> define-completion-category which either does nothing or which copies the
> completion category overrides and defaults from the parent to the
> inherited category, but as such would behave differently than the new
> mechanism. Neither is a satisfactory solution.
That probably means there's little point for project.el to add any
shims. Thanks.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 19:25:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 19:42:02 GMT)
Full text and
rfc822 format available.
Message #44 received at 79409 <at> debbugs.gnu.org (full text, mbox):
Dmitry Gutov <dmitry <at> gutov.dev> writes:
> On 08/09/2025 22:19, Daniel Mendler wrote:
>> I don't think we can use Compat here, since we cannot replace the
>> completion-metadata-get function such that callers magically learn about
>> category inheritance.
>
> Huh, right.
>
> I guess Compat could do that with advice and such, but that way lies trouble.
Yes, we've excluded advices early on during the development of Compat.
>> We could provide a poor implementation for
>> define-completion-category which either does nothing or which copies the
>> completion category overrides and defaults from the parent to the
>> inherited category, but as such would behave differently than the new
>> mechanism. Neither is a satisfactory solution.
>
> That probably means there's little point for project.el to add any shims.
> Thanks.
You could add a project-buffer category to completion-category-defaults
to give the same effect as category inheritance as long as the user
doesn't override the settings.
Otoh you could also just leave things as is. This is not a big deal,
since it will just result in a minor difference in completion styles
settings and users could always override if they bother.
Daniel
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 19:43:03 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 20:18:02 GMT)
Full text and
rfc822 format available.
Message #50 received at 79409 <at> debbugs.gnu.org (full text, mbox):
On 08/09/2025 22:41, Daniel Mendler wrote:
> You could add a project-buffer category to completion-category-defaults
> to give the same effect as category inheritance as long as the user
> doesn't override the settings.
I suppose you mean like this. Seems like an improvement, since the
original commit only added the entry in the latest Emacs.
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index c15148110a6..2291b2a6b4c 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -1718,9 +1718,11 @@ project--buffers-completion-table
(t
(complete-with-action action buffers string pred)))))
-(when (fboundp 'define-completion-category) ; Introduced in Emacs 31.
- (define-completion-category 'project-buffer '(buffer)
- "Completion category for buffers in a given project."))
+(if (fboundp 'define-completion-category) ; Introduced in Emacs 31.
+ (define-completion-category 'project-buffer '(buffer)
+ "Completion category for buffers in a given project.")
+ (add-to-list 'completion-category-defaults
+ '(project-buffer (styles . (basic substring)))))
(defun project--read-project-buffer ()
(let* ((pr (project-current t))
Or - the reverse - project--buffers-completion-table could switch to the
category 'buffer' in older Emacs.
> Otoh you could also just leave things as is. This is not a big deal,
> since it will just result in a minor difference in completion styles
> settings and users could always override if they bother.
Maybe not a big deal indeed.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#79409
; Package
emacs
.
(Mon, 08 Sep 2025 20:19:01 GMT)
Full text and
rfc822 format available.
This bug report was last modified 5 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.