[Top][All Lists]

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

[AUCTeX] auto-fill: automatic line break for comments

From: Jannis
Subject: [AUCTeX] auto-fill: automatic line break for comments
Date: Mon, 27 May 2013 14:10:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

Dear Auctex users,

I use auto-fill to automatically hard-wrap (i.e. insert line breaks) long lines after a specific length. These are the relevant lines in .emacs:

(add-hook 'LaTeX-mode-hook 'turn-on-auto-fill)
(add-hook 'latex-mode-hook 'turn-on-auto-fill)
(add-hook 'text-mode-hook 'turn-on-auto-fill)
(setq-default fill-column 80)

This works fine. For comments it automatically inserts % signs for the new lines in case I type a comment. If I mark a whole region and use M-q, however, to correct the wrapping after some changes, comments are not automatically recognised, no % is inserted, and parts of the comment are treated as usual text. Only when I put the cursor into the same line again and hit M-q, the wrapping works fine. This, however, is not practical to change the wrapping of whole documents.

Is there any solution to this?


reply via email to

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