bug-auctex
[Top][All Lists]
Advanced

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

Re: [Bug-AUCTeX] 11.87; LaTeX-newline doesn't insert newline when commen


From: Piet van Oostrum
Subject: Re: [Bug-AUCTeX] 11.87; LaTeX-newline doesn't insert newline when comment-auto-fill-only-comments is set
Date: Sun, 19 Oct 2014 19:33:06 +0200

Ralf Angeli wrote:

 > * Mosè Giordano (2014-10-19) writes:
 > 
 > > Thank you.  I've just noticed also insertion of other environments,
 > > like itemize, gives weird results when
 > > `comment-auto-fill-only-comments' is non-nil.  Does it make sense to
 > > let-bind this variable to nil when calling `indent-new-comment-line'
 > > in the line referenced by Piet?
 > 
 > Actually I'm a bit surprised that the behavior of
 > `comment-indent-new-line' is changed in such a way by the value of
 > `comment-auto-fill-only-comments'.  Especially since the doc string of
 > `comment-indent-new-line' does not mention anything about it.
 > 
 > Anyway, setting `comment-auto-fill-only-comments' to nil would work but
 > might be a bit strange because it does not seem to be directly related
 > to the behavior of `comment-indent-new-line'. An alternative could be to
 > call `comment-indent-new-line' only when point is actually in a
 > comment. But this will mean more code on our side.
 > 
 > I don't have a clear preference for any solution.  Perhaps let-binding
 > the variable might currently be the saver alternative.
 > 
 > -- 
 > Ralf

(This is a copy of an earlier message by me that you – Ralf – did not receive 
directly)

I think I have found another solution. LaTeX-newline should check if it is 
inside a comment and then call indent-new-comment-line, and if not, call 
newline.

I propose to replace the
            (t
             (indent-new-comment-line)))
with
                ((TeX-in-comment)
                 (indent-new-comment-line))
            (t
             (newline)))

-- 
Piet van Oostrum <address@hidden>
WWW: http://pietvanoostrum.com/
PGP key: [8DAE142BE17999C4]



reply via email to

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