GNU bug report logs - #77859
[PATCH] Handle empty cancidates in python-shell-completion-at-point

Previous Next

Package: emacs;

Reported by: Christian Sattler <sattler.christian <at> gmail.com>

Date: Thu, 17 Apr 2025 09:05:02 UTC

Severity: normal

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

To reply to this bug, email your comments to 77859 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#77859; Package emacs. (Thu, 17 Apr 2025 09:05:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Christian Sattler <sattler.christian <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 17 Apr 2025 09:05:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Christian Sattler <sattler.christian <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Handle empty cancidates in python-shell-completion-at-point
Date: Thu, 17 Apr 2025 11:04:16 +0200
[Message part 1 (text/plain, inline)]
Fixes regression bug#77853.
[Handle-empty-cancidates-in-python-shell-completion-at-point.patch (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77859; Package emacs. (Sat, 26 Apr 2025 12:03:02 GMT) Full text and rfc822 format available.

Message #8 received at 77859 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Christian Sattler <sattler.christian <at> gmail.com>,
 kobarity <kobarity <at> gmail.com>
Cc: 77859 <at> debbugs.gnu.org
Subject: Re: bug#77859: [PATCH] Handle empty cancidates in
 python-shell-completion-at-point
Date: Sat, 26 Apr 2025 15:02:47 +0300
> From: Christian Sattler <sattler.christian <at> gmail.com>
> Date: Thu, 17 Apr 2025 11:04:16 +0200
> 
> Fixes regression bug#77853.
> 
> From bfd998ef21accf658e9938b53086925f50ec9ddf Mon Sep 17 00:00:00 2001
> From: Christian Sattler <sattler.christian <at> gmail.com>
> Date: Wed, 16 Apr 2025 22:03:46 +0200
> Subject: [PATCH] Handle empty cancidates in python-shell-completion-at-point.
> 
> This fixes a regression (bug#77853) introduced by 0b9c714:
> 2024-02-08 "Respect the delimiter of completer in Python shell completion"
> ---
>  lisp/progmodes/python.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index 6fbabe99cb0..ed87a67ad30 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -4894,7 +4894,8 @@ python-shell-completion-at-point
>                :annotation-function
>                (lambda (c) (concat " " (nth 3 (assoc c cands))))
>                :company-docsig
> -              (lambda (c) (nth 4 (assoc c cands)))))))))
> +              (lambda (c) (nth 4 (assoc c cands)))))
> +       (t (list start end (cddr python-shell--capf-cache)))))))
>  
>  (define-obsolete-function-alias
>    'python-shell-completion-complete-at-point
> -- 
> 2.48.1
> 

Should this be installed, or did the fix for bug#77853 fix this as
well?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#77859; Package emacs. (Sat, 26 Apr 2025 13:18:01 GMT) Full text and rfc822 format available.

Message #11 received at 77859 <at> debbugs.gnu.org (full text, mbox):

From: kobarity <kobarity <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Liu Hui <liuhui1610 <at> gmail.com>,
 Christian Sattler <sattler.christian <at> gmail.com>, 77859 <at> debbugs.gnu.org
Subject: Re: bug#77859: [PATCH] Handle empty cancidates in
 python-shell-completion-at-point
Date: Sat, 26 Apr 2025 22:17:35 +0900
Eli Zaretskii wrote:
> 
> > From: Christian Sattler <sattler.christian <at> gmail.com>
> > Date: Thu, 17 Apr 2025 11:04:16 +0200
> > 
> > Fixes regression bug#77853.
> > 
> > From bfd998ef21accf658e9938b53086925f50ec9ddf Mon Sep 17 00:00:00 2001
> > From: Christian Sattler <sattler.christian <at> gmail.com>
> > Date: Wed, 16 Apr 2025 22:03:46 +0200
> > Subject: [PATCH] Handle empty cancidates in python-shell-completion-at-point.
> > 
> > This fixes a regression (bug#77853) introduced by 0b9c714:
> > 2024-02-08 "Respect the delimiter of completer in Python shell completion"
> > ---
> >  lisp/progmodes/python.el | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> > 
> > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> > index 6fbabe99cb0..ed87a67ad30 100644
> > --- a/lisp/progmodes/python.el
> > +++ b/lisp/progmodes/python.el
> > @@ -4894,7 +4894,8 @@ python-shell-completion-at-point
> >                :annotation-function
> >                (lambda (c) (concat " " (nth 3 (assoc c cands))))
> >                :company-docsig
> > -              (lambda (c) (nth 4 (assoc c cands)))))))))
> > +              (lambda (c) (nth 4 (assoc c cands)))))
> > +       (t (list start end (cddr python-shell--capf-cache)))))))
> >  
> >  (define-obsolete-function-alias
> >    'python-shell-completion-complete-at-point
> > -- 
> > 2.48.1
> > 
> 
> Should this be installed, or did the fix for bug#77853 fix this as
> well?

Liu's fix for bug#77853 already fixed it.

At first I was going to fix it the same way as Christian, but I think
Liu's patch is better.  If `python-shell-completion-at-point' returns
nil when there are no completion candidates, as is currently the case,
the next completion function may be able to provide appropriate
completion candidates.

The problem with bug#77853 is that the default setting includes an
inappropriate completion function for inferior Python mode, so it
would be better to remove the inappropriate completion function
`comint-filename-completion' from `comint-dynamic-complete-functions'
as in Liu's patch.




Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 26 Apr 2025 14:29:02 GMT) Full text and rfc822 format available.

