Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
disabling all c/c++/java indentation
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  21 messages - Expand all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
jlangtonremovetoreply  
View profile  
 More options Jun 24 2001, 8:29 pm
Newsgroups: comp.emacs
From: jlangtonREMOVETORE...@sandiego.edu
Date: Mon, 25 Jun 2001 00:08:04 GMT
Local: Sun, Jun 24 2001 8:08 pm
Subject: disabling all c/c++/java indentation
Hi, all.

I'd like to completely disable all automatic indentation in c, c++, and
java.  I do want to keep the syntax highlighting, however.  What is the
simplest way to do this?  I do not, under any circumstances, want emacs to
second-guess my own indentation, whether I type an electric character, or
if I go back and add a comment later on.  I use both GNU emacs and xemacs
on Solaris and Linux, and GNU emacs on Windows, and I'd like (if
possible) to do this with one .emacs per OS.  Thanks in advance for any
help anyone can provide.

-Asher


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Henrik Enberg  
View profile  
 More options Jun 24 2001, 11:09 pm
Newsgroups: comp.emacs
From: Henrik Enberg <henrik+n...@enberg.org>
Date: 25 Jun 2001 05:09:00 +0200
Subject: Re: disabling all c/c++/java indentation
On Mon Jun 25, jlangtonREMOVETORE...@sandiego.edu wrote:

> Hi, all.

> I'd like to completely disable all automatic indentation in c, c++, and
> java.  I do want to keep the syntax highlighting, however.  What is the
> simplest way to do this?  I do not, under any circumstances, want emacs to
> second-guess my own indentation, whether I type an electric character, or
> if I go back and add a comment later on.  I use both GNU emacs and xemacs
> on Solaris and Linux, and GNU emacs on Windows, and I'd like (if
> possible) to do this with one .emacs per OS.  Thanks in advance for any
> help anyone can provide.

Hmm, this seems to pop up every once in a while.  I really can't understand
why. `cc-mode' can be made to indent pretty much anyway one pleases.

Anyway, I've put some code that seems to do the right thing here:

<URL:http://www.enberg.org/emacs/dumb-cc-mode.el>

Caveat, not tested on XEmacs.

Henrik
--
Soylent Green is People!


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
QuoteMstr - Danny Colascione  
View profile  
 More options Jun 25 2001, 12:02 am
Newsgroups: comp.emacs
From: qtm...@optonline.net (QuoteMstr - Danny Colascione)
Date: Mon, 25 Jun 2001 03:57:39 GMT
Local: Sun, Jun 24 2001 11:57 pm
Subject: Re: disabling all c/c++/java indentation

On Mon, 25 Jun 2001 00:08:04 GMT, jlangtonREMOVETORE...@sandiego.edu wrote:
> I'd like to completely disable all automatic indentation in c, c++, and
> java.  I do want to keep the syntax highlighting, however.  What is the
> simplest way to do this?  I do not, under any circumstances, want emacs to
> second-guess my own indentation, whether I type an electric character, or
> if I go back and add a comment later on.  I use both GNU emacs and xemacs
> on Solaris and Linux, and GNU emacs on Windows, and I'd like (if
> possible) to do this with one .emacs per OS.  Thanks in advance for any
> help anyone can provide.

Does (setq c-syntactic-indentation nil) work?

--
"I have received your new book against the human race, and thank you
for it. Never was such a cleverness used in the design of making us
all stupid. One longs, in reading your book, to walk on all fours."
- Voltaire, on The Social Contract, in a letter of Rousseau


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
QuoteMstr - Danny Colascione  
View profile  
 More options Jun 25 2001, 12:03 am
Newsgroups: comp.emacs
From: qtm...@optonline.net (QuoteMstr - Danny Colascione)
Date: Mon, 25 Jun 2001 03:58:12 GMT
Local: Sun, Jun 24 2001 11:58 pm
Subject: Re: disabling all c/c++/java indentation

> I'd like to completely disable all automatic indentation in c, c++, and
> java.  I do want to keep the syntax highlighting, however.  What is the
> simplest way to do this?  I do not, under any circumstances, want emacs to
> second-guess my own indentation, whether I type an electric character, or
> if I go back and add a comment later on.  I use both GNU emacs and xemacs
> on Solaris and Linux, and GNU emacs on Windows, and I'd like (if
> possible) to do this with one .emacs per OS.  Thanks in advance for any
> help anyone can provide.

Does (setq c-syntactic-indentation nil) work?

--
"I have received your new book against the human race, and thank you
for it. Never was such a cleverness used in the design of making us
all stupid. One longs, in reading your book, to walk on all fours."
- Voltaire, on The Social Contract, in a letter of Rousseau


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
those who know me have no need of my name  
View profile  
 More options Jun 25 2001, 3:50 am
Newsgroups: comp.emacs
From: those who know me have no need of my name <not-a-real-addr...@usa.net>
Date: 25 Jun 2001 06:56:45 GMT
Local: Mon, Jun 25 2001 2:56 am
Subject: Re: disabling all c/c++/java indentation
<slrn9jddmk.19f.qtm...@ool-18b88ad6.dyn.optonline.net> divulged:

>> I'd like to completely disable all automatic indentation in c, c++, and
>> java.  I do want to keep the syntax highlighting, however.  What is the
>> simplest way to do this?  
>Does (setq c-syntactic-indentation nil) work?

which you have to do in c-mode-common-hook, and which only works in version
5.27 or later.

also, according to the (raw) docstring ...

,----
| If nil, every line is just indented to the same level as the previous
| one, and the \\[c-indent-command] command adjusts the indentation in steps
| specified by `c-basic-offset'.  The indentation style have no effect
| in this mode, nor any of the indentation associated variables,
| e.g. `c-special-indent-hook'.
`----

