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: Wed, 11 Jul 2007 09:44:44 +0800 Organization: wv Message-ID: References: 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 1184118299 28834 80.91.229.12 (11 Jul 2007 01:44:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2007 01:44:59 +0000 (UTC) Cc: emacs-devel@gnu.org To: "Stefan Monnier" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jul 11 03:44:56 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 1I8RGB-0003Sq-3M for ged-emacs-devel@m.gmane.org; Wed, 11 Jul 2007 03:44:55 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8RGA-0007XV-JA for ged-emacs-devel@m.gmane.org; Tue, 10 Jul 2007 21:44:54 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1I8RG6-0007Wy-SB for emacs-devel@gnu.org; Tue, 10 Jul 2007 21:44:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1I8RG3-0007W4-Pq for emacs-devel@gnu.org; Tue, 10 Jul 2007 21:44:49 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1I8RG3-0007Vq-Iw for emacs-devel@gnu.org; Tue, 10 Jul 2007 21:44:47 -0400 Original-Received: from nz-out-0506.google.com ([64.233.162.232]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1I8RG3-0005Po-62 for emacs-devel@gnu.org; Tue, 10 Jul 2007 21:44:47 -0400 Original-Received: by nz-out-0506.google.com with SMTP id f1so1108367nzc for ; Tue, 10 Jul 2007 18:44:46 -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=IG9L27Bl/szt4uDLVA6ihbHrFKv5WH45TxTVZUDPZJ3y9+u14tI/tAfwZKE1h0zHyYEKdUtj776u+FaOeSAEkWG9iI9pSdNdj9OPHK2Wk4C1iuJOdZgTw9OCTUqPTUpy6uYx+S9JXncfvQt1B/xOZK22fMTD+t/biaBAioVYQMo= 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=agSOakPN6GFrOwXqqNaAzGa/2F1/mXkY01qf6+fz9iaB2hlKbsZEvAM1e7/tirdxHG8kt68iX5J+swp4uMcFbYY0rU2ZdIZIGZH9gqUQpiWAfP1zYYjAZnGqkedhxbGODAqtpKB9w/ECAH2i9XuZ99yhfMTgo6nYbhK9/BY5gso= Original-Received: by 10.141.5.3 with SMTP id h3mr1463378rvi.1184118286112; Tue, 10 Jul 2007 18:44:46 -0700 (PDT) Original-Received: from williamnb ( [222.92.124.222]) by mx.google.com with ESMTP id f13sm8541727rvb.2007.07.10.18.44.44 (version=SSLv3 cipher=OTHER); Tue, 10 Jul 2007 18:44:45 -0700 (PDT) In-Reply-To: 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:74617 Archived-At: On Tue, 10 Jul 2007 21:41:03 +0800, Stefan Monnier wrote: >> 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. > > The Emacs-22.1 version of M-; already tries to align comments on > neighbouring lines. This feature has been slightly improved in > Emacs-CVS, > but if it doesn't work for you in Emacs-22.1, then it probably won't work > any better in Emacs-CVS. > > The most likely reason why it may appear not to work is that it only > aligns > comments if it can do so without pushing them past the > `comment-fill-column' > (which defaults to `fill-column'). So try setting this value to > something > larger (or better yet: reformat your code so as not to use so many > columns ;-). enlarged the value do a litter neat. but like the following codes: ---8<--------------------------------------------->8--- BOOLEAN RDFastIoReadCompressed(IN PFILE_OBJECT FileObject, // IN PLARGE_INTEGER FileOffset, // IN ULONG Length, // IN ULONG LockKey, // OUT PVOID Buffer, // OUT PMDL* MdlChain, // IN OUT PIO_STATUS_BLOCK IoStatus, // OUT COMPRESSED_DATA_INFO* CompressedDataInfo, // IN ULONG CompressedDataInfoLength, // IN PDEVICE_OBJECT DeviceObject) // { return FALSE; } ---8<--------------------------------------------->8--- the '//' of MdlChain could not be a row to IoStatus's. it seems M-; could not back-reference in some situation. > > > Stefan > -- Sincerely yours, William