From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: [joakim@verona.se: pyhon mode indentation problem] Date: Thu, 15 Jun 2006 19:20:15 +0200 Message-ID: References: <20060615182656.CC94.SLAWOMIR.NOWACZYK.847@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1150569134 22329 80.91.229.2 (17 Jun 2006 18:32:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 17 Jun 2006 18:32:14 +0000 (UTC) Cc: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jun 17 20:32:10 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Frfac-0001WN-Al for ged-emacs-devel@m.gmane.org; Sat, 17 Jun 2006 20:32:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Frfab-00007e-NP for ged-emacs-devel@m.gmane.org; Sat, 17 Jun 2006 14:32:09 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1FqvVz-00047A-TZ for emacs-devel@gnu.org; Thu, 15 Jun 2006 13:20:19 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1FqvVx-000434-TK for emacs-devel@gnu.org; Thu, 15 Jun 2006 13:20:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1FqvVx-00042u-RS for emacs-devel@gnu.org; Thu, 15 Jun 2006 13:20:17 -0400 Original-Received: from [195.54.107.70] (helo=mxfep01.bredband.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1FqvfP-0005Xq-11 for emacs-devel@gnu.org; Thu, 15 Jun 2006 13:30:03 -0400 Original-Received: from kurono.home ([83.227.131.3] [83.227.131.3]) by mxfep01.bredband.com with ESMTP id <20060615172015.OGZN25882.mxfep01.bredband.com@kurono.home>; Thu, 15 Jun 2006 19:20:15 +0200 Original-To: Slawomir Nowaczyk In-Reply-To: <20060615182656.CC94.SLAWOMIR.NOWACZYK.847@student.lu.se> (Slawomir Nowaczyk's message of "Thu, 15 Jun 2006 18:44:06 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.51 (gnu/linux) X-Mailman-Approved-At: Sat, 17 Jun 2006 14:31:27 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:55960 Archived-At: Slawomir Nowaczyk writes: I posted some more info on this on "bugs" list. Short recap: - It doesnt work for me like it does for you, but it did, in an older emacs - I can solve this problem with this redefinition: (defun python-skip-comments/blanks (&optional backward) "Skip comments and blank lines. BACKWARD non-nil means go backwards, otherwise go forwards. Backslash is treated as whitespace so that continued blank lines are skipped. Doesn't move out of comments -- should be outside or at end of line." (with-syntax-table python-space-backslash-table (forward-comment (if backward ;(+ most-negative-fixnum 1000) -10000000 most-positive-fixnum)))) (only change is the large negative value, not quite as large as most-negative-fixnum) so, it seems like a bug in "forward-comment", at least here, in my setup. > On Thu, 15 Jun 2006 11:09:49 -0400 > Richard Stallman wrote: > > #> Maybe someone would like to work on this. > > This particular thing is, AFAIU, not a bug. > > Nevertheless, is anybody maintaining python.el? I tried using it once > and it seemed rather cumbersome. I am not sure if I have time and/or > skills to improve it... but if nobody else is working on it, I might > give it a shot. > > #> the problem is especially obvious on the line marked #1, or #2 Try > #> moving the indentation to column 0. Emacs will say "sole > #> indentation". > > I am not sure I understand: > > If I move the #1 line so that it starts at column 0 (i.e. is not > indentated at all) and press TAB, it will indent correctly, with 4 > spaces. After that, though, subsequent TABs will result in "sole > indentation" message -- this is a feature: TAB in python-mode cycles > through all possible (syntactically valid) indentations (of which > there is only one in this case). > > Or did you mean something else by "moving the indentation to column 0"? > > Similarly, calling 'indent-for-tab-command' (this is what TAB is bound > for me in emacs -q) on line #2 indents it properly with 4 spaces (it > is indented with 3 in your email). Subsequent TABs give message "sole > indentation" -- which it is. > > What did you expect to happen? > > -- > Best wishes, > Slawomir Nowaczyk > ( slawomir.nowaczyk.847@student.lu.se ) > > Never attribute to malice that which can be adequately > explained by stupidity. -- Joakim Verona http://www.verona.se