--
okay, have a sig then


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kai Großjohann  
View profile  
 More options Jun 25 2001, 9:19 am
Newsgroups: comp.emacs
From: Kai.Grossjoh...@CS.Uni-Dortmund.DE (Kai Großjohann)
Date: Mon, 25 Jun 2001 15:04:51 +0200
Local: Mon, Jun 25 2001 9:04 am
Subject: Re: disabling all c/c++/java indentation

On Mon, 25 Jun 2001, jlangtonREMOVETORE...@sandiego.edu wrote:
> I'd like to completely disable all automatic indentation in c, c++,
> and java.  I do want to keep the syntax highlighting, however.

I strongly suggest that you investigate whether you can customize the
indentation such that it matches what you would normally do.  I find
that being able to say C-x h C-M-\ on any piece of code to nicely
indent it is an extremely useful feature.  What's more, wrong
indentation tells me that I've made a typo somewhere, such as forgot a
`;' or `}'.  In fact, for me automatic indentation is so useful that I
sometimes (slightly!) modify my coding style so that automatic
indentation works better.

Many things can be customized.

But if you must, you can just redefine all the keys that would
normally indent:

(defun jl-c-setup ()
  (local-set-key (kbd "TAB") 'tab-to-tab-stop)
  (local-set-key (kbd ";") 'self-insert-command))
(add-hook 'c-mode-hook 'jl-c-setup)
(add-hook 'c++-mode-hook 'jl-c-setup)

You need to add more local-set-key statements for the other keys that
might do indentation, such as `:' and `/'.  And you need to add more
add-hook statement for Java mode and maybe other modes.

kai
--
~/.signature: No such file or directory


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Torsten Müller  
View profile  
 More options Jun 26 2001, 1:30 am
Newsgroups: comp.emacs
From: "Torsten Müller" <TMuel...@easy-soft-dresden.de>
Date: Tue, 26 Jun 2001 07:29:44 +0200
Local: Tues, Jun 26 2001 1:29 am
Subject: Re: disabling all c/c++/java indentation
In my experience indentation is an extremly personal thing. I never felt
familiar with EMACS automatic indentation because it is totally different
from what I want. You can customize almost everything but it is not possible
to get indentation work correctly if you just want to have only real tab
characters at the left side. This is how I indent. And I don't know why tabs
are not really supported in indentation.

In some cases EMACS automatic indentation is generally not useful,
especially if you edit a text coming originally from another development
tool. So you get parts of the text indented in EMACS style, other parts in
another style.

So I found it always absolutely frustrating if the editor modified the text
I just typed in very exactly. Many thanks to the development team for the
introduction of the customization variable "c-syntactic-indentation" in
cc-mode 5.27. Now we can finally turn off this dreadful and time-consuming
feature.

Torsten Müller

"Kai Großjohann" <Kai.Grossjoh...@CS.Uni-Dortmund.DE> schrieb im Newsbeitrag
news:vafae2wg170.fsf@lucy.cs.uni-dortmund.de...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark A. Flacy  
View profile  
 More options Jun 26 2001, 3:29 am
Newsgroups: comp.emacs
From: "Mark A. Flacy" <fl...@nortelnetworks.com>
Date: 26 Jun 2001 02:23:23 -0500
Local: Tues, Jun 26 2001 3:23 am
Subject: Re: disabling all c/c++/java indentation
Well, you can embed the default style in a eval block so things work as
expected.  Using tabs alone is evil, which you may discover when someone
else's editor uses a different tab spacing than yours.

"Extremely personal" indentation doesn't cut the mustard in a large
corporation.   It doesn't even cut the mustard for small groups.  But,
since you've been in indentation purgatory the past few years, I'm glad
that you are finally able to turn it off.  I personally couldn't live
without it turned on, but that's me.

If you ever were to send me source code for review, you'd get it back
indented my way.  :-)


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kai Großjohann  
View profile  
 More options Jun 26 2001, 8:04 am
Newsgroups: comp.emacs
From: Kai.Grossjoh...@CS.Uni-Dortmund.DE (Kai Großjohann)
Date: Tue, 26 Jun 2001 13:57:57 +0200
Local: Tues, Jun 26 2001 7:57 am
Subject: Re: disabling all c/c++/java indentation

On Tue, 26 Jun 2001, Torsten Müller wrote:
> In my experience indentation is an extremly personal thing. I never
> felt familiar with EMACS automatic indentation because it is totally
> different from what I want. You can customize almost everything but
> it is not possible to get indentation work correctly if you just
> want to have only real tab characters at the left side. This is how
> I indent. And I don't know why tabs are not really supported in
> indentation.

You can easily tell Emacs to refrain from spaces in most cases.  For
example, if you set c-basic-offset to 4 and tab-width to 4 and
indent-tabs-mode to t, then you'll get tabs (and no spaces) in most
cases.

Emacs will still uses spaces in cases like this:

    function_name(argument_1,
                  argument_2);

Clearly, the second line might need spaces for indentation to the open
paren -- consider what happens when you make the function name longer
by one char.

But even in this case, it is possible to tell Emacs to indent like
this:

    function_name(argument_1,
        argument_2);

So what is the problem?

Fwiw, I sometimes use something like this in CPerl mode:

    function_name
        (argument_1,
         argument_2);

This is useful when the function name and each argument are very very
long.  Note how I put the paren on the second line.  I think moving
the paren to the second line is a good compromise for getting
automatic, good-looking indentation.

> In some cases EMACS automatic indentation is generally not useful,
> especially if you edit a text coming originally from another
> development tool. So you get parts of the text indented in EMACS
> style, other parts in another style.

C-h x C-M-\ should take care of that -- afterwards everything is
indented in Emacs style.

kai
--
~/.signature: No such file or directory


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
those who know me have no need of my name  
View profile  
 More options Jun 26 2001, 3:54 pm
Newsgroups: comp.emacs
From: those who know me have no need of my name <not-a-real-addr...@usa.net>
Date: 26 Jun 2001 18:59:50 GMT
Local: Tues, Jun 26 2001 2:59 pm
Subject: Re: disabling all c/c++/java indentation
[virtually all of these responses have been seen one time or another for
quite some time.  you just might want to skip it.]

<yw0r66dj7lhw....@nortelnetworks.com> divulged:

>Well, you can embed the default style in a eval block so things work as
>expected.  

this does work quite well, provided the cc-mode indentation engine is
capable of doing it.

>Using tabs alone is evil, which you may discover when someone
>else's editor uses a different tab spacing than yours.

and yet it is almost always completely correctable with a single command,
e.g., vi's ``set ts=n''.

>"Extremely personal" indentation doesn't cut the mustard in a large
>corporation.   It doesn't even cut the mustard for small groups.  

i've been involved in several collaborations where (usually one)
loud-mouthed emacs user forced a style on the group simply because emacs
could not do what had otherwise been discussed.  generally i've quit such
groups -- not alone due to that issue, but because any group that caves in
to an individual will surely cave on other issues (often the schedule).
when i head groups that type of tyranny isn't allowed.

when the group consists mostly of emacs users it's not usually an issue.
heck the fsf mythos is usually so strong that gnu style is assumed rather
than explicit.

when the group selects a style that emacs can attain i've been happy to let
it do the work.  when indent can handle it i go for something that is close
in emacs and have indent make it conform -- though any tweaking is done
with vi lest emacs re-indented wrongly.  when neither works well enough a
nil c-syntactic-indentation saves me from having to write it all in vi.

>If you ever were to send me source code for review, you'd get it back
>indented my way.  :-)

also not usually acceptable -- review does not imply update.  it would be
understandable of you to return it, un-reviewed, if it weren't sufficiently
close to a style you are comfortable reading.

--
okay, have a sig then


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Torsten Müller  
View profile  
 More options Jun 27 2001, 2:40 am
Newsgroups: comp.emacs
From: "Torsten Müller" <TMuel...@easy-soft-dresden.de>
Date: Wed, 27 Jun 2001 08:39:35 +0200
Local: Wed, Jun 27 2001 2:39 am
Subject: Re: disabling all c/c++/java indentation
Tried it, but had no entire success. Even "setq c-syntactic-indentation nil"
leads to indentation.

What I really want (and this was also the starting point of this discussion)
is to avoid **every** EMACS manipulation on the text. Is this too much?
Look, it's fine to have an automatic mechanism. In many cases you can
produce some nice output with it. But I want just the possibility to turn
this off. I want the possibility to control everything myself. Nobody would
have a car that drives itself straight on while the driver wanted to turn
right but forgot to switch on the right direction indicator. And nobody
would have a car that switches on the direction indicator itself in every
curve. Think about this.

(Beside this "mis-feature" of automatic indentation EMACS is a great program
and I use it all the day.)

Torsten

"Kai Großjohann" <Kai.Grossjoh...@CS.Uni-Dortmund.DE> schrieb im Newsbeitrag
news:vafr8w7a1x6.fsf@lucy.cs.uni-dortmund.de...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kai Großjohann  
View profile  
 More options Jun 27 2001, 5:49 am
Newsgroups: comp.emacs
From: Kai.Grossjoh...@CS.Uni-Dortmund.DE (Kai Großjohann)
Date: Wed, 27 Jun 2001 11:40:40 +0200
Local: Wed, Jun 27 2001 5:40 am
Subject: Re: disabling all c/c++/java indentation

On Wed, 27 Jun 2001, Torsten Müller wrote:
> Tried it, but had no entire success.

The local-set-key method I proposed in my first message in this thread
ought to work.  Please provide more detail in what way does it fail?

Note that I didn't redefine all keys, just some of them.  Clearly, you
need to extend my suggestion with other keys.

kai
--
~/.signature: No such file or directory


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mark A. Flacy  
View profile  
 More options Jun 27 2001, 6:44 am
Newsgroups: comp.emacs
From: "Mark A. Flacy" <fl...@nortelnetworks.com>
Date: 27 Jun 2001 05:40:03 -0500
Local: Wed, Jun 27 2001 6:40 am
Subject: Re: disabling all c/c++/java indentation
I don't understand that logic (no offense intended).  Why choose an
indentation style that is difficult to maintain?  If you have an
indentation engine that makes it simple to change the indentation style to
something that *you* can read and understand, why do you care how other
people indent their code?  Why would you care if they reindent your code to
some other style?

Note that the indentation engine does not have to be emacs; there are
several indentation engines out there can modify the file prior to
modification.  


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kai Großjohann  
View profile  
 More options Jun 27 2001, 7:19 am
Newsgroups: comp.emacs
From: Kai.Grossjoh...@CS.Uni-Dortmund.DE (Kai Großjohann)
Date: Wed, 27 Jun 2001 13:13:02 +0200
Local: Wed, Jun 27 2001 7:13 am
Subject: Re: disabling all c/c++/java indentation
On 27 Jun 2001, Mark A. Flacy wrote:

> I don't understand that logic (no offense intended).  Why choose an
> indentation style that is difficult to maintain?

It does not make sense to change the indentation style of a file where
you only change a couple of lines.  When developing in a team, this
situation (edit a foreign file where you only need to change a little
bit) might arise quite often.

kai
--
~/.signature: No such file or directory


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Torsten Müller  
View profile  
 More options Jun 27 2001, 7:48 am
Newsgroups: comp.emacs
From: "Torsten Müller" <TMuel...@easy-soft-dresden.de>
Date: Wed, 27 Jun 2001 13:47:56 +0200
Local: Wed, Jun 27 2001 7:47 am
Subject: Re: disabling all c/c++/java indentation
I tried two methods on several GNU EMACS versions (20.4, 20.7.1).

1) c-syntactic-indentation nil (requires cc-mode 5.27)
This is documented as "indents every line like the previous one". A
beautiful construct like ...

