473,387 Members | 1,540 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

emacs for OS X

Hi all

My editor of choice on linux for python, bar none, is xemacs. I love the
python mode that detects a python file and handles indentation and
coloration for me automagically.

I have been using a powerbook for a while now, and I finally found emacs
for aqua in OS X Jaguar (10.2.8). I downloaded it from porkrind.com. The
version of emacs is 21.3 I believe. Anyway, not only does it *not*
detect python files automatically, but it tries to use fundamental mode
to handle them which is a pain in the ass. I want my coloring and
indentation back, damn it all!

I found python-mode.el in the python distribution folder, but not only
do I have no clue as to what to do with it, I can't find an emacs folder
or a .emac file. Just the emac program. Any help with this would be
greatly appreciated. If you have overcome this yourself I especially
want to hear from you.

In other news.....

I have a code question for you all. This one is a real trip. I am trying
to use NNTPLIB to download just the message numbers and "from" fields
for any specified number of messages I want, from 1 to 10,000. So far so
good. But when I play by the rules, I get unpredictable results. If I
ask for 20 from headers I get one. If I ask for 500, I get a couple. If
I ask for 6000, one time I might get 500, the next time I might get
2,300. It is very frustrating. Here is the code soundbite:

response, number_of_messages, first_available_message,
last_available_message, groupname = n.group(newsgroup)

###############
# Do we need to create run time files from server download?
# This section takes care of it if it needs to be done.

if dbuild_flag == 1 or fexist(database_shelve+".db") == 0:

# Retrieve and print From: information
# The NNTPlib xhdr routine returns a list of nested sublists. Each
# sulist contains a pair - message number, requested header in string
# form.

