TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: CHARLIE GIBBS
from: JIM DIAMOND
date: 2017-04-04 22:46:00
subject: Re: 64Gbyte flash memory

On 2017-04-04 at 20:06 ADT, Charlie Gibbs  wrote:
> On 2017-04-04, rickman  wrote:

>> On 4/4/2017 3:36 PM, Charlie Gibbs wrote:

>>> On 2017-04-04, rickman  wrote:

>>> I took a look at emacs a while ago.  However it was just a bit too
>>> foreign to wrap my head around.  I think tab handling was the straw
>>> that broke the camel's back.

>> What does it do with tabs?  Codewright could be pretty weird.  The
>> choices were to replace tabs with spaces (which means deleting them is a
>> PITA) or using tabs (which means putting them in lots of times when you
>> are trying not to).  Didn't seem to have a middle ground of inserting
>> tabs when you hit the tab key one.  But maybe I missed an option or two.

> That's the problem I was having.  I'm stuck in a nasty middle ground where
> I want to indent my C code by multiples of 4 spaces, and many programs
> (e.g. cat) assume a tab every 8 spaces.  So I wind up typing 4 spaces
> for the first level of indentation, tab for the second level, tab plus
> four spaces for the third level, two tabs for the fourth, etc.  I'm the
> first to admit that it's ugly - especially when moving a block of code
> and changing its indentation.  But the only alternative is to do away
> with tabs altogether, and as you say it's a PITA.  I can't remember just
> what emacs did or how much work I'd have to do to make it work, but it
> was almost as ugly, and not too compatible with cat and friends.

Emacs understands the difference between a tab character and an
indentation amount.  (Or maybe I should say emacs can be made to
understand the difference between those two concepts).  You just need
to configure it for what you want.  (You may find that easy, maybe
not.)

When moving a block of code around, it is easy to re-indent it.  There
is a function in cc-mode called "c-indent-defun".  I have ^C^Q bound
to that, and so any time the indentation gets messed up, it is very
quick to re-indent the whole function.

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.

Cheers.

                                Jim

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.