switch (x) {
        case 1: {
                x++;
                break;
        }
        case 2: {
                for (int i=0; i<10; i++) {
                }
                break;
        }
        default:
               break;

}

... looks like ...

switch (x) {
case 1: {
 x++;
 break;

}

case 2: {
for (int i=0; i<10; i++) {
}
 break;
}

 default:
  break;

}

... depending on how I type this. I could understand that there are people
who like the case under the switch (I don't). But why is the for-loop
indented on typing { while the break is not indented? And if the case
keywords are under the switch why is the default keyword not indented in the
same manner? This is not usable in sources of a programming language,
because it hinders user made indentaion. The real problem is the
inconsequence in this mode. It doesn't even work as documented.

2) customizing many variables
I know all of the cc-mode variables now. And I notice again that they are
insufficient to avoid **every** EMACS specific indentation. In general I
could not turn off the behaviour on typing characters like { : and //.
Therefor I modified (one by one) all the "hanging" variables,
c-indent-comments-syntactically and c-comment-only-line-offset,
c-offsets-alist, saved the changes to .emacs and inspected what happened.
Not much, really. I did not detect any difference between the
"c-default-style"s. What are these styles good for? Why isn't there a plain
style, a do-never-anything-style?

Normally a user does configuration to cause the application to do something.
How can I do some configuration to cause EMACS something **not** to do? I
want just a fundamental-mode with syntax coloring.

Torsten

"Kai Großjohann" <Kai.Grossjoh...@CS.Uni-Dortmund.DE> schrieb im Newsbeitrag
news:vafbsnaw99j.fsf@lucy.cs.uni-dortmund.de...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kai Großjohann  
View profile  
 More options Jun 27 2001, 8:04 am
Newsgroups: comp.emacs
From: Kai.Grossjoh...@CS.Uni-Dortmund.DE (Kai Großjohann)
Date: Wed, 27 Jun 2001 13:59:59 +0200
Local: Wed, Jun 27 2001 7:59 am
Subject: Re: disabling all c/c++/java indentation

It appears that `{' is still electric.  Hm.  But
c-syntactic-indentation says that the current line should not be
reindented when that variable is nil.  Looks like a bug.

kai
--
~/.signature: No such file or directory


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kai Großjohann  
View profile  
 More options Jun 27 2001, 8:04 am
Newsgroups: comp.emacs
From: Kai.Grossjoh...@CS.Uni-Dortmund.DE (Kai Großjohann)
Date: Wed, 27 Jun 2001 13:56:50 +0200
Local: Wed, Jun 27 2001 7:56 am
Subject: Re: disabling all c/c++/java indentation

On Wed, 27 Jun 2001, Torsten Müller wrote:
> I tried two methods on several GNU EMACS versions (20.4, 20.7.1).

You did not try the local-set-key method I proposed for turning off
syntactic indentation.  Why do you claim it doesn't work, then?

Once again:

(defun tm-c-setup ()
  (local-set-key (kbd "TAB") 'tab-to-tab-stop)
  (local-set-key (kbd ":") 'self-insert-command)
  (local-set-key (kbd "}") 'self-insert-command)
  (local-set-key (kbd ";") 'self-insert-command))
(add-hook 'c++-mode-hook 'tm-c-setup)

You need to add more local-set-key lines.  And more add-hook lines if
C++ is not enough.  This is not pretty, but I'm pretty sure it will
work.

kai
--
~/.signature: No such file or directory


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Torsten Müller  
View profile  
 More options Jun 27 2001, 9:32 am
Newsgroups: comp.emacs
From: "Torsten Müller" <TMuel...@easy-soft-dresden.de>
Date: Wed, 27 Jun 2001 15:31:47 +0200
Local: Wed, Jun 27 2001 9:31 am
Subject: Re: disabling all c/c++/java indentation
Thank you, Kai, for your unhesitant help. I'll try it again with
local-set-key.

Torsten


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Torsten Müller  
View profile  
 More options Jun 27 2001, 9:47 am
Newsgroups: comp.emacs
From: "Torsten Müller" <TMuel...@easy-soft-dresden.de>
Date: Wed, 27 Jun 2001 15:46:14 +0200
Local: Wed, Jun 27 2001 9:46 am
Subject: Re: disabling all c/c++/java indentation
Did it - really a hack but works great in addition to
"c-syntactic-indentation nil".

(defun tm-c-setup ()
  (local-set-key (kbd "TAB") 'tab-to-tab-stop)
  (local-set-key (kbd "{") 'self-insert-command)  ; support for "{" needed
  (local-set-key (kbd "}") 'self-insert-command)
  (local-set-key (kbd ":") 'self-insert-command)
  (local-set-key (kbd ";") 'self-insert-command))
(add-hook 'c++-mode-hook 'tm-c-setup)

Thank you once more for your help on this hairy problem.

Torsten


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
those who know me have no need of my name  
View profile  
 More options Jun 27 2001, 11:52 am
Newsgroups: comp.emacs
From: those who know me have no need of my name <not-a-real-addr...@usa.net>
Date: 27 Jun 2001 15:15:31 GMT
Local: Wed, Jun 27 2001 11:15 am
Subject: Re: disabling all c/c++/java indentation
<9hbv4d$d9gm...@ID-90666.news.dfncis.de> divulged:

>Tried it, but had no entire success. Even "setq c-syntactic-indentation nil"
>leads to indentation.

are you sure it has that value in the buffer and that your cc-mode is
recent enough (5.27 or later)?

--
okay, have a sig then


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Torsten Müller  
View profile  
 More options Jun 28 2001, 12:33 am
Newsgroups: comp.emacs
From: "Torsten Müller" <TMuel...@easy-soft-dresden.de>
Date: Thu, 28 Jun 2001 06:32:22 +0200
Local: Thurs, Jun 28 2001 12:32 am
Subject: Re: disabling all c/c++/java indentation
5.28, I'm sure. (NTEmacs 20.7.1)

"those who know me have no need of my name" <not-a-real-addr...@usa.net>
schrieb im Newsbeitrag news:9hctaj42abk@enews1.newsguy.com...


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google