message_request = getinput("\nHow many posts should I be interested
in? [max 10,000]")

if int(message_request) > int(number_of_messages):
print "\nRequest exceeds current available message count.
Adjusting to %s posts" % number_of_messages
message_request = number_of_messages
elif int(message_request) > 10000:
print "\nRequest exceeds program capacity. Assuming max of 10,000
posts, and continuing ...."
message_request = "10000"
last_message = str(int(first_available_message) +
int(message_request))

stringrequest = first_available_message+"-"+last_message

print "\nRetrieving list of first %s newsgroup participants" %
message_request
print "\nI'm working ..............."

# This is what should work reliably and is not:

response, poster = n.xhdr("from", stringrequest)

##################

Now when I make my xhdr request using the full range of messages as told
to me by:

response, number_of_messages, first_available_message,
last_available_message, groupname = n.group(newsgroup)

by changing:

stringrequest = first_available_message+"-"+last_message

to:

stringrequest = first_available_message+"-"+last_available_message

I get reliable results every time. Anyone care to help me on this one?
It simply makes no sense that I should be able to get reliable results
only when I ask for all 48,000 "from" message headers available from my
newsgroup of choice. I have verified, by the way, that last_message is a
properly formed string in the format needed by xhdr.

thanks, and best regards,

Mathew

--
ROT 13 this address to mail me:

bar jbeq abg guerr; uvtu qrfreg zna, gura nqq - ng lnubb qbg pbz.
Jul 18 '05 #1
5 1830
Tuxtrax <Se****@Signature.com.invalid> wrote:
Hi all

My editor of choice on linux for python, bar none, is xemacs. I love the
python mode that detects a python file and handles indentation and
coloration for me automagically.

I have been using a powerbook for a while now, and I finally found emacs
for aqua in OS X Jaguar (10.2.8). I downloaded it from porkrind.com. The
version of emacs is 21.3 I believe. Anyway, not only does it *not*
detect python files automatically, but it tries to use fundamental mode
to handle them which is a pain in the ass. I want my coloring and
indentation back, damn it all!

I found python-mode.el in the python distribution folder, but not only
do I have no clue as to what to do with it, I can't find an emacs folder
or a .emac file. Just the emac program. Any help with this would be
greatly appreciated. If you have overcome this yourself I especially
want to hear from you.

In other news.....


I use Emacs with Panther but i think that the situation is the same.
Download python-mode from python.org:
http://www.python.org/emacs/python-mode/python-mode.el

Compile the file

Move both file where emacs can find them

Open Terminal
The .emacs file is into your home folder (tipically /Users/<youid>) so
when you open terminal you are already in the right place

add the following lines to your .emacs file :

(setq auto-mode-alist
(cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)
(global-font-lock-mode t)
(setq font-lock-maximum-decoration t)

(i've found this code in www.python.org)

Now when you try to open a .py file emacs loads python-mode
Hope this helps

--
Ciao
Fabio
Jul 18 '05 #2

Wezzy> Download python-mode from python.org:
Wezzy> http://www.python.org/emacs/python-mode/python-mode.el

Ancient, ancient, ancient!

Pop up a level to

http://www.python.org/emacs/python-mode/

and you'll read:

The current release of python-mode.el is no longer maintained on this
website. Check the python-mode project on Sourceforge instead.

The version you referred to (which I don't think is any longer linked to
from the website) is 4.6. The current version is 4.54.

Skip

Jul 18 '05 #3

Tuxtrax> I found python-mode.el in the python distribution folder, but
Tuxtrax> not only do I have no clue as to what to do with it, I can't
Tuxtrax> find an emacs folder or a .emac file. Just the emac
Tuxtrax> program. Any help with this would be greatly appreciated. If
Tuxtrax> you have overcome this yourself I especially want to hear from
Tuxtrax> you.

Stick it in a directory in your Emacs load-path and byte-compile it. C-h v
load-path RET will show you what your load-path is. M-x byte-compile-file
RET will prompt you for a file to compile. Respond with the full path to
your copy of python-mode.el. Finally, associate .py files with python-mode
by adding something like

(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))

to your ~/.xemacs (or ~/.xemacs/init.el, depending on XEmacs version) file.

Skip

Jul 18 '05 #4
Skip Montanaro <sk**@pobox.com> wrote:
Wezzy> Download python-mode from python.org:
Wezzy> http://www.python.org/emacs/python-mode/python-mode.el

Ancient, ancient, ancient!

Pop up a level to

http://www.python.org/emacs/python-mode/

and you'll read:

The current release of python-mode.el is no longer maintained on this
website. Check the python-mode project on Sourceforge instead.

Today when i post my message i've opened
http://www.python.org/emacs/python-mode/ and followed the link to sf.net
but the project hasn't released any file yet, so i've posted the url to
the www.python.org version that is still online.
The version you referred to (which I don't think is any longer linked to
from the website) is 4.6. The current version is 4.54.


i've downloaded python-mode.el few time ago so i didn't know that there
are new versions, thanks for this info. (Anyway the old one is still
online)

--
Ciao
Fabio
Jul 18 '05 #5
The current release of python-mode.el is no longer maintained on this
website. Check the python-mode project on Sourceforge instead.


Wezzy> Today when i post my message i've opened
Wezzy> http://www.python.org/emacs/python-mode/ and followed the link to
Wezzy> sf.net but the project hasn't released any file yet, so i've
Wezzy> posted the url to the www.python.org version that is still
Wezzy> online.

You've shamed me into releasing the single file which is part of the
project. The new release is "barking-up-the-wrong-tree". If we get more
formal with the releases perhaps I'll adopt a numeric release schedule.

Wezzy> (Anyway the old one is still online)

I'll see about deleting it.

Skip

Jul 18 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christian Seberino | last post by:
I am looking at the ELSE home page and trying to figure out if I should invest the time to learn about the ELSE minor mode for Emacs. Is there any programmer out there using ELSE that is getting...
49
IDE
by: Thomas Lindgaard | last post by:
Hello I am probably going to start a war now... but so be it :) I just want to hear what all you guys who eat pythons for breakfast use for python coding. Currently I use Kate, but I would...
81
by: julio | last post by:
Sorry but there is no another way, c# .net and mono are going to rip python, not because python is a bad lenguage, but because is to darn old and it refuses to innovate things, to fix wrong things,...
12
by: Thomas Bartkus | last post by:
Does anyone use emacs together with both WordStar key bindings and python mode? I'm afraid that Wordstar editing key commands are burned R/O into my knuckles! I would like to play with emacs...
7
by: Xah Lee | last post by:
Summary: when encountering ex as a unit in css, FireFox (and iCab) did not take into account the font-family. Detail: http://xahlee.org/js/ff_pre_ex.html Xah xah@xahlee.org ∑...
4
by: emin.shopper | last post by:
Emacs seems to freeze when doing certain shell commands on Microsoft Windows. The following is a simple example with Xemacs: ---------------------------------------------------------- ...
5
by: levander | last post by:
I've been using pdb under emacs on an Ubuntu box to debug python programs. I just upgraded from Ubuntu Edgy to Feisty and this combo has stopped working. Python is at 2.5.1 now, and emacs is at...
331
by: Xah Lee | last post by:
http://xahlee.org/emacs/modernization.html ] The Modernization of Emacs ---------------------------------------- THE PROBLEM Emacs is a great editor. It is perhaps the most powerful and...
4
by: Richard Szopa | last post by:
Hi All, I am a devoted Emacs user and I write a lot in Python. However, I never managed to get my Emacs configuration right for this purpose. There were some discussions on this, but the threads...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.