defalias does not provide backward-compatibility

Bug #870200 reported by Ryan Thompson
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-mode.el
Fix Released
High
Andreas Roehler

Bug Description

In python-mode.el version 6.0.4, there is this section of code:

;; backward compatibility
(defalias 'py-python-command 'py-shell-name)
(defalias 'py-jpython-command 'py-shell-name)
(defalias 'py-jython-command 'py-shell-name)
(defalias 'py-default-interpreter 'py-shell-name)
(defalias 'python-command 'py-shell-name)

However, "defalias" works only for functions, and all of those symbols are variables, so this "backward-compatibility" section actually has no effect at all, and packages like ipython.el that rely on backward-compatibility become broken. "defvaralias" should be used instead. Although the truly correct function to use is "define-obsolete-variable-alias", which requires a slightly different syntax.

Changed in python-mode:
assignee: nobody → Andreas Roehler (a-roehler)
importance: Undecided → High
milestone: none → 6.0.4
status: New → Confirmed
Revision history for this message
Thomas Caswell (tcaswell-gmail) wrote :

change defalias to defvaralias

The patch also includes a line removal from the py-execute-base because me and bzr still don't get along well

Revision history for this message
Andreas Roehler (a-roehler) wrote : Re: [Bug 870200] Re: defalias does not provide backward-compatibility

Am 07.10.2011 21:28, schrieb Thomas Caswell:
> change defalias to defvaralias
>
> The patch also includes a line removal from the py-execute-base because
> me and bzr still don't get along well
>
> ** Patch added: "defvar_fix.patch"
> https://bugs.launchpad.net/python-mode/+bug/870200/+attachment/2524291/+files/defvar_fix.patch
>

Hi Thomas,

unfortunately mail reporting your patch arrived only when checked in a
fix already.

BTW don't understand your change in py-execute-base...

Cheers,

Andreas

Changed in python-mode:
status: Confirmed → Fix Committed
Revision history for this message
Ryan Thompson (rct86) wrote :

It would probably be better to use "define-obsolete-variable-alias" instead of defvaralias. This would allow emacs to inform people that the variables are obsolete.

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

Am 08.10.2011 01:22, schrieb Ryan Thompson:
> It would probably be better to use "define-obsolete-variable-alias"
> instead of defvaralias. This would allow emacs to inform people that the
> variables are obsolete.
>

so it was checked in yesterday, you recommended that already and so I
did - :)

Thanks a lot BTW.

Andreas

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.