473,584 Members | 2,874 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Emacs python mode indent levels

Since Python has no explcit ends to blocks, emacs doesn't always know
the right indentation level to use. And <del> doesn't seem to be very
consistent (it always seems to go back 8 characters, which doesn't
help when the indent level is 4).

Another language where indentation is significant is Haskell. The
emacs Haskell mode has an excellent solution to the problem: Pushing
<tab> cycles through the various possible indentations.

Does anyone know if anything like this is possible with Python mode?
Or are there any other popular solutions?

(I am not an elipser)

--
John.
Jul 18 '05 #1
2 2751

John> Another language where indentation is significant is Haskell. The
John> emacs Haskell mode has an excellent solution to the problem:
John> Pushing <tab> cycles through the various possible indentations.

John> Does anyone know if anything like this is possible with Python
John> mode? Or are there any other popular solutions?

Probably. <wink>...

Feel free to file a feature request with the python-mode project on
SourceForge. If we get to it, we get to it.

Speaking of which, if you find reviewing and responding to bug/patch reports
for Python beneath you, perhaps you'd like to hone your ELisp chops a bit:

http://sf.net/projects/python-mode

Feel free to review submissions, fix bugs, etc. Operators are standing
by...

Skip

Jul 18 '05 #2
On 14 Jul 2004 20:22:07 -0700, John Fouhy <jf****@paradis e.net.nz> wrote:
Since Python has no explcit ends to blocks, emacs doesn't always know
the right indentation level to use. And <del> doesn't seem to be very
consistent (it always seems to go back 8 characters, which doesn't
help when the indent level is 4).
are you using python-mode.el? It works fine here...
Another language where indentation is significant is Haskell. The
emacs Haskell mode has an excellent solution to the problem: Pushing
<tab> cycles through the various possible indentations.
I'd say go talk to the python-mode people [1]

Does anyone know if anything like this is possible with Python mode?
Or are there any other popular solutions?

(I am not an elipser)


does that mean you don't fit ellipses [2]? :-P
References:

1) http://python-mode.sf.net
2) http://groups.google.com/groups?thre...ing.google.com

--
John Lenton (jl*****@gmail. com) -- Random fortune:
bash: fortune: command not found
Jul 18 '05 #3

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

Similar topics

5
1856
by: Tuxtrax | last post by:
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...
0
1220
by: Greg Novak | last post by:
I realize that this is a pretty esoteric question, but I'm not even getting any traction on it by myself. I believe that the problem has to do with signal handling for programs run underneath Python, and how these signals may (or may not) percolate up to higher levels, which for me means Emacs. PyX is a Python package for drawing graphs...
3
2761
by: porterboy | last post by:
CONTEXT: I am using Emacs to edit Python code and sometimes also Matlab code. When I hit <return> in a loop of some sort, Emacs usually gets the nesting indentation right, which is particularly important in Python. To ensure this I have used python-mode.el and matlab.el modes in emacs. QUESTION: If I suddenly decide I want an outer loop,...
12
12269
by: Rex Eastbourne | last post by:
Hi, I'm interested in running a Python interpreter in Emacs. I have Python extensions for Emacs, and my python menu lists "C-c !" as the command to run the interpreter. Yet when I run it I get the message "Spawning Child Process: invalid argument." What do I need to do/download to fix this? I read in a post in this group from a while...
12
2815
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 for Python editing but I'm having (2) problems. 1) When I load a .py file, emacs automatically overrides my wordstar-mode with python-mode, forcing...
4
3176
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: ---------------------------------------------------------- Microsoft Windows XP (C) Copyright 1985-2001 Microsoft Corp.
6
1628
by: eugene.morozov | last post by:
Hello, Does anyone know how to make python-mode correctly indent nested lists and dictionaries. I hate indenting Django url patterns and Zope Archetypes schemas by hand, because python-mode indents them in incorrect and ugly way. Here's how it should be: StringField('reference', widget=StringWidget( description='Position reference'
3
4501
by: Grant Edwards | last post by:
I've recently switched from Jed to Emacs for editing python source, and I'm still stumped as to how one indents or dedents a region of code. In Jed it's 'C-c <' or 'C-c >'. Google has found several answers, but none of them work, for example I've tried bot "C-c tab" and "C-c C-r" based on postings Google has found, but neither appears to...
0
818
by: Malte Helmert | last post by:
skip@pobox.com wrote: One of the two modes (if memory serves, python.el) has an annoying bug/feature where indent-region is essentially implemented as "hit tab once on every line in the region". Of course, this frequently does the wrong thing as "tab" has to guess the right indentation in cases where there are multiple possibilities. So...
0
7897
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8330
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7940
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8198
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6587
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3850
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2336
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1438
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1162
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.