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 ;-).