monnier pushed a commit to branch externals/auctex
in repository elpa.
commit 435d80fb12ba99b435ff252dca0521e75f178ef2
Author: Mosè Giordano <[email protected]>
Date: Wed Oct 22 15:38:42 2014 +0200
Fix LaTeX-newline when comment-auto-fill-only-comments is non-nil.
* latex.el (LaTeX-newline): Fix for when
`comment-auto-fill-only-comments' is non-nil. Suggested by Piet
van Oostrum.
---
ChangeLog | 6 ++++++
latex.el | 8 +++++++-
2 files changed, 13 insertions(+), 1 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index d91774a..24e2066 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2014-10-22 Mos� Giordano <[email protected]>
+
+ * latex.el (LaTeX-newline): Fix for when
+ `comment-auto-fill-only-comments' is non-nil. Suggested by Piet
+ van Oostrum.
+
2014-10-13 Matthew Leach <[email protected]>
* style/cleveref.el: New file.
diff --git a/latex.el b/latex.el
index 143cb4e..565807b 100644
--- a/latex.el
+++ b/latex.el
@@ -80,8 +80,14 @@ This depends on `LaTeX-insert-into-comments'."
(concat "[ \t]*" TeX-comment-start-regexp "+[ \t]*")))
(delete-region (match-beginning 0) (match-end 0))
(indent-new-comment-line))
+ ;; `indent-new-comment-line' does nothing when
+ ;; `comment-auto-fill-only-comments' is non-il, so we must be sure
+ ;; to be in a comment before calling it. In any other case
+ ;; `newline' is used.
+ ((TeX-in-comment)
+ (indent-new-comment-line))
(t
- (indent-new-comment-line)))
+ (newline)))
(newline)))