Re: Strange behaviour of RET in comments

Ralf Angeli <[email protected]>
Newsgroups gmane.emacs.auc-tex
Message-ID <[email protected]>
* Uwe Siart (2005-01-18) writes:

> On 18 Jan 2005 at 14:50, Ralf Angeli wrote:
>
>> You asked for this behavior by customizing `TeX-newline-function'.
>
> You're right, I've chosen 'newline-and-indent' in order get automatic 
> indentation after RET if there's already indentation present. But I'd 
> never thought that the effect I reported is due to this (because in the 
> example there's no indentation at all).

Yes, but don't forget that for indentation the content _after_ the
comment starter (including comment padding) is relevant in case
`LaTeX-syntactic-comments' is enabled.  You can see that typing <TAB>
at the start of a commented line will move point to the first
non-whitespace character after the comment starter.

> It seems as if 'newline-and-indent' doesn't work at all in commented 
> regions: 
>
> Here (with blanks at the beginning of the line)
>
> ,----
> |      % Comment
> `----
>
> pressing RET in point after 'Comment' puts the cursor at the very 
> beginning of the next line. Without '%' all is fine.

That's because the indentation function skips the commented region
when it looks back and uses the first non-commented line for deciding
upon the indentation of the current line.

-- 
Ralf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.