[bug] loading python-mode opens python-mode.el

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[bug] loading python-mode opens python-mode.el

Yagnesh Raghava Yakkala

Hello,

I checked python-mode trunk from few days from launchpad and I
found that whenever I open new emacs I see a buffer with python-mode.el.
and with emacs -Q

the reproduce.
,----
| emacs -Q
| M-x load-file highlight-indentation.el
| M-x load-file python-mode.el
| M-x list-buffers
`----
you can see a buffer called python.el.gz opened.

git bisect gives me this change
,----
| a1ad7275 * fixes lp:888338, keywords in identifiers are highlighted incorrectly
`----

but this huge commit.

--
YYR

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: [bug] loading python-mode opens python-mode.el

Barry Warsaw
On Dec 07, 2011, at 12:35 AM, [hidden email] wrote:

>I checked python-mode trunk from few days from launchpad and I
>found that whenever I open new emacs I see a buffer with python-mode.el.
>and with emacs -Q

You know, I just started noticing this myself.  Please submit a bug and I'm
sure Andreas will fix it soon.

-Barry
_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: [bug] loading python-mode opens python-mode.el

Yagnesh Raghava Yakkala
Barry Warsaw <[hidden email]> writes:

> On Dec 07, 2011, at 12:35 AM, [hidden email] wrote:
>
>>I checked python-mode trunk from few days from launchpad and I
>>found that whenever I open new emacs I see a buffer with python-mode.el.
>>and with emacs -Q
>
> You know, I just started noticing this myself.  Please submit a bug and I'm
> sure Andreas will fix it soon.

report submitted https://bugs.launchpad.net/python-mode/+bug/900847

further more;
I think I narrowed the problem.
on line number 556 there is call find-function-noselect, which makes
this happen.

>
> -Barry


--
YYR

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: [patch] loading python-mode opens python-mode.el

Yagnesh Raghava Yakkala
Yagnesh Raghava Yakkala <[hidden email]> writes:

> Barry Warsaw <[hidden email]> writes:
>
>> On Dec 07, 2011, at 12:35 AM, [hidden email] wrote:
>>
>>>I checked python-mode trunk from few days from launchpad and I
>>>found that whenever I open new emacs I see a buffer with python-mode.el.
>>>and with emacs -Q
>>
>> You know, I just started noticing this myself.  Please submit a bug and I'm
>> sure Andreas will fix it soon.
>
> report submitted https://bugs.launchpad.net/python-mode/+bug/900847
>
> further more;
> I think I narrowed the problem.
> on line number 556 there is call find-function-noselect, which makes
> this happen.
>
>>
>> -Barry
This patch seems to fix the problem. Though I dont believe my elisp.


diff --git a/python-mode.el b/python-mode.el
index b4cd5f1..8301964 100644
--- a/python-mode.el
+++ b/python-mode.el
@@ -553,7 +553,7 @@ If `py-install-directory' isn't set, guess from buffer-file-name. "
          (add-to-list 'load-path (concat (expand-file-name py-install-directory) "/test"))
          (add-to-list 'load-path (concat (expand-file-name py-install-directory) "/tools")))
         (t (setq py-install-directory
-                 (file-name-directory (buffer-file-name (car (find-function-noselect 'python-mode)))))))
+                 (file-name-directory (locate-library "python-mode")))))
   (when (interactive-p) (message "%s" load-path)))
 
 (py-set-load-path)


--
YYR

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: [patch] loading python-mode opens python-mode.el

Andreas Röhler-2
Am 06.12.2011 19:06, schrieb Yagnesh Raghava Yakkala:

> Yagnesh Raghava Yakkala<[hidden email]>  writes:
>
>> Barry Warsaw<[hidden email]>  writes:
>>
>>> On Dec 07, 2011, at 12:35 AM, [hidden email] wrote:
>>>
>>>> I checked python-mode trunk from few days from launchpad and I
>>>> found that whenever I open new emacs I see a buffer with python-mode.el.
>>>> and with emacs -Q
>>>
>>> You know, I just started noticing this myself.  Please submit a bug and I'm
>>> sure Andreas will fix it soon.
>>
>> report submitted https://bugs.launchpad.net/python-mode/+bug/900847
>>
>> further more;
>> I think I narrowed the problem.
>> on line number 556 there is call find-function-noselect, which makes
>> this happen.
>>
>>>
>>> -Barry
>
> This patch seems to fix the problem. Though I dont believe my elisp.
>

Hi,

thanks a lot investigating this.

Think will drop the whole thing --trying to guess the path from file
loading-- is error prone anyway.

If Emacs encounters

  (file-name-directory (locate-library "python-mode"))

before python-mode is loaded, an error will result.

OTOH if python-mode is already present, it must not be the one we need
for subdirectories. Does not make sense to store the path from here.

Will update the INSTALL instead requiring settings before.

BTW as completion from Pymacs isn't used for the moment, think it's a
truly stand-alone still.

Andreas








Andreas








_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode
Reply | Threaded
Open this post in threaded view
|

Re: [patch] loading python-mode opens python-mode.el

Yagnesh Raghava Yakkala
Hello Andreas,
apologies for late reply.,

Andreas Röhler <[hidden email]> writes:

>
> Think will drop the whole thing --trying to guess the path from file
> loading-- is error prone anyway.
>
> If Emacs encounters
>
>  (file-name-directory (locate-library "python-mode"))
> before python-mode is loaded, an error will result.

yes, I can see where it fails. I saw your fix on launchpad, Thanks for that.

However it seems emacs will set a variable `load-file-name' when a file being
loaded.  So a reliable way to get the folder name might be:

(file-name-directory load-file-name)

--
YYR

_______________________________________________
Python-mode mailing list
[hidden email]
http://mail.python.org/mailman/listinfo/python-mode