Different TAB and INDENT settings?

Product Compare Forums Multi-Edit Support Different TAB and INDENT settings?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1431
    HansDK
    Participant

    My collegues use emacs editor (editing LUA stuff)
    The crazy people use 3 for indent and 8 for tab setting so I have difficulties reading there code.
    How can I do this in my ME V9.0e ??
    At my knowledge in ME the TAB and INDENT setting is allways the same.
    Kind regards

    #5118
    AndyColson
    Participant

    Just because I dont know: You tab when you hit the tab key, right? How do you indent?

    Would not a person indent using the tab key?

    -Andy

    #5121
    Carloche
    Participant

    Actually, you are able to customize the tab settings and right margin, as well as a host of other things, for each filename extension. Just go to Tools | Customize | Filename Extensions and Edit the appropriate extension. On the middle left you’ll find the setting you’re looking for. :)

    #5123
    Wayne Ostrowercha
    Participant

    Yes, there is something there called the format line — it has been years since I used it, but I think you can set it up for all sorts of uneven spacing.

    #5128
    HansDK
    Participant

    Yes the tab key is for inserting a tab character or indenting the code.
    I must be a bit more specific:
    My colleague use linux and a editor called emacs.
    When they indent the following is written in the file:
    1) 3 space = 3
    2) 6 space = 6
    3) tab + 1 space = 9
    4) tab + 4 space = 12
    5) 1 tab + 7 space = 15
    6) 2 tab + 2 space = 18
    This is of course cracy but this is what they do to the file, and I have to read and edit there files too.
    Reformatting all files would be a way but how do I easy change all tabs to 8 spaces? Search and replace cannot find the Tab char or how do I do that?
    Any help?

    #5129
    Carloche
    Participant

    Absolutely the Search and Replace can find the tab character! In doing your searching and replacing, you’ll notice a button with a left arrow on it that is at the right of your search and replace fields. This is a drop down menu for a number of frequently used regular expressions. One of those is the “\t” without the quotes. That is your horizontal tabs. Play around with that and see if it works for you.

    #5131
    Wayne Ostrowercha
    Participant

    To keep their settings, you can also go to Text | Layout and change the tab spacing to 8. There are also other settings to try.

    If they don’t mind permanent changes to the files, you can run Tools | Format code (which runs PolyStyle). You would have to configure it first. Also, I don’t know whether you would have to change everything to spaces first (Text | Convert tabs)

    #5134
    ReidSweatman
    Participant

    This is probably already obvious in the existing posts, but just in case: the examples you mention make it clear that your co-workers have tabs set to expand to eight spaces. You can set up any extension group to display tabs at whatever length you want, and to embed as either tabs or spaces in the Edit Filename Extension Setup dialog for the extension(s).

    The format line option is intended for situations where the tabs aren’t evenly spaced, or occur at fixed, known locations in all files with the specified extensions; about the only place I use format lines myself is for x86 assembler files, which tend to line up nicely in columns. It’s been years since I looked at COBOL, but it might be useful there, too. RPG, maybe. It makes tabs behave exactly as they did on typewriters that let you set fixed tab locations (uh-oh, I mentioned typewriters…now they know I grew up eating Bronto-burgers ;) ).

    If existing files have embedded tabs, you’ll probably want to set the extension tab length to eight, but expanded to spaces, then follow Wayne’s suggestion regarding the tab converter option (although if the tab usage in the files is consistent enough, you might not have to convert; but as I say, from the figures you gave, it looks pretty obvious that those files use eight-character tabs and have them set to expand to that many spaces, rather than embedding an actual tab character in the file (\t, or 0x09). If you do have to convert you can run into issues that’ll force you to patch some things by hand, if EMACS adjusts tab expansion along imaginary tab-length locations (for instance, if the tabs were set to five characters when a file was typed, pressing the Tab key with the cursor on column three would only insert two characters instead of five, as that would get you to the next column number modulo five).

    And the last confusing thing: Multi-Edit uses 0xFF characters as “virtual space” when it displays on screen, as part of its tab-handling mechanism. You’ll see these as some odd high-order character if you use the Layout dialog to make tabs visible. You should never erase these manually or regex them out; work with the tab characters themselves, instead, and the virtual spaces will adjust themselves. You’ll only see them if you don’t save tabs as spaces, and have that dialog option turned on. They don’t save as part of the file, either; just the tab character they go with, so your documents will still be compatible with your co-workers’.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.