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

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

Re: simple editor required


From: Kai Großjohann
Subject: Re: simple editor required
Date: Sun, 08 Jun 2003 12:19:04 +0200
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.3.50 (gnu/linux)

"Paul Edwards" <kerravon@nosppaam.w3.to> writes:

> The thing is, the code that I am changing is not just one style,
> I have to match the code that I am editting.  So I would rather
> just have very basic editting working by default.  ie I don't
> mind have to press space 4 times after typing a "{", but I do
> mind having to type 20 spaces after a "{".

Okay, okay.

Please use C-h v c-syntactic-indentation RET to find out if the
variable is defined.  If it is, you can do the following:

(setq c-syntactic-indentation nil)

If that doesn't do the trick, then maybe the following works:

(defun pe-c-setup ()
  (setq c-syntactic-indentation nil))
(add-hook 'c-mode-hook 'pe-c-setup)

If the variable doesn't exist, then you need to do something more
elaborate:

(defun pe-c-setup ()
  (local-set-key (kbd "TAB") 'indent-relative)
  (local-set-key (kbd "{") 'self-insert-command))
(add-hook 'c-mode-hook 'pe-c-setup)

Maybe you have to add more local-set-key statements, similar to the
second one, for other characters that don't just insert themselves.

Also, the above was for C mode, use add-hook lines with c++-mode-hook
or java-mode-hook instead of c-mode-hook to get the effect for the
corresponding modes.


I don't understand your comment out the delete key, though.
-- 
This line is not blank.


reply via email to

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