all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#73773: 31.0.50; void-variable subword-mode in python-mode
@ 2024-10-12 15:47 Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-10-13  9:17 ` Stefan Kangas
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-10-12 15:47 UTC (permalink / raw)
  To: 73773

[-- Attachment #1: Type: text/plain, Size: 1607 bytes --]

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@gmail.com>
AuthorDate: Sat Sep 21 14:07:29 2024 +0200
Commit:     Stefan Kangas <stefankangas@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

[-- Attachment #2: python.el patch for subword-mode --]
[-- Type: text/x-patch, Size: 626 bytes --]

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"

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* bug#73773: 31.0.50; void-variable subword-mode in python-mode
  2024-10-12 15:47 bug#73773: 31.0.50; void-variable subword-mode in python-mode Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-10-13  9:17 ` Stefan Kangas
  2024-10-13  9:32   ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Kangas @ 2024-10-13  9:17 UTC (permalink / raw)
  To: Stephen Berman; +Cc: 73773

Stephen Berman <stephen.berman@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@gmail.com>
> AuthorDate: Sat Sep 21 14:07:29 2024 +0200
> Commit:     Stefan Kangas <stefankangas@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.





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#73773: 31.0.50; void-variable subword-mode in python-mode
  2024-10-13  9:17 ` Stefan Kangas
@ 2024-10-13  9:32   ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-10-13  9:32 UTC (permalink / raw)
  To: Stefan Kangas; +Cc: 73773-done

On Sun, 13 Oct 2024 09:17:36 +0000 Stefan Kangas <stefankangas@gmail.com> wrote:

> Stephen Berman <stephen.berman@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@gmail.com>
>> AuthorDate: Sat Sep 21 14:07:29 2024 +0200
>> Commit:     Stefan Kangas <stefankangas@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





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-13  9:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-12 15:47 bug#73773: 31.0.50; void-variable subword-mode in python-mode Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-13  9:17 ` Stefan Kangas
2024-10-13  9:32   ` Stephen Berman via Bug reports for GNU Emacs, the Swiss army knife of text editors

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.