all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* python mode
@ 2006-04-22  8:28 Gary Wessle
  2006-04-22  9:03 ` Peter Dyballa
                   ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Gary Wessle @ 2006-04-22  8:28 UTC (permalink / raw)


Hi

I opened a file.py but emacs 21.4.1 on debian testing didn't switch
the mode to the python mode. what do I need to do to fix this. 


http://www.emacswiki.org/cgi-bin/wiki/PythonMode
Gnu emacs post 21 has its own python mode (python.el). This is enabled
by default for .py files so you don\u2019t have to add anything to
your .emacs to use it.


thanks

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-22  8:28 python mode Gary Wessle
@ 2006-04-22  9:03 ` Peter Dyballa
       [not found] ` <mailman.763.1145696607.9609.help-gnu-emacs@gnu.org>
  2006-04-24  8:48 ` Stefan Monnier
  2 siblings, 0 replies; 17+ messages in thread
From: Peter Dyballa @ 2006-04-22  9:03 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 22.04.2006 um 10:28 schrieb Gary Wessle:

> I opened a file.py but emacs 21.4.1 on debian testing didn't switch
> the mode to the python mode. what do I need to do to fix this.

Check auto-mode-alist. If it does not contain an entry for Python  
files or the wrong mode correct this with something like:

	(add-to-list 'auto-mode-alist '("\\.py\\'"	 . python-mode))

--
Greetings

   Pete

»¿ʇı̣ əsnqɐ ʇ,uɐɔ noʎ ɟı̣
ɓuı̣ɥʇʎuɐ sı̣ pooɓ ʇɐɥʍ«

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
       [not found] ` <mailman.763.1145696607.9609.help-gnu-emacs@gnu.org>
@ 2006-04-22  9:28   ` Gary Wessle
  2006-04-22 10:18     ` Peter Dyballa
       [not found]     ` <mailman.764.1145701120.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 17+ messages in thread
From: Gary Wessle @ 2006-04-22  9:28 UTC (permalink / raw)


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 22.04.2006 um 10:28 schrieb Gary Wessle:
> 
> > I opened a file.py but emacs 21.4.1 on debian testing didn't switch
> > the mode to the python mode. what do I need to do to fix this.
> 
> Check auto-mode-alist. If it does not contain an entry for Python
> files or the wrong mode correct this with something like:
> 
> 	(add-to-list 'auto-mode-alist '("\\.py\\'"	 . python-mode))
> 

I placed the line you suggested in my .emacs and load-file .emacs
then opened my.py file but I am getting
file mode specification error: (void function  python-mode)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-22  9:28   ` Gary Wessle
@ 2006-04-22 10:18     ` Peter Dyballa
       [not found]     ` <mailman.764.1145701120.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 17+ messages in thread
From: Peter Dyballa @ 2006-04-22 10:18 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 22.04.2006 um 11:28 schrieb Gary Wessle:

> I placed the line you suggested in my .emacs and load-file .emacs
> then opened my.py file but I am getting
> file mode specification error: (void function  python-mode)

So you first need to load or require your Elisp file with the  
definition of python-mode in it.

--
Greetings

   Pete

"What do you think of Western Civilisation?"
  "I think it would be a good idea!"
     - Mohandas Karamchand Gandhi

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
       [not found]     ` <mailman.764.1145701120.9609.help-gnu-emacs@gnu.org>
@ 2006-04-22 10:34       ` Gary Wessle
  2006-04-22 11:11         ` Peter Dyballa
       [not found]         ` <mailman.767.1145704577.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 17+ messages in thread
From: Gary Wessle @ 2006-04-22 10:34 UTC (permalink / raw)


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 22.04.2006 um 11:28 schrieb Gary Wessle:
> 
> > I placed the line you suggested in my .emacs and load-file .emacs
> > then opened my.py file but I am getting
> > file mode specification error: (void function  python-mode)
> 
> So you first need to load or require your Elisp file with the
> definition of python-mode in it.

I thought that python.el file is included in the installed emacs as it
has been indicated in the wiki, do I need to get it and place it in
where the other .el files are?

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-22 10:34       ` Gary Wessle
@ 2006-04-22 11:11         ` Peter Dyballa
       [not found]         ` <mailman.767.1145704577.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 17+ messages in thread
