GNU bug report logs - #72298
Should python-mode-abbrev-table declare :parents python-base-mode-abbrev-table?

Previous Next

Package: emacs;

Reported by: Ship Mints <shipmints <at> gmail.com>

Date: Thu, 25 Jul 2024 18:15:02 UTC

Severity: normal

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

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 72298 in the body.
You can then email your comments to 72298 AT debbugs.gnu.org in the normal way.

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#72298; Package emacs. (Thu, 25 Jul 2024 18:15:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ship Mints <shipmints <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 25 Jul 2024 18:15:02 GMT) Full text and rfc822 format available.

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

From: Ship Mints <shipmints <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Should python-mode-abbrev-table declare :parents
 python-base-mode-abbrev-table?
Date: Thu, 25 Jul 2024 14:13:44 -0400
[Message part 1 (text/plain, inline)]
I was expecting that python-base-mode-abbrev-table would apply to both
python-mode and python-ts-mode buffers. python-ts-mode doesn't derive from
python-mode so the abbrev tables aren't shared by default. Unless I'm
missing something, using a base table doesn't work for me.

(define-abbrev-table 'python-mode-abbrev-table ()
  "Abbrev table for Python mode."
;; should this:
  :parents (list python-mode-skeleton-abbrev-table))
;; be defined thusly?
  :parents (list python-base-mode-abbrev-table
python-mode-skeleton-abbrev-table))

I tried to find guidance on this outside of hacking abbrev tables manually
to be shared. Perhaps other people have the same expectation.

Thank you,

Stephane
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72298; Package emacs. (Thu, 25 Jul 2024 18:35:02 GMT) Full text and rfc822 format available.

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

From: Ship Mints <shipmints <at> gmail.com>
To: 72298 <at> debbugs.gnu.org
Subject: Re: bug#72298: Should python-mode-abbrev-table declare :parents
 python-base-mode-abbrev-table?
Date: Thu, 25 Jul 2024 14:33:03 -0400
[Message part 1 (text/plain, inline)]
An example of a personal hack to make this work could be to add something
like this to a python-mode-hook:

(if (derived-mode-p 'python-base-mode)
  (setq local-abbrev-table python-base-mode-abbrev-table))

On Thu, Jul 25, 2024 at 2:15 PM Ship Mints <shipmints <at> gmail.com> wrote:

> I was expecting that python-base-mode-abbrev-table would apply to both
> python-mode and python-ts-mode buffers. python-ts-mode doesn't derive from
> python-mode so the abbrev tables aren't shared by default. Unless I'm
> missing something, using a base table doesn't work for me.
>
> (define-abbrev-table 'python-mode-abbrev-table ()
>   "Abbrev table for Python mode."
> ;; should this:
>   :parents (list python-mode-skeleton-abbrev-table))
> ;; be defined thusly?
>   :parents (list python-base-mode-abbrev-table
> python-mode-skeleton-abbrev-table))
>
> I tried to find guidance on this outside of hacking abbrev tables manually
> to be shared. Perhaps other people have the same expectation.
>
> Thank you,
>
> Stephane
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72298; Package emacs. (Sat, 17 Aug 2024 13:56:02 GMT) Full text and rfc822 format available.

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

From: Ship Mints <shipmints <at> gmail.com>
To: 72298 <at> debbugs.gnu.org
Subject: Re: bug#72298: Should python-mode-abbrev-table declare :parents
 python-base-mode-abbrev-table?
Date: Sat, 17 Aug 2024 09:53:15 -0400
[Message part 1 (text/plain, inline)]
Greetings. Curious if I'm barking up the wrong tree with this assessment...

On Thu, Jul 25, 2024 at 2:33 PM Ship Mints <shipmints <at> gmail.com> wrote:

