On Wed, 05 Apr 2017 13:44:28 -0400, rickman wrote:
> On 4/5/2017 2:01 AM, Charlie Gibbs wrote:
>> On 2017-04-05, Jim Diamond wrote:
>>
>>> You can set up emacs so that the tab key puts in the right amount of
>>> indentation for the current line. With tab chars being 8 spaces wide,
>>> it can either be told to use only spaces for indentation or it can be
>>> told to use the appropriate number of (8-wide) tabs followed by (e.g.)
>>> 4 spaces.
>>
>> So it _can_ be done. I'll have to take another look at it in my
>> copious free time. (Hah!)
>>
>> One solution I find unacceptable is to use one tab character per level;
>> if you tell your editor of choice that a tab is 4 characters, your code
>> might look great in that editor, but it'll still look like hell
>> everywhere else.
>
> Most editors I use can work with variable width tabs and in fact,
> usually remember the setting.
Thats fine if you aren't working on a developer team and never intend to
share your code with other people. The problem arises because that
editors remember tab settings either need them to be set in a
configuration file or keep them, filed against the text file's pathname
on some sort of cache, the trouble being that this info is generally not
passed on when you share to file or commit it in the team's repository.
I have seen editors that stored tabbing information as the first line of
the file being edited, but this had two problems: (1) its very ugly and
(2) other editors won't understand it. About its only benefit was that
you could set variable spaced tabs, which was nice for old assemblers,
COBOL, FORTRAN and RPG, which all used variable tab spacing to imitate
the punched cards these compilers were originally intended to use.
However, since then all these languages have moved on and no longer
require such rigid line formatting.
IMO this is why the use of tabs is steadily being replaced by a fixed,
but configurable, number of spaces (aka soft tabs), because:
- all editors can handle it
- the source file still looks neat no matter how many different editors
it has been through
- with a good editor there's no way the user can tell whether its using
tabs or spaces unless they use a hex dump or similar on the file.
- some editors can be configured to associate differing soft tab spacings
with the file type, usually by recognising the file extension.
My favourite Linux/UNIX/OS-9/DOS editor, microEmacs, does all of the
above as well as being able to load and edit as many files as will fit
into the process memory.
Its probably long dead now, but the best Windows editor I remember using
was PFE (Programmer's First Editor), which did all of the above as well
as, like microEmacs, being able to edit many files at once.
--
martin@ | Martin Gregorie
gregorie. | Essex, UK
org |
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|