Loading ...
Sorry, an error occurred while loading the content.

Indentation question

Expand Messages
  • Salman Khilji
    There are cases, where one would want auto-indentation in text-files. In some editors, all auto-indentation means that the indentation of the next line will
    Message 1 of 3 , Oct 28, 2004
    • 0 Attachment
      There are cases, where one would want auto-indentation
      in text-files. In some editors, all auto-indentation
      means that the indentation of the next line will be
      the same as the current one. I have a file with an
      extenstion .pro. a part of it looks like:

      SOURCES += CommQt.cpp \
      Connection.cpp \
      ConnectionConfig.cpp \
      ConnectionForm.cpp

      If I place my cursor on the 2nd Line and hit ENTER to
      add a new line ME adds a new line but puts the cursor
      at the beginning of it. Is there a way to get ME to
      put the cursor at the same leve as all the C's above?

      I would like to see this behavior in any text
      file---not just .pro files, except for programming
      languages for which the current behavior is okay.





      __________________________________
      Do you Yahoo!?
      Yahoo! Mail Address AutoComplete - You start. We finish.
      http://promotions.yahoo.com/new_mail
    • Jon Green
      ... This is quite a nice suggestion for a rule. I do not know what .pro files are, but get the impression they are kind of like Makefiles and yes would work
      Message 2 of 3 , Oct 28, 2004
      • 0 Attachment
        Salman Khilji wrote:
        > There are cases, where one would want auto-indentation
        > in text-files. In some editors, all auto-indentation
        > means that the indentation of the next line will be
        > the same as the current one. I have a file with an
        > extenstion .pro. a part of it looks like:
        >
        > SOURCES += CommQt.cpp \
        > Connection.cpp \
        > ConnectionConfig.cpp \
        > ConnectionForm.cpp
        >
        > If I place my cursor on the 2nd Line and hit ENTER to
        > add a new line ME adds a new line but puts the cursor
        > at the beginning of it. Is there a way to get ME to
        > put the cursor at the same leve as all the C's above?
        >
        > I would like to see this behavior in any text
        > file---not just .pro files, except for programming
        > languages for which the current behavior is okay.
        >

        This is quite a nice suggestion for a rule. I do
        not know what .pro files are, but get the impression
        they are kind of like Makefiles and yes would work
        quite well. At the moment we do not use indent rules
        in Makefiles.

        I guess the rule syntax would be along the lines of:-

        indent .hilight.xxx ? "=\\s +" "\\"

        Where you would define the indent start position and
        a continuation character. Indentation would continue
        on subsequent lines at the position defined by the
        end of the first token string (i.e. after white space).

        Indent is being over-hauled at the moment so is quite
        an opportune time for such a suggestion.

        Any more ?

        Jon.
      • Phillips, Steven
        Isn t this simply achieved by enabling indent mode? (C-x m indent to toggle) In this mode the cursor is indented to the same level as the previous line which
        Message 3 of 3 , Oct 29, 2004
        • 0 Attachment
          Isn't this simply achieved by enabling indent mode? (C-x m 'indent' to toggle) In this mode the cursor is indented to the same level as the previous line which is all I've ever see any editor do in this scenario.

          The improved indentation would be good for makefiles but not for a general text file as it would exclude the use of modes like indent, justify etc.

          Steve

          > -----Original Message-----
          > From: Jon Green [mailto:jon@...]
          > Sent: Thursday, October 28, 2004 11:35 PM
          > To: jasspa@yahoogroups.com
          > Subject: Re: [jasspa] Indentation question
          >
          >
          >
          > Salman Khilji wrote:
          > > There are cases, where one would want auto-indentation
          > > in text-files. In some editors, all auto-indentation
          > > means that the indentation of the next line will be
          > > the same as the current one. I have a file with an
          > > extenstion .pro. a part of it looks like:
          > >
          > > SOURCES += CommQt.cpp \
          > > Connection.cpp \
          > > ConnectionConfig.cpp \
          > > ConnectionForm.cpp
          > >
          > > If I place my cursor on the 2nd Line and hit ENTER to
          > > add a new line ME adds a new line but puts the cursor
          > > at the beginning of it. Is there a way to get ME to
          > > put the cursor at the same leve as all the C's above?
          > >
          > > I would like to see this behavior in any text
          > > file---not just .pro files, except for programming
          > > languages for which the current behavior is okay.
          > >
          >
          > This is quite a nice suggestion for a rule. I do
          > not know what .pro files are, but get the impression
          > they are kind of like Makefiles and yes would work
          > quite well. At the moment we do not use indent rules
          > in Makefiles.
          >
          > I guess the rule syntax would be along the lines of:-
          >
          > indent .hilight.xxx ? "=\\s +" "\\"
          >
          > Where you would define the indent start position and
          > a continuation character. Indentation would continue
          > on subsequent lines at the position defined by the
          > end of the first token string (i.e. after white space).
          >
          > Indent is being over-hauled at the moment so is quite
          > an opportune time for such a suggestion.
          >
          > Any more ?
          >
          > Jon.
          >
          >
          >
          > ------------------------ Yahoo! Groups Sponsor
          > --------------------~-->
          > $9.95 domain names from Yahoo!. Register anything.
          > http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/89EolB/TM
          > --------------------------------------------------------------
          > ------~->
          >
          > ______________________________________________________________
          > ____________
          >
          > This is an unmoderated list. JASSPA is not responsible for
          > the content of
          > any material posted to this list.
          >
          > To unsubscribe, send a mail message to
          >
          > mailto:jasspa-unsubscribe@yahoogroups.com
          >
          > or visit http://groups.yahoo.com/group/jasspa and
          > modify your account settings manually.
          >
          >
          >
          > Yahoo! Groups Links
          >
          >
          >
          >
          >
          >
          >
          >
        Your message has been successfully submitted and would be delivered to recipients shortly.