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

[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: Mon, 23 Jun 2003 10:46:39 GMT

"Kai Großjohann" <address@hidden> wrote in message news:address@hidden
> "Paul Edwards" <address@hidden> writes:
>
> > If I am at the beginning of the "cccc" line and I hit enter,
> > emacs is inspired to indent cccc to be under bbbb.  I don't
> > want that, I want cccc to stay where it is.  If I wanted cccc
> > to be indented I would do something, e.g. press tab or hit
> > spaces.
>
> Okay, so if the previous line exists and is not blank, then indent
> the new line to the previous line after RET.
>
> Yeah, I'm afraid you'll have to write your own indentation function.
> Maybe this one?
>
> (defun pe-indent-relative ()
>   "Like `indent-relative' but don't indent after blank line."
>   (when (save-excursion
>           (and (zerop (forward-line -1))
>                (not (looking-at "\s-*$"))))
>     (indent-relative-maybe)))
>
> (defun pe-text-setup ()
>   (setq indent-line-function 'pe-indent-relative))
>
> (add-hook 'text-mode-hook 'pe-text-setup)
>
> Maybe it works, but I haven't tested it.

This didn't work (had no effect), but am I meant to change the
binding of my RET or something like that?

Thanks.  Paul.




reply via email to

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