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

Re: [jasspa] Turning off auto-indent

Expand Messages
  • Jeremy Cowgar
    ... Ok, thanks, that did work as I was expecting. ... Yes. I believe we have went over this before and the answer was that it s not possible. All the current
    Message 1 of 8 , Sep 14, 2009
      On Mon, 14 Sep 2009 17:04:38 -0400, Jon Green <jon@...> wrote:

      > I would suggest that these are not quite correct and should be using:
      >
      > ; buffer-init variables
      > set-variable .fhook-euphoria.setup ® "/history/fhook/euphoria"
      > "bdfghnopx"
      > set-variable .fhook-euphoria.setup-mask "abdefghikmnoptux"
      > set-variable .fhook-euphoria.comment "|/*| */|*| * | * |fr|"
      > set-variable .fhook-euphoria.comment-1 "|--||--|-- | --|r|"
      > set-variable .fhook-euphoria.indent-width 4
      >
      > That seems to work OK when I ran it and then turned auto-indent off.
      >
      > So when you run up buffer-setup then you need to:
      >
      > a) Turn off Use-auto indent (turns off the auto indent!)
      > b) Enable indent (This lines up with the previous line)
      >
      > I do not think you had "indent" enabled if it goes back to the beginning
      > of the line.
      >

      Ok, thanks, that did work as I was expecting.

      > The indentation in the example provided seemed to work OK. Have you got
      > an example where it is failing for you and messing up?
      >

      Yes. I believe we have went over this before and the answer was that it's
      not possible. All the current constructs work. What doesn't work is:

      public constant
      ABC = "abc",
      DEF = "def",
      XYZ = "xyz"

      Now, to make matters worse:

      public enum
      --** User ID
      USER_ID,
      --** User name (code used to login as)
      USER_NAME,
      --** The real name of the user
      USER_REALNAME

      if 10 then
      bye()
      end if

      Sort of got the , at the end of the line to indent properly, however I
      could not make it stop indenting when a line was reached that didn't
      contain a comma.

      Jeremy
    • Bryan Schofield
      This may not be appropriate for your euphoria language mode, but I ve solved a complex indent/highlight problem by switching schemes in the middle. For
      Message 2 of 8 , Sep 14, 2009
        This may not be appropriate for your euphoria language mode, but I've
        solved a complex indent/highlight problem by switching schemes in the
        middle. For example, on the "alternate" java (hkjava.emf) I switch
        to .indent.java-comm indent scheme when I detect the start of block
        comment, then later switch back to .indent.java.

        Perhaps you could create an extra .indent.euphoria-const indent scheme
        that handles the "public constant" and "public enum" case only.

        HTML mode does trickery with switching indent schemes, too.

        If memory serves, indent <scheme> "t" and indent <scheme> "x" are used.

        Cheers
        -- bryan

        On Sep 14, 2009, at 5:18 PM, "Jeremy Cowgar" <jeremy@...> wrote:

        > On Mon, 14 Sep 2009 17:04:38 -0400, Jon Green <jon@...> wrote:
        >
        >> I would suggest that these are not quite correct and should be using:
        >>
        >> ; buffer-init variables
        >> set-variable .fhook-euphoria.setup ® "/history/fhook/euphoria"
        >> "bdfghnopx"
        >> set-variable .fhook-euphoria.setup-mask "abdefghikmnoptux"
        >> set-variable .fhook-euphoria.comment "|/*| */|*| * | * |fr|"
        >> set-variable .fhook-euphoria.comment-1 "|--||--|-- | --|r|"
        >> set-variable .fhook-euphoria.indent-width 4
        >>
        >> That seems to work OK when I ran it and then turned auto-indent off.
        >>
        >> So when you run up buffer-setup then you need to:
        >>
        >> a) Turn off Use-auto indent (turns off the auto indent!)
        >> b) Enable indent (This lines up with the previous line)
        >>
        >> I do not think you had "indent" enabled if it goes back to the
        >> beginning
        >> of the line.
        >>
        >
        > Ok, thanks, that did work as I was expecting.
        >
        >> The indentation in the example provided seemed to work OK. Have you
        >> got
        >> an example where it is failing for you and messing up?
        >>
        >
        > Yes. I believe we have went over this before and the answer was that
        > it's
        > not possible. All the current constructs work. What doesn't work is:
        >
        > public constant
        > ABC = "abc",
        > DEF = "def",
        > XYZ = "xyz"
        >
        > Now, to make matters worse:
        >
        > public enum
        > --** User ID
        > USER_ID,
        > --** User name (code used to login as)
        > USER_NAME,
        > --** The real name of the user
        > USER_REALNAME
        >
        > if 10 then
        > bye()
        > end if
        >
        > Sort of got the , at the end of the line to indent properly, however I
        > could not make it stop indenting when a line was reached that didn't
        > contain a comma.
        >
        > Jeremy
        >
        >
        > ------------------------------------
        >
        > __________________________________________________________________________


        >
        > This is an unmoderated list, but new members are moderated to ensure
        > that there are no spam users. JASSPA is not responsible for the
        > content of
        > any material posted to this list.
        >
        > To un-subscribe, 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
        >
        >
        >
      • Jon Green
        ... Hi Bryan, I looked at this last night running multiple schemes using a block ending of ^ s*$ (empty line). It worked for all of the given examples when
        Message 3 of 8 , Sep 15, 2009
          Bryan Schofield wrote:
          > This may not be appropriate for your euphoria language mode, but I've
          > solved a complex indent/highlight problem by switching schemes in the
          > middle. For example, on the "alternate" java (hkjava.emf) I switch
          > to .indent.java-comm indent scheme when I detect the start of block
          > comment, then later switch back to .indent.java.
          >
          > Perhaps you could create an extra .indent.euphoria-const indent scheme
          > that handles the "public constant" and "public enum" case only.
          >
          > HTML mode does trickery with switching indent schemes, too.
          >
          > If memory serves, indent <scheme> "t" and indent <scheme> "x" are used.
          >
          > Cheers
          > -- bryan
          >

          Hi Bryan,

          I looked at this last night running multiple schemes using a block
          ending of "^\\s*$" (empty line). It worked for all of the given examples
          when working in-line however failed for a restyle-buffer. The problem is
          that there is not a good anchor to end the block. Using a blank line is
          also very spurious as there are too many of them.

          I know Jeremy tried anchoring on the ',', but given that this also
          appears in bracketed expressions then this is not a good choice. Also it
          fails for the construct which includes the comments.

          It is quite a nasty construct and I was thinking you almost want
          something like a indent 'c' (continue) which ends when it reaches a
          blank line. ('c' in its current form will not work either).

          Still thinking about it.

          Regards
          Jon

          >>
          >> public constant
          >> ABC = "abc",
          >> DEF = "def",
          >> XYZ = "xyz"
          >>
          >> Now, to make matters worse:
          >>
          >> public enum
          >> --** User ID
          >> USER_ID,
          >> --** User name (code used to login as)
          >> USER_NAME,
          >> --** The real name of the user
          >> USER_REALNAME
          >>
          >> if 10 then
          >> bye()
          >> end if
          >>
          >> Sort of got the , at the end of the line to indent properly, however I
        Your message has been successfully submitted and would be delivered to recipients shortly.