help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: turning off all indentation


From: Tim X
Subject: Re: turning off all indentation
Date: Wed, 08 Dec 2010 15:08:11 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Lynn Newton <lynn.newton@gmail.com> writes:

>> I have a hard time imagining why you would run
>> indent-region if you definitely don't want Emacs to
>> indent the region.
>
> Me too. It was just an example. I've had all variations
> Emacsen behave obstreperously for no reason that I
> could detect, suddenly changing its characteristics and
> forgetting my preferences, right in the middle of
> editing when in some particular programming mode. (This
> happens a lot to me in cperl-mode.) In some cases I
> wind up having little recourse other than to kill the
> editing session and start a new one.
>
>> > (Note the 8-space tabs.)
>
>> It's not like you can't configure cc-mode to do
>> exactly that style of indentation.
>
> True enough, but that doesn't answer the original
> question about how to set that for every mode all the
> time. It's just what the person in whose behalf I'm
> asking wants. Certainly not my own preference, as I
> think that in most modes the defaults that are set are
> good, and probably should not be altered without good
> reason.

Doing it for all possible modes is probably an impossible task as there
is no way to identify all possible modes - if not an infinite set, it
certainly wold be a very large one. 

The best I suspect you can do is use hooks to ensure keys like enter and
tab are bound to their basic functions. This could be difficult as there
is no guarantee that a mode provides such a hook and there are some
modes that provide quite sophisticated behavior, such as behving
differently depending on how many time the key is pressed within a
certain interval etc. Re-binding such keys could easily result in the
loss of valuable functionality as well as indentation. 

There is no simple way this can be done. It is very much working against
what the modes are desinged for. In many cases, once you remove custom
indentation behavior, all you are left with is font locking. 

If the only thing your friend wants is font-locking, I would just derive
new modes from someting like fundamental mode, add font-lock keywords
and use that mode instead of the standard modes.  If they don't even
want font-locking, then just use fundamental mode for everythig and be
done with it. 

In the end, it feels very much like a grandmother who has purchased a
high performance v12 to only use it in the slow lane, You may
as well just use a simpler less featured editor that supports emacs key
bindings. and save some resources. 

As DK points out, the real solution is to put in the effort to customize
the modes your friend uses to behave the way he wants and then just
forget about it. Either stop fighting against the system or change
systems. The proposed approach will never be reliable, will probably
break after upgrades and will just be a constant source of frustration. 

Tim

-- 
tcross (at) rapttech dot com dot au


reply via email to

[Prev in Thread] Current Thread [Next in Thread]