[Top][All Lists]

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

Re: simple editor required

From: Paul Edwards
Subject: Re: simple editor required
Date: Wed, 25 Jun 2003 07:47:37 GMT

"Kai Großjohann" <address@hidden> wrote in message news:address@hidden
> > Is there any mode I can switch too, where I can get the behaviour
> > I want, without it making a whole set of new problems for me
> > (e.g. automatic assumptions about C coding style).  The only
> > assumption I want is that it is indented text, so if the previous
> > line started in column 16, then the cursor should be positioned
> > there when I start a new line.
> Well, recent versions of CC mode have the variable
> c-syntactic-indentation that you can set to nil from a mode hook:
> (defun paul-c-setup ()
>   (setq c-syntactic-indentation nil))
> (add-hook 'c-mode-hook 'paul-c-setup)
> I won't be all that different from text mode, but you can get syntax
> highlighting.  Maybe you will like that.

I don't need syntax highlighting, what I need is indent to work
logically.  Is cc's indenting more logical?

Anyway, I have the results of the most recent testing.

> Use M-x debug-on-entry RET to find out if the pe-indent-relative
> indentation function is ever called.

Yes it is.

Then I replaced that with the new one...

> (defun pe-newline-and-maybe-indent ()
>  (interactive)
>  (if (bolp) (newline) (newline-and-indent)))

And this one appears to do exactly what I want.  Thanks for
helping me get this sorted.

I guess while I'm on a roll I should see if I can get xemacs to
behave like emacs, so that next time I'm on a site with xemacs
only, I can get it to behave as logically as emacs (now) does!  :-)

BFN.  Paul.

reply via email to

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