From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "William Xue" Newsgroups: gmane.emacs.devel Subject: Re: how to align the comments to start from the same column? Date: Sat, 14 Jul 2007 14:04:31 +0800 Organization: wv Message-ID: References: <200707131818.l6DIIoG1003172@oogie-boogie.ics.uci.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1184393094 24895 80.91.229.12 (14 Jul 2007 06:04:54 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 14 Jul 2007 06:04:54 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Dan Nicolaescu" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 14 08:04:47 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 1I9akJ-0004hC-33 for ged-emacs-devel@m.gmane.org; Sat, 14 Jul 2007 08:04:47 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I9akI-0005Yx-8t for ged-emacs-devel@m.gmane.org; Sat, 14 Jul 2007 02:04:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I9akC-0005VV-Ti for emacs-devel@gnu.org; Sat, 14 Jul 2007 02:04:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I9akA-0005RS-87 for emacs-devel@gnu.org; Sat, 14 Jul 2007 02:04:40 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I9akA-0005Qi-2U for emacs-devel@gnu.org; Sat, 14 Jul 2007 02:04:38 -0400 Original-Received: from py-out-1112.google.com ([64.233.166.180]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I9ak9-0006dI-H9 for emacs-devel@gnu.org; Sat, 14 Jul 2007 02:04:37 -0400 Original-Received: by py-out-1112.google.com with SMTP id f31so1383457pyh for ; Fri, 13 Jul 2007 23:04:36 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:date:to:subject:from:organization:cc:content-type:mime-version:references:content-transfer-encoding:message-id:in-reply-to:user-agent; b=B13bw2B/rt1aUWhgbFJOXhYK0dgJzSv5MuHemgvN0iZ/5IMv1uv957jTXphX++1adbrpEKHqfxQI8ISheIPRMMmzR31tsg6LWcs3VUoDmz6kwGWfzgJSiYxO2l6kT5JoBf5phuUYmftgfiJ3FkV4fZHbJ9ItktPREVv5afoWy5k= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:date:to:subject:from:organization:cc:content-type:mime-version:references:content-transfer-encoding:message-id:in-reply-to:user-agent; b=PZFO3K/BOnkVsiaPvicR0AVicqe/4zAc+Detg/fMq3r//HvRUT7EhoQMZsotks8COlk66/q/e8bgXSG1+ogaAdaRCrRN82fjtvZjmthzW2JXQCRgRjSI3GWMLtq5Zb1ujQrWBYePn1tddlWPd9fW7y2OagsH3vlajNk4G560N6w= Original-Received: by 10.140.143.9 with SMTP id q9mr646471rvd.1184393076096; Fri, 13 Jul 2007 23:04:36 -0700 (PDT) Original-Received: from williamnb ( [222.92.124.222]) by mx.google.com with ESMTP id f34sm13996025rvb.2007.07.13.23.04.33 (version=SSLv3 cipher=OTHER); Fri, 13 Jul 2007 23:04:34 -0700 (PDT) In-Reply-To: <200707131818.l6DIIoG1003172@oogie-boogie.ics.uci.edu> User-Agent: Opera Mail/9.21 (Win32) X-detected-kernel: Linux 2.6 (newer, 2) 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:74759 Archived-At: On Sat, 14 Jul 2007 02:18:49 +0800, Dan Nicolaescu wrote: > "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. Thanks for the information. But the url seems invalid here. I have googled about it, not found any place to download it. ---8<--------------------------------------------->8--- ;;; bc-mode.el --- BC code editing commands for Emacs ;; Copyright (C) 2005 Kumar Appaiah ;; Author: Kumar Appaiah ;; Keywords: ---8<--------------------------------------------->8--- this file seems not the same with yours. Could you send it to me by mail? In advance thanks! -- Sincerely yours, William