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

SourceForge.net noreply at sourceforge.net
Tue May 31 02:08:36 CEST 2005


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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Klose (doko)
>Assigned to: Nobody/Anonymous (nobody)
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: Skip Montanaro (montanaro)
Date: 2005-05-30 19:08

Message:
Logged In: YES 
user_id=44345

Matthias, I'm sympathetic to your plight, but the code that's responsible
for computing indentation is already too complex and my lisp-fu isn't
sufficient for the problem.  Unassigning in case some other intrepid
Lisp cowboy wants to tackle this.


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

Comment By: Matthias Klose (doko)
Date: 2004-03-28 08: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 09: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