help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Plain text indentation problem


From: mccormick . bob
Subject: Plain text indentation problem
Date: Sun, 13 Jan 2008 21:17:37 -0800 (PST)
User-agent: G2/1.0

I'm having an odd problem with auto-indentation in Emacs in text-mode
that I'm hoping someone here can help me with.   I'm trying to edit a
file whose format needs to be similar to this:

--------------------------------------
Story: simple addition
  Scenario: add one plus one
    Given an addend of 1
    And an addend of 1
    When the addends are added
    Then the sum should be 2
  Scenario: add two plus five
    Given an addend of 2
    And an addend of 5
------------------------------------------------

The problem is, when I get to the second "Scenario" line that needs to
be indented less than the line before it.  Emacs automatically indents
it the same as the previous line (which I'd expect), but what's the
best way to get the line back to the same indentation as the previous
line?  I've been doing M-b's until I get to the beginning of the first
word ("Scenario"), then backspacing.  The problem is if I backspace
back to the beginning of the line, then hit tab again, emacs indents
the line in one space more than the first "Scenario" line.   In other
words, it looks kind of like this:

----------------------------
  Scenario: add one plus one
    Given an addend of 1
   Scenario: add two plus five
    Given an addend of 2
----------------------------------

Any ideas what I'm doing wrong?  Is there an easier way to move a line
back one TAB width?

(BTW.. For anyone whose interested, the file format in question is for
the Ruby Rspec Story Runner tool)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]