Notification sent to Christian Sattler <sattler.christian <at> gmail.com>:
bug acknowledged by developer. (Sat, 26 Apr 2025 14:29:02 GMT) Full text and rfc822 format available.

Message #16 received at 77859-done <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: kobarity <kobarity <at> gmail.com>
Cc: liuhui1610 <at> gmail.com, sattler.christian <at> gmail.com,
 77859-done <at> debbugs.gnu.org
Subject: Re: bug#77859: [PATCH] Handle empty cancidates in
 python-shell-completion-at-point
Date: Sat, 26 Apr 2025 17:28:01 +0300
> Date: Sat, 26 Apr 2025 22:17:35 +0900
> From: kobarity <kobarity <at> gmail.com>
> Cc: Christian Sattler <sattler.christian <at> gmail.com>,
> 	Liu Hui <liuhui1610 <at> gmail.com>,
> 	77859 <at> debbugs.gnu.org
> 
> Eli Zaretskii wrote:
> > 
> > > From: Christian Sattler <sattler.christian <at> gmail.com>
> > > Date: Thu, 17 Apr 2025 11:04:16 +0200
> > > 
> > > Fixes regression bug#77853.
> > > 
> > > From bfd998ef21accf658e9938b53086925f50ec9ddf Mon Sep 17 00:00:00 2001
> > > From: Christian Sattler <sattler.christian <at> gmail.com>
> > > Date: Wed, 16 Apr 2025 22:03:46 +0200
> > > Subject: [PATCH] Handle empty cancidates in python-shell-completion-at-point.
> > > 
> > > This fixes a regression (bug#77853) introduced by 0b9c714:
> > > 2024-02-08 "Respect the delimiter of completer in Python shell completion"
> > > ---
> > >  lisp/progmodes/python.el | 3 ++-
> > >  1 file changed, 2 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> > > index 6fbabe99cb0..ed87a67ad30 100644
> > > --- a/lisp/progmodes/python.el
> > > +++ b/lisp/progmodes/python.el
> > > @@ -4894,7 +4894,8 @@ python-shell-completion-at-point
> > >                :annotation-function
> > >                (lambda (c) (concat " " (nth 3 (assoc c cands))))
> > >                :company-docsig
> > > -              (lambda (c) (nth 4 (assoc c cands)))))))))
> > > +              (lambda (c) (nth 4 (assoc c cands)))))
> > > +       (t (list start end (cddr python-shell--capf-cache)))))))
> > >  
> > >  (define-obsolete-function-alias
> > >    'python-shell-completion-complete-at-point
> > > -- 
> > > 2.48.1
> > > 
> > 
> > Should this be installed, or did the fix for bug#77853 fix this as
> > well?
> 
> Liu's fix for bug#77853 already fixed it.
> 
> At first I was going to fix it the same way as Christian, but I think
> Liu's patch is better.  If `python-shell-completion-at-point' returns
> nil when there are no completion candidates, as is currently the case,
> the next completion function may be able to provide appropriate
> completion candidates.
> 
> The problem with bug#77853 is that the default setting includes an
> inappropriate completion function for inferior Python mode, so it
> would be better to remove the inappropriate completion function
> `comint-filename-completion' from `comint-dynamic-complete-functions'
> as in Liu's patch.

Thanks, I'm therefore closing this one.




This bug report was last modified 10 days ago.

Previous Next


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