From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dan Nicolaescu Newsgroups: gmane.emacs.devel Subject: Re: how to align the comments to start from the same column? Date: Fri, 13 Jul 2007 11:18:49 -0700 Message-ID: <200707131818.l6DIIoG1003172@oogie-boogie.ics.uci.edu> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1184350801 19315 80.91.229.12 (13 Jul 2007 18:20:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 13 Jul 2007 18:20:01 +0000 (UTC) Cc: emacs-devel@gnu.org To: "William Xue" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Jul 13 20:19:58 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1I9PkD-0007S0-LV for ged-emacs-devel@m.gmane.org; Fri, 13 Jul 2007 20:19:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I9PkD-0005P3-1H for ged-emacs-devel@m.gmane.org; Fri, 13 Jul 2007 14:19:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I9Pk9-0005OS-Nx for emacs-devel@gnu.org; Fri, 13 Jul 2007 14:19:53 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I9Pk9-0005OG-3X for emacs-devel@gnu.org; Fri, 13 Jul 2007 14:19:53 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I9Pk8-0005OD-Uh for emacs-devel@gnu.org; Fri, 13 Jul 2007 14:19:52 -0400 Original-Received: from oogie-boogie.ics.uci.edu ([128.195.1.41]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I9Pk8-0003eg-Qw for emacs-devel@gnu.org; Fri, 13 Jul 2007 14:19:53 -0400 Original-Received: from mothra.ics.uci.edu (mothra.ics.uci.edu [128.195.6.93]) by oogie-boogie.ics.uci.edu (8.13.6/8.13.6) with ESMTP id l6DIIoG1003172; Fri, 13 Jul 2007 11:18:50 -0700 (PDT) In-Reply-To: (William Xue's message of "Tue\, 10 Jul 2007 10\:44\:58 +0800") Original-Lines: 44 X-ICS-MailScanner: Found to be clean X-ICS-MailScanner-SpamCheck: not spam, SpamAssassin (score=-1.44, required 5, autolearn=disabled, ALL_TRUSTED -1.44) X-ICS-MailScanner-From: dann@mothra.ics.uci.edu X-detected-kernel: Solaris 9 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:74727 Archived-At: "William Xue" writes: > Hi, > when I am coding in cpp files, I will use M-; to make some comments, > like following: > > IoCreateFileSpecifyDeviceObjectHint(&h_rd_file, > // file handle > GENERIC_READ > | GENERIC_WRITE, // desire access > &rd_file_obj_attr, > // object attributes > &rd_io_status_block, > // io status block > 0, // > allocation size > FILE_ATTRIBUTE_NORMAL, > // file attributes > FILE_SHARE_READ, > // share access > > Is there a way to format the comments to the same column? > > I want something like: > > 1. select the codes as a region > 2. press a magic keybinding > 3. the comments align to the longest column of comments in the region. You can find this package: ;;; bc-mode.el --- Minor mode for formatting right-margin block comments. ;; ;; Copyright (C) 1991-1996 Steve Burgett ;; $Id: bc-mode.el,v 1.1 1996/10/19 18:54:00 burgett Exp burgett $ ;; ;; Author: Steve Burgett ;; Created: July 1992 ;; Version: 1.1 ;; Keywords: comment minor-mode programming editing ;; HTTP: http://robotics.eecs.berkeley.edu/~burgett/ It has very sophisticated comment handling, I think it does what you want.