py-underscore-word-syntax-p customization has no effect

Bug #1100947 reported by Paul Pogonyshev
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler

Bug Description

Customization of the variable has no effect as long as python-mode-syntax-table is already defined. The only way to apply the customization is to somehow re-evaluate the variable (e.g. go to source code and C-M-x on it) which is 1) annoying, 2) requires you know Elisp at least to some extent. Worse yet, if you (require 'python-mode) above customization stuff (yes, as suggested in INSTALL), customization won't take effect even if you restart Emacs.

Customizations should take effect immediately or at least after I C-x r a buffer.

Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.1.1
importance: Undecided → Medium
status: New → In Progress
Changed in python-mode:
status: In Progress → Fix Committed
Revision history for this message
Paul Pogonyshev (doublep) wrote :

I don't quite see how this is fixed. Again, I have customized the variable so underscore is not part of a word, but this has no effect even after restarting Emacs.

Revision history for this message
Paul Pogonyshev (doublep) wrote :

May I propose this change?

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 1100947] Re: py-underscore-word-syntax-p customization has no effect

Am 18.01.2013 22:45, schrieb Paul Pogonyshev:
> May I propose this change?
>
> ** Patch added: "instantly modify python-mode-syntax-table if the variable is customized"
> https://bugs.launchpad.net/python-mode/+bug/1100947/+attachment/3488015/+files/1100947.diff
>

Great, thanks a lot.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Am 18.01.2013 22:12, schrieb Paul Pogonyshev:
> I don't quite see how this is fixed.

BTW provided a switch which toggles it for current session:
toggle-py-underscore-word-syntax-p

  Again, I have customized the
> variable

Switch doesn't work via defcustom.
Will add your solution BTW.

so underscore is not part of a word, but this has no effect
> even after restarting Emacs.
>

Changed in python-mode:
status: Fix Committed → In Progress
Revision history for this message
Paul Pogonyshev (doublep) wrote :

Just noticed that the patch references the function which is not yet defined when you eval the buffer for the first time (from 'require). So either relevant defun should be before defcustom, or you need to change :set value to not use not-yet-defined functions.

Revision history for this message
Andreas Roehler (a-roehler) wrote :

Am 19.01.2013 12:27, schrieb Paul Pogonyshev:
> Just noticed that the patch references the function which is not yet
> defined when you eval the buffer for the first time (from 'require). So
> either relevant defun should be before defcustom, or you need to change
> :set value to not use not-yet-defined functions.
>

Also introduced a defvar to start with

Changed in python-mode:
status: In Progress → Fix Committed
Changed in python-mode:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.