From: Peter Dyballa @ 2006-04-22 11:11 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 22.04.2006 um 12:34 schrieb Gary Wessle:

> I thought that python.el file is included in the installed emacs as it
> has been indicated in the wiki, do I need to get it and place it in
> where the other .el files are?

In my distributions of GNU Emacsen the standard python.el file is  
located in lisp/progmodes. The file is not (pre-)loaded by default,  
it must be loaded when needed as for example htmlize-view or AUCTeX  
or preview-latex etc. If an Elisp file has a provide statement, you  
can require it, otherwise you need to load if. You can you use the  
autoload function to load an Elisp automatically when it's needed,  
maybe this way:

	(autoload 'python-mode "python" "Handle Python files appropriately." t)

But actually such a finesse is not needed since GNU Emacs loads the  
code into memory late, when actually needed for to do specific work.  
So a simple load or require statement in .emacs is good enough.

--
Greetings

   Pete

There is no national science just as there is no national
multiplication table; what is national is no longer science.
          -- Anton Checov

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
       [not found]         ` <mailman.767.1145704577.9609.help-gnu-emacs@gnu.org>
@ 2006-04-22 20:08           ` Gary Wessle
  2006-04-22 21:10             ` Peter Dyballa
       [not found]             ` <mailman.790.1145740262.9609.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 17+ messages in thread
From: Gary Wessle @ 2006-04-22 20:08 UTC (permalink / raw)


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 22.04.2006 um 12:34 schrieb Gary Wessle:
> 
> > I thought that python.el file is included in the installed emacs as it
> > has been indicated in the wiki, do I need to get it and place it in
> > where the other .el files are?
> 
> In my distributions of GNU Emacsen the standard python.el file is
> located in lisp/progmodes. 

in my debian testing system
# locate python.el
/usr/share/emacs/site-lisp/semantic/wisent/wisent-python.el

the file python.el does not exist.

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-22 20:08           ` Gary Wessle
@ 2006-04-22 21:10             ` Peter Dyballa
       [not found]             ` <mailman.790.1145740262.9609.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 17+ messages in thread
From: Peter Dyballa @ 2006-04-22 21:10 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 22.04.2006 um 22:08 schrieb Gary Wessle:

> in my debian testing system
> # locate python.el
> /usr/share/emacs/site-lisp/semantic/wisent/wisent-python.el

So try this! If it's not sufficient get GNU Emacs source and compile,  
if you can't find a useful deb package! Check load-path whether it  
contains /usr/share/emacs/site-lisp/semantic/wisent, otherwise you  
would need add this component. ( (add-to-list 'load-path "...") )

BTW, you've located the wisent-python.el file in the site-lisp tree.  
So this is definitely not a GNU Emacs file, but something specific to  
your system. The GNU Emacs one would be in /usr/local/share/emacs/ 
<version number>/lisp/progmodes ...

--
Greetings

   Pete

"Isn't vi that text editor with two modes... one that beeps and one
that corrupts your file?" -- Dan Jacobson, on comp.os.linux.advocacy

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
       [not found]             ` <mailman.790.1145740262.9609.help-gnu-emacs@gnu.org>
@ 2006-04-23 11:53               ` Gary Wessle
  2006-04-23 12:54                 ` Peter Dyballa
  0 siblings, 1 reply; 17+ messages in thread
From: Gary Wessle @ 2006-04-23 11:53 UTC (permalink / raw)


Peter Dyballa <Peter_Dyballa@Web.DE> writes:

> Am 22.04.2006 um 22:08 schrieb Gary Wessle:
> 
> > in my debian testing system
> > # locate python.el
> > /usr/share/emacs/site-lisp/semantic/wisent/wisent-python.el
> 
> So try this! If it's not sufficient get GNU Emacs source and compile,
> if you can't find a useful deb package! Check load-path whether it
> contains /usr/share/emacs/site-lisp/semantic/wisent, otherwise you
> would need add this component. ( (add-to-list 'load-path "...") )
> 
> BTW, you've located the wisent-python.el file in the site-lisp tree.
> So this is definitely not a GNU Emacs file, but something specific to
> your system. The GNU Emacs one would be in /usr/local/share/emacs/
> <version number>/lisp/progmodes ...

the one that comes close is  "/usr/share/emacs/21.4/lisp/progmodes"
in it there is no file about python-mode.elc or any thing for python
for that matter. with debian, I'd rather not start compiling my own
emacs from source because my in-ability to understand how the rest of
the system interact with emacs and visa-versa and how to satisfy that
not to have any future problems. I got python-mode-1.0.tar.gz and in
it there is 
doctest-mode.el  
pycomplete.el	
pycomplete.py  
python-mode.el
semantic.cache

should I just move python-mode.el to ../progmodes/ and compile? as it
said in the installation instruction in python-mode.el?
if so, could you tell me how to compile the file so that it is .elc
like all the other files in progmodes?

thank you

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-23 11:53               ` Gary Wessle
@ 2006-04-23 12:54                 ` Peter Dyballa
  0 siblings, 0 replies; 17+ messages in thread
From: Peter Dyballa @ 2006-04-23 12:54 UTC (permalink / raw)
  Cc: help-gnu-emacs


Am 23.04.2006 um 13:53 schrieb Gary Wessle:

> I got python-mode-1.0.tar.gz and in it there is
> doctest-mode.el
> pycomplete.el	
> pycomplete.py
> python-mode.el
> semantic.cache
>
> should I just move python-mode.el to ../progmodes/ and compile?

No, you better put them all into a place like the site-lisp tree so  
that they survive a GNU Emacs update! And these files do not seem to  
be a regular part of an Emacs distribution, so they're better stored  
outside.

In dired-mode you can mark the .el files and command B, which will  
byte-compile them.

--
Greetings

   Pete

Make it simple, as simple as possible but no simpler. (Albert Einstein)

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-22  8:28 python mode Gary Wessle
  2006-04-22  9:03 ` Peter Dyballa
       [not found] ` <mailman.763.1145696607.9609.help-gnu-emacs@gnu.org>
@ 2006-04-24  8:48 ` Stefan Monnier
  2006-04-24 10:11   ` Tim X
  2 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2006-04-24  8:48 UTC (permalink / raw)


> I opened a file.py but emacs 21.4.1 on debian testing didn't switch
> the mode to the python mode. what do I need to do to fix this.


> http://www.emacswiki.org/cgi-bin/wiki/PythonMode
> Gnu Emacs post 21 has its own python mode (python.el).

Emacs-21.4 is in the family "Emacs-21", so it's not *post*-Emacs-21.
There is no released Emacs version with built-in python mode.  You can use
Emacs-CVS or install python.el manually.


        Stefan

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-24  8:48 ` Stefan Monnier
@ 2006-04-24 10:11   ` Tim X
  2006-04-25  8:27     ` tomás zerolo
  2006-04-25 11:32     ` Gary Wessle
  0 siblings, 2 replies; 17+ messages in thread
From: Tim X @ 2006-04-24 10:11 UTC (permalink / raw)


Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> I opened a file.py but emacs 21.4.1 on debian testing didn't switch
>> the mode to the python mode. what do I need to do to fix this.
>
>
>> http://www.emacswiki.org/cgi-bin/wiki/PythonMode
>> Gnu Emacs post 21 has its own python mode (python.el).
>
> Emacs-21.4 is in the family "Emacs-21", so it's not *post*-Emacs-21.
> There is no released Emacs version with built-in python mode.  You can use
> Emacs-CVS or install python.el manually.
>
>

also, Debian 'unstable' has emacs-snapshot, which is the latest CVS
emacs and is updated approximately weekly. I've been using it
exclusively as my emacs for the past month and it works very nicely. 

My base system is Debian testing (etch), but I have unstable apt
repositories in my apt sources file (and a apt setting specifying that
testing is my preferred distribution). This prevents apt-get from
trying to update all of the packages in unstable - once you choose a
package from unstable, it will only install whatever prerequisites
that package needs from unstable and then only upgrade those when
necessary - outcome is you can use package from both testing and
unstable (but don't get too carried away!). 

Tim


-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-24 10:11   ` Tim X
@ 2006-04-25  8:27     ` tomás zerolo
  2006-04-25 11:32     ` Gary Wessle
  1 sibling, 0 replies; 17+ messages in thread
From: tomás zerolo @ 2006-04-25  8:27 UTC (permalink / raw)



sudo apt-get install python-mode

HTH
-- tomás

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-24 10:11   ` Tim X
  2006-04-25  8:27     ` tomás zerolo
@ 2006-04-25 11:32     ` Gary Wessle
  2006-04-25 21:50       ` maru dubshinki
                         ` (2 more replies)
  1 sibling, 3 replies; 17+ messages in thread
From: Gary Wessle @ 2006-04-25 11:32 UTC (permalink / raw)


Tim X <timx@nospam.dev.null> writes:

> Stefan Monnier <monnier@iro.umontreal.ca> writes:
> 
> >> I opened a file.py but emacs 21.4.1 on debian testing didn't switch
> >> the mode to the python mode. what do I need to do to fix this.
> >
> >
> >> http://www.emacswiki.org/cgi-bin/wiki/PythonMode
> >> Gnu Emacs post 21 has its own python mode (python.el).
> >
> > Emacs-21.4 is in the family "Emacs-21", so it's not *post*-Emacs-21.
> > There is no released Emacs version with built-in python mode.  You can use
> > Emacs-CVS or install python.el manually.
> >
> >
> 
> also, Debian 'unstable' has emacs-snapshot, which is the latest CVS
> emacs and is updated approximately weekly. I've been using it
> exclusively as my emacs for the past month and it works very nicely. 
> 
> My base system is Debian testing (etch), but I have unstable apt
> repositories in my apt sources file (and a apt setting specifying that
> testing is my preferred distribution). This prevents apt-get from
> trying to update all of the packages in unstable - once you choose a
> package from unstable, it will only install whatever prerequisites
> that package needs from unstable and then only upgrade those when
> necessary - outcome is you can use package from both testing and
> unstable (but don't get too carried away!). 
> 
> Tim
> 
> 
> -- 
> tcross (at) rapttech dot com dot au
could you post your resource.list file?

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-25 11:32     ` Gary Wessle
@ 2006-04-25 21:50       ` maru dubshinki
  2006-04-25 22:10       ` Tim X
  2006-04-26  8:25       ` tomás zerolo
  2 siblings, 0 replies; 17+ messages in thread
From: maru dubshinki @ 2006-04-25 21:50 UTC (permalink / raw)


On 25 Apr 2006 21:32:17 +1000, Gary Wessle <phddas@yahoo.com> wrote:
> Tim X <timx@nospam.dev.null> writes:
> > Stefan Monnier <monnier@iro.umontreal.ca> writes:
....
> > My base system is Debian testing (etch), but I have unstable apt
> > repositories in my apt sources file (and a apt setting specifying that
> > testing is my preferred distribution). This prevents apt-get from
> > trying to update all of the packages in unstable - once you choose a
> > package from unstable, it will only install whatever prerequisites
> > that package needs from unstable and then only upgrade those when
> > necessary - outcome is you can use package from both testing and
> > unstable (but don't get too carried away!).
> >
> > Tim

>From /etc/apt/sources.list
deb http://mirrors.kernel.org/debian/ testing main non-free contrib
deb http://mirrors.kernel.org/debian/ unstable main non-free contrib
deb http://mirrors.kernel.org/debian/ stable main non-free contrib
deb http://ftp.debian.org/debian/ testing main non-free contrib
deb http://debian.lcs.mit.edu/debian/ testing main non-free contrib
deb http://lyre.mit.edu/debian/ testing main non-free contrib

>From /etc/apt/apt.conf:
APT::Default-Release "testing";

~maru

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-25 11:32     ` Gary Wessle
  2006-04-25 21:50       ` maru dubshinki
@ 2006-04-25 22:10       ` Tim X
  2006-04-26  8:25       ` tomás zerolo
  2 siblings, 0 replies; 17+ messages in thread
From: Tim X @ 2006-04-25 22:10 UTC (permalink / raw)


Gary Wessle <phddas@yahoo.com> writes:

> Tim X <timx@nospam.dev.null> writes:
>
>> Stefan Monnier <monnier@iro.umontreal.ca> writes:
>> 
>> >> I opened a file.py but emacs 21.4.1 on debian testing didn't switch
>> >> the mode to the python mode. what do I need to do to fix this.
>> >
>> >
>> >> http://www.emacswiki.org/cgi-bin/wiki/PythonMode
>> >> Gnu Emacs post 21 has its own python mode (python.el).
>> >
>> > Emacs-21.4 is in the family "Emacs-21", so it's not *post*-Emacs-21.
>> > There is no released Emacs version with built-in python mode.  You can use
>> > Emacs-CVS or install python.el manually.
>> >
>> >
>> 
>> also, Debian 'unstable' has emacs-snapshot, which is the latest CVS
>> emacs and is updated approximately weekly. I've been using it
>> exclusively as my emacs for the past month and it works very nicely. 
>> 
>> My base system is Debian testing (etch), but I have unstable apt
>> repositories in my apt sources file (and a apt setting specifying that
>> testing is my preferred distribution). This prevents apt-get from
>> trying to update all of the packages in unstable - once you choose a
>> package from unstable, it will only install whatever prerequisites
>> that package needs from unstable and then only upgrade those when
>> necessary - outcome is you can use package from both testing and
>> unstable (but don't get too carried away!). 
>> 
>> Tim
>> 
>> 
>> -- 
>> tcross (at) rapttech dot com dot au
> could you post your resource.list file?

Well, here is my sources.list file. It won't be much good to you
though as I use a private mirror, but should give you the picture -

deb http://www.mwolson.org/debian/ ./
deb ftp://mirror.internode.on.net/debian testing main contrib non-free
deb ftp://mirror.internode.on.net/debian unstable main contrib non-free

and my apt.conf is

APT {
	Default-Release "testing";
	Get {
		Fix-Broken "true";
		Show-Upgraded "true";
	};
};

Tim

-- 
tcross (at) rapttech dot com dot au

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: python mode
  2006-04-25 11:32     ` Gary Wessle
  2006-04-25 21:50       ` maru dubshinki
  2006-04-25 22:10       ` Tim X
@ 2006-04-26  8:25       ` tomás zerolo
  2 siblings, 0 replies; 17+ messages in thread
From: tomás zerolo @ 2006-04-26  8:25 UTC (permalink / raw)



It's -ahem- Ubuntu:

 +----------------------------------------------------------- 
 | deb http://de.archive.ubuntu.com/ubuntu breezy main multiverse restricted universe
 | deb-src http://de.archive.ubuntu.com/ubuntu breezy main multiverse restricted universe
 | 
 | deb http://de.archive.ubuntu.com/ubuntu breezy-updates main multiverse restricted universe
 | deb-src http://de.archive.ubuntu.com/ubuntu breezy-updates main multiverse restricted universe
 | 
 | deb http://security.ubuntu.com/ubuntu breezy-security main multiverse restricted universe
 | deb-src http://security.ubuntu.com/ubuntu breezy-security main multiverse restricted universe
 | 
 | # Backports + Extras
 | deb http://de.archive.ubuntu.com/ubuntu breezy-backports main universe multiverse restricted
 | deb http://archive.ubuntu.com/ubuntu breezy-backports main restricted universe multiverse
 +----------------------------------------------------------- 

But as others pointed out, it's on Debian testing

If you're on stable, I guess that installing by hand would be
the least hassle.

Regards
-- tomás

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2006-04-26  8:25 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-22  8:28 python mode Gary Wessle
2006-04-22  9:03 ` Peter Dyballa
     [not found] ` <mailman.763.1145696607.9609.help-gnu-emacs@gnu.org>
2006-04-22  9:28   ` Gary Wessle
2006-04-22 10:18     ` Peter Dyballa
     [not found]     ` <mailman.764.1145701120.9609.help-gnu-emacs@gnu.org>
2006-04-22 10:34       ` Gary Wessle
2006-04-22 11:11         ` Peter Dyballa
     [not found]         ` <mailman.767.1145704577.9609.help-gnu-emacs@gnu.org>
2006-04-22 20:08           ` Gary Wessle
2006-04-22 21:10             ` Peter Dyballa
     [not found]             ` <mailman.790.1145740262.9609.help-gnu-emacs@gnu.org>
2006-04-23 11:53               ` Gary Wessle
2006-04-23 12:54                 ` Peter Dyballa
2006-04-24  8:48 ` Stefan Monnier
2006-04-24 10:11   ` Tim X
2006-04-25  8:27     ` tomás zerolo
2006-04-25 11:32     ` Gary Wessle
2006-04-25 21:50       ` maru dubshinki
2006-04-25 22:10       ` Tim X
2006-04-26  8:25       ` tomás zerolo

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.