> An example of a personal hack to make this work could be to add something
> like this to a python-mode-hook:
>
> (if (derived-mode-p 'python-base-mode)
>   (setq local-abbrev-table python-base-mode-abbrev-table))
>
> On Thu, Jul 25, 2024 at 2:15 PM Ship Mints <shipmints <at> gmail.com> wrote:
>
>> I was expecting that python-base-mode-abbrev-table would apply to both
>> python-mode and python-ts-mode buffers. python-ts-mode doesn't derive from
>> python-mode so the abbrev tables aren't shared by default. Unless I'm
>> missing something, using a base table doesn't work for me.
>>
>> (define-abbrev-table 'python-mode-abbrev-table ()
>>   "Abbrev table for Python mode."
>> ;; should this:
>>   :parents (list python-mode-skeleton-abbrev-table))
>> ;; be defined thusly?
>>   :parents (list python-base-mode-abbrev-table
>> python-mode-skeleton-abbrev-table))
>>
>> I tried to find guidance on this outside of hacking abbrev tables
>> manually to be shared. Perhaps other people have the same expectation.
>>
>> Thank you,
>>
>> Stephane
>>
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72298; Package emacs. (Sat, 24 Aug 2024 08:47:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ship Mints <shipmints <at> gmail.com>, kobarity <kobarity <at> gmail.com>
Cc: 72298 <at> debbugs.gnu.org
Subject: Re: bug#72298: Should python-mode-abbrev-table declare :parents
 python-base-mode-abbrev-table?
Date: Sat, 24 Aug 2024 11:45:21 +0300
> From: Ship Mints <shipmints <at> gmail.com>
> Date: Sat, 17 Aug 2024 09:53:15 -0400
> 
> Greetings. Curious if I'm barking up the wrong tree with this assessment...
> 
> On Thu, Jul 25, 2024 at 2:33 PM Ship Mints <shipmints <at> gmail.com> wrote:
> 
>  An example of a personal hack to make this work could be to add something like this to a
>  python-mode-hook:
> 
>  (if (derived-mode-p 'python-base-mode)
>    (setq local-abbrev-table python-base-mode-abbrev-table))
> 
>  On Thu, Jul 25, 2024 at 2:15 PM Ship Mints <shipmints <at> gmail.com> wrote:
> 
>  I was expecting that python-base-mode-abbrev-table would apply to both python-mode and
>  python-ts-mode buffers. python-ts-mode doesn't derive from python-mode so the abbrev tables
>  aren't shared by default. Unless I'm missing something, using a base table doesn't work for me.
> 
>  (define-abbrev-table 'python-mode-abbrev-table ()
>    "Abbrev table for Python mode."
>  ;; should this:
>    :parents (list python-mode-skeleton-abbrev-table))
>  ;; be defined thusly?
>    :parents (list python-base-mode-abbrev-table python-mode-skeleton-abbrev-table))
> 
>  I tried to find guidance on this outside of hacking abbrev tables manually to be shared. Perhaps
>  other people have the same expectation.

kobarity, any comments?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72298; Package emacs. (Sat, 24 Aug 2024 11:32:01 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>, Ship Mints <shipmints <at> gmail.com>
Cc: 72298 <at> debbugs.gnu.org
Subject: Re: bug#72298: Should python-mode-abbrev-table declare :parents
 python-base-mode-abbrev-table?
Date: Sat, 24 Aug 2024 20:29:32 +0900
[Message part 1 (text/plain, inline)]
Eli Zaretskii wrote:
> 
> > From: Ship Mints <shipmints <at> gmail.com>
> > Date: Sat, 17 Aug 2024 09:53:15 -0400
> > 
> > Greetings. Curious if I'm barking up the wrong tree with this assessment...
> > 
> > On Thu, Jul 25, 2024 at 2:33 PM Ship Mints <shipmints <at> gmail.com> wrote:
> > 
> >  An example of a personal hack to make this work could be to add something like this to a
> >  python-mode-hook:
> > 
> >  (if (derived-mode-p 'python-base-mode)
> >    (setq local-abbrev-table python-base-mode-abbrev-table))
> > 
> >  On Thu, Jul 25, 2024 at 2:15 PM Ship Mints <shipmints <at> gmail.com> wrote:
> > 
> >  I was expecting that python-base-mode-abbrev-table would apply to both python-mode and
> >  python-ts-mode buffers. python-ts-mode doesn't derive from python-mode so the abbrev tables
> >  aren't shared by default. Unless I'm missing something, using a base table doesn't work for me.
> > 
> >  (define-abbrev-table 'python-mode-abbrev-table ()
> >    "Abbrev table for Python mode."
> >  ;; should this:
> >    :parents (list python-mode-skeleton-abbrev-table))
> >  ;; be defined thusly?
> >    :parents (list python-base-mode-abbrev-table python-mode-skeleton-abbrev-table))
> > 
> >  I tried to find guidance on this outside of hacking abbrev tables manually to be shared. Perhaps
> >  other people have the same expectation.
> 
> kobarity, any comments?

It seems to me that the skeletons should be defined in
python-base-mode.  How about the attached patch?
[0001-Make-Python-skeletons-available-in-python-ts-mode-as.patch (application/octet-stream, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72298; Package emacs. (Sat, 24 Aug 2024 14:18:02 GMT) Full text and rfc822 format available.

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

From: Ship Mints <shipmints <at> gmail.com>
To: kobarity <kobarity <at> gmail.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 72298 <at> debbugs.gnu.org
Subject: Re: bug#72298: Should python-mode-abbrev-table declare :parents
 python-base-mode-abbrev-table?
Date: Sat, 24 Aug 2024 10:14:57 -0400
[Message part 1 (text/plain, inline)]
Thank you. Will save confusion for people.

On Sat, Aug 24, 2024 at 7:30 AM kobarity <kobarity <at> gmail.com> wrote:

> Eli Zaretskii wrote:
> >
> > > From: Ship Mints <shipmints <at> gmail.com>
> > > Date: Sat, 17 Aug 2024 09:53:15 -0400
> > >
> > > Greetings. Curious if I'm barking up the wrong tree with this
> assessment...
> > >
> > > On Thu, Jul 25, 2024 at 2:33 PM Ship Mints <shipmints <at> gmail.com>
> wrote:
> > >
> > >  An example of a personal hack to make this work could be to add
> something like this to a
> > >  python-mode-hook:
> > >
> > >  (if (derived-mode-p 'python-base-mode)
> > >    (setq local-abbrev-table python-base-mode-abbrev-table))
> > >
> > >  On Thu, Jul 25, 2024 at 2:15 PM Ship Mints <shipmints <at> gmail.com>
> wrote:
> > >
> > >  I was expecting that python-base-mode-abbrev-table would apply to
> both python-mode and
> > >  python-ts-mode buffers. python-ts-mode doesn't derive from
> python-mode so the abbrev tables
> > >  aren't shared by default. Unless I'm missing something, using a base
> table doesn't work for me.
> > >
> > >  (define-abbrev-table 'python-mode-abbrev-table ()
> > >    "Abbrev table for Python mode."
> > >  ;; should this:
> > >    :parents (list python-mode-skeleton-abbrev-table))
> > >  ;; be defined thusly?
> > >    :parents (list python-base-mode-abbrev-table
> python-mode-skeleton-abbrev-table))
> > >
> > >  I tried to find guidance on this outside of hacking abbrev tables
> manually to be shared. Perhaps
> > >  other people have the same expectation.
> >
> > kobarity, any comments?
>
> It seems to me that the skeletons should be defined in
> python-base-mode.  How about the attached patch?
>
[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#72298; Package emacs. (Sun, 25 Aug 2024 00:37:02 GMT) Full text and rfc822 format available.

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

From: kobarity <kobarity <at> gmail.com>
To: Ship Mints <shipmints <at> gmail.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 72298 <at> debbugs.gnu.org
Subject: Re: bug#72298: Should python-mode-abbrev-table declare :parents
 python-base-mode-abbrev-table?
Date: Sun, 25 Aug 2024 09:34:19 +0900
[Message part 1 (text/plain, inline)]
Ship Mints wrote:
> Thank you. Will save confusion for people.

Thank you for your confirmation.

I forgot to include the bug ID in the commit message for the previous
patch, so I am attaching a revised version.  The patch itself has not
been changed.
[0001-Make-Python-skeletons-available-in-python-ts-mode-as.patch (application/octet-stream, attachment)]

Reply sent to Eli Zaretskii <eliz <at> gnu.org>:
You have taken responsibility. (Sat, 31 Aug 2024 09:45:01 GMT) Full text and rfc822 format available.

Notification sent to Ship Mints <shipmints <at> gmail.com>:
bug acknowledged by developer. (Sat, 31 Aug 2024 09:45:02 GMT) Full text and rfc822 format available.

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

From: Eli Zaretskii <eliz <at> gnu.org>
To: kobarity <kobarity <at> gmail.com>
Cc: shipmints <at> gmail.com, 72298-done <at> debbugs.gnu.org
Subject: Re: bug#72298: Should python-mode-abbrev-table declare :parents
 python-base-mode-abbrev-table?
Date: Sat, 31 Aug 2024 12:43:50 +0300
> Date: Sun, 25 Aug 2024 09:34:19 +0900
> From: kobarity <kobarity <at> gmail.com>
> Cc: 72298 <at> debbugs.gnu.org
> 
> Ship Mints wrote:
> > Thank you. Will save confusion for people.
> 
> Thank you for your confirmation.
> 
> I forgot to include the bug ID in the commit message for the previous
> patch, so I am attaching a revised version.  The patch itself has not
> been changed.

Thanks, installed on the emacs-30 branch, and closing the bug.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 28 Sep 2024 11:24:11 GMT) Full text and rfc822 format available.

This bug report was last modified 19 days ago.

Previous Next


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