all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: joakim@verona.se
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [joakim@verona.se: pyhon mode indentation problem]
Date: Thu, 15 Jun 2006 19:20:15 +0200	[thread overview]
Message-ID: <m3mzceuyi8.fsf@kurono.home> (raw)
In-Reply-To: <20060615182656.CC94.SLAWOMIR.NOWACZYK.847@student.lu.se> (Slawomir Nowaczyk's message of "Thu, 15 Jun 2006 18:44:06 +0200")

Slawomir Nowaczyk <slawomir.nowaczyk.847@student.lu.se> 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 <rms@gnu.org> 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

  reply	other threads:[~2006-06-15 17:20 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-15 15:09 [joakim@verona.se: pyhon mode indentation problem] Richard Stallman
2006-06-15 16:44 ` Slawomir Nowaczyk
2006-06-15 17:20   ` joakim [this message]
2006-06-15 22:37     ` Slawomir Nowaczyk
2006-06-16 15:06   ` Richard Stallman
2006-06-16 16:34     ` joakim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3mzceuyi8.fsf@kurono.home \
    --to=joakim@verona.se \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.