Yagnesh Raghava Yakkala | 30 Jan 14:09 2012

[BUG] loading Semantic changing python mode preference


Hello list.,

I use python-mode.el for editing Python files not the one(python.el)
that comes with the GNU Emacs.

But if I load CEDET, my preference is being overwritten. I think the
following line in  "lisp/cedet/semantic/wisent/python.el" file causing this
problems.

,----
| ;; Try to load python support, but fail silently since it is only used
| ;; for optional functionality
| (require 'python nil t)
`----

possible fix?

diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el
index 50ed45d..fe08b6c 100644
--- a/lisp/cedet/semantic/wisent/python.el
+++ b/lisp/cedet/semantic/wisent/python.el
 <at>  <at>  -32,7 +32,7  <at>  <at> 

 ;; Try to load python support, but fail silently since it is only used
 ;; for optional functionality
-(require 'python nil t)
+(load (symbol-file 'python-mode 'defun))

 (require 'semantic/wisent)
(Continue reading)

emacs18 | 31 Jan 05:03 2012
Picon

Re: [BUG] loading Semantic changing python mode preference

Yagnesh Raghava Yakkala <yagnesh <at> live.com> writes:

> Hello list.,
>
> I use python-mode.el for editing Python files not the one(python.el)
> that comes with the GNU Emacs.
>
> But if I load CEDET, my preference is being overwritten. I think the
> following line in  "lisp/cedet/semantic/wisent/python.el" file causing this
> problems.
>
> ,----
> | ;; Try to load python support, but fail silently since it is only used
> | ;; for optional functionality
> | (require 'python nil t)
> `----
>
> possible fix?
>
> diff --git a/lisp/cedet/semantic/wisent/python.el b/lisp/cedet/semantic/wisent/python.el
> index 50ed45d..fe08b6c 100644
> --- a/lisp/cedet/semantic/wisent/python.el
> +++ b/lisp/cedet/semantic/wisent/python.el
>  <at>  <at>  -32,7 +32,7  <at>  <at> 
>  
>  ;; Try to load python support, but fail silently since it is only used
>  ;; for optional functionality
> -(require 'python nil t)
> +(load (symbol-file 'python-mode 'defun))
>  
(Continue reading)

Yagnesh Raghava Yakkala | 31 Jan 07:54 2012

Re: [BUG] loading Semantic changing python mode preference


Hello,
Thanks for the reply.,

emacs18 <at> gmail.com writes:
[...]

> Having said this I'm not sure whether this is a worthwhile change,
> because the patch above is just a first step to support python-mode.el.
> Further work seems to be needed to fix other problems, e.g.,
> wisent/python.el calls `python-proc' function which is defined in
> python.el but not in python-mode.el.
>
> I'm afraid that there may be other issues to deal with.
> Given that lisp/progmodes/python.el and lisp/cedet/semantic/wisent/python.el
> are both part of GNU emacs, further coupling between the two may arise
> in the future.  Also I'm not sure that the official GNU emacs maintainers
> would be willing to accept changes that complicate the code to support 
> non-standard elisp packages that largely duplicate what is already in
> GNU emacs.
>
> If you really want to add support for python-mode.el in cedet, the
> best chance may be to port part of python-mode.el that you like and
> make them be add-on enhancements to lisp/progmodes/python.el.
>
> By the way what does python-model.el provide that you are willing to go
> through this trouble to use it instead of lisp/progmodes/python.el?  I
> do not have a good understanding of the features provided by either
> python files.

(Continue reading)

Eric M. Ludlam | 5 Feb 18:02 2012
Picon

Re: [BUG] loading Semantic changing python mode preference

Hi,

Thanks for the detailed analysis Richard.  I like your suggestions 
regarding this patch.

Since python.el is part of Emacs, and python-mode is outside that, I 
think support for python-mode for CEDE could just be part of 
python-mode, or an external support file in contrib.  (ie - if you want 
to use python-mode, you might add this to your .emacs:

(load-file "/path/to/cedet/common/cedet.el")
(require 'cedet-python-mode)

and have that setup the environment.  One thing the support file might 
do is:

(require 'python-mode)
(provide 'python)

to trick wisent-python into doing the right thing for you.  It sounds 
like, from Richard's view, that there is some additional support needed 
that could be added for python-proc.

Does this make sense?
Eric

On 01/30/2012 11:03 PM, Richard Kim wrote:
> Yagnesh Raghava Yakkala<yagnesh <at> live.com>  writes:
>
>> Hello list.,
(Continue reading)


Gmane