GNU bug report logs - #73773
31.0.50; void-variable subword-mode in python-mode

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Sat, 12 Oct 2024 16:41:02 UTC

Severity: normal

Found in version 31.0.50

Done: Stephen Berman <stephen.berman <at> gmx.net>

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 73773 in the body.
You can then email your comments to 73773 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#73773; Package emacs. (Sat, 12 Oct 2024 16:41:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stephen Berman <stephen.berman <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 12 Oct 2024 16:41:02 GMT) Full text and rfc822 format available.

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

From: Stephen Berman <stephen.berman <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 31.0.50; void-variable subword-mode in python-mode
Date: Sat, 12 Oct 2024 17:47:20 +0200
[Message part 1 (text/plain, inline)]
0. emacs -Q
1. M-x menu-bar-mode (disable menu bar)
3. Visit a file in python-mode, e.g. modules/modhelp.py in the Emacs
   sources.
4. Pressing <f10> or C-mouse-3 pops up the global menu as usual.
5. M-x toggle-debug-on-error
6. Now pressing <f10> or C-mouse-3 does not pop up the global menu but
   instead a *Backtrace* buffer pops open displaying "Lisp error:
   (void-variable subword-mode)".

This is due to the following commit:

commit 29a760711731ce49965079e72d76b26ef3b7bcb4
Author:     Stefan Kangas <stefankangas <at> gmail.com>
AuthorDate: Sat Sep 21 14:07:29 2024 +0200
Commit:     Stefan Kangas <stefankangas <at> gmail.com>
CommitDate: Sat Sep 21 14:08:09 2024 +0200

  Add subword-mode toggle to python-mode menu

  * lisp/progmodes/python.el (python-mode-map): Add subword-mode
  toggle to menu.

The attached patch fixes this problem.


In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.43, cairo version 1.18.2) of 2024-10-12 built on strobelfssd
Repository revision: c3600916b6942b2a9797ec2248d29cb337c7c6fa
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101013
System Description: Linux From Scratch r12.2-17-systemd

Configured using:
 'configure -C 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt6/lib/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
