[Python-mode] [ python-mode-Bugs-813266 ] better indentation for lambda bodies

SourceForge.net noreply at sourceforge.net
Sun Mar 28 09:21:09 EST 2004


Bugs item #813266, was opened at 2003-09-26 20:37
Message generated for change (Comment added) made by doko
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581349&aid=813266&group_id=86916

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
Assigned to: Skip Montanaro (montanaro)
Summary: better indentation for lambda bodies

Initial Comment:
[forwarded from http://bugs.debian.org/208303]

  Currently, if you place the body of a lambda on the
next line (to
curb rightward drift), the Emacs Python mode indents it
like this:

  ...
  lambda x:
  body_of_lambda()
  ...

  In keeping with Lisp traditions, and to improve
readability, I suggest
a small amount of indentation for the lambda body, eg:

  lambda x:
    body_of_lambda()

  or

  lambda x:
      body_of_lambda()



----------------------------------------------------------------------

>Comment By: Matthias Klose (doko)
Date: 2004-03-28 14:21

Message:
Logged In: YES 
user_id=60903

The bug submitter responded in the original report:

  It looks like there's some indentation now, which is
certainly an 
improvement, but it's relative to the entire statement, so (eg) 
 
  function_with_callback(1, 2, 3, lambda args: 
     body_of_the_lambda) 

He prefers:

  function_with_callback(1, 2, 3, lambda args: 
                                    body_of_the_lambda) 
 
  so that the lambda body is visually attached to the lambda. 


----------------------------------------------------------------------

Comment By: Skip Montanaro (montanaro)
Date: 2003-12-19 15:19

Message:
Logged In: YES 
user_id=44345

Matthias, is this still a problem for you?  In XEmacs, I get a
four-space indent if I end the line with "lambda:" and hit the
TAB key on the next line.  (Please check with the latest 
version.  It's accumulated several changes in the past day.)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=581349&aid=813266&group_id=86916



More information about the Python-mode mailing list