emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to align the comments to start from the same column?


From: William Xue
Subject: Re: how to align the comments to start from the same column?
Date: Wed, 11 Jul 2007 09:44:44 +0800
User-agent: Opera Mail/9.21 (Win32)

On Tue, 10 Jul 2007 21:41:03 +0800, Stefan Monnier <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]