From: "William Xue" <william.xue@gmail.com>
To: "Stefan Monnier" <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: how to align the comments to start from the same column?
Date: Wed, 11 Jul 2007 09:44:44 +0800 [thread overview]
Message-ID: <op.tu91suuxhkv0w5@williamnb> (raw)
In-Reply-To: <jwvir8sxtu0.fsf-monnier+emacs@gnu.org>
On Tue, 10 Jul 2007 21:41:03 +0800, Stefan Monnier
<monnier@iro.umontreal.ca> 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
next prev parent reply other threads:[~2007-07-11 1:44 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-10 2:44 how to align the comments to start from the same column? William Xue
2007-07-10 11:31 ` Alan Mackenzie
2007-07-10 13:41 ` Stefan Monnier
2007-07-11 1:44 ` William Xue [this message]
2007-07-11 4:01 ` Stefan Monnier
2007-07-11 7:03 ` William Xue
2007-07-13 18:18 ` Dan Nicolaescu
2007-07-14 6:04 ` William Xue
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.tu91suuxhkv0w5@williamnb \
--to=william.xue@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).