From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: M-q on comments in source code Date: Sat, 24 May 2014 17:41:25 +0200 Message-ID: <5380BDA5.4090400@easy-emacs.de> References: <87ppj3csrk.fsf@yun.yagibdah.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1400946150 27942 80.91.229.3 (24 May 2014 15:42:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 May 2014 15:42:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat May 24 17:42:23 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WoE5V-0000z1-W0 for geh-help-gnu-emacs@m.gmane.org; Sat, 24 May 2014 17:42:22 +0200 Original-Received: from localhost ([::1]:48339 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoE5V-00084G-Kl for geh-help-gnu-emacs@m.gmane.org; Sat, 24 May 2014 11:42:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44615) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoE5C-00082S-LR for help-gnu-emacs@gnu.org; Sat, 24 May 2014 11:42:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WoE55-0006IV-6H for help-gnu-emacs@gnu.org; Sat, 24 May 2014 11:42:02 -0400 Original-Received: from mout.kundenserver.de ([212.227.126.130]:50134) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoE54-0006IH-SX for help-gnu-emacs@gnu.org; Sat, 24 May 2014 11:41:55 -0400 Original-Received: from [192.168.178.32] (brln-4d0ca2c3.pool.mediaWays.net [77.12.162.195]) by mrelayeu.kundenserver.de (node=mreue006) with ESMTP (Nemesis) id 0MJIXG-1WqyAX3JaU-002pIK; Sat, 24 May 2014 17:41:44 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Icedove/24.5.0 In-Reply-To: <87ppj3csrk.fsf@yun.yagibdah.de> X-Provags-ID: V02:K0:5RMgVgp4kwtbg88aCNDodkhzvNd8/5KhYZBz7P6vj7t 8mhTbEn7oqZtuVuPoY7LKKXiF2uelUJa5soTA6+O5pnqWyXCSI M8S75312+MkHfMxMM+hCYqUtl1NrXuo6AkLo2JFKUva6vgiJQz wD2STC5HEPVWdjHPhhAhMeaS9N3Ne3Du6M7R9quhJbu5QbZnf1 9wa/lIkq8u8OHK6iwSv4eZDQwiEN/PirK+jd9jFKNLciA0EJPg w/fi57gaLcL63lbqft9qfF0rXtO5YwEJ0+fUd8RF5RW3T54O26 FB22tzuJBCrMRSW23mCQ59xx1dR0z5lAULiSlFb6QA77yV0N5j vP6l8rn+lTSfbx+kQjKHk21aLJxwnEHVTs4TThQ38 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 212.227.126.130 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 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 Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:97818 Archived-At: On 24.05.2014 13:37, lee wrote: > Hi, > > modes like c-mode indent comments with the code, which is fine as an end > result and not so ideal when writing them. To give an example: > > > ,---- > | if(full) > | { > | // > | // A max value might be removed when the arrays are shifted. In > | // that case, find a new one after shifting. Otherwise, the max > `---- > > > Now press M-q to format the comment and the above looks like this: > > > ,---- > | if(full) > | { > | // > | // A max value might be > | // removed when the arrays are > | // shifted. In that case, > | // find a new one after > | // shifting. Otherwise, the > | // max continues to be known. > `---- > > > This formatting is a bit silly ... What can I do to get the comments > formatted as in the first example, i. e. the comment indented with the > source but with each line trimmed to a length of about max 75 > characters, not counting the indentation? > > I can manually unindent the lines, edit them, format them and reindent > them, and I`m looking for a better way. Even something like > auto-fill-mode for comments that does it automatically would be nice. > > M-x customize-variable RET comment-style RET setting it to 0, "plain", does this solve it?