From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lee Newsgroups: gmane.emacs.help Subject: M-q on comments in source code Date: Sat, 24 May 2014 13:37:03 +0200 Organization: my virtual residence Message-ID: <87ppj3csrk.fsf@yun.yagibdah.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1400933156 24879 80.91.229.3 (24 May 2014 12:05:56 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 24 May 2014 12:05:56 +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 14:05:49 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 1WoAhv-0001WX-VC for geh-help-gnu-emacs@m.gmane.org; Sat, 24 May 2014 14:05:48 +0200 Original-Received: from localhost ([::1]:47766 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoAhv-000682-HR for geh-help-gnu-emacs@m.gmane.org; Sat, 24 May 2014 08:05:47 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36850) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoAhc-00067l-8w for help-gnu-emacs@gnu.org; Sat, 24 May 2014 08:05:34 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WoAhT-0003jK-3w for help-gnu-emacs@gnu.org; Sat, 24 May 2014 08:05:28 -0400 Original-Received: from client-194-42-186-216.muenet.net ([194.42.186.216]:33082 helo=yun.yagibdah.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WoAhS-0003iJ-TV for help-gnu-emacs@gnu.org; Sat, 24 May 2014 08:05:19 -0400 Original-Received: from lee by yun.yagibdah.de with local (Exim 4.80.1) (envelope-from ) id 1WoAhR-0000OW-48 for help-gnu-emacs@gnu.org; Sat, 24 May 2014 14:05:17 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) Mail-Followup-To: help-gnu-emacs@gnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 194.42.186.216 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:97814 Archived-At: 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. -- Knowledge is volatile and fluid. Software is power.