[Message part 2 (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73773; Package emacs. (Sun, 13 Oct 2024 09:19:02 GMT) Full text and rfc822 format available.

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

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: 73773 <at> debbugs.gnu.org
Subject: Re: bug#73773: 31.0.50; void-variable subword-mode in python-mode
Date: Sun, 13 Oct 2024 09:17:36 +0000
Stephen Berman <stephen.berman <at> gmx.net> writes:

> 0. emacs -Q
> 1. M-x menu-bar-mode (disable menu bar)
> 3. Visit a file in python-mode, e.g. modules/modhelp.py in the Emacs
>    sources.
> 4. Pressing <f10> or C-mouse-3 pops up the global menu as usual.
> 5. M-x toggle-debug-on-error
> 6. Now pressing <f10> or C-mouse-3 does not pop up the global menu but
>    instead a *Backtrace* buffer pops open displaying "Lisp error:
>    (void-variable subword-mode)".
>
> This is due to the following commit:
>
> commit 29a760711731ce49965079e72d76b26ef3b7bcb4
> Author:     Stefan Kangas <stefankangas <at> gmail.com>
> AuthorDate: Sat Sep 21 14:07:29 2024 +0200
> Commit:     Stefan Kangas <stefankangas <at> gmail.com>
> CommitDate: Sat Sep 21 14:08:09 2024 +0200
>
>   Add subword-mode toggle to python-mode menu
>
>   * lisp/progmodes/python.el (python-mode-map): Add subword-mode
>   toggle to menu.
>
> The attached patch fixes this problem.
>
>
> In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
>  3.24.43, cairo version 1.18.2) of 2024-10-12 built on strobelfssd
> Repository revision: c3600916b6942b2a9797ec2248d29cb337c7c6fa
> Repository branch: master
> Windowing system distributor 'The X.Org Foundation', version 11.0.12101013
> System Description: Linux From Scratch r12.2-17-systemd
>
> Configured using:
>  'configure -C 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt6/lib/pkgconfig'
>
> Configured features:
> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
> LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
> RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
> WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
>
> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
> index 812e28268c2..4e3b18a327b 100644
> --- a/lisp/progmodes/python.el
> +++ b/lisp/progmodes/python.el
> @@ -361,6 +361,11 @@ python-mode-map
>    ;; Utilities
>    "<remap> <complete-symbol>" #'completion-at-point)
>
> +;; Define this so invoking menu-bar-open in a python-mode buffer does
> +;; not cause a void-variable error when subword-mode is not loaded,
> +;; menu-bar-mode is disabled and debug-on-error is enabled (bug#xxx).
> +(defvar subword-mode nil)
> +
>  (easy-menu-define python-menu python-mode-map
>    "Menu used for ´python-mode'."
>    '("Python"

Thanks, LGTM. I would move the comment to the commit message though.

Please install when you can.




Reply sent to Stephen Berman <stephen.berman <at> gmx.net>:
You have taken responsibility. (Sun, 13 Oct 2024 09:34:02 GMT) Full text and rfc822 format available.

Notification sent to Stephen Berman <stephen.berman <at> gmx.net>:
bug acknowledged by developer. (Sun, 13 Oct 2024 09:34:02 GMT) Full text and rfc822 format available.

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

From: Stephen Berman <stephen.berman <at> gmx.net>
To: Stefan Kangas <stefankangas <at> gmail.com>
Cc: 73773-done <at> debbugs.gnu.org
Subject: Re: bug#73773: 31.0.50; void-variable subword-mode in python-mode
Date: Sun, 13 Oct 2024 11:32:40 +0200
On Sun, 13 Oct 2024 09:17:36 +0000 Stefan Kangas <stefankangas <at> gmail.com> wrote:

> Stephen Berman <stephen.berman <at> gmx.net> writes:
>
>> 0. emacs -Q
>> 1. M-x menu-bar-mode (disable menu bar)
>> 3. Visit a file in python-mode, e.g. modules/modhelp.py in the Emacs
>>    sources.
>> 4. Pressing <f10> or C-mouse-3 pops up the global menu as usual.
>> 5. M-x toggle-debug-on-error
>> 6. Now pressing <f10> or C-mouse-3 does not pop up the global menu but
>>    instead a *Backtrace* buffer pops open displaying "Lisp error:
>>    (void-variable subword-mode)".
>>
>> This is due to the following commit:
>>
>> commit 29a760711731ce49965079e72d76b26ef3b7bcb4
>> Author:     Stefan Kangas <stefankangas <at> gmail.com>
>> AuthorDate: Sat Sep 21 14:07:29 2024 +0200
>> Commit:     Stefan Kangas <stefankangas <at> gmail.com>
>> CommitDate: Sat Sep 21 14:08:09 2024 +0200
>>
>>   Add subword-mode toggle to python-mode menu
>>
>>   * lisp/progmodes/python.el (python-mode-map): Add subword-mode
>>   toggle to menu.
>>
>> The attached patch fixes this problem.
>>
>>
>> In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
>>  3.24.43, cairo version 1.18.2) of 2024-10-12 built on strobelfssd
>> Repository revision: c3600916b6942b2a9797ec2248d29cb337c7c6fa
>> Repository branch: master
>> Windowing system distributor 'The X.Org Foundation', version 11.0.12101013
>> System Description: Linux From Scratch r12.2-17-systemd
>>
>> Configured using:
>>  'configure -C 'CFLAGS=-Og -g3' PKG_CONFIG_PATH=/opt/qt6/lib/pkgconfig'
>>
>> Configured features:
>> ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
>> LCMS2 LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG
>> RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER
>> WEBP X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB
>>
>> diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
>> index 812e28268c2..4e3b18a327b 100644
>> --- a/lisp/progmodes/python.el
>> +++ b/lisp/progmodes/python.el
>> @@ -361,6 +361,11 @@ python-mode-map
>>    ;; Utilities
>>    "<remap> <complete-symbol>" #'completion-at-point)
>>
>> +;; Define this so invoking menu-bar-open in a python-mode buffer does
>> +;; not cause a void-variable error when subword-mode is not loaded,
>> +;; menu-bar-mode is disabled and debug-on-error is enabled (bug#xxx).
>> +(defvar subword-mode nil)
>> +
>>  (easy-menu-define python-menu python-mode-map
>>    "Menu used for ´python-mode'."
>>    '("Python"
>
> Thanks, LGTM. I would move the comment to the commit message though.

Sure, done.

> Please install when you can.

Thanks, done in commit 9a110c390dc and closing the bug.

Steve Berman




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

This bug report was last modified 280 days ago.

Previous Next


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