tuple unpacking highlighted incorrectly

Bug #961496 reported by Benjamin Peterson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
Medium
Andreas Roehler

Bug Description

For example:

foo, bar = toothpick

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

please tell what you get and what's wanted instead

Revision history for this message
Benjamin Peterson (benjaminp) wrote :

On my emacs, the left hand side is highlighted as yellow (I'm not sure what face this is) while every other identifier is black.

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 961496] Re: tuple unpacking highlighted incorrectly

Am 22.03.2012 13:06, schrieb Benjamin Peterson:
> On my emacs, the left hand side is highlighted as yellow (I'm not sure
> what face this is)

maybe try this little tool:

(defun ar-face-atpt ()
   "Report and return face at point. "
   (interactive)
   (let ((erg (get-char-property (point) 'face)))
     (when (interactive-p) (message "%s" erg))
     erg))

> while every other identifier is black.
>

don't get it see picture attached.

BTW can't find any string "yellow" in python-mode.el

Revision history for this message
Benjamin Peterson (benjaminp) wrote :

Here's a screenshot.

Revision history for this message
Barry Warsaw (barry) wrote :

On Mar 22, 2012, at 02:29 PM, Benjamin Peterson wrote:

>Here's a screenshot.
>
>** Attachment added: "highlight_bug.png"
> https://bugs.launchpad.net/python-mode/+bug/961496/+attachment/2916396/+files/highlight_bug.png

Benjamin, are you on r907? (current head as of this writing). Your example
highlights correctly for me now.

Revision history for this message
Benjamin Peterson (benjaminp) wrote :

It's still happening. It looks like the names in the tuple assignment have "font-lock-variable-name-face" and those outside have the default face.

Revision history for this message
Benjamin Peterson (benjaminp) wrote :

I have this in my init.el:

  (set-variable 'py-variable-name-face 'default)

BTW

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

probably you should remove that, its at best redundant

py-variable-name-face inherits already default face, unless you customize otherwise

its implemented like that:

(defface py-variable-name-face
  '((t (:inherit default)))
  "Face method decorators."
  :group 'python-mode)

Changed in python-mode:
status: New → Incomplete
Revision history for this message
Benjamin Peterson (benjaminp) wrote :

Removing that variable doesn't change the color. Do you know why the normal variable assignment and the tuple unpacking are getting different faces?

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

Am 23.03.2012 13:50, schrieb Benjamin Peterson:
> Removing that variable doesn't change the color. Do you know why the
> normal variable assignment and the tuple unpacking are getting different
> faces?
>

ahh, see the error now.

Presently font-lock-variable-name-face is used instead of py-variable-name-face

Changed in python-mode:
importance: Undecided → Medium
assignee: nobody → Andreas Roehler (a-roehler)
milestone: none → 6.0.6
status: Incomplete → Confirmed
Changed in python-mode:
status: Confirmed → Fix Committed
Revision history for this message
Benjamin Peterson (benjaminp) wrote :

Thank you. It works now.

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.