From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Adam Hardy Newsgroups: gmane.emacs.help Subject: Re: auto-fill mode in java-mode Date: Mon, 13 Oct 2003 23:58:08 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <3F8B1FF0.6040609@cyberspaceroad.com> References: Reply-To: help-gnu-emacs@gnu.org NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1066082816 19748 80.91.224.253 (13 Oct 2003 22:06:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 13 Oct 2003 22:06:56 +0000 (UTC) Cc: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 14 00:06:54 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A9Aq5-0003FG-00 for ; Tue, 14 Oct 2003 00:06:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A9AlG-0007ze-CQ for geh-help-gnu-emacs@m.gmane.org; Mon, 13 Oct 2003 18:01:54 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1A9Aiu-0006uY-1w for help-gnu-emacs@gnu.org; Mon, 13 Oct 2003 17:59:28 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1A9AiL-0006NC-V8 for help-gnu-emacs@gnu.org; Mon, 13 Oct 2003 17:59:26 -0400 Original-Received: from [199.232.41.8] (helo=mx20.gnu.org) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.24) id 1A9AiL-0006Ge-Db for help-gnu-emacs@gnu.org; Mon, 13 Oct 2003 17:58:53 -0400 Original-Received: from [212.227.126.171] (helo=moutng.kundenserver.de) by mx20.gnu.org with esmtp (Exim 4.24) id 1A9AiJ-0006VV-Ck for help-gnu-emacs@gnu.org; Mon, 13 Oct 2003 17:58:51 -0400 Original-Received: from [212.227.126.207] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1A9AiH-0005Xp-00; Mon, 13 Oct 2003 23:58:49 +0200 Original-Received: from [217.228.245.254] (helo=cyberspaceroad.com) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1A9AiH-0003mq-00; Mon, 13 Oct 2003 23:58:49 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5) Gecko/20030925 X-Accept-Language: de-de, en, en-us Original-To: Alan Mackenzie In-Reply-To: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13165 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13165 On 10/13/2003 11:10 AM Alan Mackenzie wrote: >>I'm trying to get my java-mode to wrap lines at 75 cols and I've not >>got it working. > > What do you mean by "lines"? In the CC Modes, only comments get > auto-filled by default. Are your comment lines getting auto-filled? Do > you also want code lines to get auto-filled? Yes they are and yes I do :) > > If you want lines of code to get filled too, set the user option > c-ignore-auto-fill. For example, in your mode hook add something like > > (setq c-ignore-auto-fill '(cpp)) > > which will fill everything but preprocessor lines (do such exist in > Java?). c-ignore-auto-fill is fully documented on the page "Text Filling > and Line Breaking" in the CC Mode info pages. > > I'm not sure how useful the auto-filling is in lines other than comment > lines. That is very useful, thanks. And after reading the docs you pointed me at, I installed filladapt-mode as well, which makes it even better. Essentially I want to restrict the width so I can just cut & paste my code into emails without the email mangling it. It does sometimes break the line in surprising places, but that's not an issue. There is only one quibble that I have with the arrangement as I now have it, and the cc-mode help, which is great, is not telling me how or why it happens: - when auto-fill breaks a line, it ignores my idea of what the indentation should be. I have to hit tab (or an electric key) for the indentation to sort itself out. I assume my settings are in need of some adjustment, but I don't know which of the following it is: (c-set-offset 'topmost-intro-cont c-basic-offset) (c-set-offset 'inline-open 0) (c-set-offset 'inclass 4) (c-set-offset 'substatement-open 0) (c-set-offset 'block-open '-) (c-set-offset 'objc-method-intro 'c-lineup-arglist-intro-after-paren) (setq c-electric-pound-behavior '(alignleft)) (local-set-key [return] 'newline-and-indent) Thanks again, Adam -- GNU Emacs 21.3.1 on Linux 2.4.20 RH9